Electronics > Projects, Designs, and Technical Stuff

Inverted Pendulum robot won't balance! (MPU-6050, STM32, PID etc)

<< < (4/5) > >>

thinkfat:
How many computation loops do you get per second? Is your MCU actually fast enough for all that floating point stuff you're doing?

Mr. Scram:

--- Quote from: ogden on January 06, 2020, 07:17:10 am ---By practical experimenting you mean tuning PID variables using trial and error approach, other name for it is "PID tuning magic"? :D Yes, why not - as long as it works for you. Thou there are other ways. Further reading: https://www.mathworks.com/company/newsletters/articles/tuning-a-pid-controller-when-a-plant-model-is-not-available.html

--- End quote ---
You seem to be misconstruing what I said and also adding to it. I said PID tuning isn't an exact art. Dicking around until you get something serviceable would justify that qualification. Having some idea of control theory just ensures your making educated guesses instead of blind stabs. Having a feel for where to guess and stab is wherein the art lies. The dark part occasionally surfaces when you have dicky systems that just won't behave.

ogden:

--- Quote from: Mr. Scram on January 06, 2020, 02:52:34 pm ---Having some idea of control theory just ensures your making educated guesses instead of blind stabs. Having a feel for where to guess and stab is wherein the art lies. The dark part occasionally surfaces when you have dicky systems that just won't behave.

--- End quote ---
Not every control task is hobby drone. Sometimes you have to work out plant model and tune PID w/o educated guesses unless you want to waste months of your time and/or damage expensive stuff/materials. Simple example: boiler which cools down during few days and can't go above certain temperature no matter what (otherwise contents are damaged).

Mr. Scram:

--- Quote from: ogden on January 06, 2020, 03:08:16 pm ---Not every control task is hobby drone. Sometimes you have to work out plant model and tune PID w/o educated guesses unless you want to waste months of your time and/or damage expensive stuff/materials. Simple example: boiler which cools down during few days and can't go above certain temperature no matter what (otherwise contents are damaged).

--- End quote ---
You mean there's some art in using the appropriate models or approach as it depends on the situation and isn't quite a clear cut problem with an equally clear cut path to a solution? That sounds about right. Sounds familiar too.

MattHollands:
Ok I've made the pendulum arm a bit longer and it is performing better: https://youtu.be/KH-BAVT16ps
I have printed some "arm extensions" but unfortunately I had to bolt them together with metal bolts so the weight is not really at the top. I have ordered some plastic bolts so I can move all the weight to the top and see if that improves things further.

Thanks for all the tips on tuning - I seem to be getting closer.


--- Quote from: thinkfat on January 06, 2020, 12:28:45 pm ---How many computation loops do you get per second? Is your MCU actually fast enough for all that floating point stuff you're doing?

--- End quote ---

My loop time is about 1ms.


--- Quote from: mikerj on January 06, 2020, 11:12:28 am ---If it's not currently included I'd advise adding some method of logging the outputs from your sensors (e.g. serial link) so change to the control loop performance from modifying PID gains can be easily visualised in e.g. a spreadsheet. 

--- End quote ---

Lol yep totally wish I had included a radio chip or something so I could stream data off it. If I spin a second board I may well do this.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod