<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping</link><pubDate>Thu, 13 Aug 2026 12:18:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>e14sbhargav</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Current Revision posted to Documents by e14sbhargav on 8/13/2026 12:18:18 PM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Join Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges. Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing. Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://players.brightcove.net/1362235890001/default_default/index.html?videoId=6403322675112"&gt;players.brightcove.net/.../index.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/frame_5F00_000003.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/0777.Drawing1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/frame_5F00_000049.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/Drawing3.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/Drawing2.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/frame_5F00_000206.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/lowkp_5F00_2.5.1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation. The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example. One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation. A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different. Once it begins moving, it has to estimate where it is. This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On and&amp;nbsp;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning. Those are often the challenges that consume the most development time on real projects. Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvtgqs7p7"&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/IMG_5F00_3404.JPG" /&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-03-81/frame_5F00_000349.png" /&gt;&lt;/h2&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg2v5b0"&gt;Supporting Files and Links&lt;/h2&gt;
&lt;p&gt;-&amp;nbsp;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/m/files/151576"&gt;Episode 727 Resource Files - Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg5dmh4"&gt;Bill of Materials / Parts Used&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-48cda" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2,3974106,4568690,4007697~5,3879700~2&amp;nsku=52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_BUY_KIT" class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('48cda'));" data-farnell="3769977~2,3974106,4568690,4007697~5,3879700~2" data-newark="52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2,,,undefined~5,undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-c50ed" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2&amp;nsku=52AJ5083~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('c50ed'));" data-farnell="3769977~2" data-newark="52AJ5083~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor Driver&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-04dda" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3974106&amp;nsku=33AK3153&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('04dda'));" data-farnell="3974106" data-newark="33AK3153" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raspberry Pi Pico 2W&lt;/td&gt;
&lt;td&gt;RASPBERRY PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-2cd7f" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4568690&amp;nsku=20AM4425&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('2cd7f'));" data-farnell="4568690" data-newark="20AM4425" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IR Sensor&lt;/td&gt;
&lt;td&gt;SEEED STUDIO&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-53175" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4007697~5&amp;nsku=42AK5670~5&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('53175'));" data-farnell="4007697~5" data-newark="42AK5670~5" data-comoverride="" data-cmpoverride="" data-cpc="undefined~5" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;Wheel&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-c5e33" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3879700~2&amp;nsku=07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('c5e33'));" data-farnell="3879700~2" data-newark="07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1jvtg5dmh5"&gt;Additional Parts&lt;/h2&gt;
&lt;table class="e14-product-bom-additional"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA battery holder&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M3 machine screws&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small caster wheel&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA batteries&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Perfboard and wires&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="mcetoc_1jvtg5dmh6"&gt;&lt;/h3&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: embedded robotics programming, autonomous robot project, infrared cliff sensors, introduction to robotics, robotics for beginners, raspberry pi pico 2 w robot, robot wheel encoders, robot motor driver, wheel odometry, mobile robot platform, pid motor control, mobile robot mapping, e14presents_milosrasic, wireless robot control, friday_release, differential drive robot, diy robot build&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/7</link><pubDate>Thu, 13 Aug 2026 12:18:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 7 posted to Documents by cstanton on 8/13/2026 12:18:18 PM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Join Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges. Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing. Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://players.brightcove.net/1362235890001/default_default/index.html?videoId=6403322675112"&gt;players.brightcove.net/.../index.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000003.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/0777.Drawing1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000049.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/Drawing3.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/Drawing2.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000206.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/lowkp_5F00_2.5.1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation. The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example. One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation. A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different. Once it begins moving, it has to estimate where it is. This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On and&amp;nbsp;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning. Those are often the challenges that consume the most development time on real projects. Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvtgqs7p7"&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/IMG_5F00_3404.JPG" /&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000349.png" /&gt;&lt;/h2&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg2v5b0"&gt;Supporting Files and Links&lt;/h2&gt;
&lt;p&gt;-&amp;nbsp;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/m/files/151576"&gt;Episode 727 Resource Files - Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg5dmh4"&gt;Bill of Materials / Parts Used&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-32fff" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2,3974106,4568690,4007697~5,3879700~2&amp;nsku=52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_BUY_KIT" class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('32fff'));" data-farnell="3769977~2,3974106,4568690,4007697~5,3879700~2" data-newark="52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2,,,undefined~5,undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-f6d22" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2&amp;nsku=52AJ5083~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('f6d22'));" data-farnell="3769977~2" data-newark="52AJ5083~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor Driver&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-da8bd" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3974106&amp;nsku=33AK3153&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('da8bd'));" data-farnell="3974106" data-newark="33AK3153" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raspberry Pi Pico 2W&lt;/td&gt;
&lt;td&gt;RASPBERRY PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-26322" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4568690&amp;nsku=20AM4425&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('26322'));" data-farnell="4568690" data-newark="20AM4425" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IR Sensor&lt;/td&gt;
&lt;td&gt;SEEED STUDIO&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-df820" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4007697~5&amp;nsku=42AK5670~5&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('df820'));" data-farnell="4007697~5" data-newark="42AK5670~5" data-comoverride="" data-cmpoverride="" data-cpc="undefined~5" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;nbsp;Wheel&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-9ed39" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3879700~2&amp;nsku=07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('9ed39'));" data-farnell="3879700~2" data-newark="07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1jvtg5dmh5"&gt;Additional Parts&lt;/h2&gt;
&lt;table class="e14-product-bom-additional"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA battery holder&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M3 machine screws&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small caster wheel&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA batteries&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Perfboard and wires&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="mcetoc_1jvtg5dmh6"&gt;&lt;/h3&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: embedded robotics programming, autonomous robot project, infrared cliff sensors, introduction to robotics, robotics for beginners, raspberry pi pico 2 w robot, robot wheel encoders, robot motor driver, wheel odometry, mobile robot platform, pid motor control, mobile robot mapping, e14presents_milosrasic, wireless robot control, friday_release, differential drive robot, diy robot build&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/6</link><pubDate>Thu, 13 Aug 2026 12:17:31 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 6 posted to Documents by cstanton on 8/13/2026 12:17:31 PM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Join Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges. Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing. Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://players.brightcove.net/1362235890001/default_default/index.html?videoId=6403322675112"&gt;players.brightcove.net/.../index.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000003.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/0777.Drawing1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000049.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/Drawing3.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/Drawing2.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000206.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/lowkp_5F00_2.5.1.png" /&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation. The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example. One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation. A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different. Once it begins moving, it has to estimate where it is. This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On and&amp;nbsp;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning. Those are often the challenges that consume the most development time on real projects. Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvtgqs7p7"&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/IMG_5F00_3404.JPG" /&gt;&lt;img loading="lazy" alt="image" style="max-height:360px;max-width:640px;"  src="/resized-image/__size/1280x720/__key/communityserver-wikis-components-files/00-00-00-04-35/frame_5F00_000349.png" /&gt;&lt;/h2&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg2v5b0"&gt;Supporting Files and Links&lt;/h2&gt;
&lt;p&gt;-&amp;nbsp;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/m/files/151576"&gt;Episode 727 Resource Files - Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1jvtg5dmh4"&gt;Bill of Materials / Parts Used&lt;/h2&gt;
&lt;table class="e14-product-bom-main"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;th&gt;&lt;a id="e14-product-link-d50d0" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2,3974106,4568690,4007697~5,3879700~2&amp;nsku=52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_BUY_KIT" class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('d50d0'));" data-farnell="3769977~2,3974106,4568690,4007697~5,3879700~2" data-newark="52AJ5083~2,33AK3153,20AM4425,42AK5670~5,07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2,,,undefined~5,undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Kit&lt;/a&gt; &lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-8ef6a" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3769977~2&amp;nsku=52AJ5083~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('8ef6a'));" data-farnell="3769977~2" data-newark="52AJ5083~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DFROBOT Motor Driver&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-0a70e" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3974106&amp;nsku=33AK3153&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('0a70e'));" data-farnell="3974106" data-newark="33AK3153" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raspberry Pi Pico 2W&lt;/td&gt;
&lt;td&gt;RASPBERRY PI&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-87e82" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4568690&amp;nsku=20AM4425&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('87e82'));" data-farnell="4568690" data-newark="20AM4425" data-comoverride="" data-cmpoverride="" data-cpc="undefined" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NOT THE SAME FORMFACTOR - IR Sensor&lt;/td&gt;
&lt;td&gt;SEEED STUDIO&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-d99f8" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=4007697~5&amp;nsku=42AK5670~5&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('d99f8'));" data-farnell="4007697~5" data-newark="42AK5670~5" data-comoverride="" data-cmpoverride="" data-cpc="undefined~5" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NOT USED IN VIDEO - Wheel&lt;/td&gt;
&lt;td&gt;DFROBOT&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a id="e14-product-link-bf907" data-at-areainteracted="rte-content" data-at-type="click" data-at-link-type="button" href="https://referral.element14.com/OrderCodeView?fsku=3879700~2&amp;nsku=07AK0287~2&amp;COM=e14c-noscript&amp;CMP=e14c-noscript&amp;osetc=e14-noscript-tracking-loss" data-at-label="PRODUCT_POPUP_OPEN"class="e14-embedded e14_shopping-cart-far e14-button" onclick="event.preventDefault();e14.func.displayProduct(e14.meta.user.country, this, 'embedded-link', e14.func.getProductLinkJSON('bf907'));" data-farnell="3879700~2" data-newark="07AK0287~2" data-comoverride="" data-cmpoverride="" data-cpc="undefined~2" data-avnetemea="" data-avnetema="" data-avnetasia="" &gt;Buy Now&lt;/a&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="xs-hide"&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="mcetoc_1jvtg5dmh5"&gt;Additional Parts&lt;/h2&gt;
&lt;table class="e14-product-bom-additional"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Product Name&lt;/th&gt;
&lt;th&gt;Manufacturer&lt;/th&gt;
&lt;th&gt;Quantity&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA battery holder&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M3 machine screws&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small caster wheel&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AA batteries&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Perfboard and wires&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="mcetoc_1jvtg5dmh6"&gt;&lt;/h3&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: embedded robotics programming, autonomous robot project, infrared cliff sensors, introduction to robotics, robotics for beginners, raspberry pi pico 2 w robot, robot wheel encoders, robot motor driver, wheel odometry, mobile robot platform, pid motor control, mobile robot mapping, e14presents_milosrasic, wireless robot control, friday_release, differential drive robot, diy robot build&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/5</link><pubDate>Thu, 13 Aug 2026 11:51:30 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 5 posted to Documents by cstanton on 8/13/2026 11:51:30 AM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Join Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges. Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing. Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://players.brightcove.net/1362235890001/default_default/index.html?videoId=6403322675112"&gt;players.brightcove.net/.../index.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation.&lt;/p&gt;
&lt;p&gt;The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf78"&gt;From Fixed Robots to Mobile Robots&lt;/h2&gt;
&lt;p&gt;One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation.&lt;/p&gt;
&lt;p&gt;A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different.&lt;/p&gt;
&lt;p&gt;Once it begins moving, it has to estimate where it is.&lt;/p&gt;
&lt;p&gt;This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning.&lt;/p&gt;
&lt;p&gt;Those are often the challenges that consume the most development time on real projects.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8b"&gt;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: embedded robotics programming, autonomous robot project, infrared cliff sensors, introduction to robotics, robotics for beginners, raspberry pi pico 2 w robot, robot wheel encoders, robot motor driver, wheel odometry, mobile robot platform, pid motor control, mobile robot mapping, e14presents_milosrasic, wireless robot control, friday_release, differential drive robot, diy robot build&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/4</link><pubDate>Thu, 13 Aug 2026 09:27:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 4 posted to Documents by cstanton on 8/13/2026 9:27:50 AM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Loin Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://players.brightcove.net/1362235890001/default_default/index.html?videoId=6403322675112"&gt;players.brightcove.net/.../index.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation.&lt;/p&gt;
&lt;p&gt;The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf78"&gt;From Fixed Robots to Mobile Robots&lt;/h2&gt;
&lt;p&gt;One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation.&lt;/p&gt;
&lt;p&gt;A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different.&lt;/p&gt;
&lt;p&gt;Once it begins moving, it has to estimate where it is.&lt;/p&gt;
&lt;p&gt;This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning.&lt;/p&gt;
&lt;p&gt;Those are often the challenges that consume the most development time on real projects.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8b"&gt;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/3</link><pubDate>Thu, 13 Aug 2026 09:22:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 3 posted to Documents by cstanton on 8/13/2026 9:22:03 AM&lt;br /&gt;
&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Loin Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Robotics-101-_2D00_-Ep.-4-_2D00_-Locomotion-_2600_-Mapping_5F00_V3.mp4"&gt;community.element14.com/.../Robotics-101-_2D00_-Ep.-4-_2D00_-Locomotion-_2600_-Mapping_5F00_V3.mp4&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;strong&gt;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation.&lt;/p&gt;
&lt;p&gt;The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf78"&gt;From Fixed Robots to Mobile Robots&lt;/h2&gt;
&lt;p&gt;One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation.&lt;/p&gt;
&lt;p&gt;A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different.&lt;/p&gt;
&lt;p&gt;Once it begins moving, it has to estimate where it is.&lt;/p&gt;
&lt;p&gt;This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning.&lt;/p&gt;
&lt;p&gt;Those are often the challenges that consume the most development time on real projects.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8b"&gt;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/2</link><pubDate>Thu, 13 Aug 2026 09:15:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 2 posted to Documents by cstanton on 8/13/2026 9:15:03 AM&lt;br /&gt;

