hi guys i got a stepmotor that i want to go to 120 steps foward and then go back 120 steps to do a 90 degree and 160 degree...
the problem is when power is turn off then depending where it stoped motor will start doing 120 steps foward and 120 backwords,and will not mantain route i wanted so i add a optical switch to tell the motor when it passes there to go 120 down up and then 120 steps down.
but so far not able to do it, so was hoping that someone can take a look in code i did so far
If you want to use an optical detector (or any other device) to detect the position of a stepper your program must test the detector after every step.
Rather than using myStepper.step(-120); you may only use myStepper.step(-1); and you must use your own code to count the number of steps.
The usual way to manage a stepper motor is to move it to its Home position when the program starts and then keep count of where it is. It is not safe to assume it was not moved while the power was off.
im using ULN2003 driver, from datasheet says 500 ma max current, i measure and peaks are arround 590ma, how can i limit max peak to 500ma, what values of resistor be better...
this is circuit shematic im using
Pic is up now, i already burn 1 uln2003, the strange part is when i was using with arduino i had no troubles, now that i set all on breadbord i burn chip after motor work for awhile, sense uln2003 max peak per output current is 500 ma and from my mesures with multimeter is 590 ma per output, so that explain why driver burn, only solution i can see is use 9v instead of 12v to drop the mA, or change resitors values,im just not sure what resistor values would be apropriate.
i actualy have a driver UDN2544B for step motor im just not sure how to wire, anyone in here have any schematic how to wire up,resitences etc to arduino, i have tryed fint info on it cant find nothing other then datasheet,and im not sure how to correct wire up
50 ohm resistance - use a ULN2803 with inputs outputs doubled up in pairs for extra
current handling. The ULN2803 has 8 channels so you can doulbe up and drive 4 phases.