LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initial Error during Real-time control

Hello all,

I am currently controlling a DC motor in real time by using an simple PI controller. 

Unfortunately, I found that there is some initial error when the desired motor speed (which i desired) is zero, the error signal come from the actual DC motor is oscillating at -3.

What should i do in order to make the initial signal to zero?

Initial error.png

 

Thank you very much.

0 Kudos
Message 1 of 8
(2,547 Views)

Yuki

 

since you are working with DC motors, two things could be happening:

1. the DC motor has a deadband near zero that, although you are trying to move the motor, the voltage is not enough to move it. In general, a PI controller would be integrating to overcome this gap and eventually, it would start moving the DC motor. It is always good to plot the control action and see what the controller is doing.

 

2. the zero could means no move for your DC motor and, in this case, it will only get stuck at -3. If you try other values of sepoint around 0 (link 0.1 or 0.01 or even -0.1), then post its response. This also can tell if you have an issue at zero or it can be around it.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 8
(2,538 Views)

Ok, thanks barp, due to my uni lab is closing down, i will collect the data and show u tomorrow 🙂

0 Kudos
Message 3 of 8
(2,536 Views)

Ok barp, i had work out for many scale (-0.1, 0.01, 0.1, 0, 1, 2, 10, 100, 500, 1000, 2000, 3000) and i will show you here. P/S: Red color= Actual motor speed, Green color= Setpoint(desired Speed), and the white color= controller signal.

-0.1.png0.png0,01.png0.1.png1.png2.png10.png100.png500.png1000.png2000.png3000.png

0 Kudos
Message 4 of 8
(2,528 Views)

Sry my fault,

P/S: Red color= Desired speed, Green color= Actual Speed, and the white color= controller signal.

0 Kudos
Message 5 of 8
(2,523 Views)

Yuki

 

The graphs tell the story what is going on. It is always important to do this kind of operations when testing a control system.

The problem you are running into is that your system is not linear around zero. By analyzing the steps with small signal, you can see that the control action (white) always grow, trying to compensate for the difference. The problem is that the voltage below certain value does not actuate on the output and the system is not controlled. All the graphs with speed below 10 show this behavior. If you wait long enough, the system will behave like the graph with speed 10. This effect can be create by two problems: you drive has a nonlinearize at the origin called "dead zone" which means that it does not output any voltage until you pass certain value. The other option is that you have friction on your system or backlash on the mechanical part. Both will present themselves as this effect you saw. To solve this problem, you will have to identify what you have.

 

To evaluate which kind on nonlinearity, you have to do a 'static' test of the system and verify what you have. Please look at this example to see how you can peform a static test.

 

examples\Control and Simulation\Case Studies\Process Control\Horizontal Cylinder\horizontal cylinder nonlinear tank.vi

 

At 10, you can see that the system is trying to control and after some time, it is able to move with large overshoot. This is due to a effect called "Windup". To study this effect, please look at this link:

http://www.20sim.com/webhelp/20sim.htm#library/signal/control/pid_control/antiwindup.htm

 

You would have to code an antiwinup technique somethink to avoid this issue.

 

Please characterize the nonlinearity and implement the anti-windup and let us know the results.

 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 6 of 8
(2,513 Views)

Hi barp,

 

Thanks for your reply barp :). Hmm regarding to the 'static' test, this is the result which i had try out when i am doing system identification.

The Vi is stand for voltage input and the Vo is stand for the voltage output. 

Is this a nonlinearity system?

P/S: 0.06 is the minimum threshold, for voltage input below 0.05, the voltage output is equal to 0.

And now i am trying to work out the anti windup, will post the result when i got it.

nl1.png

Thankyou very much barp 🙂

0 Kudos
Message 7 of 8
(2,504 Views)

Yuki

 

A simple bias to the output will make the to be considered "nonlinear". For a a system to be linear, it should be possible to use the superposition property:

1. f(u1 + u2) = f(u1) + f(u2)

2. f(m * u1) = m * f(u1)

 

For a system with bias, f = a + b.x, then:

1. f(u1 + u2) = a + b (u1 + u2) = a + b (u1) + b (u2) which is different from: f(u1) + f(u2) = a+b(x1) + a + b(x2) = 2*a + b (u1) + b (u2)

2. f( m* u1) = a+ b (m*u1) = a + b*m* u1 which is also different than: m * f(u1) = m* (a + b x1) = m*a + b*m*x1.

 

So, this proves that the system with a bias is nonlinear. Now, the good news is that, if you it is just bias, then you should be able to compensate by just applying a negative voltage or a value that will move the point back to zero (which is our case is make the constant a above equal zero), which by a quick inspection, it seemed to be - 0.67894.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 8 of 8
(2,497 Views)