How to control a stepper motor using SD02B?

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

Re: How to control a stepper motor using SD02B?

Postby sich » Wed Oct 27, 2010 3:49 am

ccperng WROTE:if I supply a let say 1kHz frequency PWM to the driver, will the driver output the same frequency of pulses to the motor??

Yes, SD02B will drive the stepper motor at the stepping frequency equals to the frequency of the pulses given to the driver. The error rate is proportional to the stepping frequency, from 0% to around 2.5% at 20kHz. However, please take note that SD02B's default stepping mode is set to 1/10 micro-stepping. So the stepper motor will rotate at 10 times lower speed (1/10), but with 10 times more accuracy (10X). You can change the mode by using UART interface & protocol provided. Both sample source code for PIC and computer are available at the product page. You may choose either way.

ccperng WROTE:What if i supply more than 1kHz? cos from the user manual, the maximum speed is up to 1000 steps per second only...

Yes, you can supply more than 1kHz to the PULSE pin. SD02B can detect pulses at frequency up to 20kHz (tested). However, normal small size stepper motor cannot operate up to 10kHz.
If not mistaken, the 1k steps per sec is only a suggested frequency for most of the small size stepper motors, such as MO-STEP-17PM-J3X and 42BYGHD-234. You'll notice these stepper motors cannot run smoothly at very high frequency (eg: > 4kHz, without load).
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: How to control a stepper motor using SD02B?

Postby hayate_kun » Fri Oct 29, 2010 10:50 am

sich WROTE:Hi dante,

You'll see 3 LEDs light up at a moment because of the microstepping. By default, SD02B will step at 1/10 microstepping. So when you use a switch to generate pulses to the PULSE pin, you will see one LED stay at full brightness while the other two change their brightness every 10 cycles when you continue to release and press the switch continuously.

One thing to clarify here is that we are energizing 2 coils for bipolar method. In every 10 cycles (for 1/10 microstepping) one coil remains it's energizing direction (let's say X to !X) and the other coil is given PWM to maintain the shaft at a position between 1.8 degree. So you see that two LEDs light up but at different illuminate levels. These sequence change every 10 cycles.


Hello Sich! your information was very helpful to me! I am now trying to find out how to generate microstepping in programming C. As for now, I'm using PWM to generate the pulse however I've found out that this is not the correct method to be used with stepper motor.

Therefore, I'll be very thankful if you can show me how to set the microstepping with the driver. I'm using LINIX Stepping Motor with 3.5 kg.cm of holding torque.
Thank you.
Sharing is caring. Thanks in advance! ;)
User avatar
hayate_kun
Newbie
 
Posts: 9
Joined: Tue Oct 26, 2010 11:27 am

Re: How to control a stepper motor using SD02B?

Postby kl84 » Tue Nov 02, 2010 4:05 am

Hi hayate_kun,

Are u using a stepper driver like SD02B or building your own stepper driver? Two different stories there...
User avatar
kl84
Amateur
 
Posts: 166
Joined: Thu Jul 08, 2010 12:14 pm

Re: How to control a stepper motor using SD02B?

Postby hayate_kun » Tue Nov 02, 2010 10:51 am

Hi kl84!

I'm using SD02B driver.
Sharing is caring. Thanks in advance! ;)
User avatar
hayate_kun
Newbie
 
Posts: 9
Joined: Tue Oct 26, 2010 11:27 am

Re: How to control a stepper motor using SD02B?

Postby kl84 » Wed Nov 03, 2010 1:34 pm

You can use timer module to do it. Enable the timer module and its interrupt enable bit. On each timer register overflow, the timer interrupt flag will be set. You can change the frequency of the interrupt occurrence by writing different values into the timer register. This register will increase from 0000h to FFFFh and roll over to 0000h again. So the value you wrote into it determines how fast the register overflows. Therefore, you can toggle a pin every time an interrupt occurs and that will generate the pulses.

However, if the frequency of the interrupt is still too high for the stepper motor (timer interrupt frequency = 1 / the stepping speed), you can make the frequency at the lowest rate and then create a routine in your interrupt to count how many times the timer interrupt occurs. Changing the counter value will give you different frequencies too. Once the counter value reaches, toggle a pin.

Another simplest but inaccurate method would be using the delay. Set an o/p pin HIGH, delay, set it LOW and delay. Alter the delay time to change the frequency.
User avatar
kl84
Amateur
 
Posts: 166
Joined: Thu Jul 08, 2010 12:14 pm

Re: How to control a stepper motor using SD02B?

Postby fremond » Wed Mar 02, 2011 11:31 am

i am sorry..i am a newbie in robotic arm project..how do i connect SD02B to my laptop and to the stepper motor?..im using UC00A to connect from laptop to SD02B but how come the LED green light does not blink?..do i require additional power source?
fremond
Novice
 
Posts: 18
Joined: Tue Jan 18, 2011 10:22 pm

Re: How to control a stepper motor using SD02B?

Postby kl84 » Wed Mar 02, 2011 12:32 pm

Yup...you need additional power source. Please go through the user's manual first before you connect it. The power supply for SD02B is quite 'tricky'. Pay more attention to that part. Then if you're using UART interface and UC00A, I think they include the setup instructions too (last few chapters i guess).
User avatar
kl84
Amateur
 
Posts: 166
Joined: Thu Jul 08, 2010 12:14 pm

Re: How to control a stepper motor using SD02B?

Postby fremond » Wed Mar 02, 2011 1:58 pm

erm..can i ask a bit more?..for example if i use normal battery for torch light and connect to SD02B, will the stepper motor run?..let's say the battery is 6V and my stepper motor only require 5V..will it works?
fremond
Novice
 
Posts: 18
Joined: Tue Jan 18, 2011 10:22 pm

Re: How to control a stepper motor using SD02B?

Postby fremond » Sun Mar 06, 2011 12:00 am

i need help urgently..currently im connecting UC00A to SD02B and to stepper motor..now the problems:

1) when i plug in UC00A, my laptop could not detect the port..i tried to install the driver but to no avail
2) i used another of my UC00A and this time my UC00A can connect but no yellow or red light sparkle..but anyway i continue to use it and connect to SD02B and to stepper motor. I used SD02B GUI downloaded from cytron to control the motor but unfortunately, it is not working.
p/s: im using 6V/2.3AH battery as the power source for SD02B

others: im facing trouble with matlab as well. Can some samaritan out there be kind enough to supply me MATLAB GUI source code to control two stepper motor?..thanks a lot^^
fremond
Novice
 
Posts: 18
Joined: Tue Jan 18, 2011 10:22 pm

Re: How to control a stepper motor using SD02B?

Postby sich » Mon Mar 07, 2011 10:08 am

fremond WROTE:im using 6V/2.3AH battery as the power source for SD02B

That should be fine although your motor only needs 5V.
fremond WROTE:when i plug in UC00A, my laptop could not detect the port..i tried to install the driver but to no avail

Try to reinstall the driver, uninstall first. Make sure you're using the correct driver. Cytron has updated the driver version in the website currently. Please get the new one.
fremond WROTE:i used another of my UC00A and this time my UC00A can connect but no yellow or red light sparkle..but anyway i continue to use it and connect to SD02B and to stepper motor. I used SD02B GUI downloaded from cytron to control the motor but unfortunately, it is not working.

May be the UC00A is not working at all due to the previous problem. Do you see a new com port appears in Device Manager when you plug in UC00A?
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

PreviousNext

Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 40 guests

cron