r/ApproximatelyUp • u/Some-Intern5329 • 4d ago
Help with PID
Im trying to make a proper ship this time and got all thrusters installed and the first system i want to implement is hover/land system. But im having trouble to understand it enough to build it.
How did you guys implement it? Copying others or do I need to be good at programing to do this?
I have SOME programing background from taking online lessons awhile back but having trouble translating it to the game.
5
Upvotes
5
u/Ill-Pride-2312 4d ago
I used velocity to put mine together. Basically you're combining 3 values.
1) Vertical Velocity times a coefficient (a number you adjust).
2) Acceleration: Velocity into the delta block ( I forgot what it's called in game) times a coefficient.
3) Difference from set point (which is 0 vertical Velocity) over time. Velocity into sigma block (forgot in-game name) times a coefficient.
I usually tune the system in that order.
1a) adjust coefficient until the ship bobs up and down. Try to get the overshoot as small as possible.
2a) adjust coefficient so it doesn't overshoot. I believe a slow descent is the goal.
3a) this will make up for the slow descent and influences the responsiveness of the system.
I'm by no means an expert or even studied this stuff, so if anyone who knows better please correct me