Live data from Hacker News

PID Control Challenges

janismac.github.io

11–20 of 123 posts

Re: PID Control Challenges

#11
The "Ball on Platform: Edge Balance" one seems super interesting to me.

Is the sample solution just hardcoded or is there some maths behind it to make it work from any location/initial speed?

Re: PID Control Challenges

#14
post #7
post #5

Possibly useful: A header-only proportional-integral-derivative (PID) controller. https://github.com/RhysU/helm

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

I find this hard to believe. Even a humble arduino can do 34,000 software float divides per second. https://gist.github.com/cellularmitosis/506c878631f806cfe6f8...

Re: PID Control Challenges

#15
post #7

Earlier quoted context omitted.

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

Is this still true? It seems like most IoT stuff has chips that easily eclipse the capabilities of my Amiga1000 and are 32bitbwith hardware floats. Looking around, I'm having trouble finding something that isn't a 32bitHF in my house. Possibly my Keurig machine? Even using digital instead of an RLC implementation in a coffee machine seems like a waste, but I'm old.

Most PID applications are not IoT. Many use a cortex M0 which doesn't have hardware float support, or non Arm, even 8bit. When you are selling millions it pays to use the cheapest part you can get away with.

Re: PID Control Challenges

#16

Earlier quoted context omitted.

Is this still true? It seems like most IoT stuff has chips that easily eclipse the capabilities of my Amiga1000 and are 32bitbwith hardware floats. Looking around, I'm having trouble finding something that isn't a 32bitHF in my house. Possibly my Keurig machine? Even using digital instead of an RLC implementation in a coffee machine seems like a waste, but I'm old.

Most PID applications are not IoT. Many use a cortex M0 which doesn't have hardware float support, or non Arm, even 8bit. When you are selling millions it pays to use the cheapest part you can get away with.

What do those things go in anymore? Surely there are asic pid controllers that are insanely cheap? Tuning an analog one I can see probably doesn't make sense anymore, but there is something nice about being able to do that with a screwdriver instead of jtag. What do these M0s go into?

Re: PID Control Challenges

#17
post #7

Earlier quoted context omitted.

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

Is this still true? It seems like most IoT stuff has chips that easily eclipse the capabilities of my Amiga1000 and are 32bitbwith hardware floats. Looking around, I'm having trouble finding something that isn't a 32bitHF in my house. Possibly my Keurig machine? Even using digital instead of an RLC implementation in a coffee machine seems like a waste, but I'm old.

Cortex-M4/M33 are pretty widely deployed on microcontrollers with control hardware, for example the STM32G4 and Reneasas RA series.

There's still a few reasons not to use it, though. Saving and restoring the float registers adds interrupt handling overhead. If you can fit into 16 bit integers, you can also use the 2 way SIMD instructions and get at least double the throughput.

Finally, floats themselves have a lot of footguns. You have to be very careful about propagating NaNs etc into control loops. It's also really easy (in C) to accidentally promote to double.

Re: PID Control Challenges

#18
post #7
post #5

Possibly useful: A header-only proportional-integral-derivative (PID) controller. https://github.com/RhysU/helm

It's a nice theoretical implementation but few practical examples would be found using floating-point math, running as they are on systems that don't support it.

Maybe that was true up until the 90's, but doing anything but floating point for a PID is just a waste of development time, even on an 8-bit AVR.

Re: PID Control Challenges

#19

Earlier quoted context omitted.

Is this still true? It seems like most IoT stuff has chips that easily eclipse the capabilities of my Amiga1000 and are 32bitbwith hardware floats. Looking around, I'm having trouble finding something that isn't a 32bitHF in my house. Possibly my Keurig machine? Even using digital instead of an RLC implementation in a coffee machine seems like a waste, but I'm old.

Most PID applications are not IoT. Many use a cortex M0 which doesn't have hardware float support, or non Arm, even 8bit. When you are selling millions it pays to use the cheapest part you can get away with.

It’s changing rapidly. I can get $0.10 32-but microcontrollers that run at 48MHz and handle plenty of soft float operations just fine.

Re: PID Control Challenges

#20
My control systems prof said every engineer has done an inverted pendulum problem in school and nobody in their career has ever been asked to balance an inverted pendulum. So our final was a thermostat instead.
Post reply on HN