This project implements control of an inverted pendulum system using both wired (Arduino-based) and wireless (ESP-NOW-based) architectures.
The system is modeled and analyzed in MATLAB/Simulink, and control is implemented using a proportional controller derived via pole placement techniques.
- Sensor readings are directly obtained by the Arduino
- Control computation is performed locally
- Output voltage is applied directly to the motor
- Sensor data is collected by an ESP32 (plant side)
- Data is transmitted via ESP-NOW
- Controller ESP32 computes control input
- Control signal is sent back to plant ESP
- Arduino Mega acts as a voltage interface (3.3V → 5V) for motor actuation
proportional/
Proportional_controller.ino
simulation/
controlled_simulation.m
linearization_with_motor.m
pendulum_model.slx
pole_placement_with_motor.m
wireless/
Delay_RTT.ino
ESP_PWM_reader.ino
Pendulum_controller.ino
Pendulum_plant.ino
| File | Description |
|---|---|
linearization_with_motor.m |
Linearizes the pendulum system including motor dynamics |
pole_placement_with_motor.m |
Computes controller gains using pole placement |
controlled_simulation.m |
Simulates closed-loop system performance |
pendulum_model.slx |
Simscape model of pendulum + motor dynamics |
- Model system dynamics
- Include motor voltage behavior
- Design controller gains before hardware implementation
File: proportional/Proportional_controller.ino
- Implements proportional controller on Arduino
- Uses gains obtained from simulation
- Sensor readings are directly processed
- Motor is controlled via wired interface
- Runs on ESP32 (plant side)
- Reads sensor data
- Transmits data to controller via ESP-NOW
- Receives control signal
- Runs on ESP32 (controller side)
- Receives sensor data
- Computes control input (voltage)
- Sends control signal back to plant
- Runs on Arduino Mega
- Reads PWM signal from ESP32 (3.3V)
- Converts it to 5V signal for motor driver
- Acts as a level shifter + actuator interface
- Measures communication delay (Round Trip Time)
- Evaluates latency in wireless control loop
- Dual architecture: wired and wireless control
- Real-time ESP-NOW communication
- Latency measurement and analysis
- MATLAB-based system modeling and controller design
- Integration of embedded systems with control theory
- Networked control systems
- Wireless feedback control
- Real-time embedded control systems
- Robotics and automation
- Controller gains are derived from MATLAB simulations
- Wireless system introduces delay, analyzed via RTT measurement
- Arduino Mega is used to handle voltage level mismatch (3.3V → 5V)