&lt;div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Loin Milo&amp;scaron; Ra&amp;scaron;ić as he builds a differential-drive mobile robot and explores the fundamentals of mobile robotics. In this instalment of the Introduction to Robotics series, he brings together electronics, mechanical design, motor control, encoder feedback, PID tuning, wireless communications and sensor-driven behaviours to create a robot capable of navigating a surface and mapping its edges.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Along the way, Milo&amp;scaron; demonstrates how wheel encoders enable speed control and odometry, how infrared sensors can be used as cliff detectors, and how a simple mapping algorithm can turn sensor data into useful environmental information. The project also highlights practical challenges including battery brownouts, logic-level compatibility, controller tuning and real-world testing.&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Whether you&amp;#39;re building your first robot or looking to understand how mobile robotics systems are put together, this project provides a hands-on introduction to the concepts that underpin larger autonomous platforms, and you can find the supporting files&amp;nbsp;below&lt;/div&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1jvt6eeoid" class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Time to Build a Robot!&lt;/h2&gt;
&lt;div class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-04-35/Robotics-101-_2D00_-Ep.-4-_2D00_-Locomotion-_2600_-Mapping_5F00_V3.mp4"&gt;community.element14.com/.../Robotics-101-_2D00_-Ep.-4-_2D00_-Locomotion-_2600_-Mapping_5F00_V3.mp4&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Throughout this Introduction to Robotics series, Milo&amp;scaron; Ra&amp;scaron;ić has gradually built the knowledge needed to design, build and control robotic systems. It began with the fundamentals of electronics, sensors, actuators, CAD and mechanical design in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, before moving into closed-loop control, motion profiles and robotic software concepts in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. The previous instalment then applied many of those concepts to a complete robot arm in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For the fourth part of the series, the focus shifts to one of the most recognisable categories of robotics: the mobile robot.&lt;/p&gt;
&lt;p&gt;Unlike a robot arm that operates from a fixed base, a mobile robot must move through its environment, react to what it senses, maintain control of its motion and attempt to understand where it is. Even the simplest mobile robot quickly introduces concepts such as locomotion, wheel odometry, sensor-driven behaviours and environmental mapping.&lt;/p&gt;
&lt;p&gt;The platform Milo&amp;scaron; develops combines many of the ideas explored throughout the series into a compact differential-drive robot built around a Raspberry Pi Pico 2 W, geared motors with integrated encoders, infrared cliff sensors, wireless communications and a custom firmware and GUI stack.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rather than introducing advanced SLAM systems, sensor fusion stacks or computer vision pipelines, the project focuses on the core building blocks that underpin mobile robotics. The result is a platform that remains approachable while still exposing many of the same challenges encountered in larger autonomous systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf70"&gt;Bringing the Previous Parts Together&lt;/h2&gt;
&lt;p&gt;This project is the fourth instalment of the series where every subsystem relies on concepts already introduced.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;introduced the core hardware elements such as sensors, motors, microcontrollers, CAD design and manufacturing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;explored feedback systems, control loops and software structures used to regulate motion.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics"&gt;Building and Programming a SCARA Industrial Robot Arm – An Introduction to Robotics&lt;/a&gt;&amp;nbsp;&lt;/strong&gt;demonstrated how those ideas could be combined into a complete robotic system with embedded firmware and a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this mobile robot platform, all of those concepts return. Motors require drivers, sensors require interpretation, encoder feedback must be processed, software needs to communicate with hardware, and control loops keep the system stable. The key difference is that the robot is no longer bolted to a workbench. It must move through the world while attempting to keep track of its own position.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf71"&gt;Locomotion: How Do Mobile Robots Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins by introducing locomotion, the ability of a robot to move from one place to another.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Robots can move in many different ways. Wheeled robots, walking robots, tracked vehicles and bio-inspired machines all fall under the broad category of locomotion. Since the objective of this project is to introduce the fundamentals of mobile robotics without adding unnecessary complexity, Milo&amp;scaron; focuses on wheeled robots.&lt;/p&gt;
&lt;p&gt;Even then, there are multiple approaches. A car changes direction by altering the angle of its steering wheels. Some robots use tracks while others employ more specialised wheel arrangements such as mecanum wheels. For this platform, the chosen solution is differential drive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot uses two powered drive wheels and a third passive support wheel, normally a caster. Steering is achieved entirely through the relative speed of the left and right wheels.&lt;/p&gt;
&lt;p&gt;If both wheels rotate at the same speed, the robot travels in a straight line. If one wheel turns faster than the other, the robot follows a curve. If the wheels rotate in opposite directions, the robot can rotate on the spot.&lt;/p&gt;
&lt;p&gt;The design keeps moving parts to a minimum while still demonstrating many important mobile robotics concepts.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That comparison is particularly fitting because robot vacuum cleaners use many of the same underlying principles explored in this project: differential drive, wheel feedback, environmental sensing and autonomous movement.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf72"&gt;Selecting the Hardware&lt;/h2&gt;
&lt;p&gt;With the robot architecture decided, the next step was selecting the hardware.&lt;/p&gt;
&lt;p&gt;The drive system is built around two DFROBOT geared DC motors with integrated encoders. The gearbox reduces the motor speed to something useful for driving a robot, while the encoder provides rotational feedback.&lt;/p&gt;
&lt;p&gt;These encoders are important because they allow the robot to measure wheel speed and estimate wheel position. Without them, the firmware could only command a motor and hope it behaved as expected. With encoder feedback, movement can be measured, controlled and visualised.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For anyone unfamiliar with encoders and feedback systems, the element14 Learning Center article &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; provides useful background on how rotational position and velocity can be measured electronically.&lt;/p&gt;
&lt;p&gt;The motors are controlled through a DFROBOT dual motor driver. The microcontroller generates a direction signal and a PWM signal for each motor, while the motor driver handles the current required by the motors themselves.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply)
//      battery    --&amp;gt; VM            (motor supply)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While deceptively simple, this arrangement introduces readers to one of the most common motor-control structures used throughout robotics.&lt;/p&gt;
&lt;p&gt;Those wanting a deeper understanding of motor drive electronics can explore &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;, which covers PWM, motor drivers and motor control fundamentals in more detail.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf73"&gt;The Raspberry Pi Pico 2 W and Power System&lt;/h2&gt;
&lt;p&gt;To coordinate the robot&amp;#39;s sensors, motors and communications, Milo&amp;scaron; selected a Raspberry Pi Pico 2 W.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Pico handles the embedded side of the project. It reads sensor data, processes encoder counts, executes the PID control loops, communicates with the GUI and generates motor commands.&lt;/p&gt;
&lt;p&gt;This is another point where concepts from earlier parts of the series return. The microcontroller acts as the bridge between the electronic hardware and the software logic driving the robot&amp;#39;s behaviour.&lt;/p&gt;
&lt;p&gt;An interesting challenge emerged from the encoder hardware. The motor encoders operate using 5 V logic, while the Pico uses 3.3 V logic.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple level-shifting circuit is therefore required between the encoder outputs and the microcontroller inputs. This kind of practical electrical consideration appears frequently in real robotics projects and is often overlooked when looking only at block diagrams.&lt;/p&gt;
&lt;p&gt;The robot itself is powered from a four-cell AA battery pack, supplying approximately 6 V for the motors and supporting circuitry. A regulator generates the required logic voltage for the Pico and sensors.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; jokingly highlights another very real robotics issue: battery quality.&lt;/p&gt;
&lt;p&gt;If the supply voltage drops too far under load, motors may continue turning while the microcontroller resets unexpectedly, producing brownouts and unpredictable behaviour.&lt;/p&gt;
&lt;p&gt;Power distribution often receives less attention than software or mechanics, but it has a huge influence on reliability. Readers interested in that topic may find &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; useful supplementary reading.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf74"&gt;Cliff Detection Instead of Obstacle Detection&lt;/h2&gt;
&lt;p&gt;Many consumer robots rely on bump sensors, cameras or LiDAR to detect obstacles. Rather than attempting to build a complete navigation system, Milo&amp;scaron; deliberately simplifies the sensing challenge.&lt;/p&gt;
&lt;p&gt;The robot uses five downward-facing infrared sensors as cliff detectors.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the problem from obstacle avoidance to edge detection. Rather than navigating around furniture, the robot explores a raised surface and attempts to identify where the surface ends.&lt;/p&gt;
&lt;p&gt;The approach is particularly useful for demonstrating how sensor information can directly drive robotic behaviour without requiring complex perception systems.&lt;/p&gt;
&lt;p&gt;The firmware includes logic specifically designed around this sensor arrangement.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means
// &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// Danger is the absence of floor.

