evil-mad / EggBot

Software for The Original EggBot
GNU General Public License v3.0
288 stars 140 forks source link

Add command to disable automatic motor driver enabling (EBB firmware) #199

Closed EmbeddedMan closed 1 year ago

EmbeddedMan commented 1 year ago

In current EBB firmware, any time any stepper motor motion command is sent both motor drivers are always enabled.

Add a command (CU,50,1 and CU,50,0) to enable/disable this functionality.

Once disabled, the EN command completely controls motor driver enable, and so it's possible to (for example) limp one motor (with EN,1,0 or EN,0,1) and then make stepper motor move commands where only one motor moves and the other is disabled.

EmbeddedMan commented 1 year ago

This command has been finished, and is already incorporated into the EBF_v3.0.0 branch code. It will become available in the v3.0.0 release of EBB Firmware. Here are the details: CU,50,1 will turn on the automatic enabling of each motor driver's enable pin at the time the motion command is parsed (note, not necessarily at the time that it begins to execute the motion). This is the default at boot and mimics the behavior of previous versions. CU,50,0 will turn off the automatic enabling of each motor driver's enable pin.

If automatic driver enabling is turned off, then it is up to the user to manually control both driver's enable pins using the EM command. So for example, if you do CU,50,0 and then SM,100,100,100, neither motor will move (they will both just freewheel). The CU,50,0 command may be useful in situations where you desire to leave one motor free to spin (limp) while the other is moved by a motion command.