I have been making an inverted pendulum using LQR. Here's a list of my hardware:
Microcontroller: Microchip WiFIRE (PIC 32) Motor Control: L298N Encoders (2x): US Digital shaft encoders (4095 counts) DC Motor: Faulhaber Coreless DC motor (2338S006) Gearbox: Faulhaber Planetary (3.71:1)
I am using Simulink to program the PIC32. So far I have verified that the encoders for the cart and pendulum are generating the correct measurements. The system 'wants' to behave, but is unwilling to 'push through' to keep the pendulum upright: if there is a positive error on the pendulum angle, the cart does not most fast enough to accelerate the pendulum in the opposite direction and get underneath it (it's being lazy). Attached is a screenshot of my Simulink model.
I have tried messing around with my Q matrix for the LQR but I'm convinced there is something missing in my modeling of the system. Here is an image of the MatLab code I used to simulate the dynamics
I understand this is a very open question but if this behavior sounds familiar to any of you I would really like to get some input on where to look next, I feel like I am stuck and have been really excited to get this up and running.
Thanks
Update: Tim, good point. Here is an image of my equations of motion.