Searching \ for ' [PIC] PWM motor control' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=motor
Search entire site for: 'PWM motor control'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] PWM motor control'
2001\02\22@032045 by Vasile Surducan

flavicon
face
On Wed, 21 Feb 2001, Mike Mansheim wrote:

>
> I think it is more typical to have a PI only system - and only use the
> derivative term when absolutely necessary.  It is simply a means to let

 I'm not a software specialist, but I've done many analogical regulators
P, PI but never PID. Real application demonstrate ( for me ) that PID is
almost pure theoretical. So could you point just one *real* example in
which derivative term must be implemented ?


> the control system react to the rate of change of the error, and often
> isn't needed.
> Finally, going way back to the original post on this, they said that it
> can take a while to get a speed reading.  I just wanted to mention that you
> must pay attention to how often the pid calculation is done.

Usual when the electronic system ( including hardware and firmware
) is  interacting with a mechanical one, PI theoretical calculation
could not match with reality. The crude result is the whole electronic
system "must be learned" and some adjusting point must be added.
A good and painfull example for this is the response reaction time...
Vasile

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@050022 by Simon Nield

flavicon
face
vasile:
>P, PI but never PID. Real application demonstrate ( for me ) that PID is
>almost pure theoretical. So could you point just one *real* example in


This website has a great engineering style motion control tutorial (i.e. it's not just a load of
abstact math) which I personally found a good refresher to the stuff I studied at university. I
really can't recommend this document enough:
www.newport.com/Motion_Control/Tutorial/
or grab the pdf:
http://www.newport.com/file_store/Motion_Control/Tutorial/PDF_Files/motion_tutorial.pdf


