Developed a seemingly working fix with the "correction loop" strategy. Might be putting the motor through hell but it is consistent.
This commit is contained in:
parent
fcf24b5539
commit
f84e8b741a
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-app",
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-app",
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"description": "GUI for the mcopy small gauge film optical printer platform",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
|
|
@ -51,7 +51,7 @@ const int PROJECTOR_FRAME = 600;
|
|||
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
||||
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
||||
const int PROJECTOR_HALF_TIME = 450;
|
||||
const int PROJECTOR_STOP_DELAY = 15;
|
||||
const int PROJECTOR_STOP_DELAY = 1;
|
||||
|
||||
//PROJECTOR VARIABLES
|
||||
boolean proj_dir = true;
|
||||
|
@ -132,16 +132,24 @@ void proj_stop () {
|
|||
digitalWrite(PROJECTOR_BWD, LOW);
|
||||
digitalWrite(LED_FWD, LOW);
|
||||
digitalWrite(LED_BWD, LOW);
|
||||
|
||||
int correctionLoops = 0;
|
||||
if (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||
if (proj_dir) {
|
||||
digitalWrite(PROJECTOR_BWD, HIGH);
|
||||
delay(PROJECTOR_STOP_DELAY);
|
||||
while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||
digitalWrite(PROJECTOR_BWD, HIGH);
|
||||
delay(PROJECTOR_STOP_DELAY);
|
||||
correctionLoops++;
|
||||
}
|
||||
digitalWrite(PROJECTOR_BWD, LOW);
|
||||
mc.log("correctionLoops: " + String(correctionLoops));
|
||||
} else {
|
||||
digitalWrite(PROJECTOR_FWD, HIGH);
|
||||
delay(PROJECTOR_STOP_DELAY);
|
||||
while (digitalRead(PROJECTOR_MICROSWITCH) == PROJECTOR_MICROSWITCH_CLOSED) {
|
||||
digitalWrite(PROJECTOR_FWD, HIGH);
|
||||
delay(PROJECTOR_STOP_DELAY);
|
||||
correctionLoops++;
|
||||
}
|
||||
digitalWrite(PROJECTOR_FWD, LOW);
|
||||
mc.log("correctionLoops: " + String(correctionLoops));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mcopy",
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"arduino": "file:app/lib/arduino",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"description": "Small gauge film optical printer platform",
|
||||
"main": "build.js",
|
||||
"directories": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.76",
|
||||
"version": "1.8.77",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
|
Loading…
Reference in New Issue