STATERA Library · Series 04 · Volume 03 · Chapter 07 · EN
Parent Index: PAI-SG Library — 04 Quadruped [EN]
Other-language Index: PAI-SG Library — 04 Quadruped [KR]
Source: https://github.com/Statera-Library/04_Vol_03_Locomotion_Balance_and_Motion_Control/blob/main/Chapter_07_MPC_Control/Chapter_07_MPC_Control_EN.md
Volume 03. Locomotion Balance and Motion Control
07. MPC Control
07.01 MPC Overview
Model Predictive Control (MPC) is an advanced control methodology that enables quadruped robots to anticipate future dynamic behavior and determine appropriate control actions through mathematical optimization. Unlike conventional feedback controllers that primarily respond to current tracking errors, MPC predicts the evolution of robot states over a finite time horizon while considering physical constraints, environmental conditions, and locomotion objectives.
The fundamental principle of MPC is receding horizon control. At each control cycle, the controller obtains the current robot state, predicts future motion, and calculates an optimal sequence of control inputs. Only the first control input is applied before the optimization process is repeated using updated state measurements. This continuous recalculation allows the robot to adapt to changing ground conditions, external disturbances, and unexpected motion deviations.
In quadruped locomotion, MPC provides a systematic framework for coordinating body motion, leg movements, and ground reaction forces. The controller evaluates how different force distributions and contact configurations influence the position, orientation, and velocity of the robot body. By predicting these interactions, MPC can maintain dynamic balance during walking, trotting, running, stair climbing, and locomotion across irregular industrial terrain.
State-space modeling establishes the mathematical foundation of MPC. The robot state typically includes body position, orientation, linear velocity, angular velocity, and other relevant dynamic variables. Control inputs may include ground reaction forces, joint torques, or desired accelerations. Depending on computational requirements, the prediction model may employ simplified centroidal dynamics, single rigid body dynamics, or more comprehensive multibody representations.
The prediction horizon determines how far into the future the controller evaluates robot behavior. A longer horizon enables anticipation of upcoming contact transitions, terrain changes, and potential stability problems, whereas a shorter horizon reduces computational complexity and improves responsiveness. Appropriate horizon selection requires balancing prediction accuracy, locomotion speed, gait characteristics, environmental uncertainty, and available computing resources.
The cost function defines the objectives that MPC attempts to achieve during optimization. Typical objectives include minimizing body position errors, orientation deviations, velocity tracking errors, excessive contact forces, and unnecessary control variations. Additional terms may penalize energy consumption, aggressive body acceleration, or undesirable foot placement. Weighting factors establish the relative importance of competing locomotion objectives.
Constraint handling represents one of the most important advantages of MPC. Quadruped robots operate under physical limitations involving actuator torque, joint movement, ground friction, contact force magnitude, and mechanical reachability. MPC incorporates these limitations directly into the optimization problem, helping prevent dynamically infeasible commands. However, reliable constraint enforcement depends on model accuracy, state estimation quality, and solver feasibility.
Center of Mass (CoM) MPC focuses on predicting and regulating the translational and rotational behavior of the robot body through coordinated ground reaction forces. By considering the location of supporting feet and the resulting moments around the center of mass, the controller determines suitable force distributions. This approach is particularly effective for maintaining body stability during dynamic gait transitions, acceleration, deceleration, and disturbance rejection.
Footstep MPC extends predictive optimization to the selection or adjustment of future foot placement locations. Rather than relying exclusively on predetermined gait trajectories, the controller can evaluate alternative footholds according to stability, reachability, terrain geometry, and expected contact conditions. Depending on the formulation, contact timing may also be optimized, allowing the robot to respond more effectively to disturbances and environmental changes.
Terrain-aware MPC integrates environmental perception into predictive locomotion control. Information obtained from LiDAR, depth cameras, inertial sensors, and terrain estimation algorithms can describe surface elevation, inclination, roughness, and potential contact uncertainty. The controller uses this information to modify body trajectories, contact forces, and foothold constraints, improving locomotion adaptability across stairs, slopes, gravel, and uneven surfaces.
Real-time MPC requires optimization algorithms capable of producing reliable control solutions within strict execution deadlines. Linearized dynamics and quadratic programming are frequently employed to reduce computational complexity. Warm-start techniques, efficient matrix operations, and dedicated numerical solvers further improve execution performance. Predictable computation latency is essential because delayed control commands may compromise dynamic stability.
Nonlinear Model Predictive Control (NMPC) incorporates nonlinear robot dynamics directly into the prediction and optimization process. This approach can represent complex rotational behavior, configuration-dependent dynamics, and interactions between body motion and contact forces more accurately. However, nonlinear optimization generally requires greater computational resources, making solver convergence, numerical conditioning, and real-time feasibility important engineering considerations.
MPC typically operates within a hierarchical locomotion control architecture. High-level navigation provides desired motion commands, gait planners establish contact schedules, and state estimation supplies updated robot conditions. MPC generates dynamically consistent motion or contact force references, which Whole Body Control (WBC) and lower-level joint controllers translate into actuator commands while enforcing additional kinematic and dynamic requirements.
Industrial inspection applications introduce operational requirements beyond conventional locomotion performance. Quadruped robots must maintain stable sensor orientations, protect inspection payloads, minimize vibration, and regulate motion near sensitive equipment. MPC can incorporate these requirements into its optimization objectives, supporting controlled movement through narrow passages, industrial staircases, uneven facilities, and environments requiring precise inspection positioning.
Effective MPC deployment requires systematic debugging and validation. Engineers must examine prediction errors, optimization residuals, constraint violations, solver execution times, contact estimation accuracy, and discrepancies between commanded and measured motion. Simulation, hardware-in-the-loop testing, and progressively challenging field experiments help identify modeling limitations and establish appropriate fallback strategies when optimization becomes infeasible.
The overall engineering value of MPC lies in its ability to integrate predictive dynamics, motion objectives, physical constraints, and environmental information into a unified optimization framework. When combined with reliable state estimation, terrain perception, whole body control, and independent safety mechanisms, MPC establishes a scalable foundation for adaptive, energy-conscious, and dynamically stable quadruped locomotion in demanding industrial inspection environments.
07.02 State Space Modeling
State-space modeling provides the mathematical foundation for Model Predictive Control (MPC) in quadruped robots by representing the relationship between robot states, control inputs, and dynamic evolution. Instead of describing individual mechanical components independently, the state-space formulation organizes the relevant physical variables into a unified mathematical representation that supports future motion prediction, optimization, and feedback control.
A state vector represents the physical condition of the quadruped robot at a particular instant. Typical state variables include body position, body orientation, linear velocity, angular velocity, and gravitational acceleration when incorporated into an augmented model. More comprehensive formulations may include joint positions, joint velocities, actuator states, and contact-related variables. State selection depends on the control objectives and required prediction accuracy.
The control input vector defines the variables that the MPC algorithm can manipulate to influence future robot behavior. In simplified quadruped locomotion models, control inputs commonly consist of three-dimensional ground reaction forces generated by each supporting foot. Alternative formulations may use joint torques, desired body accelerations, or foot placement adjustments. These inputs must remain consistent with actuator capabilities and physical contact conditions.
The continuous-time state-space representation describes the rate of change of robot states as a function of current states, control inputs, and external disturbances. Nonlinear formulations capture complex interactions between translational motion, rotational dynamics, and environmental contact. Linear or linearized representations approximate these relationships around selected operating conditions, enabling more computationally efficient optimization during real-time locomotion.
Single Rigid Body Dynamics (SRBD) is widely used in quadruped MPC because it reduces computational complexity while retaining essential body motion characteristics. The robot is approximated as a rigid body with concentrated mass and rotational inertia, while leg dynamics are simplified or neglected. Ground reaction forces generated at individual contact points determine the translational acceleration and rotational acceleration of the body according to Newton-Euler dynamics.
Centroidal dynamics provides another important modeling approach by describing the evolution of linear and angular momentum around the robot\'s center of mass. The total external force determines the rate of change of linear momentum, while external moments determine the rate of change of angular momentum. This representation supports coordinated force distribution among multiple supporting legs without requiring the complete prediction of individual joint trajectories.
Rotational dynamics requires particular attention because body orientation directly influences locomotion stability, foot reachability, and inspection sensor alignment. Euler angles provide an intuitive representation but introduce singularities and nonlinear transformation relationships. Rotation matrices and quaternions offer alternative representations for complex body motion, although their integration into optimization requires appropriate mathematical treatment.
Contact modeling introduces time-dependent relationships between robot dynamics and supporting surfaces. During stance phases, supporting feet generate ground reaction forces that influence body acceleration and angular momentum. During swing phases, the corresponding contact forces must remain zero. The contact schedule therefore determines which control inputs are available at each prediction step, producing a switched or time-varying dynamic system.
Ground contact forces must satisfy unilateral contact conditions and friction limitations. The normal component of each contact force must remain nonnegative, while tangential components must remain within the friction cone defined by the estimated surface friction coefficient. Linearized friction pyramids are frequently employed in MPC to simplify constraint handling while preserving an approximation of physically feasible force distributions.
State-space discretization converts continuous-time robot dynamics into a sequence of discrete prediction steps suitable for numerical optimization. Common discretization methods include forward Euler integration, higher-order numerical integration, and exact discretization for applicable linear models. The selected sampling interval influences numerical accuracy, prediction resolution, optimization problem size, and the computational workload of the real-time controller.
Linearization approximates nonlinear robot dynamics around a reference state, nominal trajectory, or current operating condition. The resulting state transition and input matrices describe how small variations in states and control inputs influence future motion. Updating these matrices as the robot changes orientation, velocity, or contact configuration improves prediction consistency and supports linear time-varying MPC across different locomotion conditions.
The discrete state-space model is repeatedly propagated across the prediction horizon to estimate future body trajectories and dynamic responses. Each predicted state depends on the preceding state, the corresponding control input, and the modeled environmental interactions. Stacking these relationships into a consolidated prediction formulation enables the optimization solver to evaluate multiple future control decisions within a unified computational framework.
State estimation establishes the connection between the mathematical prediction model and the physical robot. Inertial Measurement Units (IMUs), joint encoders, contact sensors, and visual or LiDAR-based odometry provide complementary measurements of robot motion. Sensor fusion algorithms estimate body position, orientation, velocity, and contact conditions, supplying consistent initial states for each MPC optimization cycle despite measurement noise and sensor uncertainty.
Model parameter identification and uncertainty management are essential for maintaining prediction accuracy under practical operating conditions. Robot mass, center of mass location, inertia tensors, payload distribution, and ground friction may differ from nominal design assumptions. External disturbances, actuator limitations, and unmodeled leg dynamics introduce additional discrepancies that must be addressed through feedback, parameter adaptation, or robust control formulations.
For industrial inspection quadrupeds, state-space modeling must accommodate changing payload configurations, irregular terrain, stair geometry, and inspection-specific motion requirements. Model fidelity should be selected according to operational complexity and available computational resources rather than mathematical completeness alone. A validated state-space representation provides the foundation for prediction horizon design, cost function optimization, constraint handling, and reliable integration with Whole Body Control.
07.03 Prediction Horizon
The prediction horizon is a fundamental design parameter in Model Predictive Control (MPC) that determines how far into the future a quadruped robot evaluates its dynamic behavior before selecting control actions. By anticipating future states, contact transitions, and environmental interactions, the controller can generate coordinated locomotion commands that balance immediate motion requirements with future stability and operational constraints.
The prediction horizon is generally represented by a finite sequence of discrete time steps over which the robot dynamics are propagated. Its total duration is determined by multiplying the number of prediction steps by the prediction sampling interval when uniform discretization is used. These two parameters jointly influence prediction accuracy, temporal resolution, optimization complexity, and the ability to anticipate upcoming locomotion events.
Receding horizon control continuously updates the prediction process as the robot moves through its environment. At each optimization cycle, the controller initializes the prediction model using the latest estimated robot state and calculates a sequence of future control inputs. Only the first control action is implemented, while the remaining sequence is recalculated during subsequent cycles to accommodate new measurements and disturbances.
A short prediction horizon reduces the number of optimization variables and generally improves computational responsiveness. This configuration is particularly useful when rapid feedback is required or when available processing resources are limited. However, an excessively short horizon may prevent the controller from anticipating future contact transitions, insufficient braking distances, unfavorable body configurations, and emerging stability problems.
A long prediction horizon allows the controller to evaluate the consequences of current control decisions across multiple future locomotion phases. This capability supports anticipatory acceleration, deceleration, body orientation adjustment, and contact force redistribution. Nevertheless, increasing the horizon also increases computational requirements and may amplify prediction errors caused by uncertain terrain conditions and imperfect dynamic models.
Gait characteristics strongly influence the appropriate prediction horizon for quadruped locomotion. Walking involves relatively slow contact transitions and extended support phases, whereas trotting introduces more frequent changes between diagonal supporting legs. Running may include flight phases during which ground reaction forces cannot be generated. The horizon should therefore capture sufficient contact events to support dynamically meaningful decisions.
Contact schedule prediction enables MPC to anticipate which legs will support the robot at each future time step. By incorporating scheduled stance and swing phases into the prediction model, the controller can calculate appropriate ground reaction forces before contact transitions occur. Accurate contact scheduling is particularly important when the robot changes gait, crosses obstacles, or encounters unexpected differences between planned and actual touchdown timing.
The prediction horizon also influences center of mass trajectory planning. During dynamic locomotion, the center of mass must follow a trajectory consistent with available contact forces, supporting foot locations, and body momentum. A sufficiently informative horizon allows the controller to anticipate changes in support configuration and redistribute forces before instability develops, rather than relying exclusively on corrective actions after disturbances occur.
Terrain-aware prediction extends the horizon design beyond conventional robot dynamics by incorporating information about upcoming ground geometry. Elevation maps, surface inclination estimates, obstacle boundaries, and potential foothold locations provide environmental references for future prediction steps. The useful prediction distance must remain consistent with perception coverage, localization accuracy, and confidence in the estimated terrain properties.
Prediction sampling intervals determine the temporal resolution of the optimization model. Smaller intervals improve the representation of rapid dynamic changes but increase the number of prediction steps required for a given horizon duration. Larger intervals reduce computational complexity but may inadequately represent short contact phases and abrupt force transitions. Nonuniform discretization can provide finer resolution near the current state.
The prediction horizon and control horizon are related but conceptually distinct parameters. The prediction horizon specifies how far future robot states are evaluated, while the control horizon determines the number of independently optimized control decisions. Control input parameterization or move-blocking techniques can reduce the number of decision variables while retaining a longer prediction horizon, although excessive simplification may reduce control flexibility.
Terminal costs and terminal constraints influence the behavior of the predicted robot state at the end of the horizon. Without appropriate terminal treatment, the optimizer may select actions that appear beneficial within the prediction interval but create unfavorable conditions immediately afterward. Terminal penalties, feasible terminal regions, and suitable reference trajectories can improve long-term behavior and support formal stability guarantees under appropriate assumptions.
Adaptive prediction horizon strategies modify the horizon duration or discretization according to locomotion speed, gait frequency, terrain complexity, and computational availability. A robot approaching an industrial staircase may require greater anticipation of future footholds, while rapid disturbance recovery may prioritize faster optimization updates. Such adaptation must preserve numerical consistency, solution feasibility, and predictable execution timing.
Real-time implementation requires balancing horizon length against solver execution deadlines. Engineers should evaluate average computation time, worst-case latency, optimization convergence, and missed control cycles under representative operating conditions. Warm-start initialization, sparse optimization, efficient numerical solvers, and simplified dynamic models can support longer horizons without unnecessarily compromising controller responsiveness.
Prediction uncertainty generally increases as the horizon extends further into the future. Errors in estimated friction, payload distribution, contact timing, and external disturbances can progressively reduce prediction reliability. Robust MPC, uncertainty-dependent constraint tightening, and conservative terrain assumptions can mitigate these effects, while continuous state feedback corrects discrepancies between predicted and measured robot behavior.
For industrial inspection quadrupeds, prediction horizon validation should include walking, trotting, stair climbing, slope traversal, obstacle crossing, and precision positioning under representative payload conditions. The appropriate horizon should be established through simulation and field testing rather than a universal numerical specification. Horizon selection ultimately balances anticipatory control, physical feasibility, computational efficiency, and operational safety.
07.04 Cost Function Design
Cost function design is a fundamental component of Model Predictive Control (MPC) that determines how a quadruped robot evaluates alternative future motion trajectories and control inputs. Within the prediction horizon, the cost function assigns numerical penalties to undesirable states, tracking errors, and control behaviors. The optimization algorithm then identifies a feasible control sequence that minimizes the accumulated cost while satisfying specified physical and operational constraints.
A typical MPC cost function combines state tracking penalties, control input penalties, and terminal state penalties. State tracking terms measure deviations between predicted robot states and desired reference trajectories, while control input terms regulate the magnitude and variation of applied forces or torques. Terminal penalties evaluate the predicted condition at the end of the horizon, encouraging behavior that remains compatible with subsequent locomotion requirements.
State tracking objectives commonly include body position, orientation, linear velocity, and angular velocity. Accurate position tracking is particularly important during precision walking and inspection positioning, whereas velocity tracking becomes more significant during continuous locomotion. Orientation penalties help maintain appropriate body alignment, reducing excessive roll, pitch, and yaw deviations that could compromise stability, sensor performance, or mechanical clearance.
Center of Mass (CoM) tracking represents an important objective in quadruped MPC because the relationship between body mass distribution and supporting contact locations directly influences dynamic balance. The cost function can penalize deviations from desired center of mass trajectories, excessive vertical displacement, and undesirable lateral oscillations. Appropriate weighting encourages smooth body motion while allowing necessary adjustments during contact transitions.
Ground reaction force regularization prevents the optimizer from generating unnecessarily large or rapidly changing contact forces. By penalizing force magnitude and deviations from nominal force distributions, the controller can encourage efficient load sharing among supporting legs. However, excessive force penalties may reduce acceleration capability or disturbance rejection performance, requiring careful coordination between motion tracking objectives and force regulation.
Control input variation penalties improve locomotion smoothness by discouraging abrupt changes between consecutive control commands. Rapid force transitions can increase mechanical vibration, actuator loading, electrical current peaks, and tracking difficulties in lower-level controllers. Penalizing these variations helps produce smoother contact force trajectories, particularly during slow inspection movements, gait transitions, and operation on sensitive industrial surfaces.
Foot placement objectives can be incorporated into MPC formulations that explicitly optimize future foothold locations. The cost function may penalize deviations from nominal foot positions, excessive step lengths, asymmetric leg configurations, and proximity to undesirable terrain regions. These objectives support coordinated gait execution while preserving sufficient flexibility for obstacle avoidance, balance recovery, and adaptation to irregular supporting surfaces.
Energy-related cost terms encourage locomotion strategies that reduce unnecessary mechanical effort and electrical power consumption. Simplified formulations often penalize squared contact forces or joint torques as computationally efficient proxies for energy expenditure. More detailed models may incorporate joint velocity, mechanical power, actuator efficiency, and regenerative braking characteristics to better represent actual energy consumption during industrial missions.
Weighting matrices determine the relative importance of individual cost function components. Higher weights generally increase the optimizer\'s preference for minimizing the corresponding errors, while lower weights permit greater flexibility in satisfying competing objectives. Because position, velocity, orientation, and force variables have different physical units and numerical scales, normalization is essential for achieving meaningful weighting relationships and reliable numerical conditioning.
Quadratic cost functions are frequently employed in linear and linearized MPC because they support efficient quadratic programming formulations. Positive semidefinite state weighting matrices and positive definite control weighting matrices are common design choices that help establish convex optimization properties under suitable model assumptions. Nonlinear or nonquadratic penalties may provide greater modeling flexibility but can introduce additional computational complexity.
Terminal cost design addresses the limited duration of the prediction horizon by evaluating the desirability of the final predicted state. A properly selected terminal penalty encourages the robot to finish the horizon in a condition compatible with continued stable locomotion. Terminal weights may be derived from local optimal control formulations, reference trajectory requirements, or experimentally validated stability considerations, depending on the underlying MPC architecture.
Soft constraint penalties allow selected operational requirements to be relaxed when strict enforcement would make the optimization problem infeasible. Slack variables represent the magnitude of permitted violations and receive appropriate penalties within the cost function. This approach can improve controller availability during unexpected disturbances, although critical physical and safety constraints must not be treated as ordinary adjustable preferences without independent protection mechanisms.
Terrain-aware cost functions incorporate environmental characteristics into locomotion optimization. Penalties associated with surface roughness, uncertain footholds, excessive body inclination, and estimated slip risk can guide the controller toward more reliable motion strategies. Such penalties should reflect the confidence of terrain perception and friction estimation, preventing uncertain environmental information from producing unnecessarily aggressive or overly conservative control behavior.
Adaptive cost weighting enables MPC to modify locomotion priorities according to operating conditions. During precision inspection, body stability and sensor alignment may receive greater emphasis, while high-speed trotting may prioritize velocity tracking and dynamic balance. Stair climbing and slippery terrain may require stronger penalties on unfavorable body configurations or risky contact forces. Weight transitions should remain smooth to avoid discontinuous control behavior.
Cost function tuning requires systematic evaluation of interactions between competing objectives. Engineers should examine tracking errors, body oscillation, contact force distribution, actuator saturation, energy consumption, and optimization convergence across representative operating scenarios. Sensitivity analysis, parameter sweeps, simulation, and controlled hardware experiments can identify weighting configurations that provide acceptable performance without excessive computational or mechanical demands.
For industrial inspection quadrupeds, effective cost function design must balance locomotion accuracy, dynamic stability, energy efficiency, mechanical durability, inspection data quality, and operational safety. No universal weighting configuration is suitable for every robot or terrain condition. A validated cost function should therefore reflect platform-specific dynamics, payload characteristics, mission requirements, and the capabilities of the integrated Whole Body Control architecture.
07.05 Constraint Handling
Constraint handling is a fundamental capability of Model Predictive Control (MPC) that enables quadruped robots to generate motion commands consistent with physical limitations, environmental conditions, and operational requirements. By incorporating constraints directly into the optimization problem, MPC evaluates not only the desirability of predicted motion trajectories but also their feasibility within the mechanical and dynamic capabilities of the robot.
Constraints in quadruped locomotion can generally be classified into state constraints, control input constraints, contact constraints, and environmental constraints. State constraints restrict allowable robot configurations and motion characteristics, while control input constraints define permissible forces, torques, and accelerations. Contact and environmental constraints describe the physical conditions governing interactions between the robot and its supporting surfaces.
Hard constraints represent requirements that must be satisfied by every feasible optimization solution. Typical examples include maximum actuator torque, mechanical joint limits, unilateral ground contact conditions, and prohibited collision regions. Violating these constraints may produce physically unrealizable commands or unacceptable operational risks. Consequently, hard constraints must be formulated consistently with the actual capabilities and limitations of the robotic platform.
Soft constraints represent requirements that may be temporarily relaxed under explicitly defined conditions. Tracking accuracy, preferred body height, nominal foot placement, and desired orientation can often be formulated as soft constraints. Slack variables quantify permitted violations and introduce corresponding penalties into the cost function. This approach improves optimization feasibility while maintaining pressure toward the desired operating conditions.
Ground reaction force constraints are essential for maintaining physically consistent contact interactions. Supporting feet can generally exert compressive forces against the ground but cannot generate tensile forces without specialized adhesion mechanisms. The normal component of each contact force must therefore remain nonnegative. Upper force limits may also be introduced to protect mechanical structures, actuators, and vulnerable supporting surfaces.
Friction constraints prevent the optimizer from requesting tangential contact forces that exceed the estimated traction capability of the supporting surface. The friction cone defines the relationship between normal and tangential contact forces according to the surface friction coefficient. Linearized friction pyramids provide computationally efficient approximations for quadratic programming, while conservative friction estimates help reduce unexpected slipping.
Contact schedule constraints determine which legs are permitted to generate ground reaction forces during each prediction step. Feet in the stance phase may contribute to body support and propulsion, whereas feet in the swing phase must generate zero modeled ground reaction force. Accurate synchronization between predicted and measured contact conditions is necessary to prevent infeasible force commands during touchdown, liftoff, and unexpected contact transitions.
Actuator constraints establish the permissible operating ranges of motors, transmissions, and associated power electronics. Maximum joint torque, rotational speed, electrical current, and thermal limitations directly influence achievable locomotion performance. Because available torque may vary with motor speed, temperature, and battery voltage, fixed actuator limits should be replaced or supplemented by operating-condition-dependent constraints when necessary.
Joint position and velocity constraints prevent the robot from entering mechanically prohibited or dynamically unsuitable configurations. Excessive joint extension may reduce available motion flexibility, increase structural loading, or approach kinematic singularities. Simplified MPC formulations can approximate these restrictions through leg workspace and force limits, while Whole Body Control enforces more detailed joint-level requirements.
Foot placement constraints define feasible regions in which the robot can establish future ground contacts. These regions depend on leg reachability, body orientation, terrain geometry, obstacle boundaries, and expected support quality. During stair climbing or obstacle crossing, additional restrictions may prevent foot placement near unsupported edges, narrow gaps, or unstable surfaces that cannot reliably sustain the predicted contact forces.
Body motion constraints regulate allowable position, orientation, velocity, and acceleration throughout the prediction horizon. Limits on body roll, pitch, vertical displacement, and angular velocity help protect locomotion stability and inspection equipment. However, excessively restrictive body constraints may prevent necessary postural adjustments on slopes or irregular terrain, requiring careful coordination with gait and terrain adaptation strategies.
Collision avoidance constraints restrict predicted robot configurations to prevent undesirable contact between the body, legs, payload, and surrounding infrastructure. Industrial inspection environments frequently contain pipelines, structural supports, machinery, and confined passages. Collision constraints should account for the robot\'s physical dimensions, localization uncertainty, perception accuracy, and the clearance required during dynamic leg movements.
Constraint tightening provides additional robustness against uncertainties in dynamic models, state estimation, terrain perception, and actuator performance. Instead of operating directly at theoretical physical limits, the controller maintains predefined safety margins within the feasible operating region. These margins may be adjusted according to estimated uncertainty, although excessive tightening can unnecessarily restrict mobility and reduce optimization feasibility.
Optimization infeasibility occurs when no predicted control sequence can simultaneously satisfy all imposed constraints. Common causes include conflicting motion references, inaccurate contact schedules, excessive disturbances, and restrictive operating limits. Feasibility recovery may involve relaxing designated soft constraints, reducing commanded velocity, modifying future footholds, or activating a separately validated fallback controller appropriate to the current contact configuration.
Real-time constraint handling requires efficient mathematical formulations and reliable numerical solvers. Linear equality and inequality constraints are commonly employed in linear MPC, whereas nonlinear MPC can represent more complex dynamic and geometric restrictions. Engineers must evaluate solver convergence, constraint residuals, numerical tolerances, and execution deadlines because a mathematically feasible solution is useful only when delivered within the required control period.
For industrial inspection quadrupeds, constraint validation should examine friction margins, actuator saturation, joint limits, collision clearance, contact consistency, and recovery behavior under representative payload and terrain conditions. Constraint definitions must remain traceable to verified physical specifications and operational requirements. Effective constraint handling supports reliable predictive locomotion, but independent safety supervision remains necessary to address model errors and unexpected field conditions.
07.06 CoM MPC
Center of Mass Model Predictive Control (CoM MPC) is a predictive locomotion control methodology that regulates the translational and rotational behavior of a quadruped robot through coordinated ground reaction forces. By predicting the evolution of the center of mass and body momentum over a finite time horizon, the controller determines physically feasible control actions that support dynamic balance, trajectory tracking, and stable locomotion.
The center of mass represents the weighted average position of the entire robot\'s mass distribution, including the body, legs, actuators, batteries, and inspection payloads. Its position relative to supporting contact points strongly influences locomotion stability and force distribution. During dynamic locomotion, the controller must consider not only the center of mass position but also its velocity, acceleration, and associated angular momentum.
CoM MPC commonly employs simplified centroidal dynamics or Single Rigid Body Dynamics (SRBD) to describe the relationship between ground reaction forces and body motion. The combined external forces determine the translational acceleration of the center of mass, while moments generated around the center of mass influence angular momentum. These simplified representations reduce computational complexity while preserving essential locomotion dynamics.
The state vector in CoM MPC typically includes center of mass position, linear velocity, body orientation, and angular velocity or angular momentum. The control input vector generally consists of three-dimensional ground reaction forces associated with individual supporting feet. The prediction model propagates these variables across the prediction horizon, allowing the optimizer to evaluate how alternative force distributions influence future body behavior.
Reference trajectory generation establishes the desired center of mass motion according to navigation commands, gait characteristics, and terrain conditions. Reference variables may include forward velocity, lateral velocity, body height, and desired orientation. Smooth reference trajectories are particularly important because abrupt changes in commanded motion can require excessive contact forces or produce dynamically infeasible body configurations.
Ground reaction force optimization determines how supporting legs collectively generate the forces and moments required to achieve desired center of mass motion. The optimizer distributes vertical forces to support the robot\'s weight and horizontal forces to accelerate, decelerate, or change direction. Coordinated force allocation also generates corrective moments that regulate body orientation and compensate for disturbances during locomotion.
Contact scheduling defines the availability of individual supporting legs throughout the prediction horizon. During walking, multiple legs may provide continuous support, whereas trotting frequently alternates between diagonal contact pairs. Running may introduce flight phases with no ground contact. CoM MPC must anticipate these transitions and generate force trajectories consistent with the changing support configuration and available control authority.
Dynamic balance regulation requires consideration of center of mass motion, contact geometry, and body momentum rather than relying exclusively on static support polygon criteria. During dynamic locomotion, the projected center of mass may temporarily move outside the support polygon without causing instability. Predictive control evaluates whether future contact forces and planned supporting configurations can maintain or recover dynamically feasible motion.
Cost function design in CoM MPC typically penalizes center of mass tracking errors, body orientation deviations, velocity errors, excessive contact forces, and rapid force variations. Appropriate weighting balances accurate motion tracking against mechanical loading, energy-related objectives, and locomotion smoothness. Inspection applications may additionally emphasize body height consistency and reduced angular oscillations to improve sensor measurement quality.
Constraint handling ensures that optimized center of mass trajectories remain compatible with physical contact conditions and robot capabilities. Ground reaction forces must satisfy unilateral contact requirements, friction limits, and maximum allowable force magnitudes. Additional constraints may regulate body height, orientation, acceleration, and leg reachability, preventing the optimizer from requesting motion that cannot be executed by the physical robot.
Terrain-aware CoM MPC adjusts desired body trajectories and contact force distributions according to environmental geometry. When traversing slopes, stairs, or uneven surfaces, the controller may modify center of mass height, body inclination, and lateral displacement to maintain feasible supporting configurations. Terrain elevation, local surface normals, estimated friction, and foothold reliability provide important inputs for predictive optimization.
Payload variation introduces significant challenges for center of mass modeling in industrial inspection quadrupeds. Additional cameras, LiDAR units, robotic manipulators, or specialized inspection instruments may alter total mass, center of mass location, and rotational inertia. Accurate payload parameter identification or online adaptation helps maintain prediction consistency and prevents inappropriate force distributions caused by outdated dynamic model assumptions.
Disturbance rejection in CoM MPC relies on repeated state estimation and predictive force redistribution. External impacts, unexpected foot slipping, and terrain irregularities can introduce deviations in center of mass velocity and body orientation. The controller evaluates corrective actions across future contact phases, although disturbances exceeding the available contact force authority may require coordinated footstep replanning or dedicated recovery control.
Integration with Whole Body Control (WBC) establishes the connection between optimized center of mass behavior and physical joint actuation. CoM MPC generates desired body motion and contact force references, while WBC calculates compatible joint accelerations and actuator torques using more detailed robot dynamics. This hierarchical architecture allows predictive optimization to remain computationally efficient while addressing joint-level constraints.
Real-time implementation requires reliable state estimation, efficient numerical optimization, and consistent communication between control layers. Engineers must evaluate prediction errors, force tracking accuracy, solver execution latency, and constraint satisfaction under representative operating conditions. Warm-start techniques, sparse optimization, and simplified dynamic models can improve computational performance without unnecessarily reducing prediction quality.
Validation of CoM MPC for industrial inspection quadrupeds should include standing stability, precision walking, dynamic trotting, stair climbing, slope traversal, payload variation, and controlled disturbance recovery. Performance indicators include center of mass tracking error, body orientation deviation, contact force consistency, energy consumption, and recovery time. Platform-specific validation establishes appropriate operating limits and supports reliable integration with footstep and terrain-aware MPC.
07.07 Footstep MPC
Source:https://dev.to/richard_minsoogo/locomotion-balance-and-motion-control-ch07-mpc-control-en-9p7
![Locomotion Balance and Motion Control — Ch.07: MPC Control [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fezjj8q29a9yvbiplpthg.png)





![Locomotion Balance and Motion Control — Ch.11: Case Studies [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvkkda1tl380kl4y7zvly.png)
![Locomotion Balance and Motion Control — Ch.12: Checklists and Templates [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnsx5xe4pqm4xo5p6kb4t.png)