Page 2 of 2

Re: Help with cascade PID for self balancing bike

Posted: Sat May 30, 2020 5:21 pm
by kurtow187
There is an article in the german electronic magazine 'Elektor'

https://www.elektormagazine.de/news/gra ... er-roboter

maybe this could be interesting...


regards

kurtow

Re: Help with cascade PID for self balancing bike

Posted: Sat May 30, 2020 5:26 pm
by ag123
interesting and thanks ray. for thermistors we'd probably have an 'easier' time as
https://en.wikipedia.org/wiki/Thermistor
the Steinhart–Hart equation is still within reach of even the stm32f103 to calculate.
and certainly isn't difficult for F3 and F4 which has the fpu.
high mhz speeds and 32 bits certainly makes a difference.

i'd think some of the trouble of being non-linear is probably that some of the math don't even have close form formula solutions and need numerical methods (e.g. iterative newton rhapson etc) to calculate, and the math isn't quite straight forward. some of them even exhibit chaotic behavior
https://en.wikipedia.org/wiki/Double_pendulum
Image
i'd guess i'd spend some effort to get myself familiar nevertheless, it is one topic i find difficulty to grasp.

it is nevertheless interesting as this complicated stuff applied made many things possible e.g. drones, rockets, aircrafts and the simple buck converter etc

Re: Help with cascade PID for self balancing bike

Posted: Sun May 31, 2020 1:04 pm
by flyboy74
I am slowly getting filling in the gap in my math knowledge and starting to understand most of the needed math.

If your interested in watching the lecture on how to linearize a non linear system this is the video https://www.youtube.com/watch?v=1YMTkELi3tE

It seems what they do is instead of considering the whole non linear system you just consider a very small nudge either side of the fixed point because when you look at only a very small part of a non linear it will look linear then if you design a good enough control system it will keep it within this very small nudge either side of the fixed point and it will act like it is linear, it will only be if your control is poor and it moves to far off that it will start to act non linear

Re: Help with cascade PID for self balancing bike

Posted: Sun May 31, 2020 5:28 pm
by ag123
wow very nice and educational :)
it seemed to also show why these systems can fail even if a PID controller is driving it, as it is unstable.

Re: Help with cascade PID for self balancing bike

Posted: Sun May 31, 2020 10:38 pm
by flyboy74
ag123 wrote: ↑Sun May 31, 2020 5:28 pm wow very nice and educational :)
it seemed to also show why these systems can fail even if a PID controller is driving it, as it is unstable.
If you watch the whole series you will be surprised at what can be mathematically worked out. They mathematically calculate the values needed for the control system (values of the PID or any other system your using). Then they calculate how different values change how dynamic or robust the control system is, the more dynamic the control system (the more aggressive it controls it) the less robust it is and they is a way of calculating where you can optimize dynamic vs robust i.e at what point do you get a lot more robust for little loss in dynamic or at what point do you get very little increase of robust for a lot of loss in dynamic.