EmbeddedRelated.com
Forums
Memfault Beyond the Launch

PID controller, help

Started by Lox February 13, 2012
Hello all

I'm trying to implement a PIC controller to controll the position by
adjusting the speed of an motor. The input I have is the position.

My colleague says that I first must derivate the position and use it
as input to the PID regulator. Do I have to do that?

He says I must have speed as an input because I have speed as an
output!?!?!?! That sounds strange.



On Mon, 13 Feb 2012 09:42:15 -0800, Lox wrote:

> Hello all > > I'm trying to implement a PIC controller to controll the position by > adjusting the speed of an motor. The input I have is the position. > > My colleague says that I first must derivate the position and use it as > input to the PID regulator. Do I have to do that? > > He says I must have speed as an input because I have speed as an > output!?!?!?! That sounds strange.
Well, something doesn't match up. First, you can't seem to decide if you're controlling speed or position -- first you say that you're controlling position, then speed, then you're quoting your unknown colleague as saying you're controlling speed. So back off a pace or two: what do you want the motor to do? If the answer is "go to the position that I command, and I absolutely don't care how it gets there", then you're controlling position. If the answer is "go a certain speed, and I don't care where it is", then you're controlling speed. If it's something like "go to the position I command, but never exceed V", then you're controlling both position and velocity, and boy are you going to be smarter coming out the other end of this problem than you are now (assuming that you succeed). Now, assuming that you are controlling the motor drive (either voltage or current), and that you want the motor to go to a certain position, your system does, indeed, need to take the derivative of the motor position. But the 'D' in PID is derivative, so you don't necessarily have to take the derivative _before_ you apply the problem to your PID controller -- you may well be able to let the controller do that. For the rest -- read this, and get back to us with questions: http://www.wescottdesign.com/articles/Sampling/pidwophd.html. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
I want to control the position.
On 2/13/2012 10:42 AM, Lox wrote:
> Hello all > > I'm trying to implement a PIC controller to controll the position by > adjusting the speed of an motor. The input I have is the position.
What do you use to get position ?
> > My colleague says that I first must derivate the position and use it > as input to the PID regulator. Do I have to do that?
What is "derivate"?? Examples of DERIVATE <a cuisine that is regarded by some as a derivate of creole cookery>
> > He says I must have speed as an input because I have speed as an > output!?!?!?! That sounds strange.
Please study more. Your confused.
> > >
On Mon, 13 Feb 2012 10:14:14 -0800, Lox wrote:

> I want to control the position.
Then -- depending on a whole bunch of other things -- you probably don't need to explicitly take the derivative of position before you run the PID controller. (Note that if you're trying to do really precise control, and you're running through a gear box, flexible mechanism, or other physical process that divorces the motor somewhat from the positioner, then it is often a Really Good Idea to have independent feedback of the motor speed, either through a tachometer, an encoder, or as a poor second choice, back EMF calculations). -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com

Memfault Beyond the Launch