Menu

Reluctant control variables

2018-07-22
2018-07-23
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22

    I have implemented a simple control strategy with two control variables and one state. At first I wanted to meet a static reference value of the state. Thus I calculated the control's equilibrium values and passed those to the control variables as their initial input. The algorithm has no problem adjusting to this system with PT1-behaviour. Afterwards I tried to use a dynamic reference value
    x_ref = x_ref_0 + t*a
    The cost function evaluates to
    J = q*pow(x-x_ref,2)
    The problem is that the control variables stick to their static values and so does the state. It reaches the equilibrium value but doesn't bother to follow the simple reference value. I tried to implement a equality constraint but that only blew up my algorithm and nothing worked anymore. Why are my control variables so reluctant to adjust?

     

    Last edit: Jacob Mannhardt 2018-07-22
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22
     

    Last edit: Jacob Mannhardt 2018-07-22
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22
     

    Last edit: Jacob Mannhardt 2018-07-22
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22

    Is there something wrong with my reference formulation:

        ctypeRNum* par = (ctypeRNum*)userparam;
        typeInt fac_des = (int)floor(t/30);
        typeRNum p_KA_des = par[1] + 30000*fac_des; 
    

    I want p_KA_des to jump from par[1] = 170 000 Pa to 200 000 Pa at t = 30s.
    I'm sincerely sorry to bother you with these questions!

     
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22

    SOLVED:

    I had to use scaling. u[0] and x[0] are of O(10^5) and every other state of O(10^0).

    Thanks guys, your toolbox is amazing, but sometimes I get lost in the multitude of options!

     
  • Jacob Mannhardt

    Jacob Mannhardt - 2018-07-22

    SOLVED:

    I had to use scaling. u[0] and x[0] are of O(10^5) and every other state of O(10^0).

    Thanks guys, your toolbox is amazing, but sometimes I get lost in the multitude of options!

     
  • Andreas Völz

    Andreas Völz - 2018-07-23

    Hello Jacob,

    when you use the time t within one of the problem functions you should have a look at the documentation, especially equation (3.1). Except the system model f, all functions get the internal MPC time t in [0, T] passed as parameters. If you need the "real" time, then you have to pass grampc.param.t0 via userparam to the problem functions and use t0+t there.

    Regards,
    Andreas

     

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.