Master's Thesis · Multibody Simulation · Mobile Robotics

Mathematical Model of a Vacuum Cleaner Robot in Simscape Multibody

MATLAB Simulink Simscape Multibody Stateflow Contact modelling Differential drive Inverse kinematics

Recorded in the Simscape Mechanics Explorer. The suction mouth hits the step first and lifts the front. Then the spring-loaded drive wheels reach the edge and pull the robot up.

The robot model drops off the obstacle. The spring pushes the drive wheels back down to the floor.

ThesisDetermining physical relationships and building mathematical models in robotic systems. Master's in Mechatronics Engineering, University of Applied Sciences Kaiserslautern, 2022
Reference robotA commercial D-shaped differential-drive vacuum robot
ToolsMATLAB, Simulink, Simscape Multibody, Simscape Multibody Contact Forces Library, Stateflow
Model envelopeD-shaped body, 36 * 35 * 10 cm, all key dimensions set from one parameter mask
Drive unitsLeading, trailing and telescopic suspension as switchable variants, 470 N/m spring with 5 cm free length
Solverode23t (the contact model is stiff)
ValidationMaximum climbable obstacle height, simulation against the real robot

Overview

Physical tests on a vacuum robot are slow. Every change to the wheel position, spring or centre of gravity means a new prototype and a new test series. My thesis built a simulation model that answers these questions first, so fewer physical tests are needed.

  • Theory. Kinematic and Lagrange dynamic equations of a differential-drive mobile robot.
  • Model. A Simscape Multibody model of the robot with drive units, suspension, caster wheels, suction mouth and a wet-cleaning module.
  • Contacts and friction. Using spatial contact force library and friction coefficient I measured on the real wheel, the contact forces between wheels, floor and obstacl are modelled .
  • Fidelity check. The obstacle-climbing limit of the model compared with the measured limit of the real robot.
  • Driving. Inverse kinematics of the differential drive in a Stateflow chart, which steers the model through a list of waypoints.

Differential-drive kinematics

The robot has two driven wheels with radius R on one axle, track width L apart. It cannot slide sideways, and each wheel rolls without slip. The forward and angular velocity of the robot then follow from the two wheel speeds φ̇r and φ̇l:

v = R · (φ̇_r + φ̇_l) / 2    ω = R · (φ̇_r − φ̇_l) / L
ẋ = v · cos θ    ẏ = v · sin θ    θ̇ = ω

To drive the model I need the inverse. A controller asks for v and ω, and each wheel gets its own speed:

φ̇_r = (v + ω · L / 2) / R    φ̇_l = (v − ω · L / 2) / R

The thesis also derives the Lagrange dynamic model, M(q)·q̈ + V(q, q̇)·q̇ = B·τ. In the simulation, Simscape Multibody builds and solves these equations itself. The derivation was there to understand what the solver does and which parameters matter.

Simulink Differential Drive Kinematics subsystem with linear velocity, angular velocity and track width inputs and right and left wheel speed outputs, two slider controls for the velocities, and the inside of the subsystem built from a product, sum and gain blocks with gain 1 over the wheel radius
The inverse kinematics in Simulink. Sliders set v and ω, and the subsystem below turns them into the right and left wheel speeds.

Contacts and friction

Whether the robot climbs a step or gets stuck is decided almost entirely by contact forces. The model uses penalty-based contacts. Two bodies may overlap slightly, and a spring-damper pushes them apart.

  • Wheels to floor. Sphere-to-plane contacts from the Simscape Multibody Contact Forces Library for the drive wheels, caster wheels, base plate and suction mouth. Each contact outputs normal and friction force on a bus, logged for every run.
  • Robot to obstacle. Spatial Contact Force blocks between the obstacle and the body, wheels, casters and suction mouth. These blocks use the full part geometry, which matters for the curved suction mouth that lifts the robot.
  • Stiffness and damping. Stiffness follows from the allowed penetration, k = m · g / d. Damping starts one to two orders of magnitude below stiffness and is tuned from there. Too high, and the solver slows down. Too low, and parts sink into each other.
  • Friction law. The Spatial Contact Force block blends static and dynamic friction around a critical velocity. Below it, the effective coefficient is the static value. Above it, the coefficient falls towards the dynamic value.

Measuring the wheel friction

Friction coefficients are not standard values. They depend on the material pair, so I measured this wheel on wood. I placed a 60.8 g drive wheel on a wooden board and raised one end until the wheel started to slide. At that angle θ, the static friction coefficient is μs = tan θ.

F_friction = F_g · sin θ    F_normal = F_g · cos θ    μ_s = tan θ
15 trials:  θ = 45.3° to 49.1°  →  μ_s = 1.01 to 1.16

