ARMSLab / slmpc

Successive Linearization Model Predictive Control
https://armslab.github.io/lmpc-matlab
16 stars 13 forks source link

regarding the slmpc #2

Closed spdiwan closed 5 years ago

spdiwan commented 5 years ago

Hi, I have run the code which you have developed, working fine. Its nice code, writen in simple manner. I have develop the code for 4 states, 1 input, 2 output system. But it's not working. I have to test it in real time. How to do it? plz help me regarding to it. shall i send you my code?

olzhas commented 5 years ago

please share it here and the error you have.

spdiwan commented 5 years ago

Hi, I have programmed my system in tutorial_nonlinear_inp.m. I have run it but i didn't get good response. my initial condition is [-0.05;0.173;0;0] and the final is [0;0;0;0;], but I didnt get it. I have changed the weights also,but no effect on the output. I don't understand where I made mistake. Please help me out.

Best Regards,

Supriya P. Diwan (+91 9822591274) Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Thu, Apr 11, 2019 at 6:15 PM Olzhas Adiyatov notifications@github.com wrote:

please share it here and the error you have.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ARMSLab/slmpc/issues/2#issuecomment-482099082, or mute the thread https://github.com/notifications/unsubscribe-auth/AX0HCgWVLHF45B0MUG3M2XgHMm9lQrcSks5vfy5bgaJpZM4cozaF .

bexultanrakhim commented 5 years ago

Hi, I checked your code. System you are trying to control is extremely unstable or possibly uncontrollable. For example, small deviation for any initial state (except state 1 ) leads to instability. Could you check if your system dynamics are correct? I would suggest you to try to solve Ocp first and see if it is possible to stabilize the system. If your system dynamics equations are correct, then I would suggest you to:

  1. Change the sampling time. If your system has natural frequency much higher than sampling frequency it would be problematic to control.
  2. Change Horizon length np. Increasing the horizon length often solves the problem.
  3. Try to tune the coefficients for Q,R matrices.
spdiwan commented 5 years ago

My system is rotary inverted pendulum system, the system dynamic equation is checked . System is highly nonlinear and due to this i have taken jacobian. System has four states rotary arm angle is first state, pendulum angle is second and their velocities are other two. I have checked this system for linear MPC by considering the steady states as [0 0 0 0]. its working fine. I have to use NMPC to control it. I have checked it using ACADO toolbox. its giving good output. Thats why I am confused about your code. I would like to see how it will be worked in successive linearized manner. I would like to see difference in NMPC and slmpc. Initially its in [3 10 0 0]degree position and then it will be [0 0 0 0]. Whether my assigning are wrong in your program? (predictive matrices,Q,R, etc.)

Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 9:53 AM bexultanrakhim notifications@github.com wrote:

Hi, I checked your code. System you are trying to control is extremely unstable or possibly uncontrollable. For example, small deviation for any initial state (except state 1 ) leads to instability. Could you check if your system dynamics are correct? I would suggest you to try to solve Ocp first and see if it is possible to stabilize the system. If your system dynamics equations are correct, then I would suggest you to:

  1. Change the sampling time. If your system has natural frequency much higher than sampling frequency it would be problematic to control.
  2. Change Horizon length np. Increasing the horizon length often solves the problem.
  3. Try to tune the coefficients for Q,R matrices.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ARMSLab/slmpc/issues/2#issuecomment-482774885, or mute the thread https://github.com/notifications/unsubscribe-auth/AX0HCqQ8A10yE7D9wjXSEe5mzg0j3HQuks5vgVuwgaJpZM4cozaF .

spdiwan commented 5 years ago

I have checked by varying the parameters but not showing any output.... Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 10:05 AM Prof. Supriya Diwan < supriya.diwan@walchandsangli.ac.in> wrote:

