top of page

Steering Ahead: Decoding the Strategy of Model Predictive Control ( MPC )

Updated: Jun 10, 2023

Model Predictive Control (MPC), it sounds intimidating, doesn't it? But don't worry! We're about to turn this advanced process control method into a delightful conversation that's as relatable as your daily game of chess or cooking your favorite dish. MPC, a technique well-established in industries like chemical plants and oil refineries since the 1980s, and more recently in power system balancing and power electronics, is about to become your new favorite topic!

Chess

So, what is MPC? It's like being a chess master, meticulously planning your game while keeping an eye on your opponent's moves. Or like being a seasoned chef, constantly adjusting your recipe based on the aroma wafting from your pot. MPC, essentially, uses a model of the system to predict its future behavior. It then employs an online optimization algorithm to find the best control action that aligns the predicted output with the reference, all while minimizing the cost function.

Model Predictive Control, or MPC, is a method akin to planning your moves in a chess game or adjusting your recipe while cooking. It involves predicting the future behavior of a system and optimizing actions to achieve the best outcome while keeping within certain constraints. Just as you strategize in chess or adapt in cooking, MPC constantly anticipates, plans, and adjusts - proving that the principles of Model Predictive Control are at play in every corner of our lives.

Let's break it down, piece by piece, and see how MPC works its magic:

  1. Prediction: Imagine you're in a chess game. You're predicting your opponent's moves, aren't you? That's what MPC does with system control. It uses the current state and a model of the system (the rulebook of the system's behavior) to anticipate the next move.

  2. Optimization: MPC then strategizes its best move, like a chess grandmaster. It forms an optimization problem, aiming to discover the sequence of control inputs (moves) that keeps the system as close as possible to the desired outcome, while also minimizing effort.

  3. Implementation: It's time to make a move! MPC executes the first move from the optimal sequence.

  4. Update: Just like the ripple effect after a move in chess, the system responds, and MPC takes note of the new state.

  5. Repeat: And like the rhythm of a captivating chess match, the process starts all over again for the next move.


Car drive

To get a real taste of MPC, let's jump into the driver's seat of a car maintaining a steady speed of 60 mph on a highway. Here, your foot on the gas pedal is the control input, and the car's speed is the output. MPC, acting as the cruise control system, predicts the car's future speed based on the current speed, the gas pedal pressure, and the car's dynamics. It then adjusts the gas pedal to keep the speed as close as possible to 60 mph, while avoiding sudden speed changes.


I've also cooked up a simple pseudo code that encapsulates the essence of MPC, just like a recipe for your favorite dish! This step-by-step guide, while being a simplified version of the actual MPC algorithm, captures the iterative nature of the process, emphasizing the constant prediction, optimization, and adjustment that's core to MPC.

# Gather your ingredients (define the system model, cost function, constraints, and initial state)
system_model = get_system_model()
cost_function = get_cost_function()
constraints = get_constraints()
state = get_initial_state()

# Start cooking (main MPC loop)
while True:
    # Predict how the dish will turn out based on the current state
    predicted_output = system_model.predict(state)

    # Figure out what to do to make the dish turn out as delicious as possible
    optimization_problem = figure_out_best_move(cost_function, predicted_output, constraints)

    # Do the first thing in the list of best moves
    optimal_control_input = do_best_move(optimization_problem)

    # Add the ingredient or do the cooking step
    add_ingredient_or_do_cooking_step(optimal_control_input[0])

    # Check how the dish is turning out
    state = check_how_dish_is_turning_out(state, optimal_control_input[0])

    # Repeat until the dish is ready

To give you an example, here is an implementation of MPC to control inverted pendulum in a cart: https://in.mathworks.com/matlabcentral/fileexchange/128714-control-of-inverted-pendulum-in-a-cart-using-mpc?s_tid=prof_contriblnk


So, whether you're a chess enthusiast, a home cook, or a car aficionado, remember that the principles of Model Predictive Control are all around you. It's all about thinking ahead, predicting outcomes, and making adjustments.


Cite this article as:

Kumar, Y. Steering Ahead: Decoding the Strategy of Model Predictive Control ( MPC ). https://www.spacenavigators.com/post/model-predictive-control-mpc. Accessed Jun. 10, 2023.



87 views0 comments

Comments


bottom of page