From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Control in Quanser Controls Board + NI ELVIS III

Hi,

 

I am new to LabView. I tried example LabView VI's from the courseware provided by Quanser for Quanser Controls Board + NI ELVIS III board and the DC motor speed and position can be controlled. However, when I increase the proportional gain (kp) of the PID controller, the overshoot of the response decreases and rise time increases. This contradicts with common understanding of the effect of kp in PID Control theory. Would you please shed me some light on how to correct this?

 

Many Thanks.

 

Best Regards,

wkfung

0 Kudos
Message 1 of 8
(1,631 Views)

Yes  - usually when you increase Kp the overshoot increases and response gets faster, but not always.

 

1. If you have a high order system and a PID controller you can get some counterituitive responses - BUT THIS IS QUITE UNUSUAL. It is best observed by looking at the poles and zeros of the closed loop system and how it changes with the changing gain (called root locus). This is more likely if the PID controller is of the parallel form (i.e. kp+ki/s+kds). It may be that you have found a region of gains where this happens, if you keep increasing or decreasing the gain you may move into a more expected effcet.

2. If the sample time is too slow that can give oscillations

3. Sometime the proportional "gain" of a PID controller is specified in an inverse way - often called  Proportional Band (PB = 100/kp) - that would give the opposite effect. But Proportional Band is usually only found on old equipment, but sometimes retained in new systems so they are backward compatible.

4. Or there could be some error ..

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 2 of 8
(1,596 Views)

Thanks for the reply.

 

I am using this setup: https://www.quanser.com/products/quanser-controls-board/ and the courseware downloaded from this web page. I do not build the VI myself to control the system and I just use the VI provided in the courseware.

 

According to the provided VI in the courseware, the DC motor system is modelled by a first order system. In the speed control experiment (in ControlSystemsDesign_LabManual\Software\Speed Control\DC Motor Speed Control.vi), the default kp is 0.05 and ki is 1. I observed an overshoot in the output response. When I rise kp to 0.1, the output does not exhibit any overshoot and the rise time also increases.

0 Kudos
Message 3 of 8
(1,581 Views)

 

Hi,

 

As shown in the attached figure, the VI uses a the standard PI Controller block from LabView and the plant model of DC motor is a first order system. This is a typical textbook example of PID Control. I wonder why this control system behaves differently (overshoot decreases with increasing proportional gain kp) from what are specified in textbooks.

 

 

2021-05-10_13-53-36.jpg

0 Kudos
Message 4 of 8
(1,550 Views)

Are you looking at the right trend when drawing this conclusion? Don't get mixed up by looking at the motor voltage - as you ar controlling the speed - is it the speed that is showing less overshoot with increasing KP?

 

The screenshot is difficult to see exactly what is going on - but I can see a saturation block on the voltage - if you have gains that are saturating or nearly saturating then that can skew what you observe (especially if you have integral action but no anti-windup). Make sure you you use small gains away from saturation.

 

Are you using derivative at all?

 

It designed for you to learn, so think about what is going on and what you can try to diagnose (e.g. what if you only have proportional gain, or what happens is you run it open loop - does it move in the right direction?)

 

Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 5 of 8
(1,545 Views)

Thanks for your reply.

 

I only focus on the motor speed of the DC motor. The motor speed shows less overshoot when I increase Kp.

 

The response under the default settings (Kp=0.05, Ki=1) is as follows:

 

DefaultSettings.PNG

 

If I increase the Kp to 0.1, the overshoot disappears.

 

doubleKp.PNG

 

If I decrease Kp to 0.02, the overshoot becomes bigger than that when Kp=0.05.

Kp0.02-Ki1.PNG

 

If I set Ki to zero, the output motor speed cannot track the reference input.

 

(Kp=0.05)

ZeroKi-Kp0.05.PNG

 

(Kp=0.2)

ZeroKi-Kp0.2.PNG

 

I wonder why the standard educational equipment behaves differently from what standard textbooks say.

 

Many Thanks.

0 Kudos
Message 6 of 8
(1,527 Views)

Ok - few comments:

  • for the small Kp values - the contribution it makes to the control signal is small compared to the contribution from the integral action. This means the the overshoot you are seeing is largely from the relatively large Ki. Integral action pushes things to instability / makes more osciallatory as you increase.
  • you might expect the Kp to work in the same way (higher gain = more overshoot) - but that;s not what you are seeing. My GUESS as to what is this is due to is that the PID controller is in a parallel form (Kp+Ki/s+Kds) and one of the features of that is that they don't always give intuitive behaviour when simply changing the gains up and down. Basically what happens is that in the closed loop system, changing Kp only changes one part of the frequency response - and if you have Ki set at a specific value - the closed loop system can look to get more stable with increasing gain since you are increasing the phase margin. You will need to learn about closed loop transfer functions, bode plots, stability margins - or even poles and zeros of the system and a root locus.
  • If your PID controller is in ideal form - i.e. Kp*(1+ 1/Tis +Tds), then the Kp acts on the whole control response so the whole frequency resposne shifts up and down as you change the gain and you get a more intuitive change to the gain and phase margin of the closed loop system. This is why practical PID controllers tend to use this structure.
  • The ki = 0 is a bit strange as you would expect to see some response from the Kp only - sometime softwware don't allow zero values for integral action (but usually only when it is specified as an integral time - the units imply it is the inverse), so try a very small value for Ki rather than zero. It would be good to set the ki small anyway, so you can see what the Kp is doing - and it will probably behave in a more sensible way.
Consultant Control Engineer
www-isc-ltd.com
0 Kudos
Message 7 of 8
(1,510 Views)

Hi wkfung, Could you tell me about your implementation? I want to try setup our ELVIS II, ELVIS Quanser QNET-010 746730-01 and the LabVIEW 8. Do you know if it's possible? I hope that you can help me! 

 

Best regards!

 

 

0 Kudos
Message 8 of 8
(848 Views)