Which Layers of a Mop Robot Should Simulation Cover?
- Intermediate
- Article
- Ages 16+
- 7 min read

Simulating a mopping robot should cover four layers: the circuit, the firmware, the motion and the whole fleet. Each layer answers its own question and has its own pass criterion, such as a power rail that stays above its required limit when the pump starts or a robot that heads home when its link drops. A real prototype is still needed for what simulation cannot measure.
Contents
- Circuit layer
- Firmware layer
- Motion layer
- Fleet layer
What you will learn
- Tell apart what simulation can prove from what only a real prototype can answer.
- Write a testable pass criterion for each layer and tie it to a requirement.
- Follow one requirement, returning home on link loss, through all four layers and know when to stop simulating and build.
Before you start
It helps to have read the article on the parts of a mini mopping-robot system. Other terms are explained where they first appear.
What can simulation prove, and what can it not?
Simulation gives evidence that a design meets a requirement inside a model, not inside a real home. The NASA Systems Engineering Handbook separates two questions: verification asks whether the end product was realized right, validation asks whether the right end product was realized. The same document places simulation among the methods of analysis: a model is a mathematical representation of reality, and a simulation is the manipulation of a model.
The reason to simulate is cost. Testing the real product is the most resource-intensive verification technique, and validation by testing is the same. Fixing the design in a model before building a prototype is a cheaper way to catch errors early.
The limit lies in the model. According to a survey of the gap between simulation and reality, there are no perfect simulators, so there is always a difference from the real world, called the reality gap. The survey describes the gap as many sub-gaps, each from the simulation failing to replicate a physical mechanism accurately, in dynamics, perception and sensing, actuation and control, and system design. So every passing result is valid only for the part that was modelled.
- Virtual model
- Real home
- Dynamics
- Perception and sensing
- Actuation and control
- System design
What does each of the four simulation layers check?
Each layer checks a different group of faults, so all four are needed. The table below is one way to split them, with a typical tool for each; the next three articles go deep on circuits, firmware and motion.
| Layer | Question it checks | Example tool | Cannot check yet |
|---|---|---|---|
| Circuit | Do the supply, motors and pump behave when switched on together? | ngspice simulates electric and electronic circuits | Heat and noise of a real board |
| Firmware | Does the code handle events and faults correctly? | Wokwi simulates ESP32 and Wi-Fi | Real timing, radio in a real home |
| Motion | Does the virtual robot cover the room, avoid edges and dock? | Gazebo, reached through ROS topics | Floor friction, the damp pad |
| Fleet | Do the robots split zones and take turns at the dock? | The real controller connected to the motion simulation | Load on a real home's Wi-Fi |
The ngspice site describes an open source spice simulator for electric and electronic circuits. According to the Wokwi documentation, it simulates Arduino, ESP32, STM32 and many other boards, parts and sensors, and offers Wi-Fi simulation so a project can use MQTT, HTTP or NTP. With Gazebo, users interact with a running simulation by publishing and subscribing to topics over Gazebo Transport or ROS, which is how a controller on a computer can connect.
Once a real board exists, hardware in the loop adds another check. One hardware-in-the-loop framework shows the effect of delays, noise and saturation on a control system.
- Circuit layer
- Firmware layer
- Motion layer
- Fleet layer
- Part not yet checked
How do you write a pass criterion for each layer?
A pass criterion is one sentence with a condition, an expected result and a way to measure it, so anyone running it reaches the same verdict. NASA's requirement checklist asks whether requirements are specified in a measurable, verifiable manner and whether all requirements are bidirectionally traceable to higher-level requirements. The table applies that idea to the illustrative design; the content of each criterion is a design proposal.
| Source requirement | Layer | Pass criterion | Result |
|---|---|---|---|
| Stable power | Circuit | When the pump and motors start together, the voltage at the microcontroller stays above the chip's limit | Pass or fail |
| Return home on link loss | Firmware | When heartbeats stop past the timeout, the firmware cuts the pump, stops the wheels and enters the safe state; it returns only with a valid local route, localization and enough battery | Pass or fail |
| Safe room coverage | Motion | Over many runs from different start points, the virtual robot covers the room, never drives off an edge and docks successfully | Pass or fail |
| Shared dock | Fleet | When two robots need the dock together, one enters first, the other waits and neither gets stuck | Pass or fail |
The "Result" column is filled only after a run. Bidirectional traceability means each row points up to its source requirement, and each requirement points down to the test that checks it.
- Source requirement
- Simulation test
- Pass result
- Fail result
- Two-way traceability
How does one requirement cross all four layers?
One requirement usually needs evidence in several layers. Take "on link loss, stop mopping and return to the dock" as a hypothetical example:
- Circuit: with the pump off, the supply still gives the motors and the microcontroller enough power while the robot drives home.
- Firmware: the heartbeat timer expires, the state machine cuts the pump and stops the wheels within its time budget, then permits a return only with valid navigation data. A separate lost-localization test confirms it remains stationary.
- Motion: the virtual robot starts in a far zone, drives around a bed and a table, and docks successfully across many runs.
- Fleet: two robots lose the link and head to the dock together; robots enter only with permission from a modelled dock-side or local arbiter. If the lost central controller is the only arbiter, the correct outcome is separate holding positions outside the entrance, not a queue assumed to keep running.
Simulation exposes faults that reading code can miss. Suppose that in the firmware layer, repeated reconnection attempts keep resetting the heartbeat timer, so the pump never stops. The fault shows up when the link is cut many times in simulation, and the code is fixed before any board exists.
- Link lost
- Circuit lane
- Firmware lane
- Motion lane
- Fleet lane
When should you stop simulating and build?
Stop when the criteria of all four layers pass and the remaining risk can only be measured on a real prototype. Four typical items belong there: how the damp pad wets the floor, battery chemistry, real Wi-Fi radio in a home and floor friction. They sit among the sub-gaps described above, which a model struggles to reproduce accurately.
A prototype is the costliest technique, so build the smallest one that measures exactly those things. Feed the measurements back into the model so later simulations sit closer to reality.
- Frame of what only a prototype measures
- Four layers passed
- Damp pad wetting
- Battery
- Wi-Fi radio
- Floor friction
Real-world example
Someone is about to buy parts. Before ordering the pump, they build the supply circuit in a circuit simulator and see the voltage dip when the pump runs with a motor. They add a smoothing capacitor in the model and rerun it. Only when the model passes do they order parts, and the first prototype is used to check whether the model was right.
Common misunderstandings
A passing simulation means the robot will run well in a home. The result holds only for what was modelled; the reality gap is always there.
Motion simulation is enough. Circuits and firmware have faults of their own that a motion simulator cannot see, such as a voltage dip or a heartbeat timer that keeps resetting.
Once simulated, no prototype is needed. The damp pad, the battery, Wi-Fi and friction still have to be measured on a real prototype.
Frequently asked questions
Can simulation replace a prototype?
Not completely. Simulation catches faults early and cheaply, while a prototype measures what a model struggles to reproduce.
Which layer should I simulate first?
Start with the layer where a fault costs most in the real build, usually the power supply and the firmware's safety logic. This is a design suggestion and depends on the project.
Do I need a real board to simulate firmware?
No. A simulator such as Wokwi runs code for ESP32 with Wi-Fi, so you can write and test code before the board arrives. Real timing and radio still need measuring on a real board.
Summary
- Simulation gives evidence inside a model; the reality gap means each result holds only for what was modelled.
- Four layers, circuit, firmware, motion and fleet, each have a testable pass criterion traced to a source requirement.
- Stop simulating when all four layers pass, then build the smallest prototype to measure the damp pad, battery, real Wi-Fi and friction.
Terms in this article
English and Vietnamese terms, with the meanings used here. Hover, tap or Tab to a term with a dotted underline for an explanation as you read.
- verificationxác minh
- The formal process of confirming a system meets all specified requirements; it asks whether the end product was realized right.
- validationthẩm định
- Making sure the system works as expected in its intended environment; it asks whether the right end product was realized.
- simulationmô phỏng
- Running a model, a mathematical representation of reality, to see how a system responds.
- reality gapkhoảng cách thực tế
- The difference between a simulated and a real environment; no simulator removes it entirely.
- hardware in the loopmô phỏng phần cứng trong vòng lặp
- A simulation approach that puts real control hardware into the loop to show the effect of delays, noise and saturation.
- traceabilitytruy vết
- The ability to link each test to its source requirement and back, in both directions.
- prototypemẫu thử
- A physically built version used to measure what a model struggles to reproduce; the most resource-intensive validation technique.
This article is not marked as viewed
Spotted something wrong or unsafe?
Tell the administrator by email. The message already has the article title and address.
You may also like
IntermediateHow Can Robot Firmware Run Before the Hardware Exists?
Three ways to test mop-robot firmware before hardware exists: host-side logic tests, microcontroller emulation and hardware-in-the-loop, and their limits.
Robotics7 min read
AdvancedHow Do You Simulate Robot Motion in a Virtual Home?
Build a virtual home for a small mopping-robot fleet: pick a simulator, add simulated sensors, link ROS 2 and run repeated acceptance runs.
Robotics8 min read
IntermediateHow Can a Mop Robot Spot Clutter and Alert a Person?
How a mop robot merges bumps, jams, unreachable cells and still frames into a clutter score per zone, then alerts a person at the right time.
Artificial intelligence7 min read
AdvancedWhat Path Lets a Robot Mop Cover a Whole Room?
How a mop robot covers a whole room: cells around obstacles, back-and-forth passes, a map of cleaned cells, drift correction and blocked cells.
Robotics8 min read
Sources
These sources are written for older readers. If they feel hard, read them with an adult.
- 5.3 Product Verification — NASA Systems Engineering Handbook(opens in a new tab)
NASATier A: government, standards or research bodiesRead on November 2, 2026
- 5.4 Product Validation — NASA Systems Engineering Handbook(opens in a new tab)
NASATier A: government, standards or research bodiesRead on November 2, 2026
- A Framework for Real Time Hardware in the loop Simulation for Control Design(opens in a new tab)
arXivTier C: other sourcesRead on November 2, 2026
- The Reality Gap in Robotics: Challenges, Solutions, and Best Practices(opens in a new tab)
arXivTier C: other sourcesRead on November 2, 2026
- ngspice, the open source Spice circuit simulator(opens in a new tab)
ngspiceTier C: other sourcesRead on November 2, 2026
- Wokwi Documentation(opens in a new tab)
WokwiTier C: other sourcesRead on November 2, 2026
- Gazebo: Getting started(opens in a new tab)
GazeboTier C: other sourcesRead on November 2, 2026
- Appendix C: How to Write a Good Requirement — NASA Systems Engineering Handbook(opens in a new tab)
NASATier A: government, standards or research bodiesRead on November 2, 2026
