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

Drive some stepper with rs 232 possible ?

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



Joined: 21 Jun 2010
Posts: 13
Location: France

View user's profile Send private message

Drive some stepper with rs 232 possible ?
PostPosted: Tue Jul 13, 2010 1:42 am     Reply with quote

Hi everybody

I would like to ask some question about rs 232 again Smile...

very simple because i think i have the answer.

I would to drive a stepper and i was asking if it's possible to drive the stepper via the serial port rs232 for example.

Code:

putc ('0b0110011001')


for 1500 rpm. I test this solution since 2 days without success, i use my oscilloscope and try to print the frame but no success too.

So I think it 's just impossible and I must use my PORT A, B and a analog/digital convert and a computer to write the code 11001100 for the rpm.

What do you think ?

thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19553

View user's profile Send private message

PostPosted: Tue Jul 13, 2010 2:12 am     Reply with quote

It is not clear from your question, what sort of interface circuitry you have between the stepper, and the PIC....

Directly, a stepper needs a minimum of three separate phase signals (normally four, or two used in bipolar mode), so a massive amount of extra interfacing would be needed before you could 'drive a stepper' from TTL serial.

Assuming though you have one of the off the shelf step/direction controllers, with the direcion wire driven correcly either high or low, then all that is needed on the 'step' wire, is a pulse train. However you then talk about 1500RPM. Now most of these control boxes would implement full stepping, half stepping, or micro stepping modes. The frequency required on the wire for a given speed, will vary massively according to which of these your controller implements. Assuming full stepping (the mode with the highest torque), and one of the fairly typical 1.8 degree stepper motors, then '1500RPM', would require driving at 5000Hz. Perfectly possible with the standard serial port. _BUT_ - you then run into the big problems of the motor inertia, and inductance. First the inertia. Typically motors will have a specification for the fastest step train that can be delivered and they will start moving, rather than just sitting oscillating. Usually specified for 'no load', and 'half load' conditions. This is typically betwen perhaps 600Hz, and 2000Hz. Vastly below the rate needed here. You will _not_ get a stepper to start, feeding it with a pulse train at a rate for something like 1500RPM. You need to start at a lower rate, and then increase this rate to accelerate the motor, to have any hope of this working. The rate you will need to ramp, will depend on the inertia of your system. You can implement ramping by changing the UART baud rate.

The second problem is the coil inductance of the motor. When you apply power to an inductor coil, initially no current flows. The current then rises with time, the rate of rise, is dependant on the inductance, and the endpoint voltage driving the coil. The current is eventually limited by the resistances present in the drive, and coil. The problem is that for something like a '12v' stepper, this voltage, is the one at which the _maximum_ allowable current will flow through the coil, if attached, and not stepped. Using 12v, on such a motor, it'll take several mSec, for the current to reach this level, and the maximum step rate to deliver reasonable torque will be only a few hundred Hz. The only way to drive the required power into the coil _quickly_, is to feed the coils off a massively higher voltage than this 'rating', and then have a current control circuit, to limit the delivered current to the maximum allowed, when the motor is moving more slowly. Typically expect to see motors running off at least 5* their 'nominal' voltage, and for fast step rates like 5000Hz, think in terms of more like 20* this voltage. You won't get the motor to move with any reasonable torque, unless you have this implemented - things like small milling machines moving the table at reasonable rates, will use something like 50 to 60v supplies, with 3.6v motors....

So, comments:
1) You won't get a stepper to start at this rate. You need to ramp the pulse train.
2) Even with this ramped, you need a driver using much higher voltages than the motor 'rating' to use a stepper at such speeds.
3) A PWM output does this much easier....
4) For movement at such high speeds, other motor technologies are 'better'.

Best Wishes
hollajo



Joined: 21 Jun 2010
Posts: 13
Location: France

View user's profile Send private message

PostPosted: Tue Jul 13, 2010 3:28 am     Reply with quote

thx for our answer.
It's more complicated that I was thinking.

I'm going to try something with PWM.
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