l297 darlington array circuit
Hi, I am trying to control a stepper motor with a microcontrollr which should be able to send commands to the motor and make it move a certain number of steps either CW or CCW depending on the key pressed.
It is a colour wheel motion.
10 colours = 360deg = 200 steps using a 1.8deg step angle motor.
I am not being able to choose which motor to use: Bipolar or Unipolar? javascript:emoticon(':?:')I know it doesnt matter in this case, but I would like to control it using the L297 and a driver to make the software from the microcontroller shorter and use 2 pins of the microcontroller, rather than 4 pins.
In case of using Bipolar and L297, I read the datasheet of L297, but its quite ambiguous. My motor would be driving at less than 1A/ phase. So I should choose to use L293E rather than L298, though I dont find any reason why I should not be able to use L298? Please advise.javascript:emoticon('
')
Next step is to make the connections.
I found a really useful connection here:
**broken link removed**
According to that circuit, my microcontroller should be sending a set of 1s and 0s with 5ms in between per step for one colour movement, and then, after 20 steps(meaning that it has eached the next colour), a delay(which could be 1second) is sent and then the 5ms clock pulse are sent again. To choose CW or CCW, this should be connected to a pin on the microcontroller to be set high or low according to the key pressed.
I have a few questions:
The wheel will have a small part cut out(an opto switch interrupter to sense the reset position) Once, the opto switch receives the signal from the emitter, it sends a HIGH to the microcontroller which should then make the motor stop. This is the RESET position of the motor.
Is there any way to make the motor, driver, translator 'remember' that reset position so that whenever a single colour change is desired, it goes back to the reset point and then the motor turns according to the number of times the key for 'next colour' is pressed. Please note that there should be two keys: one for next CW colour and one for next CCW colour.
One key should be making the motor turn at a specific speed per colour, its the speed the wheel changes from colour A to B, not from 1 step to the other. so basically, its the delay between every 20 step commands sent to the motor.
While the motor is moving,say CW, it moves step 1 to step 200 until the optoswitch sends a HIGH to the microcontroller. At this specific point, the motor must stop(all wires should be 0000) and then turn CCW until the optoswitch again sends a HIGH to the microcontroller where the motor then turns CW...this goes on continuously.
Please note that the optoswitch is primarily there for the RESET position so that a 'good' colour change takes place rather than a messed up effect.
If you have a suggestion to the movement of the wheel, you are warmly welcome to advise me please.
My main question:
Will this circuit above work according to my specifications? Any changes you may suggest? Im quite reluctant in choosing the driver, L293E or L298?
Lets say im going to use a 12V 2-phase Bipolar stepper with a 1.8 step angle with a rated current of 0.48A per phase.
So, for a delay of 1 second between colour:
The input to Clock should be, since it is 'Pulse Low to step', a low from the microcontroller will make the motor move 1 step:
0(5ms)1(5ms)0(5ms)1(5ms).....x 10, then (1 second high-stops the motor completely)0(5ms)1(5ms)0(5ms)1(5ms).....
This sequence goes on for 200 steps until the opto switch sends a HIGh.
Please advise on the softwre and circuit side of the motor movement?
I read about using the ULN2003 transistor arrays, but this would implement tougher programming, i presume. Whereas I just need these movements:
1.....Move from 1 colour to the other with 1 second delay, 0.5second delay, 0.1 second delay, 0.05 second delay, 0.01 second delay and then 5ms delay: these are basically the different speeds I will make the motor move, 1 second being slowest and 5ms being the fastest.
Here is the motor:
**broken link removed**
2.....After moving all 200 steps, move back in the opposite direction to reach back to the RESET point.
3.....If the 'RESET' key is pressed, the motor should move clockwise until the optoswitch sends a high to the microcontroller and then the motor stops.
4.....If the 'CW NEXT COLOUR' is pressed, the motor should move to the next clockwise colour.
5.....If the 'CCW NEXT COLOUR' is pressed, the motor should move to the next anticlockwise colour.
That is all I could find out that my colour wheel and motor would do, improvising for a hopefully small program..:-(
Please help me decide on the chips to be used because I need to order the motor, the L297 and the driver by today evening!
Thank you very much for your patience for reading such a long message.
Thank you very very much in advance for helpful.