Trial Message
search the encoder for a library, read it and use it.
an encoder is just a type of counter.
when left stop is active or the motor is not moving anymore (as can be seen from the encoder reset a counter.
turn right until the encoder stops
put counter value into a variable.
divide by 2 and run motor until this value is reached.
finetuning is possible but first start with this.
what shield or electronics are used for the motor?
Thanks for the reply Shooter,
I am planning to use a car window motor ( 12 V, 1.3 A no load current and ~ 15-20 A stall current ) and I'm looking for guidance on which motor driver ( with H-bridge functionality ) to use.
Since the stall current is so high, I was thinking of using a hall current sensor to detect the stop ( by sensing a lower current spike threshold ) and cut-off power to the motor.
The encoder needs to be compact and lightweight. I came across the CUI AMT100 series capacitive incremental encoder which looks perfect ( I need a hollow shaft encoder with shaft of 8mm diameter ).
I don't know if those ideas listed above are cohesive / feasible. any advice is welcome.
"I presume the last part would need some kind of PID control to slow down the motor towards the end of the centering cycle to ensure that it doesnt overshoot."
If you are driving your motor from PWM, then you can slow it down as it nears the target location.
15-20A stall current? What are you using for a power supply?
Yes I would be using PWM to drive the motor
@CrossRoads I was thinking of using an SMPS rated at 12V, 20A. Would there be an issue with that ?