0
\$\begingroup\$

I am creating a closed loop controller for a motor which is part of a robotic arm. I give it a required angle, the controller calculates a control input, the motor moves, a pot feedbacks the angle, repeat, and the arm ends up at the required angle.

I am using state variable feedback, with integral action, and in order to calculate the control gains required for stability and speed I need a mathematical model of my system.

To get this model I am using statistical model identification techniques. I am inputting a random control signal into the motor, and recording this and the angle of the arm at each sample time. I'll then have sample input and output data of my system, and I can use a mathematical optimization technique to find the model parameters that best fit this data.

My Question

When under actual operation, the robot arm will be lifting a variety of weights. Does this mean the model I found with no load (intrinsic load) is invalid?

How do I get a mathematical model of this system when the load on the motor can change?

\$\endgroup\$
  • 2
    \$\begingroup\$ Usually control loops are tuned under around the operational conditions. But the PID loops are usually robust enough to take care of some deviations (especially with the right tuned integral part. The Proportional only won't handle it.). If you want to increase the robustness, use several nested loops (for position control, for example, you might want to implement an internal velocity loop. For the velocity loop - internal torque/current loop). \$\endgroup\$ – Eugene Sh. May 19 '15 at 14:53
  • 2
    \$\begingroup\$ You could try RLS to get a transfer function model, probably with the matrix inversion lemma to speed up the computations. RLS can work with the normal operating signals and you may not need to apply a small perturbing input. \$\endgroup\$ – Chu May 19 '15 at 15:20
  • \$\begingroup\$ Both great suggestions, thank you. I will look into both. @EugeneSH Could you please explain what the block diagram for this multi-loop system will look like (e.g). I'm just a bit confused to what you mean. Also, wouldn't having more control loops mean less robustness, because you have more control gains you need to calculate, hence you need to estimate more model parameters. Surely the less things estimated the better? No? \$\endgroup\$ – Blue7 May 19 '15 at 15:41
  • 1
    \$\begingroup\$ Sounds like the comments are putting you on the right path. I just want to add that you should take a moment making sure that the difference in loads is big enough to worry about before running down this alley. For example, if the motor's internal torque is much bigger than that of the load change, or if you're really geared down by driving a big honking lead screw, your control system can tolerate a whole bunch of load variability. Probably not your case, but thought I'd put it out there. \$\endgroup\$ – Scott Seidman May 19 '15 at 15:46
  • 1
    \$\begingroup\$ I guess I will have to put it as an answer, since too much words.. \$\endgroup\$ – Eugene Sh. May 19 '15 at 15:50
1
\$\begingroup\$

Usually control loops are tuned under around the operational conditions. But the PID loops are usually robust enough to take care of some deviations (especially with the right tuned integral part. The Proportional only won't handle it.). If you want to increase the robustness, use several nested loops (for position control, for example, you might want to implement an internal velocity loop. For the velocity loop - internal torque/current loop).
The idea is, to make the outer position loop not to care about the underlying physical system (well, to some extent), it is done with the inner loop. The inner loop will (given it is velocity loop) will take velocity reference as input from the position PID controller, assuming the velocity loop is perfect (or modelled with some transfer function for better results). The same can be done with the velocity loop, by implementing the inner torque-regulating loop. So only the innermost loop will have to take in consideration the actual physical system parameters. The parameters for the outer loop plants will be the artificial ones, derived from the inner ones.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Thanks. Can I just check I have understood this correctly: When implemented, the control algorithm for the outer loop could be: y=measure position; Z=add error to previous error; u_outer=(-f*y)+(k_I*Z). Where the error is calculated by subtracting the actual position from the desired position. The implemented control algorithm for the inner loop will be: y=measure speed; Z=add error to previous error; u_inner=(-f*y)+(k_I*Z). Where the error is calculated by subtracting the measured speed from u_outer. The final step is to write u_inner to the motor pin. Yes? \$\endgroup\$ – Blue7 May 20 '15 at 14:34
  • \$\begingroup\$ I am not quite sure I understand your notation. What are Z, f, y, u ? But there is something that is not exact on the diagram - the outputs/feedbacks are connected as like they were the same quantity, but actually they are different measurements of actual position/velocity/torque. \$\endgroup\$ – Eugene Sh. May 20 '15 at 14:40
  • \$\begingroup\$ My example control algorithm is assuming I am using PI control, where the proportional part is proportional to the output, and not the error, as it usually is (This is still a valid method of state variable feedback). My notation is pretty sloppy to be fair. For the outer loop y will be found by reading the absolute value of the multi-turn pot connected to the pulley (i.e this is the measured position). For the inner loop y is the speed of the motor, and can be found with (Position-lastPosition)/sampletime. Z is the integral of error term. u is the control input. f & k are gains \$\endgroup\$ – Blue7 May 20 '15 at 14:46
  • 1
    \$\begingroup\$ I believe your (-f*y) terms should be f*e where e=ref-y is the error. But if ref is zero for outer loop, it's ok. But for inner one it's derived from the u_outer, so you can't assume it's zero. \$\endgroup\$ – Eugene Sh. May 20 '15 at 14:50
  • 1
    \$\begingroup\$ Looks OK to me. \$\endgroup\$ – Eugene Sh. May 20 '15 at 15:10

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.