My system is rotary inverted pendulum system, the system dynamic equation is checked . System is highly nonlinear and due to this i have taken jacobian. System has four states rotary arm angle is first state, pendulum angle is second and their velocities are other two. I have checked this system for linear MPC by considering the steady states as [0 0 0 0]. its working fine. I have to use NMPC to control it. I have checked it using ACADO toolbox. its giving good output. Thats why I am confused about your code. I would like to see how it will be worked in successive linearized manner. I would like to see difference in NMPC and slmpc. Initially its in [3 10 0 0]degree position and then it will be [0 0 0 0]. Whether my assigning are wrong in your program? (predictive matrices,Q,R, etc.)

Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 9:53 AM bexultanrakhim notifications@github.com wrote:

Hi, I checked your code. System you are trying to control is extremely unstable or possibly uncontrollable. For example, small deviation for any initial state (except state 1 ) leads to instability. Could you check if your system dynamics are correct? I would suggest you to try to solve Ocp first and see if it is possible to stabilize the system. If your system dynamics equations are correct, then I would suggest you to:

  1. Change the sampling time. If your system has natural frequency much higher than sampling frequency it would be problematic to control.
  2. Change Horizon length np. Increasing the horizon length often solves the problem.
  3. Try to tune the coefficients for Q,R matrices.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ARMSLab/slmpc/issues/2#issuecomment-482774885, or mute the thread https://github.com/notifications/unsubscribe-auth/AX0HCqQ8A10yE7D9wjXSEe5mzg0j3HQuks5vgVuwgaJpZM4cozaF .

spdiwan commented 5 years ago

Hi, Have you checked the responce? Is your code is working?

Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 2:00 PM Prof. Supriya Diwan < supriya.diwan@walchandsangli.ac.in> wrote:

I have checked by varying the parameters but not showing any output.... Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 10:05 AM Prof. Supriya Diwan < supriya.diwan@walchandsangli.ac.in> wrote:

My system is rotary inverted pendulum system, the system dynamic equation is checked . System is highly nonlinear and due to this i have taken jacobian. System has four states rotary arm angle is first state, pendulum angle is second and their velocities are other two. I have checked this system for linear MPC by considering the steady states as [0 0 0 0]. its working fine. I have to use NMPC to control it. I have checked it using ACADO toolbox. its giving good output. Thats why I am confused about your code. I would like to see how it will be worked in successive linearized manner. I would like to see difference in NMPC and slmpc. Initially its in [3 10 0 0]degree position and then it will be [0 0 0 0]. Whether my assigning are wrong in your program? (predictive matrices,Q,R, etc.)

Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 13, 2019 at 9:53 AM bexultanrakhim notifications@github.com wrote:

Hi, I checked your code. System you are trying to control is extremely unstable or possibly uncontrollable. For example, small deviation for any initial state (except state 1 ) leads to instability. Could you check if your system dynamics are correct? I would suggest you to try to solve Ocp first and see if it is possible to stabilize the system. If your system dynamics equations are correct, then I would suggest you to:

  1. Change the sampling time. If your system has natural frequency much higher than sampling frequency it would be problematic to control.
  2. Change Horizon length np. Increasing the horizon length often solves the problem.
  3. Try to tune the coefficients for Q,R matrices.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ARMSLab/slmpc/issues/2#issuecomment-482774885, or mute the thread https://github.com/notifications/unsubscribe-auth/AX0HCqQ8A10yE7D9wjXSEe5mzg0j3HQuks5vgVuwgaJpZM4cozaF .

olzhas commented 5 years ago

@spdiwan I think @bexultanrakhim answered the questions via email.

spdiwan commented 5 years ago

Thank you for your response

Best Regards,

Supriya P. Diwan (+91 9822591274) Ph.D. Research Scholar (QIP) Walchand College of Engineering, Sangli-416415 Maharashtra, INDIA

On Sat, Apr 20, 2019 at 4:51 PM Olzhas Adiyatov notifications@github.com wrote:

Closed #2 https://github.com/ARMSLab/slmpc/issues/2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ARMSLab/slmpc/issues/2#event-2289461237, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6QOCXPY5VGZUU57G33B2DPRL4CFANCNFSM4HFDG2CQ .