Can you turn off/on manipulated variables at specific conditions in a MPC Controller?
    7 views (last 30 days)
  
       Show older comments
    
    Artem Wendler
 on 14 Jul 2022
  
    
    
    
    
    Commented: Emmanouil Tzorakoleftherakis
    
 on 25 Jan 2023
            Hello, 
im designing an adaptive MPC Controller with two manipulated variables (MV). One of them is electric power (0-2kW) and the other one is air mass flow (0-80kg/h). 
Now i need to turn off/on the second MV (air mass flow) at specific conditions. If its off, then it should be =0 and if its on, then the MPC should manipulate it within the constraints. The electric power should be manipulated the whole time.
In Simulink you can imprint the MV constraints / MV targets at specific points externally on the MPC block. For example you can say that the upper contraint should change between 0 kg/h and 80 kg/h. That works, but i feel like its not the right way.
Is there an other solution to control the MV "direct inside" the MPC, so that i can decide whether it should be manipulated or not?
Thanks
4 Comments
  Sam Chak
      
      
 on 17 Jul 2022
				Thanks for your clarification, but I still don't know your system works mathematically. I think that MPC considers the input is continuous. If the engine is the state x, then you can probably do something like this:
 ... system that is fed into the MPC
 ... system that is fed into the MPCwhere
 is the ON/OFF switching logic is passed on the system dynamics side.
 is the ON/OFF switching logic is passed on the system dynamics side.Then, your MPC can freely compute the input u without the internal constraint.
Accepted Answer
  Gianluca Mammone
 on 11 Dec 2022
        
      Edited: Gianluca Mammone
 on 11 Dec 2022
  
      Hi, I am in a similar situations as yours.
My solution was that given the linear system:
 that can be written in the from
  that can be written in the from  and
 and  ->
 ->
if i want to disable u1, i.e having   I just pass to the Adaptive MPC the model with
 I just pass to the Adaptive MPC the model with  , thus the optimal value for u1 is
 , thus the optimal value for u1 is 
 I just pass to the Adaptive MPC the model with
 I just pass to the Adaptive MPC the model with  , thus the optimal value for u1 is
 , thus the optimal value for u1 is 
Although this is a good idea, in practice Adaptive MC keeps optimizing u1 and finding nonzero optimum, I suggest to set an hard dynamic constraint on u1= 0
I'm open to better solutions tho, setting  is the most obvius approach this situation, and the fact that MPC keeps resisting  logic baffles me.
 is the most obvius approach this situation, and the fact that MPC keeps resisting  logic baffles me.
 is the most obvius approach this situation, and the fact that MPC keeps resisting  logic baffles me.
 is the most obvius approach this situation, and the fact that MPC keeps resisting  logic baffles me.EDIT: 
I just tried right now, you have to  set mixed input/output constraint, In my  example if we want to disable

 &&
  &&  ->  E = [1 ,0; -1, 0]  F= [0;0] G=[0;0] V=[0;0].
 ->  E = [1 ,0; -1, 0]  F= [0;0] G=[0;0] V=[0;0].- bear in mind that adaptive MPC requires E,F,G,V etc of fixed dimensions, you can't add constraints (i.e rows) during the simulation.
- given point 1, you might be tempted to inizialize your mpc object with constraints set to zero (E =zeros(2,2), F= [0;0] G=[0;0] V=[0;0]) to enable every Manipulated Variable. Doing so Matlab automatically deletes those empty constraints and you'll find yourself unable to add it later as online feature. Therefore, you have to initialize the constraint with every MV you plan to block already blocked (E = [1 ,0; -1, 0] ), and in your simulations ovverride it.
I hope I helped you. 
Best Regards
1 Comment
  Emmanouil Tzorakoleftherakis
    
 on 25 Jan 2023
				Another idea is to use gain-scheduled MPC and design multiple MPC controllers with different manipulated variables as needed
More Answers (0)
See Also
Categories
				Find more on Controller Creation in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


