steppermotor control
chrillz
Posts: 3
I have a bipolar stepper motor controller which I try to control with my bs2. (The schematic can be found at http://farm4.static.flickr.com/3195/2910951388_0e05a5c7cc_b.jpg)
It needs to get a high or low signal on the "Direction"-pin (depending on if it is to be driven clockwise or counter clockwise), and also needs to be pulsed at the "Step-pin" with the desired frequency.
Now my problem is that when I try to control the motor with my basic stamp it seems to overstep the motor and it gets really week. I have successfully controlled the stepper-controller via the parallelport on my laptop with a software called Turbo CNC. At a frequency of ca 200 Hz the motor is really strong and runs great!
The basic stamp code that I´ve tried is:
HIGH 1 ' Dir-pin, making the motor run clockwise
freqout 2, 10000, 200 ' Step-pin, should give the motor a pulse with the frequency of 200Hz for 10 seconds right?
This code makes the motor whissle and turn weekly.. Does anybody know what´s wrong?
Post Edited (chrillz) : 1/5/2009 11:30:14 PM GMT
It needs to get a high or low signal on the "Direction"-pin (depending on if it is to be driven clockwise or counter clockwise), and also needs to be pulsed at the "Step-pin" with the desired frequency.
Now my problem is that when I try to control the motor with my basic stamp it seems to overstep the motor and it gets really week. I have successfully controlled the stepper-controller via the parallelport on my laptop with a software called Turbo CNC. At a frequency of ca 200 Hz the motor is really strong and runs great!
The basic stamp code that I´ve tried is:
HIGH 1 ' Dir-pin, making the motor run clockwise
freqout 2, 10000, 200 ' Step-pin, should give the motor a pulse with the frequency of 200Hz for 10 seconds right?
This code makes the motor whissle and turn weekly.. Does anybody know what´s wrong?
Post Edited (chrillz) : 1/5/2009 11:30:14 PM GMT
Comments
I think Your board is looking for the STEP pattern. something like this
%1100
%0110
%0011
%1001
The rate at which You feed this pattern will control its speed.
I could be wrong. I'm not familiar with Your stepper board.
Take a look at DATA,READ,and SHIFTOUT
Experiment #27 is a good place to start. "StampWorks Manuel"Pg. 150
________________$WMc%_____
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there·········································· E=$WMc%2
In PBASIC Help we read, "FREQOUT generates one or two sine waves using a PWM algorithm."· Not what you're looking for.
So, I think you want to look at using PULSOUT (or PULSOUT nested in a FOR...NEXT or DO...LOOP...UNTIL.)
found on dev.www.reprap.org/bin/view/Main/Stepper_Motor_Driver_1_2
"The basic way the motor exerciser works is this:
The stepper will take 2000 steps in one direction
The stepper will take 2000 steps in the opposite direction
The speed will increase or decrease."
It seems like the corresponding way to do it in Pbasic, for just running the motor 2000 steps should be like:
Am I in the right direction?
Post Edit -- Just wanted to add for the others that your L297·generates the Gray Code with each Clock input, as appropriate given the state of the Dir input.
Post Edited (PJ Allen) : 1/6/2009 12:21:54 PM GMT
I see why You want to use the BS2, The other Stamp needs way to much code just to spin a stepper!
__________________$WMc%________________
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there·········································· E=$WMc%2