diff --git a/app/data/cfg.json b/app/data/cfg.json index c8a07e6..76ea533 100644 --- a/app/data/cfg.json +++ b/app/data/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.55", + "version": "1.8.56", "ext_port": 1111, "profiles": { "mcopy": { diff --git a/app/package-lock.json b/app/package-lock.json index bf851c2..2958827 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,6 +1,6 @@ { "name": "mcopy-app", - "version": "1.8.55", + "version": "1.8.56", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/app/package.json b/app/package.json index feafef1..5e9d2b0 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "mcopy-app", - "version": "1.8.55", + "version": "1.8.56", "description": "GUI for the mcopy small gauge film optical printer platform", "main": "main.js", "scripts": { diff --git a/data/cfg.json b/data/cfg.json index c8a07e6..76ea533 100644 --- a/data/cfg.json +++ b/data/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.55", + "version": "1.8.56", "ext_port": 1111, "profiles": { "mcopy": { diff --git a/notes/mcopy_projector_homing_debug/mcopy_projector_homing_debug.ino b/notes/mcopy_projector_homing_debug/mcopy_projector_homing_debug.ino index 07c6f39..13e6dcd 100644 --- a/notes/mcopy_projector_homing_debug/mcopy_projector_homing_debug.ino +++ b/notes/mcopy_projector_homing_debug/mcopy_projector_homing_debug.ino @@ -107,13 +107,26 @@ void home () { uint16_t eighth = quarter / 2; uint16_t takeupPeak = 0; uint16_t feedPeak = 0; - uint16_t takeupOffset = 0; - uint16_t feedOffset = 0; + int16_t takeupOffset = 0; + int16_t feedOffset = 0; long takeupReading = 0.0; long feedReading = 0.0; Serial.println("home()"); + takeupReading = analogReadAccurateAverage(TAKEUP_RECEIVER); + feedReading = analogReadAccurateAverage(FEED_RECEIVER); + + if (takeupReading > 2) { + _takeup.move(-25); + _takeup.runToPosition(); + } + + if (feedReading > 2) { + _feed.move(-25); + _feed.runToPosition(); + } + delay(10); for (uint16_t i = 0; i < steps; i++) { @@ -131,9 +144,9 @@ void home () { for (uint16_t i = 0; i < steps; i++) { Serial.print(i); - Serial.print(", "); + Serial.print(","); Serial.print(_takeupSamples[i]); - Serial.print(", "); + Serial.print(","); Serial.println(_feedSamples[i]); } @@ -153,16 +166,12 @@ void home () { Serial.println(feedOffset); if (takeupOffset > 0) { - for (uint16_t i = 0; i < takeupOffset; i++) { - _takeup.move(-1); - _takeup.runToPosition(); - } + _takeup.move(takeupOffset < steps/2 ? -takeupOffset : steps - takeupOffset); + _takeup.runToPosition(); } if (feedOffset > 0) { - for (uint16_t i = 0; i < feedOffset; i++) { - _feed.move(-1); - _feed.runToPosition(); - } + _feed.move(feedOffset < steps/2 ? -feedOffset : steps - feedOffset); + _feed.runToPosition(); } /* for (uint16_t i = 0; i < eighth; i++) { diff --git a/package-lock.json b/package-lock.json index db9b20e..3b712e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mcopy", - "version": "1.8.55", + "version": "1.8.56", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mcopy", - "version": "1.8.55", + "version": "1.8.56", "license": "MIT", "dependencies": { "arduino": "file:app/lib/arduino", diff --git a/package.json b/package.json index c3a30d5..e4f80ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcopy", - "version": "1.8.55", + "version": "1.8.56", "description": "Small gauge film optical printer platform", "main": "build.js", "directories": { diff --git a/processing/mcopy/cfg.json b/processing/mcopy/cfg.json index c8a07e6..76ea533 100644 --- a/processing/mcopy/cfg.json +++ b/processing/mcopy/cfg.json @@ -1,5 +1,5 @@ { - "version": "1.8.55", + "version": "1.8.56", "ext_port": 1111, "profiles": { "mcopy": {