Skip to content
angelengineerPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PIERO Mobile Robot — Model-Based Control & Autonomous Navigation

MATLAB R2023b Simulink Arduino Mega 2560

PIERO differential-drive mobile robot

A modular MATLAB/Simulink control stack for a differential-drive robot, covering the path from motor identification and low-level control to odometry, autonomous path following, and reactive obstacle avoidance. The same control architecture can switch between an identified plant model and an Arduino Mega 2560 hardware target.

This project was developed during a 2023 Mobile Robotics Laboratory course and later extended with a scanning ultrasonic sonar.

What this project demonstrates

Area Implementation
Embedded robotics Arduino I/O, PWM motor actuation, encoder acquisition, and fixed-step execution
System identification Discrete motor transfer functions derived from measured encoder responses
Feedback control Per-wheel closed-loop speed control and robot orientation control
Robot modelling Direct/inverse differential-drive kinematics and odometry
Autonomous navigation Pure Pursuit waypoint tracking and a custom MATLAB Function alternative
Reactive behaviour Stateflow-based obstacle avoidance using infrared distance sensors
Model-Based Design Reusable subsystem references and a hardware/simulation variant architecture
Experimental extension Servo-driven ultrasonic scanning, obstacle localisation, and serial polar visualisation

System architecture

flowchart LR
    WP[Waypoints] --> PP[Pure Pursuit]
    IR[Infrared sensors] --> OA[Stateflow obstacle avoidance]
    SONAR[Optional scanning sonar] -.-> OA
    PP --> ARB[Command arbitration]
    OA --> ARB
    ARB --> MCI[Inverse kinematics]
    MCI --> CTRL[Wheel-speed control]
    CTRL --> VAR{Plant variant}
    VAR -->|Simulation| TF[Identified motor models]
    VAR -->|Hardware| HW[Arduino + motors]
    HW --> ENC[Wheel encoders]
    TF --> MCD[Direct kinematics]
    ENC --> MCD
    MCD --> ODO[Odometry]
    ODO --> PP
Loading

The separation between navigation, kinematics, control, plant, and sensing makes it possible to test algorithms in simulation before deploying the same model structure to the robot. See the model and architecture guide for the complete inventory.

Results

The final model combines waypoint tracking, odometry, speed control, infrared sensing, a Stateflow avoidance supervisor, and a simulation/hardware plant variant.

Integrated PIERO navigation and obstacle-avoidance model

The optional extension mounts an ultrasonic sensor on a servo and visualises angle–distance measurements as a polar scan:

Getting started

Software

The models were authored in MATLAB/Simulink R2023b. Use R2023b or a newer compatible release with:

  • MATLAB and Simulink
  • Robotics System Toolbox for the Pure Pursuit block
  • Simulink Support Package for Arduino Hardware for deployment and Arduino blocks
  • Stateflow for the behaviour supervisors

System Identification Toolbox is useful for repeating the motor-identification workflow, but the identified motor models are already included.

Open the project

  1. Clone or download the repository.
  2. Open MATLAB in the repository root.
  3. Open AngelPieroProject.prj.
  4. Start with Modelos/PieroFinalProject.slx for the integrated baseline.
  5. Select the simulated or hardware plant variant in the model before running it.

From the MATLAB Command Window:

openProject("AngelPieroProject.prj");
open_system("Modelos/PieroFinalProject.slx");

To check that every committed model can be loaded:

addpath("scripts");
results = validateProject;
assert(all(results.Loaded));

Hardware deployment additionally requires the PIERO platform (or equivalent differential-drive hardware), an Arduino Mega 2560, motors with encoders, motor drivers, and compatible distance sensors.

Repository guide

Path Contents
Modelos/ Top-level experiments and integrated navigation models
Subsistemas/ Reusable control, plant, sensing, kinematics, and odometry components
Data/ Encoder S-function source, wrapper, TLC file, and Windows MEX binary
Funciones/ MATLAB sonar visualisation utility
Tareas/ Eight illustrated engineering notes in Spanish
docs/ Architecture guide and the original weekly development journal
scripts/ Non-destructive model-load validation

Project notes

Scope and authorship

This repository is Ángel Muñoz Rocha's personal project record from a collaborative university laboratory. It includes his development notes, model integration work, Arduino/Simulink investigation, sensor work, and the individual sonar extension. The journal preserves the original team context and contributions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages