Hi guys! i am working on a project and my issue is i want to give a g code in raspberry pi and that should operate the x y motors which are connected with Rambo 1.4 and Rambo has marlin installed
can someone guide me like i am kind a new to this so i exactly don’t know how to do this
so iam writing some own type of code and in that code i need to just add x,y coordinates so when i start running the program it should take the x y coordinates generated and those need to be send to motors so can i directly write something in g code to send by using marlin ?
Yes. You could send the gcode commands through the r pi to the Marlin board several ways.
Save it as a file and upload it to the r pi like a 3D print job. This can be done using the Octoprint web browser interface or programmatically (PrusaSlicer does this). Then you can execute the file and it will send all of gcode commands in order.
Or you could send the gcode commands one at a time. In Octoprint there is a terminal tab that you can type commands into.
You could also write a plugin that will send any commands you want.
There are many plug ins that you can install and send custom commands as well. Macro plug in lets you create one button macros that send a bunch of commands etc…
There is a custom control plug in that will let you create any number input/output controls. you can use text boxes with buttons, slider controls, multiple choice selectors and build anything you want to send gcode to the machine.
It sort of depends on what you want to send and where you are generating the commands from.
I’m still a bit confused. Are you trying to do something we all normally do on CNC (like set the origin, so the pattern is offset to the workpiece) or something unique (like generative art, performed by a cnc machine from special code)?
To answer your actual question, you can write python that will open a serial port (using python-serial) and send gcode to it. You can generate the strings to send in python as well. You can also pretty easily read gcode to extract x and y coordinates.
There was a post this week about doing that (weird, because it doesn’t come up that often):
But I think what you may be interested in is just moving your machine to some coordinates, like X=88.1, Y=22.7, Z=0.8, and then setting your zero to be there. If that’s the case, wall away from the python and just use G92 X0 Y0 Z0 when you get to where you want your origin. More at https://docs.v1engineering.com/learn/coordinates/