control stepper motor_need help
temc
Posts: 4
·hi there, i'm a newbie.I try to use basic stamp 2 and ULN2003 to
control a stepper motor. Any one can help me upload the circuit schematic
and source code...Thanks a lot..
I'm trying now..but dun know·whether I can·finish this task in time..
Post Edited (temc) : 5/28/2006 8:13:00 PM GMT
control a stepper motor. Any one can help me upload the circuit schematic
and source code...Thanks a lot..
I'm trying now..but dun know·whether I can·finish this task in time..
Post Edited (temc) : 5/28/2006 8:13:00 PM GMT
Comments
Is it a bipolar or an unipolar motor?
(Bipolar usually have 4 wires, unipolar 5, 6 or even more)
What is the voltage and current rating?
What are you trying to accomplish with it, and most importantly, when is your project due, and when were you supposed to start working on it.
(Sorry, but this sounds like one of those 'I have a school project due tomorrow and I haven't started on it, yet. can spomeone please do it for me', and while we are all willing to help, we prefer to help those who are willing to do a proper attempt themselves.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
When the sensor detects the rain, the motor runs to open the cover and after the rain, it runs in opposite direction.
some seniors suggest to use bs2, i did buy one and download some manual from parallax website,still reading it now. the code seems not very difficult, but I dont know how to make the circuit..what is the function of uln2003..
the motor I got here is a unipolar (6 wires), 12V , 0.6A (by sanyo denki 103-718-0140)
firstly i have to make the motor be able to run..then control the direction due to signal feedback·from sensor..
sencondly, handling with the sensor. I found a circuit that make a "beep-beep" sound when it rains.is this possible to interface it with bs2? it used 9v battery.
this is the schematic diagram of rain detect circuit :
thanks for anyhelp
Post Edited (temc) : 5/28/2006 8:43:46 PM GMT
The 4 gates seems to be a oscilator of some sort. And as it is started by a signal on the one to the lower left, I suspect that what you need is the detector-grid, the rsistor and the cap under it.
(Connect them as seen in the schematic)
The transistors are there to function as an amplifier, and are also not needed.
The ULN chip is a wonderful thing...
It contains a whole bunch of Darlington drivers(transistors) which can sink up to about 1A each.
(It won't hurt to have some sort of cooling if it needs to do that for longer periods)
I tried to search the Sankyo website, but unfortunately, it doesn't work with my browser, so I were unable to find any datasheets for it.
Do you know how many coils/windings there are on the motor, and the colour/sequence on the wires attached to them?
There will be one or two 'Common' wires. That one should be connected to 12V, and the rest of them to separate outputs of the ULN chip.
Then you need to connect one I/O-pin on the BS2 for each of those wires, to the inputs on the ULN.
That is the Hardware taken care of...
Runing a unipolar stepper is done by energising each coil in turn, so that the rotor moves a fraction of a rotation for every step. (That is why we call them steppers)
Assuming that there are 4 coils in the motor, we'll just use pins 0 - 3 (also collecktively known as OUTA)
A quick and dirty stepping function might look like this:
This will repeat the sequence 1000 times, with approx 100 steps/second.
(the motor is probably capable of going much faster)
Of course, the load might be heavy, and then we would want to 'half-step' the motor, which means we do this:
And in this case we've added a step where both the current and the next coil is energised at the same time. Then we dump twice as much power into the motor, while only moving it half as far. This is GREAT for heavy loads.
The third thing you should be aware of is 'ramp-up' and 'ramp-down'.
Steppers doesn't like being forced to run at max speed immediately. In fact, if you try, they will often slip and miss whole sequences.
so it might be a good idea to start it slowly, possibly half-stepping at slow speed, then do two or more speed increases by shortening the delay after a few hundred sequences., until you get it to the speed you want.
Hope this makes some sense?
Edit:
BTW: It never hurts to 'de energise' the coils afterwards with a
Also, the ULN2003 may be a model which can't deliver more than 500mA on each output. In that case you may have to connect two outputs in parallell to get the required current. (Most ULN2003 chips allows this) Unfortunately, there are only 7 Darlingtons in each IC, so in that case you'll need at least two ICs.
(Spread the load evenly amonst them)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Post Edited (Gadgetman) : 5/28/2006 9:28:43 PM GMT
EDIT:
if possibvle pleas attach multiple pictures from different angles of the stepper and a pic of the lobel on the stepper
thanmks
Post Edited (superworms) : 5/28/2006 9:29:57 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
the circuit of rain detect here (i havent soldered it yet):
instead of connect it to the small speaker 8ohm, 0.2W , can I connect it to one pin of bs2 to generate an input pulse..
Write a table like this
Then measure the resistance between the wires.
If V is the common one, you willonly measure halv as much resistance between it and any other pin as you will between the other pins.
The unmarked one can be a sensor, or it can be a chassis Gnd?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Post Edited (Gadgetman) : 5/28/2006 10:17:01 PM GMT
Regarding the "rain detector", the first oscillator is enabled by the water making a current path across the pattern area, resulting in a tone, and then the second oscillator modulates the first osc's output, resulting a 'beep, beep'.
Post Edited (PJ Allen) : 5/28/2006 11:07:00 PM GMT
One question, can I connect a 3.4 volt source to one pin of bs2?
you see the schematic of "rain detect" circuit, can I connect 2 wires ( that's used to be connected to a small speaker) to one pin and common ground? the potential voltage difference between 2 wires is 3.4V.. so this pin can be read as High.
it's urgent..tmr I have to show sth to my supervisor..
Whatever comes out of the transistors is pulsed rather rapidly, and isn't really a good signal to feed to the BS2.
Instead, scavenge those three components and hook them up to the Stamp such that the the Input on the gate marked '1' goes to an I/O-pin on your Stamp.
It may be a good idea to connect a small resistor (say, 200 - 300 Ohm) between the circuit and the Stamp, though, just to make certain that you don't get too high currents flowing.
Anyway, the two wires used to connect to a speaker in that schematic are definitely no go as one is the Vin and the other is the Collector of the Transistor, and neither have anything to do with Gnd.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...