Pipsqueakalchemist
- 142
- 20
- TL;DR
- Rotary Inverted Pendulum with LQR controller, trying to improve Simulation to be more realistic and match hardware.
So I'm trying to implement a LQR control on a Rotary Inverted Pendulum. I derived the dynamics and created a Simulink model and it works perfectly in simulation. I'm trying to close the sim to real gap. My hardware component is the follwing, Nema17 with quadrature encoder mounted, AS5600 for pendulum readings, a TMC2208 to drive the motor, and a ESP32 Devkit V1 as the microcontroller.
I performed some step input, ramp input, periodic input on Nema17 (without pendulum readings). I basically modelled the relation between commanded motor velocity in code with Accelstepper library and the actual motor velocity measured by taking dirty derivatives of the encoder readings as a 2nd order system. I used the step input data and Matlab's system identification app to approximate the model and compared it with the ramp and periodic and it seemed accurate enough.
The next steps I plan to do is to make the Simulink model more realistic is
I performed some step input, ramp input, periodic input on Nema17 (without pendulum readings). I basically modelled the relation between commanded motor velocity in code with Accelstepper library and the actual motor velocity measured by taking dirty derivatives of the encoder readings as a 2nd order system. I used the step input data and Matlab's system identification app to approximate the model and compared it with the ramp and periodic and it seemed accurate enough.
The next steps I plan to do is to make the Simulink model more realistic is
- add my dirty derivative computation for the velocities into the Simulink (before I was reading the true velocity from joint block)
- compute step,ramp,periodic with pendulum readings, and use Simulink parameter estimation to model the hardware dynamics