in order of increasing complexity of control systems, I would suggest:
P - gets near there quite quickly. the quicker you get the more (chance) of overshoot
PD - adding some derivative lets you crank up the P term some more to get faster response without
too much overshoot
PID - the integral term is the icing on the cake allowing you to remove steady state error
(depending on your application you may not actually care about steady state error it it is already
'small enough', in which case you may end up with the integral
term at zero to avoid the possible decrease in stability.

PI systems would require physical damping of some sort in order to avoid instability, so maybe if
you have used this type of system with success in the past it is because your physical system is
already realtively heavily damped?


Regards,
Simon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@051939 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

I would have to agree with Vasile.  Certainly all the controllers I have
built have been PI, the derivative term just dosen't seem to give much in
the way of a performance gain, certainly not enough to justify the extra
code overhead.
Having said that, all the sytems I have worked with have been temperature
controllers that have a long thermal time constant (maybe up to 10 seconds).
I do get a slight overshoot with as step input, but adding even quite large
amounts of D into my controller didn't seem to help overshoot very much at
all.

Mike

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@054048 by Simon Nield

flavicon
face
mike:
>I do get a slight overshoot with as step input, but adding even quite large
>amounts of D into my controller didn't seem to help overshoot very much at
>all.

the long time constant you are talking about suggests the system is pretty heavily damped anyway (i
think...), so the D term may not bring much to the party.
also in heating / cooling systems the drive is often asymetric - by which I mean that you are using
a different mechanism (or in the case of peltier devices one mechanism with differing efficiencies)
in each direction - and I guess that may well have an effect on the relative usefulness of the
different terms.

do remember that PID control is only a bodge really anyway - it saves you having to analyse the
system you are trying to control and model its transfer function 'classically' - but it's a bodge
(aka "engineering approximation") that is very often perfectly sufficient for the "real world" job
(as opposed to the first year control systems course where they will have you think that you need to
analyse every system individually and then design a custom controller... still at least it provides
a bit of background to the discovery later on that in fact 'almost everyone' just buys PID
controller units and has a the manufacturer tune it for them)

Regards,
Simon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@062243 by Vasile Surducan

flavicon
face
On Thu, 22 Feb 2001, Simon Nield wrote:

> do remember that PID control is only a bodge really anyway - it saves you having to analyse the
> system you are trying to control and model its transfer function 'classically' - but it's a bodge
> (aka "engineering approximation") that is very often perfectly sufficient for the "real world" job
> (as opposed to the first year control systems course where they will have you think that you need to
> analyse every system individually and then design a custom controller... still at least it provides
> a bit of background to the discovery later on that in fact 'almost everyone' just buys PID
> controller units and has a the manufacturer tune it for them)

 I don't know who is the teacher at your control systems course but it
has damn right ! You can't find an universal solution just using an
excellent ( and epensive too ) controller. Just a simple example in
heating process: if you must keep at desired value the temperature inside
a small oven ( let say 1000C at 2KW ) and you must use an on-off command
for power supply, you may have the best controller in the world, if you
don't correlate the oven resistor value with your temperature
requirements and mains value ! With other words if you're not able to
dimension well the resistor you'll need an expensive proportional
controller to achieve the same +/- 2 C fluctuation like using a cheap
relay and a simple comparator. ( or a 12C509 to be in topics...)

dictionar:
C = Celcius degree

Regards, Vasile

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@063317 by brah

flavicon
face
       I thank all who responded to my orig note on this subject.  Some of
it's a bit deep for me, however, I see in some ideas where generating an
error causes the error to go away, whereby there is no error to drive
the motor.  That is, I would think, a positional device, such as an
elevator on a model aircraft.
       What I trying to do is, set a speed for a motor to run at.  Drive the
motor with PWM. Compare the motor's actual speed with my setting speed,
and if there is an error, change the PWM until there is no error between
setting ans actual.
       One further problem is this darn thing has to be set over a fairly wide
range, say a low figure to say ten or twenty times that (e.g. 10 rpm to
200 rpm, which I am achieving now with the set PWM and hope motor runs
true to the PWM, which, of course, according to the Laws of the Charters
Towers Jocky Club - it doesn't!)

       What about if, say, the PWM 'setting' is 1000.  The 'actual' motor
speed 900.

       (Derived from a speed sensor of immaterial description)  Subtract the
'actual' from the 'setting', and, if a negative result, add to the
result to the PWM register, or if a positive result, subtract it from
the PWM register.  (In either case, leave the 'setting' unchanged, and
just add to the PWM register, so the next comparison will be made with
the 'setting' figure, not the actual PWM register)

       So, in example, 1000 - 900 = 100. Add to PWM register, which becomes
1100.  The motor speeds up, perhaps miraculously to 1000.  Then, at next
comparison, 1000 minus 1000 = 0.  Add 0 to the PWM register and nothing
changes, motor continues to run at 1000! Change the setting, or the
motor changes, and it will compensate.

       Won't it??????  It might oscillate a bit, but maybe not much.

Regards Howard

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@073618 by Simon Nield

flavicon
face
vasile:
>  I don't know who is the teacher at your control systems course but it
...
>relay and a simple comparator. ( or a 12C509 to be in topics...)


sorry, I obviously didn't explain that last remark clearly enough.

what I am talking about is the design of the control system, not the design of the plant you are
trying to control.
if the plant is badly designed then obviously the control system is going to have a hard/impossible
time getting useful output.

i am suggesting that the 'classical method' of plant control, whereby the plant is analysed and
described in terms of a mathematical transfer function, the parameters of which are then measured,
and an inverse transfer function created and used as the control system, is almost never used in
real life.
it's too complicated a process: analysing the plant to create the transfer function generally
involves a whole bunch of approximations, and measuring the parameters of that transfer function is
difficult and often inaccurate. The transfer function has to be rationalised to avoid too many
levels of differentiation to avoid problems with noise in the error signal... and the performance
obtained after such a complicated process is often no better (and sometimes worse) than can be
acheived with a simple PID system.

i am suggesting that most often the plant is designed, then an off-the-self PID control system is
configured to suit the job... this is not just my opinion by the way, it was also what the lecturer
happily told us after we had a grounding in the subject - it's good background stuff, but not used
very often in the real world.


Regards,
Simon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\22@120606 by Mike Mansheim

flavicon
face
>What about if, say, the PWM 'setting' is 1000.  The 'actual' motor
>speed 900.
>Derived from a speed sensor of immaterial description)  Subtract the
>'actual' from the 'setting', and, if a negative result, add to the
>result to the PWM register, or if a positive result, subtract it from
>the PWM register.  (In either case, leave the 'setting' unchanged, and
>just add to the PWM register, so the next comparison will be made with
>the 'setting' figure, not the actual PWM register)
>So, in example, 1000 - 900 = 100. Add to PWM register, which becomes
>1100.  The motor speeds up, perhaps miraculously to 1000.  Then, at next
>comparison, 1000 minus 1000 = 0.  Add 0 to the PWM register and nothing
>changes, motor continues to run at 1000! Change the setting, or the
>motor changes, and it will compensate.

The simplest control system for something like this is:

if      (speed < desired speed) increase pwm output
else if (speed > desired speed) decrease pwm output

This will oscillate around the desired speed, which often is perfectly
acceptable.  How much it oscillates depends, among many other things, on
how much you change the pwm output each time.  In your example, you make
the change in pwm output "proportional" to the difference between the
actual speed and the desired speed, which can be a useful enhancement -
although it will still always oscillate around the desired speed.
But it is not a "classical" proportional control, where the pwm output
each time this calculation is done is a function *only* of the difference
between the speed and the desired speed, and has no "memory" - i.e. it is
completely unrelated to the previous pwm output.  The integral term is
what adds this memory.
A couple of practical notes if you use this approach:

- it can be useful to add a hysteresis term to create a window in which
 no change is made to the pwm.  e.g.:

 if      (speed < (desired speed - hysteresis)) increase pwm output
 else if (speed > (desired speed + hysteresis)) decrease pwm output

- I realize you were probably picking numbers out of the air for your
 example, but just in case, don't feed 1100 to a 10 bit pwm register.
 It will max out at 1023, if you've set the pwm frequency correctly
 relative to the clock; less otherwise.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\24@072326 by brah

flavicon
face
Mike Mansheim wrote:

{Quote hidden}

I thought it might oscillate, and if it's very narrow it'll probably be
acceptable.
Sorry for the figures - they were just an example - never thought to
make them more accurate to the PWM module.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...