Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

8051 controlled stepper to move colour wheel from 1colour to another using L297

Status
Not open for further replies.

Vashist

New Member
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? 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.
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...

God Bless...
 
who need a micro?

for starters the ancient circuit should be yanked off the web!

https://www.electro-tech-online.com/custompdfs/2009/03/3977.pdf does it all for $5.50.

the switch set the direction and loads a counter, when the counter runs out it stops the oscillator that drivers the stepper chip. if you do not need a reference color just use the notch to stop the oscillator.

The only glitch I see in making it simple is the reset. if you want the reset you need the counter and the reset overrides the counter.

Dan
 
who need a micro?

for starters the ancient circuit should be yanked off the web!

https://www.electro-tech-online.com/custompdfs/2009/03/3977-1.pdf does it all for $5.50.

the switch set the direction and loads a counter, when the counter runs out it stops the oscillator that drivers the stepper chip. if you do not need a reference color just use the notch to stop the oscillator.

The only glitch I see in making it simple is the reset. if you want the reset you need the counter and the reset overrides the counter.

Dan

Ancient circuitry? U mean the l297-l298 is obsolete for use with a microcontroller?
What type of circuitry is used nowadays then?

actually I should be using an 8051 microcontroller for this project as it is the main purpose to run the motor.

So, now im stuck with choice of stepper as well as choice of driver & translator, if needed.
uln2803? uln2003? l293?
I need to know by tonight before ordering.

EDIT: My dreams r broken, shattered when u mentioned that the L297-L298 circuitry is old, thus probably useless nowadays for easier implementation with a microcontroller....i guess i have to go back to connecting each of the 4 wires of the motor to the driver & create a program to make it turn, step by step, pin to pin...
:(:(:(:(:(:(
 
the Allegro part that i directed you to is a direction/step interface like the L297.

The difference you would have seen, had you looked at the data sheet, is that it is a FET chip that drives the motor directly and has synchronous rectification built in. The end result is that for most motors it has a fraction of the losses for a fraction of the components of the L297 solution.

In other words, the single chip replaces pretty much the entire schematic that you linked to.

The other point that I was making is that many here would rather not buy a trainer and learn to program, particularly when the solution is readily available in simple logic - and it seems the one that you described falls into that category.

Dan
 
Last edited:
the Allegro part that i directed you to is a direction/step interface like the L297.

The difference you would have seen, had you looked at the data sheet, is that it is a FET chip that drives the motor directly and has synchronous rectification built in. The end result is that for most motors it has a fraction of the losses for a fraction of the components of the L297 solution.

In other words, the single chip replaces pretty much the entire schematic that you linked to.

The other point that I was making is that many here would rather not buy a trainer and learn to program, particularly when the solution is readily available in simple logic - and it seems the one that you described falls into that category.

Dan

The information on the A3977 is really very useful but it is mainly for microstepping.
I cant find the chip at rapidonline nor at RS, but L297 and L298 are available, that is one reason why Im emphasising on the latters.
As for microncontoller, the wheel provides a special colour effect when moving and thus, a microcontroller is being used to provide this, though as u mentioned, simple logic ICs could do that.
Actually it is my final year BEng Electronics and Comms project..and the title itself is 'Microcontrolled POF Illuminator'. So i will have to stick to microcontrolers, and C programming.
 
well that is certainly a good reason for staying with micros.

I am not familiar with rapidonline. Arrow, Digikey,Newark, and Spoerle all have stock and will sell singles.

Dan
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top