r/ArduinoProjects • • Jul 23 '19

My XY table - code and question in the comments.

159 Upvotes

12 comments sorted by

6

u/run7b Jul 23 '19

Link to repository containing code: https://github.com/smeschke/xy_plotter/blob/master/README.md

There is a lot of great documentation on how to create g-code. There is a lot of great documentation on how to use an Arduino to run stepper motors. I was unable to find the link between the g-code and the Arduino.

My solution was to use [Python and OpenCV to record my mouse clicks](https://github.com/smeschke/xy_plotter/blob/master/manual_annotation.gif) and then convert that data into instructions for the Arduino. It would be just as easy to parse this information from g-code. This works well and it is simple, but it is limited by the Arduino’s memory. There is only room for about 15 characters.

How are Arduino 3-axis machines controlled? Should stepper-motor instructions be serially from a computer to the Arduino? Is there some software for this purpose?

2

u/w33tikv33l Jul 24 '19

I made an arduino based pen plotter that is similar to your design. I mostly use an inkscape (free vector graphic software for linux) plugin that can translate vector images to g-code. This does require quite some manual pre-processing of the images though. Here is a link:
https://www.norwegiancreations.com/2015/08/an-intro-to-g-code-and-how-to-generate-it-using-inkscape/
To answer your question, I use a simple python script to send the g-code instruction one by one to the arduino. The arduino then parses the g-code and controls the motors.

1

u/run7b Jul 24 '19

It sounds like you have the link that I am looking for. There is a Python script that runs on the computer and send that instructions to the the Arduino, and there is one on the Arduino that parses the g-code and controls the motors. Do you have a link to those scripts or a tutorial?

3

u/billyboogie Jul 24 '19

Still cheaper than print cartridges.

1

u/Saintskinny51792 Jul 24 '19

hello XY table, nice to meet you!

1

u/run7b Jul 24 '19

You can meet it's brother too: https://www.youtube.com/watch?v=uyq7RJbFZEI

1

u/Saintskinny51792 Jul 25 '19

That's freakin' awesome! and rather hypnotizing lol I could watch that thing for an hour

1

u/whowhatwutwidit Jul 24 '19

Make it precise enough to do Engineering Lettering and you got yourself a time saver there

1

u/run7b Jul 24 '19

Thanks! Engineering Lettering is going to be really helpful.