Compare commits

..

No commits in common. "b1c8192625aeef1864c730f478bc76ab7910ad06" and "37d4f50ef4fbf7040b09d11db769ea952ed91866" have entirely different histories.

11 changed files with 68 additions and 239 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "1.8.35", "version": "1.8.33",
"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.35", "version": "1.8.33",
"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.35", "version": "1.8.33",
"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.35", "version": "1.8.33",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -2,11 +2,7 @@
#include "McopyProjector.h" #include "McopyProjector.h"
McopyProjector::McopyProjector (AccelStepper takeup, AccelStepper feed, McopyProjector::McopyProjector (AccelStepper takeup, AccelStepper feed, uint8_t takeupSettingA, uint8_t takeupSettingB, uint8_t feedSettingA, uint8_t feedSettingB) {
uint8_t takeupSettingA, uint8_t takeupSettingB,
uint8_t feedSettingA, uint8_t feedSettingB,
uint8_t takeupEmitter, uint8_t takeupReceiver,
uint8_t feedEmitter, uint8_t feedReceiver) {
_takeup = takeup; _takeup = takeup;
_feed = feed; _feed = feed;
@ -14,32 +10,23 @@ McopyProjector::McopyProjector (AccelStepper takeup, AccelStepper feed,
_takeupSettingB = takeupSettingB; _takeupSettingB = takeupSettingB;
_feedSettingA = feedSettingA; _feedSettingA = feedSettingA;
_feedSettingB = feedSettingB; _feedSettingB = feedSettingB;
_takeupEmitter = takeupEmitter;
_takeupReceiver = takeupReceiver;
_feedEmitter = feedEmitter;
_feedReceiver = feedReceiver;
} }
void McopyProjector::begin () { void McopyProjector::begin () {
_takeup.setMaxSpeed(_speed); _takeup.setMaxSpeed(_speed);
_takeup.setSpeed(_speed); _takeup.setSpeed(_speed);
_takeup.setAcceleration(1000.0); _takeup.setAcceleration(1000.0);
_feed.setMaxSpeed(_speed); _feed.setMaxSpeed(_speed);
_feed.setSpeed(_speed); _feed.setSpeed(_speed);
_feed.setAcceleration(1000.0); _feed.setAcceleration(1000.0);
pinMode(_takeupSettingA, OUTPUT); pinMode(_takeupSettingA, OUTPUT);
pinMode(_takeupSettingB, OUTPUT); pinMode(_takeupSettingB, OUTPUT);
pinMode(_feedSettingA, OUTPUT); pinMode(_feedSettingA, OUTPUT);
pinMode(_feedSettingB, OUTPUT); pinMode(_feedSettingB, OUTPUT);
pinMode(_takeupEmitter, OUTPUT);
pinMode(_feedEmitter, OUTPUT);
pinMode(_takeupReceiver, INPUT);
pinMode(_feedReceiver, INPUT);
//keep at 1 for now setStepperMode(1);
setStepperMode(1);
} }
void McopyProjector::setDirection (bool dir) { void McopyProjector::setDirection (bool dir) {
@ -66,12 +53,13 @@ void McopyProjector::frame (bool dir) {
while (running) { while (running) {
if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) { if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) {
//frame done
running = false; running = false;
_posTakeup = takeupGoal; _posTakeup = takeupGoal;
_posFeed += feedGoal; _posFeed += feedGoal;
} else { } else {
_takeup.run(); _takeup.run();
_feed.run(); _feed.run();
} }
} }
@ -107,11 +95,9 @@ void McopyProjector::loop () {
_running = false; _running = false;
_posTakeup += _dir ? _stepsPerFrame : -_stepsPerFrame; _posTakeup += _dir ? _stepsPerFrame : -_stepsPerFrame;
_posFeed += _dir ? _stepsPerFrame : -_stepsPerFrame; _posFeed += _dir ? _stepsPerFrame : -_stepsPerFrame;
Serial.println(_count);
} else { } else {
_takeup.run(); _takeup.run();
_feed.run(); _feed.run();
_count++;
} }
} else if (_adjusting) { } else if (_adjusting) {
if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) { if (_takeup.distanceToGo() == 0 && _feed.distanceToGo() == 0) {
@ -121,8 +107,7 @@ void McopyProjector::loop () {
_takeup.run(); _takeup.run();
_feed.run(); _feed.run();
} }
} }*/
*/
} }
//https://wiki.iteadstudio.com/Arduino_Dual_Step_Motor_Driver_Shield //https://wiki.iteadstudio.com/Arduino_Dual_Step_Motor_Driver_Shield
@ -156,58 +141,6 @@ void McopyProjector::setStepperMode (uint8_t mode) {
} }
} }
void McopyProjector::home () {
uint16_t steps = _motorSteps * _mode;
long reading;
//
for (uint16_t i = 0; i < steps; i++) {
reading = analogReadAccurateAverage(_takeupReceiver);
_takeupSamples[i] = reading;
if (i < steps - 1) {
_takeup.move(1);
_takeup.runToPosition();
}
}
//
for (uint16_t i = 0; i < steps; i++) {
Serial.print(i);
Serial.print(", ");
Serial.println(_takeupSamples[i]);
}
uint16_t peak = findPeak(_takeupSamples, steps);
Serial.print("peak: ");
Serial.println(peak);
uint16_t offset = abs(200 - peak);
Serial.print("offset: ");
Serial.println(offset);
if (offset != 0) {
for (uint16_t i = 0; i < offset; i++) {
_takeup.move(-1);
_takeup.runToPosition();
}
for (uint16_t i = 0; i < 25; i++) {
_takeup.move(-1);
_takeup.runToPosition();
}
}
for (uint16_t i = 0; i < 50; i++) {
reading = analogReadAccurateAverage(_takeupReceiver);
_takeupSamples[i] = reading;
if (i < steps - 1) {
_takeup.move(1);
_takeup.runToPosition();
}
}
uint16_t peak2 = findPeak(_takeupSamples, 50);
uint16_t offset2 = abs(50 - peak2);
if (offset2 != 0) {
for (uint16_t i = 0; i < offset2; i++) {
_takeup.move(-1);
_takeup.runToPosition();
}
}
}
long McopyProjector::readVcc() { long McopyProjector::readVcc() {
long result; long result;
// Read 1.1V reference against AVcc // Read 1.1V reference against AVcc
@ -221,30 +154,18 @@ long McopyProjector::readVcc() {
return result; return result;
} }
long McopyProjector::analogReadAccurate (uint8_t &pin) { long McopyProjector::analogReadAccurate (int pin) {
double Vcc = readVcc() / 1000.0; double Vcc = readVcc() / 1000.0;
double ADCValue = analogRead(pin); double ADCValue = analogRead(pin);
return (ADCValue / 1024.0) * Vcc; return (ADCValue / 1024.0) * Vcc;
} }
long McopyProjector::analogReadAccurateAverage (uint8_t &pin) { long McopyProjector::analogReadAccurateAverage (int pin) {
uint8_t count = 3; int count = 3;
double sum = 0.0; double sum = 0.0;
for (uint8_t i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
sum += analogReadAccurate(pin); sum += analogReadAccurate(pin);
delay(1); delay(1);
} }
return sum / (double) count; return sum / (double) count;
} }
uint16_t McopyProjector::findPeak(long (&arr)[200], uint16_t &steps) {
uint16_t maxI = 0;
long max = 0;
for (uint16_t i = 0; i < steps; i++) {
if (arr[i] > max) {
maxI = i;
max = arr[i];
}
}
return maxI;
}

