how to add a command to control an external relay in the likeness of M7, M8 assigning a free processor output.
I think that you can use the M106 command to turn on and off the M107
评论 (12)
#2 – KrisKelvin1 于 2019-10-03
yes, I use M7 and M8 but I want to have three, and better four channels of control of external devices
#3 – mac7988 于 2019-10-04
I would love more M codes as well maybe a sub I/O board would be a great way.
#4 – bdring 于 2019-10-08
This is a common request, but I have been reluctant to add commands that are not in regular Grbl. I added it to the roadmap, but probably won’t work on it for a while.
#5 – KrisKelvin1 于 2019-10-08
very sorry …. many users wanted to be able to control external devices ![]()
#6 – bdring 于 2019-10-09
@KrisKelvin1 Very Sorry …. It is on the roadmap, and will likely get done eventually. I get virtually no donations to this projects, so I have the set the priorities myself.
#7 – bdring 于 2019-10-09
Should the format be
#8 – terjeio 于 2019-10-09 AFAIK grbl tries to follow linuxcnc specifications where relevant.
#9 – bdring 于 2019-10-10
I agree with the LinuxCNC comment
They would be M62, M63, M64 and M65
There is no mention of the S parameter, but we could default to full on/off if that parameter is not supplied.
#10 – bdring 于 2019-10-10
Looking into this further. It is probably best to just support the synchronized versions initially.
#11 – bdring 于 2019-10-13
I think I have M62 and M63 working. I need to test and think a while before I push the changes.
The format is M62 P1 to turn on pin 1 and M63 P1 to turn it off. The pin number does not refer to the actual ESP32 pin number. It is the IO you assign to be pin 1. It is done in the cpu map like this.
“C++`
#define USERDIGITALPIN1 GPIONUM_21
#define USERDIGITALPIN2 GPIONUM_25
You can define up to 4 right now.
The command is synchronized, so it waits for all previous moves to complete before it changes the pin state.
`“
G0 X0
G1 X500 F100
M62 P1
G1 X1000
This will move quickly to X0. Slowly to X500 (decelerating to a stop). Turn on Pin 1. Move to X1000.
Edit: Note: All outputs turn off on a reset (mc_reset)
#1 – bdring 于 2019-10-03
Can you use M7, M8, and M9?