Skip to content

Latest commit

 

History

History
75 lines (61 loc) · 4.82 KB

model-guide.md

File metadata and controls

75 lines (61 loc) · 4.82 KB

Model and architecture guide

This guide maps the Simulink artifacts to the PIERO control architecture and identifies the best entry points for reviewing the project.

Recommended entry points

Model Use it for
PieroFinalProject.slx Integrated baseline: Pure Pursuit, infrared obstacle avoidance, odometry, control, and plant variant
PieroFinalProject_mf.slx Integrated baseline using a custom MATLAB Function path follower
FinalProject_optional.slx Experimental sonar integration; see the reproducibility note below

Control flow

  1. A waypoint matrix defines the desired route.
  2. Pure Pursuit—or the custom MATLAB Function implementation—converts the route and current pose into linear and angular velocity commands.
  3. A Stateflow supervisor monitors distance sensors and overrides the navigation command when an obstacle is detected.
  4. Inverse kinematics converts robot velocity commands into left/right wheel references.
  5. Closed-loop wheel controllers produce motor commands.
  6. A Variant Source selects the identified discrete motor plant or the Arduino-connected hardware.
  7. Encoder feedback passes through direct kinematics and odometry to estimate the robot pose.

The integrated models use a fixed-step discrete solver with a 0.01 s base step.

Top-level models

File Purpose
Cinematica.slx Direct/inverse kinematics and odometry integration
Control_BA.slx Open-loop wheel-speed control using identified lookup data
Control_BC.slx Closed-loop wheel-speed control using two PID controllers
Control_Orientacion.slx Linear/angular velocity control with orientation feedback
DataIdent.slx Motor excitation and encoder-data capture for identification
EvitaParedes.slx Basic reactive wall avoidance using infrared sensors
EvitaParedes_con_sonar.slx Early sonar wall-avoidance experiment
Trayectoria_SB.slx Commanded trajectory using Signal Builder
Trayectoria_SD.slx Commanded trajectory using a Stateflow diagram
Trayectoria_WP.slx Waypoint tracking using the Robotics System Toolbox Pure Pursuit block
Trayectoria_WP_mf.slx Waypoint tracking using a custom MATLAB Function implementation
TrayectoriaConEvitaObstaculos.slx Waypoint tracking combined with reactive avoidance
PieroFinalProject.slx Main integrated project model
PieroFinalProject_mf.slx Main model with the custom path follower
FinalProject_optional.slx Final sonar-enhanced experiment

Reusable subsystems

File Responsibility
MCI.slx / MCD.slx Inverse and direct differential-drive kinematics
Odometria.slx Pose estimation from linear/angular velocity
ControladorBA.slx Open-loop lookup-table wheel control
ControladorBC.slx Closed-loop dual PID wheel control
ControlVelocidad.slx Controller and plant composition
Motors_TF.slx Identified discrete motor transfer functions
Motors_HW.slx Hardware motors plus encoder feedback
Motores_planta.slx Simulation/hardware plant variant
Motores.slx PWM and direction logic for the motor driver
Encoders.slx Encoder acquisition and conversion to wheel speed
Sensores.slx Infrared sensor acquisition and distance conversion
LEDs.slx / LEDvOpcional.slx Robot state indication

Data and MATLAB code

  • Data/EncoderPiero_Final.* contains the generated S-function, wrapper, TLC support, and a prebuilt Windows 64-bit MEX file used for encoder work.
  • Funciones/Visual.m receives newline-delimited angle,distance frames at 115200 baud and maintains a live polar sonar plot.
  • scripts/validateProject.m loads each committed model without saving it and reports failures.

Reproducibility notes

  • The SLX files were saved with MATLAB/Simulink R2023b.
  • Arduino models require Simulink Support Package for Arduino Hardware to compile or deploy. Without it, MATLAB can still load the models but reports hardware-support warnings.
  • EncoderPiero_Final.mexw64 is Windows-specific. The accompanying C and wrapper sources are included for rebuilding where the required compiler and dependencies are available.
  • The standard final models reference subsystem files included in the repository.
  • The optional sonar experiments reference Sonar, CONTROLADOR_SONAR, LEDs_SONAR, and Motores_sonar subsystem files that are not committed. The design process, integration screenshots, and recorded results remain documented in ProyectoOpcional.md, but a complete rebuild of those experimental models requires the missing subsystem sources.
  • Signal Builder is used in two historical experiments and produces a deprecation warning in newer MATLAB releases.