View File

@ -28,30 +28,20 @@ class McopyProjector {
AccelStepper _takeup; AccelStepper _takeup;
AccelStepper _feed; AccelStepper _feed;
const uint16_t _motorSteps = 200; //full steps uint16_t _motorSteps = 1600; //microstepped
const uint8_t _frames = 8; uint8_t _frames = 8;
const uint16_t _stepsPerFrame = 25; //round(_motorSteps / _frames); uint16_t _stepsPerFrame = 25; //round(_motorSteps / _frames);
const float _speed = 2000.0; uint8_t _mode = 1;
float _speed = 2000.0;
volatile uint8_t _mode = 1;
int64_t _posTakeup = 0; int64_t _posTakeup = 0;
int64_t _posFeed = 0; int64_t _posFeed = 0;
//X
uint8_t _takeupSettingA;
uint8_t _takeupSettingB;
//Y
uint8_t _feedSettingA;
uint8_t _feedSettingB;
//X
uint8_t _takeupEmitter;
uint8_t _takeupReceiver;
//Y
uint8_t _feedEmitter;
uint8_t _feedReceiver;
long _feedSamples[200];
long _takeupSamples[200]; uint8_t _takeupSettingA = 4;
uint8_t _takeupSettingB = 5;
uint8_t _feedSettingA = 8;
uint8_t _feedSettingB = 9;
bool _dir = true; bool _dir = true;
@ -59,17 +49,12 @@ class McopyProjector {
bool _adjusting = false; bool _adjusting = false;
long readVcc(); long readVcc();
long analogReadAccurate (uint8_t &pin); long analogReadAccurate (int pin);
long analogReadAccurateAverage (uint8_t &pin); long analogReadAccurateAverage (int pin);
uint16_t findPeak(long (&arr)[200], uint16_t &steps);
public: public:
McopyProjector(AccelStepper takeup, AccelStepper feed, McopyProjector(AccelStepper takeup, AccelStepper feed, uint8_t takeupSettingA, uint8_t takeupSettingB, uint8_t feedSettingA, uint8_t feedSettingB);
uint8_t takeupSettingA, uint8_t takeupSettingB,
uint8_t feedSettingA, uint8_t feedSettingB,
uint8_t takeupEmitter, uint8_t takeupReceiver,
uint8_t feedEmitter, uint8_t feedReceiver);
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);
@ -80,8 +65,6 @@ class McopyProjector {
void setStepperMode(uint8_t mode); void setStepperMode(uint8_t mode);
void loop(); void loop();
void home(); void home();
void firstPass();
void centerPass();
}; };

