Live data from Hacker News

PID Controllers in Unity3D (2021)

vazgriz.com

1–10 of 46 posts

Re: PID Controllers in Unity3D (2021)

#2
I used a PID controller once to build a drone for a class for my masters. I wish I had the write you just produced than because I had an issue with integral windup and just couldn't express that is was an issue in words. I didn't really understand what each of the coefficients were doing because it was a Hardware based PID controller and being a software engineer that made it very very tricky. Thanks for sharing this

Re: PID Controllers in Unity3D (2021)

#3
post #2

I used a PID controller once to build a drone for a class for my masters. I wish I had the write you just produced than because I had an issue with integral windup and just couldn't express that is was an issue in words. I didn't really understand what each of the coefficients were doing because it was a Hardware based PID controller and being a software engineer that made it very very tricky. Thanks for sharing this

Did you try this?

https://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pd...

Re: PID Controllers in Unity3D (2021)

#4
post #3
post #2

I used a PID controller once to build a drone for a class for my masters. I wish I had the write you just produced than because I had an issue with integral windup and just couldn't express that is was an issue in words. I didn't really understand what each of the coefficients were doing because it was a Hardware based PID controller and being a software engineer that made it very very tricky. Thanks for sharing this

Did you try this? https://www.wescottdesign.com/articles/pid/pidWithoutAPhd.pd...

This is really nice I wish I had this as a resource I wasn't able to root-cause the issue like this article made clear to me until 1 hr ago. Wish it was 2 years ago but I will definitely read through this!

Re: PID Controllers in Unity3D (2021)

#5
I wrote a super basic 2 axis "autopilot" with Python for X-Plane. The concepts are super simple. Getting the controller tuned properly is not.

For a surprisingly large number cases, setting a P value in the 1-3 range and a I value as P/10 works extremely well.

I now write Python for my day job. This code was written before that and now that I look at it, it is quite ugly:

https://austinsnerdythings.com/2021/10/19/coding-a-wing-leve...

A different part of my day job includes, tangentially, tuning PID control parameters for 200-500 HP electric submersible pumps in oil wells. Again, it is amazing how setting an P value in the 1-3 range and an I value P/10 works there as well.

A slightly more advanced autopilot with altitude set and hold (code is even more ugly):

https://austinsnerdythings.com/2021/12/06/coding-a-pitch-rol...

Re: PID Controllers in Unity3D (2021)

#7
I once used a $25 off-the-shelf PID temp controller that came with a type K thermocouple and integrated 12v control line to build an air intake regulator for my meat smoker. I couldn't believe the outcome - 3 hours of fuel turned into 11 hours, and the (logged) temperature stayed between 118.4 and 122 degrees celsius for 10 hours of that. This was outdoors, with all the variance that comes with it, and all I did was attach an old 12v case fan and some aluminium ducting to one of the vents. Blows my mind to this day.

Re: PID Controllers in Unity3D (2021)

#9

I once used a $25 off-the-shelf PID temp controller that came with a type K thermocouple and integrated 12v control line to build an air intake regulator for my meat smoker. I couldn't believe the outcome - 3 hours of fuel turned into 11 hours, and the (logged) temperature stayed between 118.4 and 122 degrees celsius for 10 hours of that. This was outdoors, with all the variance that comes with it, and all I did was…

The interesting thing is that if you can reframe the problem correctly, a PID controller will probably be involved in the closed loop solution. And most of the time you don't even need the derivative term.

The last few systems I've worked on professionally have been nested PI controllers with some filters on the front or back of them. Just needed the correct framing for the problem (the hard part) and it becomes straightforward to solve.

Re: PID Controllers in Unity3D (2021)

#10
post #5

I wrote a super basic 2 axis "autopilot" with Python for X-Plane. The concepts are super simple. Getting the controller tuned properly is not. For a surprisingly large number cases, setting a P value in the 1-3 range and a I value as P/10 works extremely well. I now write Python for my day job. This code was written before that and now that I look at it, it is quite ugly: https://austinsnerdythings.com/2021/10/19/cod…

Does that rule-of-thumb assume specific units/value ranges for the input and output signals?
Post reply on HN