Sending raw commands to XY Plotter


#1

I’ve been using my xy plotter to produce artwork. It’s been impressive and fun.

Perhaps this has been asked else where: is their a specification available for how to send commands to the plotter directly out the serial port, their format, prologue if any, move to x-y, pen up, pen down, detect limit switch, etc.

I’d like to write some of my own applications.


#2

If you put a gcode parsing firmware on it then you can send gcode ascii commands over serial to control the unit. This is how I use mine…

Make sure you have the original firmware available so you can go back of course…


#3

Have a look at the Motherboard arduino code xybot.ino. In it you will see the GCode and MCode commands the software currently handles.

If you are going to write your own application to send these commands over the USB serial link, be aware that the motherboard sends serial information back to the host PC as well as receives it, for the end-stops, and also sends an OK after processing the command.

I have added stuff to my code, but a quick check on an earlier version of the xybot.ino in my project archive shows:

G00 and G01 both implement a move to the X Y coordinates with additional processing of F for feed speed and A for dwell, G28 implements the home function

M01 with a following number sets the servoe for the pen to that position
M02 does pen setup for U up and D down position
M03 sets the delay to the following number
M04 sets the laser power to a following value 0-255
M05 is for the setup method
M11 tells the motherboard to report the value of each of the four end-stops

As an example of the sort of thing you can do by editing your arduino file, I have amended my code so that G00 lifts the pen and turns off the laser then does a fast move to the coordinates at maximum speed.


#4

Thank you. I’ll have a look at it.


#5

Don’t know about changing out the firmware – I suppose this is something I can find on the net somewhere?


#6

Look at Adrian’s suggestion and then You can also look at my code here… Http://github.com/jweers1/gcodeparser

It’s a work in progress but generally runs well for me right now… One thing in my code is that I set laser power using the Z movement direction…


#7

i have c# code available to drive your plotter and check the limit switches.


#8

Hello, thanks for the response. I program in C++ and Python but I could use the c# as model, if you’re willing to pass it along.


#9

I downloaded and perused Http://github.com/jweers1/gcodeparser. Thanks, this has a lot to work with.

Http://github.com/jweers1/gcodeparser is also has clear code I can use as a model.


#10

Any more updates with this thread? I am trying to send my own raw GCode and MCode commands as well but can’t get it to work. Any help would be appreciated.


#11

Hi,

I would appreciate it very much if I could get the C# code from you please. my email is saleem.qamar@hotmail.com

Thx

Saleem


#12