0
\$\begingroup\$

I posted a question recently regarding PID controllers, and it was swiftly answered.

I began to work up a Simulink model and I'm running into problems with my (simplistic) model. I want to work out the kinks with this mass-spring-dashpot system before actually completing my more complicated task.

Below is an image of my Simulink model. It has a set point loaded in from the workspace; the error signal is pushed through a PID controller. The output of this PID controller is "supposed to be" current, so I pushed it through a saturation block to limit the maximum amount of output current.

I then amplified it with a gain equivalent to the motor constant (noting that torque is proportional to current in a DC motor). To the output (which should be some sort of position), I added additive white Gaussian noise.

There are a few problems with this simulation.

One, the output of the motor is torque, not force. This, however, is a minor concern and because this is just an example I was working up to rationalize the concepts in my head, does not matter.

The real concern is the output of the PID controller. Based on my motor specifications, the maximum allowable current is about 10 A, so I set my saturation filter to cut off at -10 A and +10 A. However, using the fancy "tune PID" feature in Simulink, I'm getting absurdly high values for the controller coefficients. This, in turn, results in absurdly high values for the controller output, much greater than 10 A.

Clearly something is going wildly wrong here, and I'm not sure what. I require my rise time to be ~0.1 seconds (for a step input), and this results in values like 10^8 for the integral coefficient. I conjecture that my assumption that the output of the PID controller is current is wrong (after all, the PID controller in Simulink doesn't know what I'd like it to output), but I'm not sure how to remedy this.

Any help is greatly appreciated. ^^

For reference, I'll indicate what my constants are here instead of giving messy MATLAB code.

m = 1 kg; k = 98700 N/m; c = 10.5 kg*m/s;

I_max = 10 A; I_min = -10 A; kt = 1.08 N*m/A;

Which resulted in values of:

K_p = 1285705; K_i = 184757940; K_d = 1983; N = 23914;

EDIT: To avoid any confusion as to why I'm inputting x_set into my PID controller, let me clarify. I'm not ignoring everything said in my previous question, but instead I'm assuming I have some means to use a 1 V/m converter, so that I can be lazy and let my position in meters be equivalent to my input in voltage to the PID controller.

Simulink model of mass-spring-dashpot system.

\$\endgroup\$
  • \$\begingroup\$ Is k really 98.7kN/m \$\endgroup\$ – JonRB Feb 22 '16 at 21:44
  • \$\begingroup\$ Given a mass m = 1 kg, a quality factor Q of 30, and a natural frequency of 50 Hz, we can calculate: k = m*(2pi*50)^2 = 98.7 kN/m; c = sqrt(mk)/Q = 10.47 kg*m/s (Apologies for the bad formatting, I'm not sure how to fix this in comments.) \$\endgroup\$ – anonymouse Feb 22 '16 at 21:46
  • \$\begingroup\$ Get rid of your saturating nonlinearity until you have it working without it. \$\endgroup\$ – Scott Seidman Feb 22 '16 at 22:17
  • \$\begingroup\$ Mhm, I've already tried this. The saturation block doesn't seem to be causing the "absurdly high PID coefficients" problem; it's also not the AWGN. Despite all this, when I remove the saturation block, the graph of the output does respond correctly to a step input, but this is only because I'm allowing the high coefficients to pass into my transfer function. Maybe the concern is that my value for k is too high, and I do need ~10^8 A to control this mass, but that doesn't sound reasonable to me. \$\endgroup\$ – anonymouse Feb 22 '16 at 22:23
  • \$\begingroup\$ Where do the motor TF parameters come from? Essentially, the damping is very close to zero and, without doing the analysis, It seems that the CLTF will be very lightly damped, if not unstable. This is probably why the PID tuning algorithm is struggling to find a rational set of parameters. Check your motor parameter values. \$\endgroup\$ – Chu Feb 23 '16 at 0:02
1
\$\begingroup\$

My guess is that your fancy "tune PID" aimed for irrealistic response characteristics and ended up with those absurd gains for your controller, which should be the cause for also absurd control actions.

Get rid of the derivative term (K_d = 0; they are problematic specially if your noise contain high frequency components) and start by using small gains for K_p and K_i, and increase them as you observe the system response. K_p should be set for getting a reasonably good initial response (but don't overshoot) and K_i should be set for making the steady-state error zero in an acceptable time.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.