#define IR_CLIFFS(mask) ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The accompanying comment in the firmware highlights a surprisingly common mistake.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Getting that backwards is not a cosmetic bug:
// it produces a robot that refuses to move on solid
// ground and drives happily over a cliff.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the kind of observation that comes from testing on physical hardware rather than simulation.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf75"&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;With the electronics established, attention shifted towards the mechanical design.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; created the platform in Fusion 360 and structured it around a simple differential-drive layout consisting of two powered wheels and a caster.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project is intentionally straightforward so that readers can recreate it even if they do not have access to the exact same fabrication tools.&lt;/p&gt;
&lt;p&gt;While the published design uses 3D-printed components, the robot could be built from much simpler materials. The important requirement is maintaining alignment between the drive wheels.&lt;/p&gt;
&lt;p&gt;If the wheels are not parallel, the robot will naturally drift and produce misleading results during testing.&lt;/p&gt;
&lt;p&gt;That lesson mirrors many industrial robotics projects: elegant software cannot compensate indefinitely for poor mechanical fundamentals.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf76"&gt;Firmware, Communications and Software Architecture&lt;/h2&gt;
&lt;p&gt;The software is split into two major pieces. The first is embedded firmware running on the Pico. The second is a desktop GUI used for control, monitoring and tuning.&lt;/p&gt;
&lt;p&gt;Readers who followed the SCARA robot arm build will recognise a very similar development workflow. Once again, Milo&amp;scaron; combines embedded software and a graphical control environment into a single ecosystem.&lt;/p&gt;
&lt;p&gt;The firmware is deliberately modular.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here,
// so Serial and WiFi are guaranteed to behave identically.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This ensures that commands behave the same whether they are sent through USB Serial or over Wi-Fi.&lt;/p&gt;
&lt;p&gt;The firmware also uses movement concepts familiar to anyone who has worked with CNC machines or 3D printers.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F,
// the programmed wheel target) lives here
// rather than in the controller.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The resulting system is flexible enough for interactive testing while remaining structured enough for more advanced automation later on.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf77"&gt;Applying PID Control to a Real Robot&lt;/h2&gt;
&lt;p&gt;The theory behind PID control was explored previously in &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;. Rather than revisiting the mathematics, this project demonstrates how those concepts are applied to a mobile robot.&lt;/p&gt;
&lt;p&gt;Each wheel uses encoder feedback to regulate speed through a closed-loop controller.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s -&amp;gt; output in duty

