-
Hi, I'd like to develop a "composite driver" (a "plugin" in grbl jargon, "composite" because it enables multiple sensors and actuators) in order to re-use my MKS GENL boards. Those are 328p 3d printer boards I'd like to use for controlling everything except motors using a custom companion firmware and hooking the board via SPI to the grbl core on the main mcu (rpi pico). HW wise is all good: level shifters and the picos can fit nicely on top and easily connected. First tests indicate they can work together. The protocol might be 2 simple packetized binary streams, 1 per direction, to get sensors and set heaters/fans. Each packet the full set of sensors (in one direction) and actuators (in the other direction), 1 bit per sensor/actuator. As I've just started to look at the new grbl code in this repo, I'd be grateful to get some tips to help me getting started, as well as pointing me to similar projects if they already exist. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you want it to be flexible you may encapsulate the data transfers as auxillary I/O and write a plugin on top of that. There are several plugins that claims auxillary I/O ports and provide a set of M-codes to control them: fans, OpenPNP and laser coolant are among them. Auxillary I/O is supported by many drivers, typically the code is found in a file named ioports.c, there is also a template available. Of course you may put everything in the same file and not bother to write auxillary I/O support code, but if you do you get both a standard API and M-codes to handle the extra I/O without any additional coding effort. |
Beta Was this translation helpful? Give feedback.
If you want it to be flexible you may encapsulate the data transfers as auxillary I/O and write a plugin on top of that. There are several plugins that claims auxillary I/O ports and provide a set of M-codes to control them: fans, OpenPNP and laser coolant are among them.
Auxillary I/O is supported by many drivers, typically the code is found in a file named ioports.c, there is also a template available.
Of course you may put everything in the same file and not bother to write auxillary I/O support code, but if you do you get both a standard API and M-codes to handle the extra I/O without any additional coding effort.