Hobby servo with interlock
balrags last edited by
I wish to control a continuous hobby servo (5v). Three position 0-90-180 degrees. I also require an interlock phototransistor to prevent movement when a blocked PT condition exists. Having been trained as an 18th century mechanical engineer I get very nervous when confronted with electrons and risk blowing the board. So this is what I think I might get away with as well as a question.
Re-purposing unused E1 heater > +5 into E1 vin and take a pwm signal from the other pin to servo Orange and ground to servo Black wire. Servo Red connects to +5 ( or is this not needed? ).
Then in config.g M42 P#E1 S255 F50
In g-code as required How do I get the interlock signal in here ???? Somehow use M577 ???
M280 P#E1 S90 ( or 0 or 180 degrees)
You must not connect E1_VIN to +5V because that will short +VIN and +5V together.
The usual way to drive servos is from unused heater outputs on the Duet expansion connector - same as for BLTouch.
You may be able to implement the interlock using two M581 triggers. When the phototransistor indicates that movement is not safe, use M307 to configure that output as a heater. When it indicates that it is safe to move, use M307 to disable the heater. In the longer term, you will be able to use conditional GCode in RRF3 instead.