#define SPD_KP 0.0015f
#define SPD_KI 0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The GUI exposes tuning controls, making it possible to observe how the robot responds as controller values change.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; demonstrates the practical tuning process by examining how quickly the wheel reaches its target speed. A response that is too slow typically indicates insufficient proportional gain. Increasing Kp improves responsiveness, but pushing it too far can create oscillation and instability.&lt;/p&gt;
&lt;p&gt;Those behaviours become immediately visible when real motors, gearboxes, batteries and sensors enter the equation.&lt;/p&gt;
&lt;p&gt;The project therefore serves as a practical continuation of the PID concepts introduced earlier in the series, showing what they look like when attached to a physical robot rather than a simplified example.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf78"&gt;From Fixed Robots to Mobile Robots&lt;/h2&gt;
&lt;p&gt;One of the biggest conceptual differences between this project and the earlier SCARA robot arm is localisation.&lt;/p&gt;
&lt;p&gt;A robot arm operates from a known position. Its joints move relative to a fixed base and its location in the world remains constant.&lt;/p&gt;
&lt;p&gt;A mobile robot is different.&lt;/p&gt;
&lt;p&gt;Once it begins moving, it has to estimate where it is.&lt;/p&gt;
&lt;p&gt;This project deliberately avoids advanced localisation systems such as visual SLAM or sensor fusion. Instead, the platform introduces a simpler concept: wheel odometry.&lt;/p&gt;
&lt;p&gt;By measuring wheel rotation using encoders, the robot can estimate how far it has travelled and build a rough picture of its movement.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We are only here calculating where it is based on the encoder positions.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While not perfectly accurate, odometry provides a powerful introduction to localisation and forms the basis of countless robotics systems.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf79"&gt;Creating a Simple Mapping Behaviour&lt;/h2&gt;
&lt;p&gt;Once the platform could drive reliably and the sensors were functioning correctly, it was time to make the robot perform a task.&lt;/p&gt;
&lt;p&gt;The chosen exercise was mapping the edge of a raised surface.&lt;/p&gt;
&lt;p&gt;The mapping algorithm intentionally remains simple. Whenever a cliff sensor detects an edge, the robot reverses and changes direction. If the centre sensor detects a head-on edge, the robot performs a more substantial manoeuvre before continuing.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour is significant because it combines every major subsystem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mechanical design determines how the robot moves.&lt;/li&gt;
&lt;li&gt;The motors execute the movement.&lt;/li&gt;
&lt;li&gt;The encoders provide feedback.&lt;/li&gt;
&lt;li&gt;The PID loops regulate motion.&lt;/li&gt;
&lt;li&gt;The sensors detect the environment.&lt;/li&gt;
&lt;li&gt;The algorithm determines how the robot reacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The GUI then visualises the results.&lt;/p&gt;
&lt;p&gt;As the robot continues exploring, the triggered cliff detections begin forming a representation of the table edge.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The robot is not creating a complete map in the modern SLAM sense, but it does demonstrate how movement and sensing can be combined to generate useful environmental information.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8a"&gt;What Beginners Should Focus On&lt;/h2&gt;
&lt;p&gt;One of the most useful aspects of this project is that it intentionally avoids overwhelming complexity.&lt;/p&gt;
&lt;p&gt;Rather than introducing every possible robotics concept at once, Milo&amp;scaron; focuses on a small number of ideas and demonstrates how they fit together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Differential-drive locomotion.&lt;/li&gt;
&lt;li&gt;Motor control and motor drivers.&lt;/li&gt;
&lt;li&gt;Wheel encoders.&lt;/li&gt;
&lt;li&gt;PID speed regulation.&lt;/li&gt;
&lt;li&gt;Microcontroller-based firmware.&lt;/li&gt;
&lt;li&gt;Infrared sensing.&lt;/li&gt;
&lt;li&gt;Wireless communications.&lt;/li&gt;
&lt;li&gt;Simple mapping behaviour.&lt;/li&gt;
&lt;li&gt;Basic odometry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, readers also see the less glamorous aspects of robot development: wiring issues, logic-level compatibility, battery behaviour, sensor interpretation, wheel alignment and controller tuning.&lt;/p&gt;
&lt;p&gt;Those are often the challenges that consume the most development time on real projects.&lt;/p&gt;
&lt;h2 id="mcetoc_1jvt5umf8b"&gt;Further Learning on element14 Community&lt;/h2&gt;
&lt;p&gt;Readers wanting to explore the wider Introduction to Robotics series and related topics can continue with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1jvt5umf8c"&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;As the fourth instalment of the Introduction to Robotics series, this project acts as a bridge between foundational robotics theory and the challenges of mobile robotics.&lt;/p&gt;
&lt;p&gt;The robot combines electronics, mechanical design, feedback control, embedded software and environmental sensing into a platform that is simple enough to understand yet capable enough to demonstrate genuine robotics concepts.&lt;/p&gt;
&lt;p&gt;By the end of the project, the robot can drive, regulate its wheel speed, detect table edges, estimate its movement, visualise sensor data and build a rough representation of its surroundings.&lt;/p&gt;
&lt;p&gt;Those capabilities may appear straightforward, but together they form the basis of a huge number of robotic systems.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Whether the next step is odometry improvements, more advanced mapping, ROS integration, navigation algorithms, sensor fusion or entirely new robot architectures, this platform provides a practical foundation on which those future topics can be built.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Designing a Mobile Robot Platform with Differential Drive, PID Control and Wireless Mapping</title><link>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping/revision/1</link><pubDate>Thu, 13 Aug 2026 08:58:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:511eee92-0d1e-4e7c-a0e2-304683ea54ea</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/72102/designing-a-mobile-robot-platform-with-differential-drive-pid-control-and-wireless-mapping#comments</comments><description>Revision 1 posted to Documents by cstanton on 8/13/2026 8:58:09 AM&lt;br /&gt;
&lt;p&gt;In this fourth part of his introduction to robotics, Milo&amp;scaron; Ra&amp;scaron;ić moves from robot arms and control theory into a practical mobile robot platform. The aim is not to build the most advanced autonomous rover possible, but to show how the core ideas behind robotics come together in a small, approachable machine: locomotion, motor control, feedback, power, software, sensors, CAD and a simple mapping behaviour.&lt;/p&gt;
&lt;p&gt;The result is a compact differential-drive robot built around a Raspberry Pi Pico 2 W, two geared DC motors with encoders, a dual motor driver, five downward-facing IR sensors, a small caster wheel, and a custom firmware and GUI stack. It is designed to be something a maker can learn from, modify and recreate without needing industrial hardware or an expensive robotics platform.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This was for people that were making their first robot and just wanted to see something move.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That practical approach runs through the whole build. Milo&amp;scaron; keeps the platform small, uses accessible components, and focuses on the important robotics lessons that appear again and again in larger systems: how the robot moves, how it senses wheel motion, how it avoids falling off an edge, how it communicates with a computer, and how a simple algorithm can turn sensor readings into useful behaviour.&lt;/p&gt;
&lt;p&gt;If you are new to the field, the earlier parts of this introduction to robotics are worth reading first. The series starts with &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot&lt;/a&gt;, then moves into &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt;, before applying many of those ideas in the &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;SCARA robot arm build&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Locomotion: How Does a Robot Move?&lt;/h2&gt;
&lt;p&gt;Milo&amp;scaron; begins with locomotion, which is simply the ability to move from one place to another. In robotics, that question quickly turns into something more specific: what kind of movement can the machine perform, and what mechanical arrangement makes that movement possible?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Locomotion is the ability of moving from one place to another. So in robotics it&amp;rsquo;s how does the robot move?&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There is no single fixed list of robot locomotion types. Wheeled robots, bipedal robots, tracked robots, quadrupeds, soft robots and worm-like robots all solve movement differently. For this build, Milo&amp;scaron; deliberately chooses wheels because they are one of the easiest ways to get a robot moving across a flat surface.&lt;/p&gt;
&lt;p&gt;Even then, &amp;ldquo;wheeled robot&amp;rdquo; covers several possible configurations. A car-style robot steers by changing the angle of its front wheels. A tank-style robot changes direction by varying the speed and direction of its left and right sides. Mecanum wheels allow sideways motion, but they add complexity. To keep the number of moving parts low, Milo&amp;scaron; chooses a differential-drive layout.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;In this case the wheels are fixed, we can just play with their speed and direction.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A differential-drive robot normally uses two powered wheels and one passive support wheel or caster. If both drive wheels rotate forward at the same speed, the robot moves forward. If they rotate backwards at the same speed, it reverses. If one wheel turns faster than the other, the robot follows a curve. If the wheels turn in opposite directions, the robot rotates on the spot.&lt;/p&gt;
&lt;p&gt;This is one of the most useful beginner configurations because it teaches a lot of robotics without overcomplicating the mechanics. It is also familiar. Robot vacuum cleaners use the same basic idea, with drive wheels underneath and a caster or support point to keep the chassis balanced.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The vacuum robot is the prime example of a differential drive robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For readers wanting broader context, the &lt;a href="/technologies/robotics/" data-e14adj="t"&gt;element14 Community Robotics group&lt;/a&gt; is a useful place to browse projects, discussions and learning material around mobile robots, sensors and control systems.&lt;/p&gt;
&lt;h2&gt;The Parts of the Robot&lt;/h2&gt;
&lt;p&gt;The main hardware is intentionally direct. The bill of materials includes two DFROBOT geared motors, one DFROBOT motor driver, a Raspberry Pi Pico 2 W, five IR sensors, a small caster wheel, a 4 AA battery holder, M3 machine screws, perfboard and wiring.&lt;/p&gt;
&lt;p&gt;The drive motors are the first major choice. Milo&amp;scaron; selects small geared DC motors from DFROBOT with integrated encoders. The gearbox reduces the high speed of the motor into a lower, more usable wheel speed, while the encoder provides feedback about motor rotation.&lt;/p&gt;
&lt;p&gt;That encoder feedback is important. Without it, the robot can only guess how far the wheels have turned based on the command sent to the motor. With encoders, the firmware can measure wheel speed and distance, making closed-loop speed control and rough position estimates possible.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;This here is an encoder.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Encoders are one of the first feedback devices that beginners encounter in mobile robotics. The element14 Learning Center&amp;rsquo;s &lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; module gives a useful overview of how rotary encoders convert mechanical motion into electrical signals representing position, velocity and direction.&lt;/p&gt;
&lt;p&gt;To control the motors, the robot uses a dual motor driver. A microcontroller GPIO pin cannot safely power a DC motor directly. The microcontroller sends logic signals, while the motor driver handles the higher current needed by the motors. In this build, each motor channel has a direction input and a PWM signal for speed control.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wiring to the DRI0044 (TB6612FNG) breakout:
//      PICO           DRI0044
//      PIN_M?_PWM --&amp;gt; PWM1 / PWM2   (speed,     0..100% duty)
//      PIN_M?_DIR --&amp;gt; DIR1 / DIR2   (direction, LOW/HIGH)
//      3V3        --&amp;gt; VCC           (logic supply, 2.7-5.5V)
//      GND        --&amp;gt; GND
//      battery    --&amp;gt; VM            (motor supply, 2.5-12V)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is a valuable detail for anyone recreating the project. The motor driver&amp;rsquo;s logic side and motor-power side are separate concerns. The Pico provides low-voltage logic, while the battery supplies the motors through the driver.&lt;/p&gt;
&lt;p&gt;The &lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt; module expands on brushed DC motors, motor drivers, PWM, torque, speed and the electronics used to control different motor types.&lt;/p&gt;
&lt;h2&gt;Microcontroller, Power and Logic Levels&lt;/h2&gt;
&lt;p&gt;The robot is built around the Raspberry Pi Pico 2 W. Milo&amp;scaron; chooses it because it is compact, inexpensive, powerful enough for the control loops, and includes wireless connectivity.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Why? Because it&amp;rsquo;s a really cheap and rather powerful microcontroller and it also has Wi-Fi and Bluetooth so we can easily control it wirelessly.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The microcontroller handles the time-sensitive side of the robot. It reads encoder pulses, samples IR sensors, updates the PID loops, generates motor commands and communicates with the host-side software. For anyone getting started with embedded control, the element14 Learning Center&amp;rsquo;s &lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;Basics of Microcontrollers&lt;/a&gt; explains how MCUs read inputs, run software and control external hardware.&lt;/p&gt;
&lt;p&gt;One practical issue appears immediately: logic voltage. Milo&amp;scaron; points out that the motor encoders use 5 V logic while the Pico uses 3.3 V logic. That cannot be ignored. Feeding 5 V signals directly into a 3.3 V microcontroller input can damage the board or cause unreliable readings.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The encoders on these motors are 5V logic and our microcontroller here is 3.3V logic so we also need a level translator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A small level-shifting breakout can solve this, or a resistor divider can be used where suitable. The guide is a good reminder that beginner robots are often full of these small electrical details. The robot may look like a mechanical project from the outside, but correct voltage levels, grounding and power distribution decide whether it behaves reliably.&lt;/p&gt;
&lt;p&gt;Power is also a recurring theme. The robot uses a 4 AA battery pack, giving around 6 V for the motor supply, with regulation down to 3.3 V for the microcontroller and logic. Milo&amp;scaron; specifically warns that poor batteries can cause brownouts, where voltage dips far enough for the electronics to reset or behave unpredictably.&lt;/p&gt;
&lt;p&gt;Good batteries, solid wiring and sensible regulation are not glamorous parts of robotics, but they save a lot of debugging. The &lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; guide is a useful companion here, especially when thinking about batteries, current draw, regulators and power losses.&lt;/p&gt;
&lt;h2&gt;Using IR Sensors as Simple Cliff Detectors&lt;/h2&gt;
&lt;p&gt;Instead of using bump sensors or LIDAR, Milo&amp;scaron; keeps the environmental sensing simple. The robot uses five downward-facing IR sensors as cliff detectors. These sensors are positioned so the robot can detect when the surface beneath it disappears, such as at the edge of a table.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Mostly the robots like the Roomba have the bump sensors, some even have LiDAR to detect walls. Just to make it simpler for testing we will instead of detecting walls we will detect cliffs.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This changes the mapping problem into something manageable. Rather than trying to map obstacles in a room, the robot explores a raised surface and records where the edge is. In effect, the absence of floor becomes the boundary.&lt;/p&gt;
&lt;p&gt;The firmware reflects an easy mistake people can make with reflective IR sensors: the active sensor state does not necessarily mean danger. In this project, a sensor seeing the floor is normal. The danger condition is when the sensor no longer sees the floor.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// On a downward-facing cliff sensor a set bit means &amp;quot;this sensor SEES THE FLOOR&amp;quot;.
// It does NOT mean danger -- danger is the ABSENCE of floor.
// Pointing down off the edge of a table, the bit goes to ZERO.
//
// Getting that backwards is not a cosmetic bug: it produces a robot that
// refuses to move on solid ground and drives happily over a cliff.
#define IR_CLIFFS(mask)     ((uint8_t)((~(mask)) &amp;amp; IR_ALL_BITS))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is one of the most useful teaching details in the firmware. Sensor polarity should be understood and converted once, close to the hardware layer, so the rest of the software can think in terms of meaningful states such as &amp;ldquo;cliff detected&amp;rdquo; rather than &amp;ldquo;pin low&amp;rdquo; or &amp;ldquo;pin high&amp;rdquo;.&lt;/p&gt;
&lt;h2&gt;Designing the Chassis&lt;/h2&gt;
&lt;p&gt;Once the electronics were selected, Milo&amp;scaron; moved into the mechanical design. The platform is designed in Fusion 360 and intended to be 3D printed, but the design remains intentionally simple.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;We&amp;rsquo;re going to drop into Fusion 360, do some CAD design and we&amp;rsquo;ll make all of the parts for the small mobile robot.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The design uses two powered wheels and a small caster wheel. The key requirement is that the drive wheels are parallel and mounted securely. If they are misaligned, the robot will drift, scrub, or fight the controller. This is why even a simple chassis still benefits from careful layout.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; also keeps the build accessible by noting that the same sort of robot could be constructed with simpler materials. A 3D printed chassis is clean and repeatable, but a beginner could still learn the core ideas with tongue depressors, popsicle sticks, cardboard or hot glue, provided the wheels are held straight and the sensors are mounted consistently.&lt;/p&gt;
&lt;p&gt;That is a good way to approach a first robotics platform. CAD and 3D printing help, but they are not the actual lesson. The lesson is the relationship between the mechanical layout, the electronics and the software trying to control the machine.&lt;/p&gt;
&lt;h2&gt;Firmware and Communications&lt;/h2&gt;
&lt;p&gt;The software is split into two parts: firmware running on the Pico and a host-side GUI used for testing, tuning, driving and visualising the robot.&lt;/p&gt;
&lt;p&gt;The firmware is written in a modular way. The command interpreter is shared across Serial and Wi-Fi so that both transports behave consistently. This prevents the common problem where USB commands and network commands end up having slightly different behaviours.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Everything the host can ask for goes through here, so Serial and WiFi are
// guaranteed to behave identically -- there is exactly one implementation of
// every command, and the transport only supplies bytes.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That choice is particularly useful for debugging. When a robot can be controlled over USB during bench testing and wirelessly during normal operation, the command layer should not care which connection supplied the bytes.&lt;/p&gt;
&lt;p&gt;The firmware also uses a command style inspired by G-code. Modal state such as absolute and relative movement is handled in the command processor, allowing movements to be described in a structured way.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Modal state (G90/G91, the last F, the programmed wheel target) lives here
// rather than in the controller, exactly as it does in a 3D printer: relative
// moves are computed against the last PROGRAMMED position, never against the
// measured one. Using the measured position would make G91 accumulate the
// tracking error of every previous move.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is a subtle but important software design decision. If relative moves were based on the measured position, tracking error from previous movements could accumulate into future commands. By basing relative moves on the last programmed position, the command stream remains predictable.&lt;/p&gt;
&lt;p&gt;For anyone familiar with 3D printers, CNC machines or motion controllers, this structure will feel familiar. For beginners, it is a good example of how robotics software can borrow proven ideas from other motion-control domains.&lt;/p&gt;
&lt;h2&gt;The GUI: Driving, Testing and Tuning&lt;/h2&gt;
&lt;p&gt;The GUI gives the robot a practical development environment. It can show raw data, provide a top-down live view, visualise where the robot has moved, indicate where the IR sensors have triggered, and expose PID tuning controls.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; also explains that AI tools helped with parts of the embedded and GUI workflow, particularly in creating modular firmware and a usable graphical interface. The important point is not that AI wrote the project, but that he used it as a tool while still testing the result against real hardware.&lt;/p&gt;
&lt;p&gt;That physical testing is essential. A GUI can be perfectly drawn and firmware can appear sensible, but mobile robots reveal problems through movement: swapped motor wiring, inverted encoders, noisy sensors, timing issues, wheels rubbing, battery voltage sag, and controllers that are too slow or too aggressive.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;First with the motor driver then the encoders make sure that we get some readings then compare.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This staged bring-up is exactly how a beginner should approach a robotics build. Test one subsystem at a time. Confirm the motor driver works. Confirm encoder counts change. Confirm direction is correct. Confirm sensors switch as expected. Only then run the whole robot as a system.&lt;/p&gt;
&lt;p&gt;If you are still building confidence with software tools, the &lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;Introduction to Programming with Python&lt;/a&gt; learning module is a useful starting point for understanding the host-side scripting and GUI possibilities that often sit alongside microcontroller firmware.&lt;/p&gt;
&lt;h2&gt;Differential Drive Control&lt;/h2&gt;
&lt;p&gt;Once the robot can drive, the next step is making it drive in a controlled way. A differential-drive robot has three fundamental motion patterns:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Both wheels same speed, same direction: straight forward or backwards.&lt;/li&gt;
&lt;li&gt;Both wheels same speed, opposite directions: rotate on the spot.&lt;/li&gt;
&lt;li&gt;Both wheels same direction, different speeds: follow a curve.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These simple combinations are enough to create a wide range of movement. The robot does not need steering linkages because steering comes entirely from the relative speeds of the two drive wheels.&lt;/p&gt;
&lt;p&gt;In the firmware, left and right motor channels are mapped explicitly. If the wheels appear swapped or turn the wrong way during bring-up, the documentation points out that the pin pairs or motor connectors can be exchanged.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Driver channel 1 is taken to be the LEFT motor, channel 2 the RIGHT.
// If the wheels turn out to be swapped, exchange these two pin pairs
// or just swap the two motor connectors.
#define PIN_MOTOR_L_PWM      6      // -&amp;gt; DRI0044 PWM1
#define PIN_MOTOR_L_DIR      7      // -&amp;gt; DRI0044 DIR1
#define PIN_MOTOR_R_PWM      8      // -&amp;gt; DRI0044 PWM2
#define PIN_MOTOR_R_DIR      9      // -&amp;gt; DRI0044 DIR2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is another practical point for first-time builders. If the robot spins when it should drive straight, or turns left when it should turn right, the issue may not be the control algorithm. It may simply be that one motor is wired backwards, one encoder is inverted, or left and right have been swapped.&lt;/p&gt;
&lt;h2&gt;PID Control and Tuning the Wheels&lt;/h2&gt;
&lt;p&gt;To make a differential-drive robot behave consistently, each wheel needs speed control. That is where PID control comes in. The controller compares a target wheel speed with the measured wheel speed from the encoder, calculates the error, and adjusts motor output to reduce that error.&lt;/p&gt;
&lt;p&gt;The firmware includes default speed loop gains and feed-forward terms. Feed-forward provides a baseline output based on the expected motor behaviour, while the PID loop trims the result to correct the remaining error.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// SPEED loop (inner): error in mm/s  -&amp;gt;  output in duty [-1..+1]
// Feed-forward does most of the work; the PID only trims.
// Start here, then tune on hardware with M902 step-response captures.
#define SPD_KP                  0.0015f
#define SPD_KI                  0.0080f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is a sensible way to teach PID on a real robot. Rather than expecting the PID loop to do everything, the system begins with an approximate feed-forward estimate and lets the controller correct the difference. That makes tuning less extreme and can help reduce oscillation.&lt;/p&gt;
&lt;p&gt;In the GUI, Milo&amp;scaron; tunes the wheel response by observing how the measured speed follows the target. If the proportional gain is too low, the wheel takes too long to reach the set speed. If the gain is pushed too high, the system becomes unstable and oscillates.&lt;/p&gt;
&lt;p&gt;This is one of the most valuable demonstrations in the project because it shows the difference between theory and real hardware. A gain value that looks harmless in code can make a motor hunt, chatter or overshoot on the bench.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;It&amp;rsquo;s not an optimal algorithm by any stretches of imagination as you can see in the graphical user interface but it&amp;rsquo;s getting there.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The earlier element14 guide on &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained&lt;/a&gt; is a strong companion to this section, as it covers PID terms, motion profiles, software architecture and the move from low-level control to higher-level robot behaviour. Another relevant element14 presents project is &lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/28278/using-pid-proportional-integral-derivative-in-robotics---how-hard-could-it-be----episode-614" data-e14adj="t"&gt;Using PID in Robotics, How Hard Could it Be?&lt;/a&gt;, which shows how PID tuning often involves practical iteration rather than simply picking three magic constants.&lt;/p&gt;
&lt;h2&gt;Safety, Faults and Real Hardware Protection&lt;/h2&gt;
&lt;p&gt;Because the robot moves on a table and uses motorised wheels, the firmware includes fault states and emergency-stop handling. That is good practice even on a small educational build.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;enum FaultBits : uint16_t {
    FAULT_NONE      = 0x0000,
    FAULT_ESTOP     = 0x0001,   // M112 was issued
    FAULT_STALL_L   = 0x0002,   // left wheel stalled under load
    FAULT_STALL_R   = 0x0004,
    FAULT_ENC_L     = 0x0008,   // implausible left encoder behaviour
    FAULT_ENC_R     = 0x0010,
    FAULT_OVERRUN   = 0x0020,   // control loop missed its deadline repeatedly
    FAULT_SETTINGS  = 0x0040    // stored settings were corrupt, defaults loaded
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;These fault bits show a more mature approach than simply writing values to motors. The controller can recognise an emergency stop, stalled motors, implausible encoder behaviour, missed timing deadlines or bad settings. Even if a beginner does not implement every feature in their first robot, the structure is worth studying.&lt;/p&gt;
&lt;p&gt;There is also a slew limit on motor output, which protects the gearbox and power supply from harsh command changes.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Maximum duty change per control tick (slew limit). 1.0 = unlimited.
// 0.05 @ 1 kHz = full-scale in 20 ms; protects the gearbox and the supply.
#define MOTOR_SLEW_PER_TICK     0.05f
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This links back to the earlier discussion of physical limits. A software command can change instantly. A motor, gearbox, battery and wheel cannot. Limiting how quickly motor duty can change helps keep the robot closer to what the hardware can actually do.&lt;/p&gt;
&lt;h2&gt;Mapping a Raised Surface&lt;/h2&gt;
&lt;p&gt;Once the robot can drive and the sensors work, Milo&amp;scaron; gives it a behaviour: explore a raised surface and map the edge without falling off.&lt;/p&gt;
&lt;p&gt;The algorithm is deliberately simple. When the robot detects an edge on one side, it backs up and turns away from the cliff. If the centre sensor detects an edge head-on, the robot backs up and performs two 90 degree turns to begin another scan line. Rear sensors help prevent it reversing off the edge, although positioning remains important.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As we detect a certain edge we&amp;rsquo;re gonna go back, turn around, something similar that your robot vacuum is doing.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This behaviour mimics the idea behind some robot vacuum movement patterns, but in a simplified form. Instead of building a complete SLAM system, the robot uses local sensor readings and simple motion rules to build up a rough picture of the boundary.&lt;/p&gt;
&lt;p&gt;The GUI makes this visible by showing where the robot has travelled and where the cliff sensors have triggered. Over time, the triggered points form a rough edge map.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;As you can see it&amp;rsquo;s forming a rather nice point cloud around the edges of the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a useful beginner-friendly way into robot mapping. It avoids the complexity of cameras, LIDAR, sensor fusion and global localisation, while still showing the idea that a robot can build a representation of its surroundings by moving, sensing and recording data.&lt;/p&gt;
&lt;p&gt;For readers interested in where this can go next, the element14 Learning Center&amp;rsquo;s &lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt; introduces the software framework used in many more advanced robotics systems. It covers nodes, topics, services, message passing, simulation and the way ROS 2 supports modular robot software.&lt;/p&gt;
&lt;h2&gt;What Beginners Should Take from This Build&lt;/h2&gt;
&lt;p&gt;The most valuable part of this mobile robot platform is not any single component. It is the way the project connects different robotics ideas into a machine that can be tested and improved.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Locomotion:&lt;/strong&gt; The robot moves using a differential-drive layout, one of the simplest useful mobile robot configurations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Actuation:&lt;/strong&gt; Geared DC motors provide wheel motion, while a motor driver supplies the current the microcontroller cannot provide directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Feedback:&lt;/strong&gt; Encoders provide wheel speed and position information for closed-loop control.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sensing:&lt;/strong&gt; Downward-facing IR sensors detect the absence of floor and act as cliff detectors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Control:&lt;/strong&gt; PID loops regulate wheel speed and make movement more repeatable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Power:&lt;/strong&gt; Batteries, logic voltage, motor voltage and level shifting all affect reliability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software architecture:&lt;/strong&gt; Firmware handles real-time control, while the GUI helps with testing, tuning and visualisation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Autonomy:&lt;/strong&gt; A simple edge-following and mapping behaviour shows how sensor readings can drive robot decisions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Milo&amp;scaron; also shows that robotics is full of small practical problems. Batteries can sag. Sensors can be inverted. Encoders can use different logic levels. Motors can be wired backwards. PID gains can oscillate. A caster wheel, sensor position or wheel alignment can change the way the robot behaves.&lt;/p&gt;
&lt;p&gt;Those are not failures of the learning process. They are the learning process.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Hopefully it won&amp;rsquo;t fall off the table.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That line captures the fun of the project. The robot is simple enough to understand, but real enough to misbehave. It has motors, sensors, firmware, a GUI, PID tuning and a basic mapping algorithm. It is the kind of platform that rewards methodical testing and invites upgrades.&lt;/p&gt;
&lt;h2&gt;Where to Learn More on element14 Community&lt;/h2&gt;
&lt;p&gt;To go deeper into the topics used in this build, these element14 Community resources are good next steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72071/building-the-foundations-of-your-first-robot---an-introduction-to-robotics" data-e14adj="t"&gt;Building the Foundations of Your First Robot - An Introduction to Robotics&lt;/a&gt; for sensors, actuators, microcontrollers, gearboxes, CAD and 3D printing.&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72077/pid-control-motion-profiles-and-ros-explained---an-introduction-to-robotics" data-e14adj="t"&gt;PID Control, Motion Profiles and ROS Explained - An Introduction to Robotics&lt;/a&gt; for control loops, motion profiles, software architecture and ROS.&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72087/building-and-programming-a-scara-industrial-robot-arm-an-introduction-to-robotics" data-e14adj="t"&gt;Building and Programming a SCARA Industrial Robot Arm&lt;/a&gt; for kinematics, firmware, Python control software and coordinate-based motion.&lt;/li&gt;
&lt;li&gt;&lt;a href="/challenges-projects/element14-presents/project-videos/w/documents/72067/designing-a-mobile-robot-platform-with-inverse-kinematics-and-wireless-control" data-e14adj="t"&gt;Designing a Mobile Robot Platform with Inverse Kinematics and Wireless Control&lt;/a&gt; for a larger mobile robotics platform with wireless control, kinematics and future upgrade paths.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/" data-e14adj="t"&gt;element14 Learning Center&lt;/a&gt; for structured learning across electronics, programming, power, motors and robotics.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/27574/the-basics-of-microcontrollers" data-e14adj="t"&gt;The Basics of Microcontrollers&lt;/a&gt; for understanding how the Pico sits between sensors, software and actuators.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3508/motor-control-motor-drive-control-for-makers" data-e14adj="t"&gt;Motor Control: Motor Drive Control for Makers&lt;/a&gt; for the theory behind DC motors, motor drivers and PWM control.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/23151/magnetic-encoders" data-e14adj="t"&gt;Magnetic Encoders&lt;/a&gt; for more detail on rotational feedback devices.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/3194/power-essentials-for-makers" data-e14adj="t"&gt;Power Essentials for Makers&lt;/a&gt; for batteries, regulators and power design basics.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/28063/an-introduction-to-programming-with-python" data-e14adj="t"&gt;An Introduction to Programming with Python&lt;/a&gt; for the software side of GUI tools, scripts and robotics utilities.&lt;/li&gt;
&lt;li&gt;&lt;a href="/learn/learning-center/essentials/w/documents/29543/essentials-of-robot-operating-system-2" data-e14adj="t"&gt;Essentials of Robot Operating System 2&lt;/a&gt; for the next step into modular robotics software, simulation and higher-level control.&lt;/li&gt;
&lt;li&gt;&lt;a href="/products/arduino/arduino-tutorials/b/blog/posts/jeremy-blum-arduino-tutorials" data-e14adj="t"&gt;Jeremy Blum Arduino Tutorials&lt;/a&gt; for foundational embedded electronics and programming topics that transfer well into small robotics builds.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Final Thoughts&lt;/h2&gt;
&lt;p&gt;This mobile robot platform is a strong capstone for an introduction to robotics because it pulls together electronics, mechanics, software and control in a visible way. A robot arm is excellent for learning kinematics and joint motion, but a mobile robot adds a different kind of challenge: it must move through an environment, react to sensors and keep track of what it is doing.&lt;/p&gt;
&lt;p&gt;Milo&amp;scaron; keeps the build deliberately approachable. There is no heavy sensor fusion, no advanced SLAM stack, and no attempt to hide every detail behind a kit. Instead, the project shows the practical path from parts on a bench to a robot that can move, measure, tune, react and map the edge of a surface.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;I would love to explore more complex robotics projects with you.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;From here, the upgrade path is clear. Better batteries, more accurate sensors, wheel odometry, wireless telemetry, ROS 2 integration, LIDAR, path planning or a more advanced mapping algorithm could all build on the same foundation. The important part is that the foundation is visible. The robot has two wheels, a caster, a microcontroller, motor feedback, cliff sensors, PID control and software that makes the whole thing understandable.&lt;/p&gt;
&lt;p&gt;For a first mobile robot, that is exactly the right place to start.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>