breiler / ugs_candy_mechanics

GNU General Public License v3.0
0 stars 2 forks source link

Motor on/off to prevent too much heat #11

Open cwtait2 opened 5 years ago

cwtait2 commented 5 years ago

@breiler another thought - It would be good to figure out how to build in commands to make the motors power off when idle so they are not staying really hot and using power. In normal UGS (with the command line) this can be achieved by setting $1=100 (power off when idle) Then, before a cut, it can be set to $1=255.

However, we have the 'loading' state where the fixture is in position to be loaded with chocolate. If there is no power to the Y motor, the force of the user pushing the chocolate into the fixture actually pushes the whole fixture away. If the motors have power, this effectively brakes the motor and provides resistance to the user putting the chocolate in.

So, is there a way of adding $1=255 when the sequence is at "load your chocolate" then it goes $1=100 after the cut and move to eject.

I tried to insert these commands directly into the environment file but as they aren't gcode commands it didn't work. Any help appreciated!

breiler commented 5 years ago

This is a bit difficult with GRBL, as the $-commands aren't processed as a part of the program.

So for example if you have a small program as the following you'd expect that the movements will be made first then the motors will be shut down. But GRBL will parse and execute the $1-command first then the G01-commands: G01 X100 Y100 G01 Z100 $1=100

cwtait2 commented 5 years ago

ok - yes maybe not technically part of the string of grbl commands then.

Would the $1=100 / 255 be used in the same way that $H and $X are used? Can it be built out as a separate command like homing and kill alarm are?