Hello all
I am designing a driver to control 1 nema 23 stepper that will be programmed to go to various destinations by a stamp or pic. The motor drives a belt with a timing pulley. since missed pulses by some obstruction would be a problem, I am thinking of using an encoder (by USdigital) with the same resolution as the pulses to compare the pulses sent to the driver with the actual clocks off the encoder. The hbridge is using current sensing to toggle a comparator on and off since I am using over voltage for more torque. Since the current is constantly being checked and the mosfets turned on and off, I dont think I can use an additional shunt circuit to determine overload by the motor.
Can anyone with stepper/encoder experience advise me on what would be the best plan? Some have said I should just use a current sense to detect an obstruction, but I have no idea how to incorporate that with a chopper.
I have never seen any code for using an encoder, so maybe there is a simpler solution than what I have, but here is the crude idea I am thinking about so far that will output a pulse and then look to see if the motor moved:
MotorStep VAR OUT0
MotorDir VAR OUT1
Counter VAR WORD
PauseTime VAR NIB 'variable for time between pulses
EncoderIn VAR BIT 'from an sr latch off the encoder
EncoderRst VAR OUT2
MotorStep = 1 'active low motor driver input
MotorDir = 0 'move ccw
Main:
FOR counter = 1 TO 10000
PULSOUT EncoderRst, Pausetime 'reset encoder latch
PULSOUT MotorStep, PauseTime 'send one pulse out
IF EncoderIn = 0 THEN Problem 'check encoder latch for a pulse
NEXT
Problem:
'home motor and reset
in either case, if there is an obstruction it has to go home and reset, findig the method for checking the missed step is the thing to sort out.
Thanks for any advice!