0
\$\begingroup\$

I am working on a speed controller for a robot and it's for when the robot is balancing on its wheels. I am designing the controller as part of a project in a linear control design course. However, the controller has to be implemented on a robot and in software delivered by my instructor, so I don't have infinite room of freedom. The way I implement my controller can be seen here:-

enter image description here

As you can see, I can add a gain \$K_p \$, an integrator and post-integrator, a lead/lag-term in both forward and feedback path, a prefilter and a feed-forward. And that's it. I can't change what feedback I'm receiving, I can only add and adjust terms of the controller.

Edit - Finding the new transfer function

Doing what AJN suggests gives me a much nicer bode plot:-

enter image description here

The bode plot is much nicer, but I still have some trouble. I want to smooth out the hill in the phase plot, but I am not sure how to do so.

The new transfer function:

num = [0 0 0 -3.5113e+07 -3.7165e+10 -2.0902e+12 -3.8701e+13 -1.5402e+14 2.5341e+15 2.2109e+16 3.3405e+16];
den = [1 2.4731e+03 1.4491e+06 2.5930e+08 1.2622e+10 9.9503e+10 -1.8488e+12 -1.0302e+13 0 0 0];
G2 = tf(num,den);

Earlier form of the question containing some outdated info

num = [0 0 0 0 -2.3409e+07 -2.4777e+10 -1.3935e+12 -2.5801e+13 -1.0268e+14 1.6894e+15 1.4740e+16 2.2270e+16];
den = [1 2.4738e+03 1.4508e+06 2.6223e+08 1.5442e+10 6.8736e+11 2.6563e+13 5.2944e+14 4.0900e+15 8.1300e+15 3.7708e+15 1.1220e+13];
G2 = tf(num,den);

The open and closed loop bode plot for the transfer function is here:-

enter image description here

As you can see in the closed loop bode plot, there is a big valley in the phase, and this causes the system to be unstable (I think), and I don't want that.

My inital idea was to add a lag-term to the forward path. A lag-term removes phase, so if I place it right where the valley is the peak should get smaller. My lag-term looks like this:-

enter image description here

But even after adding the lag-term the phase still looks very weird. Here is the new closed loop bode plot:-

enter image description here

Is there a way to remove this phase valley and get a proper stable system?

\$\endgroup\$
13
  • \$\begingroup\$ This looks like hysteresis induced resonances that cause the phase reversal. And reminds me of graduate inverted broom servo train thesis. This has been done many times. Eliminating the slack (hysteresis) with push or pull tension and a velocity and position feedback loop will give better results. \$\endgroup\$ Apr 19, 2021 at 13:53
  • \$\begingroup\$ Using position control with the 2nd integral of current makes for poor phase margin. Try to use 1st order feedback, velocity arm angle then Position of angle and vehicle. I.e. multiple loops as the load changes with angle is nonlinear \$\endgroup\$ Apr 19, 2021 at 13:56
  • 1
    \$\begingroup\$ I plotted the poles and zeros of the plant and noticed; a zero on the RHP and two complex conjugate poles on the RHP. The system will be quite difficult to stabilize as you need to bring the poles to the RHP while keeping the open loop poles from migrating towards the RHP zero in the loop closing process. \$\endgroup\$
    – AJN
    Apr 19, 2021 at 14:38
  • 1
    \$\begingroup\$ "As you can see in the closed loop bode plot, there is a big valley in the phase, and this causes the system to be unstable (I think), and I don't want that." The phase plot of the closed loop plot may not be the way to think about this problem. \$\endgroup\$
    – AJN
    Apr 19, 2021 at 14:39
  • 1
    \$\begingroup\$ this looks more reasonable. however, be careful! I dont know how simulink works, but you may be plotting -G(s)H(s) now. Simulink doesn't know that it has to ignore the -ve sign in the summing junction when opening a loop (At least older simulink version didn't; I think). The positive shape of the phase plot makes me believe that to be the case. Be cautious. \$\endgroup\$
    – AJN
    Apr 19, 2021 at 15:29

1 Answer 1

1
\$\begingroup\$

A good part of Engineering Design is trying not to reinvent the wheel and learn from other’s past mistakes and make improvements. There are many non-linear factors not included in your simulation such as hysteresis from friction and slack in every moving part and a lack of design specs for inputs and output error. A single step response to voltage is not the best test as motor BEMF changes the torque.

  • use Current control and feedback for smooth acceleration/braking rather than step voltage.

  • To accelerate an inverted arm, you must go backwards first to tilt the arm forward then accelerate enough at peak velocity to tilt the arm backwards in preparation for braking towards target position.

  • research the conclusions of a dozen similar yet different inverted broom or pendulum thesis papers and cite the flaws and solutions you propose with multiple loops for ideal acceleration, velocity, tilt angle and horizontal position with errors and tolerances allowed.

  • Here is one example that met some criteria yet failed in the end to be robust. Read the conclusions of each paper first and follow my advice. The contents will give you some insights to theory but be incomplete.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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