pilhuhn / xy-plotter Goto Github PK
View Code? Open in Web Editor NEWArduino-code for my XY-plotter
License: Apache License 2.0
Arduino-code for my XY-plotter
License: Apache License 2.0
Please add new functions:
Ability to Set Origin 0:0 as a reference for example: using commands to move the pen to the corner of the page and set / store that as the 0:0 reference.
Ability to apply Offset values for both X & Y where to start printing from the origin on the page.
Break out the stepsPerMM ability to define one for the X axis and another for the Y axis.
Hi,
Can you please add in:
These will help with mechanical variances. Thanks.
Please see attached video showing what happens.
Hi,
I am able to get the motors doing the right things with your commands. When I hit "H" to home X & Y axis's the optical switches are not seen or recognized and no interrupt is ever being created.
I created a separate small routine to test these same limit switch pins and optical switches using attachedInterrupt they all work fine they see the optical switches and create an interrupt.
I am not sure what I am missing in your code but for some reason it will not generate an interrupt to stop the motor when a limit switch is seen. Any guidance would be greatly appreciated.
Please change the command functions arc, X, Y, stepsPerMM from int's to floats or better yet double floats. I believe this would fix other issues posted.
Arduino: 1.8.13 (Mac OS X), Board: "SAME51N19A M4 (SAME51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void setup()':
xy-plotter:122:3: error: 'servoMove' was not declared in this scope
122 | servoMove(SERVO_PIN, PEN_UP);
| ^~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void panic()':
xy-plotter:140:3: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
140 | Timer1.stop();
| ^~~~~~
| _timer1
xy-plotter:141:3: error: 'println' was not declared in this scope; did you mean 'printf'?
141 | println("STOPPED");
| ^~~~~~~
| printf
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void oneStep()':
xy-plotter:161:5: error: 'println' was not declared in this scope; did you mean 'printf'?
161 | println(F("D One step, hit a switch"));
| ^~~~~~~
| printf
xy-plotter:162:5: error: 'servoMove' was not declared in this scope
162 | servoMove(SERVO_PIN, PEN_UP);
| ^~~~~~~~~
xy-plotter:163:5: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
163 | Timer1.stop();
| ^~~~~~
| _timer1
xy-plotter:173:5: error: 'servoMove' was not declared in this scope
173 | servoMove(SERVO_PIN, PEN_UP);
| ^~~~~~~~~
xy-plotter:178:5: error: 'servoMove' was not declared in this scope
178 | servoMove(SERVO_PIN, PEN_DOWN);
| ^~~~~~~~~
xy-plotter:188:5: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
188 | Timer1.stop();
| ^~~~~~
| _timer1
xy-plotter:197:7: error: 'printWorkItem' was not declared in this scope
197 | printWorkItem(wItem);
| ^~~~~~~~~~~~~
xy-plotter:199:5: error: 'setDirection' was not declared in this scope
199 | setDirection(wItem);
| ^~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void interruptOnX1()':
xy-plotter:235:3: error: 'disableXInterrupts' was not declared in this scope
235 | disableXInterrupts();
| ^~~~~~~~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void interruptOnX2()':
xy-plotter:242:3: error: 'disableXInterrupts' was not declared in this scope
242 | disableXInterrupts();
| ^~~~~~~~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void interruptOnY1()':
xy-plotter:249:3: error: 'disableYInterrupts' was not declared in this scope
249 | disableYInterrupts();
| ^~~~~~~~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void interruptOnY2()':
xy-plotter:256:3: error: 'disableYInterrupts' was not declared in this scope
256 | disableYInterrupts();
| ^~~~~~~~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void startWork()':
xy-plotter:267:5: error: 'enableMotors' was not declared in this scope
267 | enableMotors();
| ^~~~~~~~~~~~
xy-plotter:268:5: error: 'enableEndSwitches' was not declared in this scope
268 | enableEndSwitches();
| ^~~~~~~~~~~~~~~~~
xy-plotter:277:5: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
277 | Timer1.initialize(100); // No motor movement, so we can speed up
| ^~~~~~
| _timer1
xy-plotter:279:5: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
279 | Timer1.initialize(200);
| ^~~~~~
| _timer1
xy-plotter:281:3: error: 'Timer1' was not declared in this scope; did you mean '_timer1'?
281 | Timer1.attachInterrupt(oneStep);
| ^~~~~~
| _timer1
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void loop()':
xy-plotter:313:23: error: 'preParse' was not declared in this scope
313 | String path = preParse();
| ^~~~~~~~
xy-plotter:314:9: error: 'parsePath' was not declared in this scope
314 | parsePath(path);
| ^~~~~~~~~
xy-plotter:323:11: error: 'enableMotors' was not declared in this scope
323 | enableMotors();
| ^~~~~~~~~~~~
xy-plotter:326:11: error: 'disableMotors' was not declared in this scope
326 | disableMotors();
| ^~~~~~~~~~~~~
xy-plotter:333:27: error: 'preParse' was not declared in this scope
333 | String path = preParse();
| ^~~~~~~~
xy-plotter:334:13: error: 'parsePath' was not declared in this scope
334 | parsePath(path);
| ^~~~~~~~~
xy-plotter:355:13: error: 'println' was not declared in this scope; did you mean 'printf'?
355 | println("D Homing");
| ^~~~~~~
| printf
xy-plotter:358:13: error: 'parsePath' was not declared in this scope
358 | parsePath(path);
| ^~~~~~~~~
xy-plotter:365:13: error: 'servoMove' was not declared in this scope
365 | servoMove(SERVO_PIN, PEN_UP);
| ^~~~~~~~~
xy-plotter:373:13: error: 'servoMove' was not declared in this scope
373 | servoMove(SERVO_PIN, PEN_DOWN);
| ^~~~~~~~~
xy-plotter:381:13: error: 'servoMove' was not declared in this scope
381 | servoMove(SERVO_PIN, val);
| ^~~~~~~~~
xy-plotter:385:11: error: 'enableEndSwitches' was not declared in this scope
385 | enableEndSwitches();
| ^~~~~~~~~~~~~~~~~
xy-plotter:400:13: error: 'disableXInterrupts' was not declared in this scope
400 | disableXInterrupts();
| ^~~~~~~~~~~~~~~~~~
xy-plotter:401:13: error: 'disableYInterrupts' was not declared in this scope
401 | disableYInterrupts();
| ^~~~~~~~~~~~~~~~~~
xy-plotter:420:11: error: 'handleZ' was not declared in this scope
420 | handleZ(arg);
| ^~~~~~~
xy-plotter:426:11: error: 'handleArc' was not declared in this scope
426 | handleArc(c,command);
| ^~~~~~~~~
xy-plotter:442:5: error: 'println' was not declared in this scope; did you mean 'printf'?
442 | println("D .. done reached ..");
| ^~~~~~~
| printf
xy-plotter:466:11: error: 'parsePath' was not declared in this scope
466 | parsePath("Y-200");
| ^~~~~~~~~
xy-plotter:471:11: error: 'parsePath' was not declared in this scope
471 | parsePath("X-200");
| ^~~~~~~~~
xy-plotter:484:21: error: 'preParse' was not declared in this scope
484 | String path = preParse();
| ^~~~~~~~
xy-plotter:486:7: error: 'parsePath' was not declared in this scope
486 | parsePath(path);
| ^~~~~~~~~
xy-plotter:492:9: error: 'disableMotors' was not declared in this scope
492 | disableMotors();
| ^~~~~~~~~~~~~
/Users/JimD/Documents/Arduino/xy-plotter/xy-plotter.ino: In function 'void compensate_move(int)':
xy-plotter:514:3: error: 'println' was not declared in this scope; did you mean 'printf'?
514 | println(" Start crawling");
| ^~~~~~~
| printf
xy-plotter:531:5: error: 'enableYInterrupts' was not declared in this scope; did you mean 'noInterrupts'?
531 | enableYInterrupts(CHANGE);
| ^~~~~~~~~~~~~~~~~
| noInterrupts
xy-plotter:533:5: error: 'enableXInterrupts' was not declared in this scope; did you mean 'noInterrupts'?
533 | enableXInterrupts(CHANGE);
| ^~~~~~~~~~~~~~~~~
| noInterrupts
Multiple libraries were found for "Servo.h"
Used: /Users/JimD/Documents/Arduino/libraries/Servo
Not used: /Applications/Arduino 2.app/Contents/Java/libraries/Servo
Not used: /Users/JimD/Library/Arduino15/packages/adafruit/hardware/samd/1.6.6/libraries/Servo
exit status 1
'servoMove' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Two things:
Hello,
Can you please provide the TimerOne.h file.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.