Compare commits

...

3 Commits

12 changed files with 61 additions and 27 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.46", "version": "1.8.49",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

2
app/package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.8.46", "version": "1.8.49",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.8.46", "version": "1.8.49",
"description": "GUI for the mcopy small gauge film optical printer platform", "description": "GUI for the mcopy small gauge film optical printer platform",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.46", "version": "1.8.49",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -6,7 +6,8 @@ McopyProjector::McopyProjector (AccelStepper takeup, AccelStepper feed,
uint8_t takeupSettingA, uint8_t takeupSettingB, uint8_t takeupSettingA, uint8_t takeupSettingB,
uint8_t feedSettingA, uint8_t feedSettingB, uint8_t feedSettingA, uint8_t feedSettingB,
uint8_t takeupEmitter, uint8_t takeupReceiver, uint8_t takeupEmitter, uint8_t takeupReceiver,
uint8_t feedEmitter, uint8_t feedReceiver) { uint8_t feedEmitter, uint8_t feedReceiver,
uint8_t servoPin) {
_takeup = takeup; _takeup = takeup;
_feed = feed; _feed = feed;
@ -18,6 +19,7 @@ McopyProjector::McopyProjector (AccelStepper takeup, AccelStepper feed,
_takeupReceiver = takeupReceiver; _takeupReceiver = takeupReceiver;
_feedEmitter = feedEmitter; _feedEmitter = feedEmitter;
_feedReceiver = feedReceiver; _feedReceiver = feedReceiver;
_servoPin = servoPin;
} }
void McopyProjector::begin () { void McopyProjector::begin () {
@ -40,6 +42,9 @@ void McopyProjector::begin () {
//keep at 1 for now //keep at 1 for now
setStepperMode(1); setStepperMode(1);
_servo.attach(_servoPin);
_servo.write(_servoHome);
} }
void McopyProjector::setDirection (bool dir) { void McopyProjector::setDirection (bool dir) {
@ -64,6 +69,9 @@ void McopyProjector::frame (bool dir) {
_running = true; _running = true;
_servo.write(_servoAway);
delay(20);
while (running) { while (running) {
if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) { if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) {
running = false; running = false;
@ -75,6 +83,9 @@ void McopyProjector::frame (bool dir) {
} }
} }
delay(20);
_servo.write(_servoHome);
_running = false; _running = false;
} }

View File

@ -3,6 +3,7 @@
#include <Arduino.h> #include <Arduino.h>
#include <AccelStepper.h> #include <AccelStepper.h>
#include <Servo.h>
/** /**
* D2 X Step * D2 X Step
@ -28,11 +29,16 @@ class McopyProjector {
AccelStepper _takeup; AccelStepper _takeup;
AccelStepper _feed; AccelStepper _feed;
Servo _servo;
const uint16_t _motorSteps = 200; //full steps const uint16_t _motorSteps = 200; //full steps
const uint8_t _frames = 8; const uint8_t _frames = 8;
const uint16_t _stepsPerFrame = 25; //round(_motorSteps / _frames); const uint16_t _stepsPerFrame = 25; //round(_motorSteps / _frames);
const float _speed = 2000.0; const float _speed = 2000.0;
const uint8_t _servoHome = 90;
const uint8_t _servoAway = 60;
volatile uint8_t _mode = 1; volatile uint8_t _mode = 1;
int64_t _posTakeup = 0; int64_t _posTakeup = 0;
@ -50,6 +56,8 @@ class McopyProjector {
uint8_t _feedEmitter; uint8_t _feedEmitter;
uint8_t _feedReceiver; uint8_t _feedReceiver;
uint8_t _servoPin;
long _feedSamples[200]; long _feedSamples[200];
long _takeupSamples[200]; long _takeupSamples[200];
@ -70,7 +78,8 @@ class McopyProjector {
uint8_t takeupSettingA, uint8_t takeupSettingB, uint8_t takeupSettingA, uint8_t takeupSettingB,
uint8_t feedSettingA, uint8_t feedSettingB, uint8_t feedSettingA, uint8_t feedSettingB,
uint8_t takeupEmitter, uint8_t takeupReceiver, uint8_t takeupEmitter, uint8_t takeupReceiver,
uint8_t feedEmitter, uint8_t feedReceiver); uint8_t feedEmitter, uint8_t feedReceiver,
uint8_t servoPin);
void begin(); void begin();
//0 = takeup, 1 = feed //0 = takeup, 1 = feed
void adjust(uint8_t motor, int64_t steps); void adjust(uint8_t motor, int64_t steps);

View File

@ -42,6 +42,8 @@
#define FEED_EMITTER 18 #define FEED_EMITTER 18
#define FEED_RECEIVER A9 #define FEED_RECEIVER A9
#define SERVO_PIN 14
AccelStepper takeup(AccelStepper::DRIVER, TAKEUP_STEP_PIN, TAKEUP_DIR_PIN); AccelStepper takeup(AccelStepper::DRIVER, TAKEUP_STEP_PIN, TAKEUP_DIR_PIN);
AccelStepper feed(AccelStepper::DRIVER, FEED_STEP_PIN, FEED_DIR_PIN); AccelStepper feed(AccelStepper::DRIVER, FEED_STEP_PIN, FEED_DIR_PIN);
@ -64,7 +66,8 @@ McopyProjector projector(takeup, feed,
TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B, TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B,
FEED_SETTINGS_A, FEED_SETTINGS_B, FEED_SETTINGS_A, FEED_SETTINGS_B,
TAKEUP_EMITTER, TAKEUP_RECEIVER, TAKEUP_EMITTER, TAKEUP_RECEIVER,
FEED_EMITTER, FEED_RECEIVER); FEED_EMITTER, FEED_RECEIVER,
SERVO_PIN);
void setup () { void setup () {
pins(); pins();
@ -75,6 +78,7 @@ void setup () {
delay(42); delay(42);
digitalWrite(LED_FWD, LOW); digitalWrite(LED_FWD, LOW);
digitalWrite(LED_BWD, LOW); digitalWrite(LED_BWD, LOW);
//projector.home(); //projector.home();
} }
@ -83,9 +87,9 @@ void loop () {
cmdChar = mcopy.loop(); cmdChar = mcopy.loop();
cmd(cmdChar); cmd(cmdChar);
if (digitalRead(BUTTON) == LOW) { if (digitalRead(BUTTON) == LOW) {
projector_frame(); //projector_frame();
} }
projector.loop(); //projector.loop();
} }
void pins () { void pins () {

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.46", "version": "1.8.49",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mcopy", "name": "mcopy",
"version": "1.8.46", "version": "1.8.49",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"arduino": "file:app/lib/arduino", "arduino": "file:app/lib/arduino",

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.46", "version": "1.8.49",
"description": "Small gauge film optical printer platform", "description": "Small gauge film optical printer platform",
"main": "build.js", "main": "build.js",
"directories": { "directories": {

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.46", "version": "1.8.49",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -583,7 +583,7 @@ module servo_gear (pos = [0, 0, 0], rot = [0, 0, 0]) {
} }
module nub_rack (pos = [0, 0, 0], rot = [0, 0, 0]) { module nub_rack (pos = [0, 0, 0], rot = [0, 0, 0]) {
H = 9.25 + 2.75; H = 9.25 + 2.4;
Len = 50; Len = 50;
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
difference () { difference () {
@ -638,7 +638,7 @@ module debug () {
//nub_rack([-6, 0, -15], [-90, 0, 0]); //nub_rack([-6, 0, -15], [-90, 0, 0]);
} }
PART = "servo_gear"; PART = "nub_rack";
if (PART == "gate_key") { if (PART == "gate_key") {
gate_key(KeyRot = 0); gate_key(KeyRot = 0);

View File

@ -12,6 +12,7 @@ include <./common/motors.scad>
include <./common/rods.scad> include <./common/rods.scad>
RailSpacing = 100; //160 RailSpacing = 100; //160
RailVoid = 20.4;
ThreadedRodSpacing = 50; ThreadedRodSpacing = 50;
RailEndX = RailSpacing + 72; RailEndX = RailSpacing + 72;
TNutVoid = 17; TNutVoid = 17;
@ -34,8 +35,8 @@ module m3_bolt_void (pos = [0, 0, 0], BoltH = 20, CapH = 3) {
module bolt_voids_2020 (pos = [0, 0, 0], rot = [0, 0, 0]) { module bolt_voids_2020 (pos = [0, 0, 0], rot = [0, 0, 0]) {
translate(pos) rotate (rot) { translate(pos) rotate (rot) {
//translate([0, -25, 0]) rotate([90, 0, 0]) m3_bolt_void(CapH = 6); translate([0, -25, 0]) rotate([90, 0, 0]) m3_bolt_void(CapH = 6);
translate([0, 25, 0]) rotate([-90, 0, 0]) m3_bolt_void(CapH = 20); translate([0, 25, 0]) rotate([-90, 0, 0]) m3_bolt_void(CapH = 20);
translate([-25, 0, 0]) rotate([0, -90, 0]) m3_bolt_void(CapH = 6, BoltH = 20); translate([-25, 0, 0]) rotate([0, -90, 0]) m3_bolt_void(CapH = 6, BoltH = 20);
} }
} }
@ -79,7 +80,7 @@ module mounting_bolt_void (pos = [0, 0, 0], rot = [0, 0, 0]) {
} }
} }
module rail_end (pos = [0, 0, 0], rot = [90, 0, 0], Motors = true) { module rail_end (pos = [0, 0, 0], rot = [90, 0, 0], Motors = true, Projector = false) {
Z = 95; Z = 95;
RailVoid = 20.4; RailVoid = 20.4;
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
@ -126,6 +127,10 @@ module rail_end (pos = [0, 0, 0], rot = [90, 0, 0], Motors = true) {
} }
} }
echo("sled");
echo("BOM: ", "(2) T8 Nut");
echo("BOM: ", "(1 or 2) Linear bearing");
echo("BOM: ", "(4 or 8) Radial bearings ()");
module sled (pos = [0, 0, 0], rot = [90, 0, 0], Length = 60) { module sled (pos = [0, 0, 0], rot = [90, 0, 0], Length = 60) {
X = RailEndX; X = RailEndX;
Y = 60; Y = 60;
@ -225,10 +230,19 @@ module lens_sled_m5_bolt_nut_voids (pos = [0, 0, 0], rot = [0, 0, 0], Angle = 36
} }
} }
module extrusion_block (pos = [0, 0, 0], rot = [0, 0, 0], Y = 40, Z = 30) {
translate(pos) rotate(rot) {
difference () {
cube([Y, Z, Y], center = true);
cube([RailVoid, Z + 1, RailVoid], center = true);
}
end_2020([0, 0, 0], [90, 0, 0]);
}
}
module lens_sled (pos = [0, 0, 0], rot = [90, 0, 0]) { module lens_sled (pos = [0, 0, 0], rot = [90, 0, 0]) {
Y = 40; Y = 40;
LensDriveX = -ThreadedRodSpacing / 2; LensDriveX = -ThreadedRodSpacing / 2;
RailVoid = 20.4;
LensFrameSpacingX = (RailEndX / 2) - (Y / 2); LensFrameSpacingX = (RailEndX / 2) - (Y / 2);
LensFrameM3VoidsZ = (60 / 2) + (40 / 2) - 12.5 + 5 + 6; LensFrameM3VoidsZ = (60 / 2) + (40 / 2) - 12.5 + 5 + 6;
@ -236,8 +250,8 @@ module lens_sled (pos = [0, 0, 0], rot = [90, 0, 0]) {
difference () { difference () {
union () { union () {
sled(rot = [0, 0, 0], Length = Y); sled(rot = [0, 0, 0], Length = Y);
translate([(RailEndX / 2) - (Y / 2), (60 / 2) + (40 / 2) - 5, 0]) cube([Y, 30, Y], center = true); extrusion_block([LensFrameSpacingX, (60 / 2) + (40 / 2) - 5, 0]);
translate([-(RailEndX / 2) + (Y / 2), (60 / 2) + (40 / 2) - 5, 0]) cube([Y, 30, Y], center = true); extrusion_block([-LensFrameSpacingX, (60 / 2) + (40 / 2) - 5, 0]);
translate([LensFrameSpacingX - 35 - 25, 48, 0]) cube([10, 21, 40], center = true); translate([LensFrameSpacingX - 35 - 25, 48, 0]) cube([10, 21, 40], center = true);
} }
T_nut_void ([LensDriveX, 0, (Y / 2) - (TNutVoid / 2) + 0.01], [180, 0, 0]); T_nut_void ([LensDriveX, 0, (Y / 2) - (TNutVoid / 2) + 0.01], [180, 0, 0]);
@ -251,10 +265,6 @@ module lens_sled (pos = [0, 0, 0], rot = [90, 0, 0]) {
side_sled_bearing_void([(RailSpacing / 2) + 21.5, 0, 0], [90, -90, 0]); side_sled_bearing_void([(RailSpacing / 2) + 21.5, 0, 0], [90, -90, 0]);
side_sled_bearing_void([-(RailSpacing / 2) - 21.5, 0, 0], [-90, -90, 0]); side_sled_bearing_void([-(RailSpacing / 2) - 21.5, 0, 0], [-90, -90, 0]);
//lens carriage frame
translate([LensFrameSpacingX, 53.5, 0]) cube([RailVoid, 32, RailVoid], center = true);
translate([-LensFrameSpacingX, 53.5, 0]) cube([RailVoid, 32, RailVoid], center = true);
// //
lens_sled_m3_bolt_voids([(RailEndX / 2) - (Y / 2), LensFrameM3VoidsZ, 0]); lens_sled_m3_bolt_voids([(RailEndX / 2) - (Y / 2), LensFrameM3VoidsZ, 0]);
lens_sled_m3_bolt_voids([(-RailEndX / 2) + (Y / 2), LensFrameM3VoidsZ, 0]); lens_sled_m3_bolt_voids([(-RailEndX / 2) + (Y / 2), LensFrameM3VoidsZ, 0]);
@ -378,12 +388,12 @@ module debug () {
} }
PART = "lens_sled"; PART = "rail_end_idle";
if (PART == "rail_end") { if (PART == "rail_end") {
rail_end(); rail_end();
} else if (PART == "rail_end_idle") { } else if (PART == "rail_end_idle") {
rail_end(Motors = false); rail_end(Motors = false, Projector = true);
} else if (PART == "lens_sled") { } else if (PART == "lens_sled") {
rotate([-90, 0, 0]) lens_sled(); rotate([-90, 0, 0]) lens_sled();
} else if (PART == "bearing_roller") { } else if (PART == "bearing_roller") {