CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Stepper Motor Question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

Stepper Motor Question
PostPosted: Wed May 30, 2012 9:04 pm     Reply with quote

Hello,
I am running PIC18F4620 clocked at 20Mhz and planning to drive a stepper motor. I am using the following stepper motor.

http://www.faulhaber.com/uploadpk/EN_AM1524_PCS.pdf

My question is can this motor be operated directly from PIC without using any other circuit?

I tired to do this but the motor is not responding. I can feel a vibration, but it is not rotating. I am also not sure how to give the ON/OFF pulse to make it rotate. Please advise.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed May 30, 2012 11:12 pm     Reply with quote

The data sheet lists 4 separate part numbers, with different specifications
for each one. Post the full part number of your component.
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Wed May 30, 2012 11:34 pm     Reply with quote

This is the full part number:

AM1524-A-0.25-12.5-57

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 31, 2012 12:13 am     Reply with quote

Read the data sheet. It's a 12 volt, 75 ma stepper motor. Your PIC
can't do that by itself.
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Thu May 31, 2012 12:32 am     Reply with quote

I dont think so, in the data sheet point 1 (Line 1) it is mentioned 3,5 Volt for A-0,5-12,5.
12V is for V-12-150 model. Sorry if I am wrong.

If I give the data in this sequence I can feel the vibration, but motor is not rotating.

Code:

 C1=0;
      C2=1;
      C3=1;
      C4=0;
      delay_ms(5);   
      C1=1;
      C2=0;
      C3=0;
      C4=1;
      delay_ms(5);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 31, 2012 12:52 am     Reply with quote

You're right. I was reading the wrong column. However, the data sheet
says the current for that motor is 0.25 Amps per winding. The PIC can
only do about 0.025 Amps per pin, maximum. The motor winding
resistance is only 12.5 ohms.
arunkish



Joined: 23 Dec 2008
Posts: 83

View user's profile Send private message

PostPosted: Thu May 31, 2012 12:57 am     Reply with quote

So, Should I use ULN2003 or something like that? How should be the sequence to rotate the motor in forward and reverse.

Thanks a lot.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Thu May 31, 2012 2:39 am     Reply with quote

First, there isn't a 5v motor in the ones you are listing. 3,5 in the data sheet, is 3.5v (remember this is a German sheet, and ',' is the decimal separator in Germany).

On the rest.

This is sort of 'stepper 101'.
There are two fundamentally different 'core ways' of driving steppers.
The first is 'full voltage drive'. Here you have a stepper rated for a particular voltage, and a driver that is simply on/off. Driving is done by turning on the required pattern of bits to the driver. This is the sort of drive you will commonly see for projects involving the stepper driven of the PC parallel port, and for a few (rare) real uses.
The second is 'current controlled drive'. Here the driver circuit implements current limiting in the hardware or software, set to provide the current the motor is rated for, and the supply voltage is much higher. This is how 99% of 'real' stepper circuits drive the motor, especially those wanting reasonable speed/torque.

The motors themselves, can be 'unipolar' (single supply, and normally four coils), or 'bipolar' (two coils only, and driver can pull each end of the coils both up or down). The commonest standard motors often have the coils separated into two pairs, so they can be used with unipolar drives or bipolar drives.
Now, the unipolar motor, can be driven two ways, using simple on/off drives. The first is 'full step' drive, where (normally) four different patterns, of two coils at a time are engaged. So (for example), assuming the four coils round, are called A,B,C,D, you turn on A+B, then B+C, then C+D, then D+A. This gives the greatest torque from the motor using this type of drive.
Even simpler, some people simply drive, A, then B, then C, then D. Less current, even simpler to do, but lower torque from the motor. Then you have 'half step' drive. With this, you turn on A+B, then just B, then B+C, C, C+D, D, D+A, and finally just A. The motor potentially moves in half it's 'rated' step size for each pattern, but the intermediate patterns offer less torque. You can then get even more complicated, and using the current drive system, actually ramp the currents to the coils, giving even finer 'intermediate' positions - this is 'microstepping'. Generally with standard motors, very fine positions will lose accuracy, so perhaps only eight intermediate positions can be 'relied' on. There are though special motors designed for microstepping, offering accurate tiny angles between the poles.

So you need at the minimum, four wires from the PIC, feeding four drivers, and to output the bit patterns needed in order to these four bits. Typically:

0b0011
0b0110
0b1100
0b1001
These would be the bit sequences you need to output to say a ULN2003, to drive this motor forwards. Move the opposite way through the table (bottom to top), to rotate the other way.

On the data sheet, you will see that the torque figures are quoted at 'nominal current in both phases'. Full step drive, driving two phases at a time.

Now, why do I refer to the 'full voltage drive', as uncommon in 'real' applications?. The reason is down to the key problem of motors. Inductance.
You turn on a voltage feeding a coil, and the current doesn't instantaneously jump to the rated value, it rises slowly over time, with the rate of rise controlled by the delivered voltage, and the inductance. This is as the magnetic field actually forms. The manufacturers of this particular motor, give the 'electrical time constant'. This is the time needed using the specified end point drive voltage, for the torque to reach 63% of the rated DC value. However remember this will be worse because of driver resistance, and is still only 63%. So if you stepped at this rate (2000Hz)m with the 24step per revolution of these motors, you would get to 5000RPM as the maximum, with the torque already degraded to less than 2/3 the DC rating. This is even worse on motors with more steps/rev (400 is quite common), where maximum speeds can often be only a very few hundred RPM.
Now, one critical part of this is the fact that the 'end point voltage' is a key term in the equation. If you double the voltage feeding the motor, you can reduce this time, and increase the working speed. Problem is that if you then leave this higher voltage applied to the motor as you slow down, you end up overheating the motor. However if you use a higher voltage, and then limit the maximum _current_ fed to the motor to the figure the motor is rated for, the driver effectively turns itself 'down' as the motor speed drops. This is what is done in every stepper system wanting to combine speed with good torque. Typically up to perhaps 6* the rated coil voltage is used on power stepper systems.

Now, for you , the 3,5 motor _will_ overheat, and draw more current than it should, if you try to drive it off 5v. 4v, would be OK (with the drop from the driver transistor). If you could arrange a separate 4v drive to feed a ULN2003, then this should give useable operation.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group