These values go straight into the floor contacts. The kinetic coefficient is set below the static one, and both are mask parameters, so other floors can be simulated by changing two numbers.

Making the model reusable

  • One parameter mask. Body and wheel dimensions, track width, component positions, centre of gravity, floor and obstacle friction, and suspension lever length and angle. Values come from the mask or from a script, so a test series can be reset in one step.
  • Variant subsystems. The three suspension types sit in one variant subsystem and share one Simscape bus interface, so switching does not break any wiring. The wet module switches between spinning pads and a roller from the same mask.
  • Solver choice. I used the Simulink Solver Profiler to find the states that slowed the run. The stiff contacts made ode23t the right solver.
  • Limits. I also started a bristle-roller model with proxy contacts placed along a helix. Its forces did not yet match the measured values, so I kept it out of the validation.
Top level of the Simulink model: wheel speed inputs and a drive input feed the Physical Model of robot block, with a position and pose measurement block on its robot frame output. Links above the model switch robot shape, wet module, suspension type and grid, and comment in or out the bristle roller, side brush and obstacle.
Top level of the model. The links above it switch the robot shape, wet module and suspension type, and turn the bristle roller, side brush and obstacle on or off.
Block Parameters dialog of the Physical Model of robot block, with collapsible groups for shape, floor and body dimensions, wheel and caster parameters, bristle roller, wet module, side brush, suspension and friction Expanded Wheel Parameters and Caster Wheel groups of the mask, with wheel thickness, radius, offset, track width and caster positions set from workspace variables
The parameter mask. Left, all parameter groups. Right, the wheel and caster groups opened, with values taken from workspace variables.
Transparent view of the D-shaped robot model with the wet module set to two spinning pads Transparent view of the same robot model with the wet module set to a single cleaning roller across the body
The two wet-module variants, chosen from the same mask. Left, spinning pads. Right, a cleaning roller.
Robot model in the Mechanics Explorer with centre-of-mass markers on the body, drive wheels, suspension parts and caster
Centre-of-mass markers in the Mechanics Explorer, one for each body of the model.

Fidelity check: climbing an obstacle

The real robot had already been tested on steps of increasing height. It climbs 19 mm, needs several attempts above 15 mm, and gets stuck above 19 mm. I rebuilt this test in the model with a rectangular obstacle, a 3 mm edge fillet as in the test standard, and the obstacle height and approach angle as script parameters.

  • The suction mouth hits the edge first. Its front radius lifts the body, so the mouth height sets the upper limit of what the robot can climb.
  • The drive wheels then reach the edge. The suspension spring presses them down, and the friction coefficient decides whether they grip or spin.
  • With too little momentum the robot stops at the edge, even at maximum friction.
  • On the way down, the spring pushes the wheels to the floor and the body oscillates briefly. The settling time can be read from the logged data.
TestSuspensionMax. obstacle height
Real robotLeading link19 mm
SimulationLeading link19 mm
SimulationTrailing link20.5 mm

With the same suspension as the real robot, the model reaches the same 19 mm limit. The trailing-link variant gives the wheels more traction force and climbs 20.5 mm in the model. That is a design change the model can rank before anyone builds it.

I also modelled a braking test. A short-circuited motor becomes a sudden zero wheel speed, and counter-braking becomes a reversed speed for a set time. The model stopped in 7.8 mm and 7.19 mm on wood. The physical test had measured 13 mm and 10 mm on cork. With different floors and an estimated centre of gravity, this was a trend check, not a validation.

Waypoint following with Stateflow

Moving sliders for v and ω by hand is a poor way to test a model. So I added a simple posture controller that drives the multibody robot through a list of waypoints.

  • A Transform Sensor between world frame and robot frame gives the current pose (x, y, θ).
  • A Stateflow chart holds the current goal. Its MATLAB function trackGoal computes the distance to the goal, √((x_g − x)² + (y_g − y)²).
  • The chart outputs the angular velocity ω needed to reach the goal. The forward speed v is fixed at 0.3 m/s.
  • Saturation blocks limit v and ω to what the real motors can deliver, and the inverse kinematics above turns them into wheel speeds.
  • When the robot is close enough to a waypoint, the chart moves to the next one. The waypoints come from a parameter script and are shown as coloured discs.
Simulink subsystem with pose and waypoints inputs feeding the Waypoint Tracking Logic chart, whose v and w outputs pass through saturation blocks. Below, the Stateflow chart with a FollowWaypoints state, a proportional angle controller with a dead band, transitions to the next waypoint, a ReachedGoal state and the trackGoal MATLAB function.
The waypoint tracking subsystem (top) and its Stateflow chart (bottom). The chart steers towards the current goal, moves to the next waypoint once it is close enough, and stops at the last one.

The robot model drives the waypoint course under the Stateflow controller, with full contact and friction dynamics.