Open weiminshen99 opened 1 year ago
Hey @weiminshen99 ,
here is a community post from some time ago that might be helpful: https://community.simplefoc.com/t/self-balancing-robot/343/24?u=antun_skuric
Basically, if you have such state space control algorithm:
Voltage = k1*angle +k2*angular_velocity +k3*motor_velocity;
k1
and k2
are necessary for stabilisation, k3
isn't really. So you can start by setting k3=0
k1
and k2
. In my experience k1
is more or less 10 times larger k2
. The expected behavior that you're searching to get is that the robot almost stays upright, but the motor never stops turning. And at some point the motor reaches its maximal velocity and then the robot falls (as it can no longer generate acceleration in that direction)k3
. The k3
penalizes the motor velocity so the motor will try to stop as soon as it can (as soon as the pendulum is stable and upright). In my experience the k3
is around 10 times smaller than k2
. With the higher k3
you will add more importance to the motor velocity so you’ll see the effect visually. k3
is good. If you add a small value k3
and the pendulum is even more unstable than without it, this probably means that the sign of k3
is wrong. :smile: Good luck!
Hi, Antun,
Thank you so much for your reply and advices! I will try them out and let you know the results.
By the way, the "Self-Balancing Robot" applications are very cool.
Dear Antun,
Thank you so much for this amazing project and it is very inspiring !!
I made a similar system that is almost working (please see https://youtube.com/shorts/L6I1zPEigmI?feature=share), but I don't know to tune the LQR parameters precisely so to make it completely stabilize. Could you please give me some advice? Thanks!
-- Wingman