GRBL w/ CANBUS on Nano

I want to set up a CNC unit using GRBL on the 328 (UNO, Nano, etc) and I want to reduce the wiring going to the Z axis head unit.
I thought that CANBus would help with this, as it would allow me to run just 4 wires between CPUs. (power gnd, can+/-)
I have 4 end stops (Z+/-, X+/-) Z stepper, spindle (PWM) and Z probe on the head unit - so, a lot of wires.
I can see that CANbus would work, but I'm not understanding how to actually implement the use of it.

I have all the hardware needed for it, but I don't know how to set up the SW side of it.

Has anyone set up something like this previously?

What is the hardware You've got?
End swiches can't be directly connected to a CAN bus. They need some device that talks CAN.

I have a nano on each end, and canbus transceiver modules attached to the i2c lines.

What is your plan to modify GRBL to monitor data communications while doing it's normal processing?

CAN is a message based system. The sender (transmitter) needs to encode your sensors and send to the receiving unit(s). The protocol can be whatever you want. If you use Cory Fowler's CAN library there is a simple transmitter and receiver codes specifically for the Arduino. They work directly with the Nano, no changes needed All you need to do is connect them properly.

It is very important to structure the bus properly or it will give you lots of problems.

No.
The idea was to control the entire head unit, which consists of the above mentioned parts.

There are setups on 3d printers that have a canbus to control the extruder and all the other pieces of the head unit, but those all use Marlin firmware.
I want to do the same with this CNC I'm building with GRBL.

What is your background as far as machine control software? There have been many, many commercial modifications to Marlin firmware. Are you familiar enough with GRBL to begin the mods?

I am more of a hardware guy, but I understand C well enough.
I have done some tweaking on Marlin for my own printer, but this is adding in functionality rather than editing what's already there.

My thought is that since there is would be a host controller talking to the PC on one side (USB) and a secondary controller on the other (Canbus), I could have the host act as passthrough for all of the communications for the head unit.

That is a lot of data communications to sort out! Good luck!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.