Cycle Start Button / Optional M-Codes

Is there a way to start the machine cycle via a physical button? Are there Inputs / Outputs that can be looked at / turned on in the program? Wait for Signal / M-Codes?

I have a Shapeoko 4. Would be open to different G Code Senders if it allows these functions.

By machine cycle do you mean the homing/machine initialization, or starting a job ?

In both cases: not by interfacing directly with the machine controller, no (there are no I/Os that GRBL would monitor to trigger a homing for example)

There is however the possibility to hook up buttons/switches to the computer that runs the G-code sender, and write the code that will translate a button push into a specific G-code command to be send to the machine via the G-code sender, and with that capability you can do all sorts of automation commands.

It’s easy if you are comfortable with a little Arduino hacking, else…not so much.
Here’s a example using an Arduino and some code to interface with CNCjs sender:

1 Like

I’ll want to manually initialize and pick the program.

Then I want be able start the program automatically and know when it is finished so I can automate it.

I will have a PI 400 on the machine that has some IO connections I can use. I would assume that I can use that to trigger a start and any other automation I can dream up.

Yes, you can definitely leverage I/O ports on a Pi400. The difficulty will likely more be in setting up the software to interface with the G-code sender (but this has been done multiple times)

Would I be able to interface to the machine while it is running? I would like you use the machine x, y, z then turn on a pneumatic gripper or vacuum cup to pick and place a part?

I think that will depend on the gcode sender you pick. There are very limited options for additional hardware connections on the GRBL controller in the Shapeoko. You will probably have to do all your custom additions entirely on the Pi400 side using the GPIO and your gcode sender.

Is your usecase to remove the router and use the Shapeoko as a pick and place machine ? If it is, you could reuse the PWM output from the controller to control the pneumatic gripper. The PWM is normally used to control a spindle (or the bitrunner), and is turned on and off by using the M3 and M5 commands.

If you can’t use the PWM because you do have a VFD/spindle/bitrunner to control, the only hackable output signal left will be A3 pin on the microcontroller that GRBL toggles based on the M8/M9 commands, however the A3 pin is not broken out to a header pin or hole, so you would have to do some precise soldering on one pin of the ATMega controller, which is…not for the faint of heart (and likely to kill your controller if you mess up)

So that’s for the “extra output signal from the controller” side of things. Now,

Nothing will prevent it once the Pi/G-code sender interface is in place. However, if the interface software running on your Pi is going to send G-code commands to the sender right in the middle of a job, you have two extra difficulties:

  • the command you send from “the outside” (as far as the Gcode sender is concerned) may interfere with the stream of G-code commands that the sender is feeding into the controller while running a job. I never tested it, it may work, the behavior probably depends on the G-code sender, and of course the commands you send should not interact with the movement/controller state that the job relies on. But M8/M9/M3/M5 would probably be ok
  • more importantly, I supposed that you would not want those extra commands to be sent completely independently from what’s going on in the job. So it seems to me that you would likely end up having to control 100% of the G-code commands (those for the job, and the “control” ones) from the Pi interface software, so that you control everything. At this point the G-code sender only acts as a glorified UART port.

So, I got carried away maybe, the “pick and place” words got me all excited :slight_smile:

1 Like

I would want to also use the router.

Something similar to this.

Thanks

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.