PID with stepper motors

S

Thread Starter

sarosero

Hi. I'm working with 6 stepper motors (distributed control) with feedback. I want to control them with PID algorithm, but I don't know how to begin with this kind of motors. I did it with DC motors, but I'm not sure if is the same with stepper motors.
Could anyone help me please???????? I'm a little bit lost!

Regards.

Sarosero
 
D
A couple of questions first....
Feedback: encoder feedback directly off the motor?
Distributed control: will the step signals be generated by a separate system? or will the host send motion commands to distributed index
controls?

There are a number of standard stepper controls that can propably handle your requirements, with a bit more definition.

David Kane
 
T
I haven't done step motor control engineering in years and only worked with the open-loop applications. However, I think closed-loop (encoder feedback) stepper applications are either only for position verification (as step
motors can lose synchronization and stall or have step errors) or for step command intervention vs. rotor position to prevent exceeding the critical
step angle error. Along these lines, I don't think the classical PID technique is used. You should research step motor control textbooks,
industry literature or talk to manufacturers for specific information.
 
B

BJ_Johnson/Appliedmotion

You do not need to do PID with steppers. All you do is send the stepper driver a pulsestream to follow and set a direction bit. NO pid is used. Feedback with steppers is typically used only to confirm commanded position is reached and to determine how much correction may be required. But correction is done after the move is
completed.

I believe that many PLC's offer stepper cards or have high speed pulse outputs to accomplish this.

Contact me directly if you like.
 
Hi David. Thanks for your message.
About your questions, I'm using an encoder feedback directly from each motor, and I'm controlling the steppers from 196 (I access to each motor with interrupts -- time window--)

I hope I had answered your questions.

Could you tell me what is the number of standard stepper controls you are talking about, please?

Regards

Sarosero
 
Well, I think a little bit equal like you. The feedback will be used to confirm stepper position, and the control of velocity include the frecuency of pulses. I'm right? But ... what about velocity profile?

In this case, I couldn't use PLC because I'm designing the microcontroller system that work with 6 motors. Is a robot applications.

Thanks for your comment....

Sarosero
 
W
List & Sarosero,

Steppers can be used with encoders, and there are some chips available to do this without implementing it yourself.

You can get information on using a digital filter to drive a stepper with encoder feedback from the Agilent (ex-H-P) semiconductor site:

Datasheet:
http://www.semiconductor.agilent.com/motion/hctl1100.html
App Notes:
http://www.semiconductor.agilent.com/motion/app_index.html>

This chip uses a multi-pole filter (not true PID). National makes two chips for motion control with true PID, they are the LM628 and LM629. They don't drive steppers, however. I include them because they may have useful info.
Here is the link:
http://www.national.com/parametric/0,1850,1080,00.html

Ericsson and ST have some stepper ap notes which may be helpful:
http://www.ericsson.se/microe/apn_ind.html
http://www.st.com/stonline/books/toc/an/41.htm

IMC has some sophisticated stepper drivers. The manuals are available on-line:
http://www.intelligent- motion.com/html/mc_chip_sets_2.html

Although none of these sites show true PID for stepper control, you should be able to get a lot of helpful information from them.

Regards,

Willy Smith
Numatico SA
Costa Rica
 
D

Dobrowolski, Jacek

Hello Sarosero ?
First excuse me if I misunderstood your name.
Please, tell me what kind of application is it and what kind of feedback you use ?
Can the load inertia or torque make the motor "lose" steps ?
What do you want to control - speed, angle/position, both of them ? Are optimization algorithms intended to use ?

Jacek Dobrowolski

Software Eng.
Electrical and Software Design Department
Secondary Department
International Tobbacco Machinery Ltd. Poland
 
V

Vikas Meshram

Hi Sarasero
I have not done PID with stepper. Basically stepper is position control device so you have to use the position control algorithm.
What you have done with DC motor? Did you design Speed PID or Position PID. I suppose that you have done Speed PID for DC motor control. If you design position control by stepper you don't need PID control control but you can feedback. Again if you use feedback it does not mean that its a PID control.
What I do in my stepper motor position control in closed loop i check the counter for the move and adjust the position. But I always adjust
position after the move is finised.

I hope this helps a littel bit.

Vikas

Email:[email protected]
 
Hi Willy.........
your help has been very important. All links are interesting.

Thanks

Sandra
'Sarosero'
 
Hello Jacek
First, my name is Sandra, and my nickname is sarosero... you could use your prefered.

About the application, it is an robot arm and I use feedback by decoder.

> Can the load inertia or torque make the motor "lose" steps ?
Ideally, not!

> What do you want to control - speed, angle/position, both of them ? Are optimization algorithms intended to use ?
I'm trying to control speed and position... no more...


Thanks for your interest !!!!

regard

Sandra
'Sarosero'
 
Sarosero,

I have seen several posts about not needing a PID with steppers . . . even with encoder feedback on the stepper motor.

We have applied PID servo filters on stepper amplifier / motor / encoder applications several times with good results. The trick is to
disable Integral and Derivative terms and use a Velocity feedforward term.