View File

@ -46,11 +46,12 @@ 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);
//CAMERA CONSTANTS //CAMERA CONSTANTS
const int BUTTON = 19; const int BUTTON = 7;
const int LED_FWD = 20; const int LED_FWD = 8;
const int LED_BWD = 21; const int LED_BWD = 9;
const int PROJECTOR_MOMENT = 240; const int PROJECTOR_MOMENT = 240;
const int PROJECTOR_STEPS = 25;
//VARIABLES //VARIABLES
volatile int projectorFrame = -1; volatile int projectorFrame = -1;
@ -60,11 +61,7 @@ volatile bool direction = true;
volatile long start; volatile long start;
McopySerial mcopy; McopySerial mcopy;
McopyProjector projector(takeup, feed, McopyProjector projector(takeup, feed, TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B, FEED_SETTINGS_A, FEED_SETTINGS_B);
TAKEUP_SETTINGS_A, TAKEUP_SETTINGS_B,
FEED_SETTINGS_A, FEED_SETTINGS_B,
TAKEUP_EMITTER, TAKEUP_RECEIVER,
FEED_EMITTER, FEED_RECEIVER);
void setup () { void setup () {
pins(); pins();
@ -75,7 +72,6 @@ void setup () {
delay(42); delay(42);
digitalWrite(LED_FWD, LOW); digitalWrite(LED_FWD, LOW);
digitalWrite(LED_BWD, LOW); digitalWrite(LED_BWD, LOW);
projector.home();
} }
void loop () { void loop () {
@ -85,7 +81,7 @@ void loop () {
if (digitalRead(BUTTON) == LOW) { if (digitalRead(BUTTON) == LOW) {
projector_frame(); projector_frame();
} }
projector.loop(); //projector.loop();
} }
void pins () { void pins () {
@ -138,7 +134,6 @@ void projector_timing_end () {
void projector_frame () { void projector_frame () {
int LED = direction ? LED_FWD : LED_BWD; int LED = direction ? LED_FWD : LED_BWD;
mcopy.log("projector_direction(false)");
digitalWrite(LED, HIGH); digitalWrite(LED, HIGH);
projector.frame(direction); projector.frame(direction);
mcopy.confirm(mcopy.PROJECTOR); mcopy.confirm(mcopy.PROJECTOR);
@ -151,7 +146,7 @@ void state () {
stateString += String(mcopy.STATE); stateString += String(mcopy.STATE);
mcopy.print(stateString); mcopy.print(stateString);
} }
/*
long readVcc() { long readVcc() {
long result; long result;
// Read 1.1V reference against AVcc // Read 1.1V reference against AVcc
@ -180,4 +175,3 @@ long analogReadAccurateAverage (int pin) {
} }
return sum / (double) count; return sum / (double) count;
} }
*/

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.8.35", "version": "1.8.33",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mcopy", "name": "mcopy",
"version": "1.8.35", "version": "1.8.33",
"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.35", "version": "1.8.33",
"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.35", "version": "1.8.33",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {

View File

@ -19,7 +19,6 @@ KeyVoidD2 = 14.2;
KeyWidth = 2.25; KeyWidth = 2.25;
StepperMountZ = 20; StepperMountZ = 20;
StepperMountInnerD = 30;
GateBoltX = (-PanelX / 2) + 54; GateBoltX = (-PanelX / 2) + 54;
GateBoltY = 105 / 2; GateBoltY = 105 / 2;
@ -33,14 +32,6 @@ LEDPin = 0.6;
LEDPinSpacing = 2.54; LEDPinSpacing = 2.54;
LEDH = 8.6; LEDH = 8.6;
ServoX = 55;
ServoY = 7;
ServoBoltD = 4.5;
ServoZ = 20;
ServoSpaceZ = 9.5;
ServoSpaceX = 48;
ServoVoidX = 40.5;
module bearing_void (pos = [0, 0, 0], width= 8) { module bearing_void (pos = [0, 0, 0], width= 8) {
fuzz = 0.3; fuzz = 0.3;
translate (pos) { translate (pos) {
@ -108,7 +99,6 @@ module LED_void (pos = [0, 0, 0], rot = [0, 0, 0], flip = false) {
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
rotate([0, -90, 0]) { rotate([0, -90, 0]) {
cylinder(r = R(LightVoidD), h = 80, center = true, $fn = 40); cylinder(r = R(LightVoidD), h = 80, center = true, $fn = 40);
/*
if (flip) { if (flip) {
translate([0, 0, -EmitterZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40); translate([0, 0, -EmitterZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40);
translate([0, 0, ReceiverZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40); translate([0, 0, ReceiverZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40);
@ -116,7 +106,6 @@ module LED_void (pos = [0, 0, 0], rot = [0, 0, 0], flip = false) {
translate([0, 0, EmitterZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40); translate([0, 0, EmitterZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40);
translate([0, 0, -ReceiverZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40); translate([0, 0, -ReceiverZ]) cylinder(r = R(LEDVoidD), h = 80, center = true, $fn = 40);
} }
*/
} }
} }
} }
@ -147,31 +136,27 @@ module LED (pos = [0, 0, 0], rot = [0, 0, 0]) {
} }
} }
module LED_housing (pos = [0, 0, 0], rot = [0, 0, 0], OffsetZ = 0, Void = true) { module LED_housing (pos = [0, 0, 0], rot = [0, 0, 0]) {
$fn = 90; $fn = 90;
D = LEDD + 0.2; D = LEDD + 0.2;
H = LEDH; H = LEDH;
Opening = 3; Opening = 3;
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
translate([0, 0, OffsetZ]) { difference () {
difference () { union() {
union() { cube([D + 3, D + 3, 10], center = true);
cube([D + 3, D + 3, 10], center = true); translate([0, 0, -4]) cube([D + 3, D + 3, 10], center = true);
translate([0, 0, -4]) cube([D + 3, D + 3, 10], center = true); translate([0, 5, -6]) cube([D + 3, 15, 6], center = true);
translate([0, 5, -6]) cube([D + 3, 15, 6], center = true); }
} translate([0, 0, -(10 / 2) + (H / 2) - 1.301]) union () {
if (Void) { cylinder(r = (D / 2), h = H - (D / 2), center = true);
translate([0, 0, -(10 / 2) + (H / 2) - 1.301]) union () { translate([0, 0, (H / 2) - (D / 4)]) sphere(r = D / 2);
cylinder(r = (D / 2), h = H - (D / 2), center = true); }
translate([0, 0, (H / 2) - (D / 4)]) sphere(r = D / 2); cylinder(r = (Opening / 2), h = 10 + 1, center = true);
} translate([0, 0, -7]) cylinder(r = (6.02 / 2), h = 4.01, center = true);
cylinder(r = (Opening / 2), h = 10 + 1, center = true); translate([0, 7.5, -8]) difference () {
translate([0, 0, -7]) cylinder(r = (6.02 / 2), h = 4.01, center = true); cube([6.02, 15, 3], center = true);
translate([0, 7.5, -8]) difference () { cube([1.5, 15 + 1, 3 + 1], center = true);
cube([6.02, 15, 3], center = true);
cube([1.5, 15 + 1, 3 + 1], center = true);
}
}
} }
} }
} }
@ -200,25 +185,18 @@ module stepper_mount_block (pos = [0, 0, 0], rot = [0, 0, 0]) {
BoltY = NEMA17BoltSpacing / 2; BoltY = NEMA17BoltSpacing / 2;
BoltCapZ = 11; BoltCapZ = 11;
H = 30; H = 30;
InnerD = StepperMountInnerD; InnerD = 30;
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
difference () { difference () {
union () { union () {
stepper_mount_block_positive([0, 0, -5], H); stepper_mount_block_positive([0, 0, -5], H);
//top LED_prop([0, -19, -4.5 + 7.5], [0, 0, 45], flip = false);
//LED_prop([0, -19, -4.5 + 7.5], [0, 0, 45], flip = false);
//bottom
//LED_prop([0, -19, -4.5 + 11.5], [0, 0, 45], H = 9, flip = false); //LED_prop([0, -19, -4.5 + 11.5], [0, 0, 45], H = 9, flip = false);
} }
translate([0, 0, -5]) cylinder(r = R(InnerD), h = H + 1, center = true, $fn = 120); translate([0, 0, -5])cylinder(r = R(InnerD), h = H + 1, center = true, $fn = 120);
bolt_void([BoltX, BoltY, -5], H);
LED_housing([0, -17.25, -4.5], [90, -90, 134], Void = false);
LED_housing([0, -17.25, -4.5], [-90, 90, 134], OffsetZ = -24.25, Void = false);
bolt_void([BoltX, BoltY, -5], H);
bolt_void([-BoltX, BoltY, -5], H); bolt_void([-BoltX, BoltY, -5], H);
bolt_void([BoltX, -BoltY, -5], H); bolt_void([BoltX, -BoltY, -5], H);
bolt_void([-BoltX, -BoltY, -5], H); bolt_void([-BoltX, -BoltY, -5], H);
@ -227,13 +205,10 @@ module stepper_mount_block (pos = [0, 0, 0], rot = [0, 0, 0]) {
bolt_and_cap_void([-BoltX, BoltY, BoltCapZ], cap = H, bolt = H); bolt_and_cap_void([-BoltX, BoltY, BoltCapZ], cap = H, bolt = H);
bolt_and_cap_void([BoltX, -BoltY, BoltCapZ], cap = H, bolt = H); bolt_and_cap_void([BoltX, -BoltY, BoltCapZ], cap = H, bolt = H);
bolt_and_cap_void([-BoltX, -BoltY, BoltCapZ], cap = H, bolt =H); bolt_and_cap_void([-BoltX, -BoltY, BoltCapZ], cap = H, bolt =H);
//top //
LED_void([0, -17.25, -4.5], [0, 0, 45]); LED_void([0, -17.25, -4.5], [0, 0, 45]);
//bottom
//LED_void([0, -17.25, 2.5], [0, 0, 45], true); //LED_void([0, -17.25, 2.5], [0, 0, 45], true);
} }
color("blue") LED_housing([0, -17.25, -4.5], [90, -90, 134], Void = true);
color("blue") LED_housing([0, -17.25, -4.5], [-90, 90, 134], OffsetZ = -24.25, Void = true);
} }
} }
@ -405,55 +380,12 @@ module orbital_mount (pos = [0, 0, 0], rot = [0, 0, 0]) {
for (i = [0 : Notches - 1]) { for (i = [0 : Notches - 1]) {
rotate([0, 0, i * (360 / Notches)]) translate([OuterD / 2, 0, 0]) rotate([0, 0, 45]) cube([Notch, Notch, BottomZ + TopZ + 1], center = true); rotate([0, 0, i * (360 / Notches)]) translate([OuterD / 2, 0, 0]) rotate([0, 0, 45]) cube([Notch, Notch, BottomZ + TopZ + 1], center = true);
} }
for (i = [0 : 3]) {
rotate([0, 0, i * (360 / 4)]) translate([OuterD / 2, 0, 0]) rotate([0, 0, 45]) cube([1, 1, BottomZ + TopZ + 1], center = true);
}
bolt_and_cap_void([BoltsX, BoltsY, -4], [180, 0, 0]); bolt_and_cap_void([BoltsX, BoltsY, -4], [180, 0, 0]);
bolt_and_cap_void([BoltsX, -BoltsY, -4], [180, 0, 0]); bolt_and_cap_void([BoltsX, -BoltsY, -4], [180, 0, 0]);
} }
} }
} }
module servo_mount_bolt_void (pos = [0, 0, 0], rot = [0, 0, 0]) {
translate (pos) rotate (rot) {
cylinder(r = ServoBoltD / 2, h = ServoY + 1, center = true, $fn = 60);
}
}
module servo_mount_old (pos = [0, 0, 0], rot = [0, 0, 0]) {
translate (pos) rotate (rot) {
difference () {
translate([1.5, 0, 0]) rotate([90, 0, 0]) rounded_cube([ServoX + 3, ServoZ+20, ServoY ], d = 4, center = true, $fn = 40);
cube([ServoVoidX, ServoY + 1, ServoZ + 1], center = true);
translate([0, ServoY - 1, 0]) cube([ServoX + 1, ServoY, 1], center = true);
servo_mount_bolt_void ([ServoSpaceX / 2, 0, ServoSpaceZ / 2], [90, 90, 0]);
servo_mount_bolt_void([-ServoSpaceX / 2, 0, ServoSpaceZ / 2], [90, 90, 0]);
servo_mount_bolt_void ([ServoSpaceX / 2, 0, -ServoSpaceZ / 2], [90, 90, 0]);
servo_mount_bolt_void ([-ServoSpaceX / 2, 0, -ServoSpaceZ / 2], [90, 90, 0]);
}
}
//debug
//translate([(55 / 2)-17.5, 0, 0]) sphere(r = 6 / 2, $fn = 60);
}
module servo_mount (pos = [0, 0, 0], rot = [0, 0, 0]) {
translate (pos) rotate (rot) {
//difference () {
//translate([1.5, 0, 0]) rotate([90, 0, 0]) rounded_cube([ServoX + 3, ServoZ+20, ServoY ], d = 4, center = true, $fn = 40);
cube([ServoVoidX, ServoY + 1, ServoZ + 1], center = true);
translate([0, ServoY - 1, 0]) cube([ServoX + 1, ServoY, 1], center = true);
translate([ServoSpaceX / 2, 0, ServoSpaceZ / 2]) rotate([90, 90, 0]) cylinder(r = R(ServoBoltD), h = ServoY + 1, center = true, $fn = 60);
translate([-ServoSpaceX / 2, 0, ServoSpaceZ / 2]) rotate([90, 90, 0]) cylinder(r = R(ServoBoltD), h = ServoY + 1, center = true, $fn = 60);
translate([ServoSpaceX / 2, 0, -ServoSpaceZ / 2]) rotate([90, 90, 0]) cylinder(r = R(ServoBoltD), h = ServoY + 1, center = true, $fn = 60);
translate([-ServoSpaceX / 2, 0, -ServoSpaceZ / 2]) rotate([90, 90, 0]) cylinder(r = R(ServoBoltD), h = ServoY + 1, center = true, $fn = 60);
//}
}
//debug
//translate([(55 / 2)-17.5, 0, 0]) sphere(r = 6 / 2, $fn = 60);
}
module projector () { module projector () {
} }
@ -478,11 +410,10 @@ module debug () {
} }
color("red") translate([(-PanelX / 2) + 10, 0, (-PanelZ / 2) -10]) rotate([90, 0, 0]) 2020_tslot(PanelY); color("red") translate([(-PanelX / 2) + 10, 0, (-PanelZ / 2) -10]) rotate([90, 0, 0]) 2020_tslot(PanelY);
orbital_mount([(-PanelX / 2) - 4.5, 0, 40], [0, 90, 0]); orbital_mount([(-PanelX / 2) - 4.5, 0, 40], [0, 90, 0]);
color("green") servo_mount([40, 0, -30], [90, 0, 0]);
} }
PART = "panelx"; PART = "panel";
if (PART == "gate_key") { if (PART == "gate_key") {
gate_key(KeyRot = 90); gate_key(KeyRot = 90);