pkerspe / ESP-StepperMotor-Server

Turn your ESP32 into a complete stepper motor control server with web UI, REST API and serial control interface
MIT License
225 stars 39 forks source link

Limit Switches in Serial #23

Closed conaito closed 3 years ago

conaito commented 3 years ago

I have setup serial limit switches. Works so far.. but release and triggering i get some trouble. How can i get it solved to trigger the limit switches and let move the motor slowly turn in other direction until the limited switch open back? Otherwise the limit switches can´t not works since they trigger again ig i move motor in other direction

pkerspe commented 3 years ago

A triggered limit switch should actually only forbid further movement in the direction the motor move before triggering the limit switch. It should still be possible to move in the other direction. Of course the motor MUST never overshoot te limit switch, if so you are right, the motor will not be able to pass back over the limitswitch. So you need to make sure your motor is able to stop quick enough once the switch has been hit. E.g. the maximum velocity you chose must never be to high to prevent the motor from stopping without overshooting.