Our approach was to set the Kp term such that a 25Hz response rate with a damping ratio of 1. No derivative gain, no integral gain and no acceleration feedforward gain. If you have a velocity feedforward term, this should be set up to compensate for the stepper motor position lag which should be easy to monitor and tune as a function of velocity. Other considerations are to set velocity and acceleration limits that correspond to reasonable performance objectives. Once the trajectory generator has been set up to create reasonable trajectories and the PID as above (Ki and Kd neutered) you should be able to home in on reasonable settings for Kp and Kvff.

Good luck!

Ken Brown
Applied Motion Systems, Inc.
http://www.kinemation.com
 
N
Hi. We work with such motors. We use the drivers from SGS thomson or withe transistors sometimes. You should just set a bit for the direction and make a clock for those chips. They make self
the driving signals. They will be faster if your clock frequency is faster. So you can use the clock frequency as you actuator value or better said out put of your pid controller. So you just make your digital pid with for example your position feedback and use the speed actuating value for controlling the position. I hope it can help you.
Best regards Nassir Abedi

Nassir Abedi(Mr.)
K. N. Toosi University of Technology
P. O. Box 16315-1355
Tehran 16314 Iran
Phone: 0098-21-869084(university)
0098-21-4110855(private)
Fax: 0098-21-862066
E-mail: [email protected] or [email protected]
 
The general way to approach distributed control with steppers is to do separate indexing drives
at each point. Communication to the drives in the past always seemed to be RS232 orRS485 multidrop configuration. A possible manufacturer is Intellegent Motion Systems (American Precision Industries, Motion Group).

In my opinion, the PID is not a good idea. The stepper acts very 'digital' and the PID acts
very 'analog'. PID certainly can be done, but it will not respond like a normal PID.

A check loop is the normal way to compensate for position errors.

If the stepper is sized correctly, the position error should be zero. If there is a position error, the compensation is best put in when the motor is moving slowly and not accelerating or decelerating. This is why the PID is a bad idea. The PID will compensate at the wrong time.

In addition, the PID will not compensate well for small 1 count errors. The gain would need to be too high.

On the other hand, the check loop will compensate for any error. This is usually done when the motion profile has just completed


David Kane
Certified Motion Control Specialist,
Association of International Motion Engineeers AIME
.com Inc.
 
J

Jacek Dobrowolski

Hello Sandra,
Oops. <- That's about mistake with your name. Sorry :) But sometimes people's names sound so strange...
Well, let's get back to the business.

I forgot to ask you what kind of control system you are using (PLC, NC or other) ?
And how steppers are driven ?

In general there isn't a big difference between driving DC motors and steppers with dedicated card as long as you use feedback. So solutions which were working with DC motors should work with steppers as well. The difference is that to control speed of DC motor you use voltage and for
steppers any signal (frequency, voltage, or direct digital value or others) which their card can accept.

If your robot arm doesn't move fast, there is no need to use whole PID. This situation takes place when time to cross a deadband of position with
full speed is longer then summarized times of ac- and deceleration. It seems to be enough using a simple proportional controller (only P term).
But you have to implement switching frequency limit which cannot be exceeded. That's the simplest way.

On the other hand, if you require very fast movements and accuracy PID should be implemented.

Which one is your case ?
And by the way what is the deadband of position counting in pulses from encoder ?

Excuse me for my poor command of English.
If you find anything unclear feel free to ask me for more explanation.

Regards,

Jacek Dobrowolski

Software Eng.
Electrical and Software Design Department
Secondary Division
International Tobacco Machinery Ltd. Poland
 
W
Sarosero,

If you're building the hardware, you might consider using that HCTL-1100 chip I mentioned in another post. It will take care of everything including velocity profile, position, hard travel limits, etc. It has a direct microprocessor interface that is easy to use. I think the newer version even has some multi-axis synchronization
possibilities.

Regards,

Willy Smith
Numatico SA
Costa Rica
 
Hi Jacek ... don't worry... your name is a little bit strange for me too.... ;)

> I forgot to ask you what kind of control system you are using (PLC, NC or other) ?

My system is so simple like a microcontroller,driver, stepper and decoder... no more... close loop

> And how steppers are driven ?

Now, I'm using LMD18245T (microstepping)

> If your robot arm doesn't move fast, there is no need to use whole PID. This situation takes place when time to cross a deadband of position with full speed is longer then summarized times of ac- and deceleration. It seems to be enough using a simple proportional controller (only P term).

Tell me more about this.. (only P term). Do you know any efficient method to recognize Kp to this kind of motors?

> But you have to implement switching frequency limit which cannot be exceeded. That's the simplest way.

Could you explain me better, please?


> And by the way what is the deadband of position counting in pulses from encoder ?

How can I calculated it?

> Excuse me for my poor command of English.

My english is more poor than your! so.... don't worry... be happy :)

Regards,

sarosero
 
ok Willy, but could you tell me ... where can I buy it (LatinAmerica).....Is expensive?

thanks....

sarosero
 
Interesting approach.
But I am not sure what the definition of damping ratio, please tell me more.

Thanks

David Kane
Certified Motion Control Specialist,
Association of International Motion Engineers AIME
 
Top