Menu

Integrator with fixed step size fails to solve IVP

WenChao Xu
2023-05-18
2023-05-22
  • WenChao Xu

    WenChao Xu - 2023-05-18

    Hello, everyone!

    First of all, the constraints and penalties on the control input rate I asked before are implemented using augmented state variables as the author said. The main problem lies in the adjustment of parameters, especially the need to enlarge the prediction horizon.

    Then, I encountered another problem during the test, that is, the discretization of the dynamic model will fail no matter whether I use the default RK2 or RK4 in the text. I guess the specific reason should be that there is a large gap in the magnitude of the parameters of the dynamic model.

    Have you ever encountered such a situation? I searched and consulted the literature, saying that the integrator with an explicit fixed step size is not numerically stable, and you can use methods such as Runge–Kutta–Chebyshev to improve numerical stability. I will test RKC first, do you have any good suggestions?

    Thanks!

    Best regards
    WenChao Xu.

     

    Last edit: WenChao Xu 2023-05-18
    • WenChao Xu

      WenChao Xu - 2023-05-19

      The reason for this is that the model of the motor and the joint of the manipulator is coupled in my dynamic model, resulting in the existence of two sub-models with a large gap in dynamic characteristics.

      RKC does not solve this problem either.

       
  • Andreas Völz

    Andreas Völz - 2023-05-19

    Dear WenChao,

    what do you mean by "the discretization of the dynamic model will fail"? Can you please explain the problem in more detail?

    Note that GRAMPC's integrator "ruku45" is a method with variable step size that should work for most problems. Besides, you could test "rodas", which uses a variable step size, too. However, I am not convinced that this is truly the source of your problems. If the MPC without additional integrator worked with "heun", then the MPC with additional integrator should still work with "heun" in my view.

    Have you already considered scaling the additional input? That is, let u be between -1 and 1, where +1 is the maximum control input rate and -1 the minimum control input rate.

    Best regards,
    Andreas Völz

     
    • WenChao Xu

      WenChao Xu - 2023-05-20

      Dear Andreas Völz,

      Note that GRAMPC's integrator "ruku45" is a method with variable step size that should work for most problems. Besides, you could test "rodas", which uses a variable step size, too.

      I'm going to try these two integrators. I have a doubt. The step size of the integrator I used in the prediction horizon was either equal to the sampling time, or at least a fixed step size. I have not used an integrator with a variable step size. Isn't the step size of the integrator not strictly kept fixed in the prediction horizon?

      Have you already considered scaling the additional input? That is, let u be between -1 and 1, where +1 is the maximum control input rate and -1 the minimum control input rate.

      I didn't scale the control input rate, I'll try to scale it next.

      Thank you for your reply!!!

      Best regards
      WenChao Xu.

       
  • Andreas Völz

    Andreas Völz - 2023-05-19

    Can you maybe state the dynamical equations of the system that you want to control?

     
    • WenChao Xu

      WenChao Xu - 2023-05-20

      Dear Andreas Völz,

      Thank you for your reply!

      My dynamic model is a single-link flexible-joint manipulator, which is a 4th-order model, and then on this basis I added the dynamic model of the servo motor to make it a 5th-order model, and The optimization variable of MPC is changed from the winding current to the joint voltage, so that PWM control can be performed directly.

      The discretization (numerical integration) of the prediction model over the entire prediction time domain is normal when using only the 4th order model, but adding this motor model leads to failure. By checking the solution results of the corresponding model in different integrators on MATLAB, I found that the state increment of each step of the 5th order model is particularly large. I asked others, and they said that the dynamic characteristics of the motor and the dynamic characteristics of the original joint model are not of the same order of magnitude.

      Best regards
      WenChao Xu.

       
  • Andreas Völz

    Andreas Völz - 2023-05-22

    Dear WenChao,

    thanks for the more detailed information. Given that the electrical subsystem is typically much faster than the mechanical subsystem, you should honestly ask yourself whether it is of advantage to include the voltage-current dynamics in the MPC. You would probably have to decrease the sampling time, increase the number of discretization steps, or shorten the prediction horizon. However, if the horizon is too short, you could get problems with stabilizing the mechanical subsystem. Therefore, if you have a system structure with such different time constants, a cascaded approach might be the better solution.

    Best regards,
    Andreas Völz

     
    👍
    1
    • WenChao Xu

      WenChao Xu - 2023-05-22

      Dear Andreas Völz

      Thank you for your reply!

      Therefore, if you have a system structure with such different time constants, a cascaded approach might be the better solution.

      Does the cascading method refer to performing MPC control on the mechanical structure to obtain a current signal, and then cascading a current controller behind it?

      Uh-huh, I see. Thank you!

      Best regards
      WenChao Xu.

       
  • Andreas Völz

    Andreas Völz - 2023-05-22

    Dear WenChao,

    yes, I meant that, use the MPC for the mechanical system and a low-level controller for the electrical subsystem. If the electrical system is fast enough and the controller well-tuned, you won't see any difference in the resulting system behaviour.

    Best regards,
    Andreas Völz

     
    • WenChao Xu

      WenChao Xu - 2023-05-22

      Dear Andreas Völz,

      I've got it, thank you!

      Best regards,
      WenChao Xu.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.