Basic 2 Program
NWUpgrades
Posts: 292
Does anyone know of a simple program to make a stepper motor rotate at various speeds CW and CCW? I have the Homework Board and a BiPolar stepper Controller. The stepper controller has 2 wires, one for step and the other for direction. I do know about programming, but I just need a simple solution to get started. Thanks in advance for any help.
Comments
No, nobody knows of a simple program to make a no-brand, no-part number stepper motor rotate at various speeds CW and CCW -- especially if you have some generic, no-brand, no-part number "BiPolar Stepper Controller" chip in the middle. I'm not complaining that you left out the manufacturer and part numbers in your question, just trying to explain why it can't be answered unless you give us the manufacturer and part numbers.
I think this is why no-one has answered your question already. First of all, I understand that some stepper motors CAN be used with the BS2 -- but I don't know of manufacturers or part numbers that will work. Next, that Controller in the middle seems like a good idea to me -- but if we don't have a manufacturer name or a part number, we can't help.
BS2's are more typically used with Servo motors, so the Stepper motor question probably whooshed past a lot of the regular people who answer questions. Thus it's taken a while to get back to you.
Even so, I'm sorry nobody responded yesterday. We really do try.
Oh, and I don't work for Parallax, I just really like their parts and support.
What stepper controller are you using?
That has great impact on your question. Some are controlled through a serial link. Some want TTL direction and step controls. This stuff matters.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
They say to look in various places on the web, but I am having no luck. I am sure the programming can be done. If someone can just point me to an example or 2 I would greatly appreciate it. The motors I am using are all smaller motors from Panasonic and Epson printers. Thanks again in advance for any help.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://ca.geocities.com/steve.brady@rogers.com/index.html
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
www.parallax.com
·
One last question on this line: How do I adjust the speed/step sequences with the code you sent? Thanks for all your help and now I know I will be purchasing from Parallax in the future.
I would guess the speed is controlled by how fast you do the steps -- the PAUSE 5 pauses 5 milliseconds, if you pause less time you may be able to speed it up.
And each step moves a certain number of degrees -- you may have to experiment to find out how many. So then positioning is just keeping track of where you start, and then how many steps (degrees) you need to move to the new position.
Now, the symptom you talk about does happen. One common fault is to 'brown-out' the BS2 by turning on a motor, or a servo, which is connected to the same power supply the BS2 is using. The BS2 then resets, comes back up, and starts over at the beginning. Since the first thing your program does is go CW, your program starts to go CW, Resets, then starts CW again. You might want to add a 10 uF, 20 uF, or 220 uF capacitor between the supply lines for the Stepper motor to prevent its turning on from resetting the BS2. A low battery can also cause this.
A good defensive programming measure on the BS2 is to have an LED under BS2 control.
Then, when you start up the program, blink the LED. Thus you can see when RESET happens.
You could also put this at the beginning of your program:
SEROUT 16, $4054, [noparse][[/noparse]"Program Starts", CR] ' So if you see lots of "Program Starts" you know the BS2 is resetting.