multigcs / LinuxCNC-RIO

RealtimeIO for LinuxCNC based on an FPGA
https://forum.linuxcnc.org/18-computer/49142-linuxcnc-rio-realtimeio-for-linuxcnc-based-on-fpga-ice40-ecp5
GNU General Public License v2.0
72 stars 17 forks source link

BOB design guidlines #38

Closed tpimh closed 9 months ago

tpimh commented 9 months ago

I have an SBC, an FPGA board and stepper motor drivers with STEP/DIR inputs. How do I connect it correctly?

As I understand, if FPGA and SBC both have 3.3V I/O levels, then SPI lines can be connected directly between them, and both boards can be powered from the same source.

If smaller stepper motor drivers are used (like A4988), their logic side can also be powered directly form the same source, and STEP/DIR lines can be connected directly to FPGA. It's best to have an isolated power supply for the motors, so the motor side ground is not connected to the logic side ground of the stepper motor driver.

Interfacing with bigger motor drivers would need some kind of level-shifting, and this is what ULN2803D is normally used for.

While it's possible to connect inputs like endstop switches directly to 3.3V and then directly to FPGA, it's recommended to use higher voltages. In this case they would use the same isolated power supply as the motors, and would need an optocoupler to connect to FPGA, and this is what ILD207T is normally used for.

Are the above points right? Please correct me if I am wrong!

multigcs commented 9 months ago

That's exactly how I did it with the tango board: https://github.com/multigcs/LinuxCNC-RIO/tree/main/configs/Tangoboard

tpimh commented 9 months ago

Yes, I was using this board design as a reference when writing this message. Are my assumptions of connecting the switches and smaller stepper motor drivers directly to FPGA without any protection correct? What other recommendations on BOB design do you have?

multigcs commented 9 months ago

small drivers without any protection works , but no good solution :)

if i build another board, i will add an ethernet adapter and differential inputs for encoders