This ch(tr)unk of j(f)unk is an attempt to learn more about PID controllers and how they can be implemented in Vizzy. The objective is to achieve zero vertical velocity, i.e. it hovers, for a couple of minutes at least then lands automatically. I’ve tried to keep it simple and avoid mission creep so if too much lateral velocity gets built up use navsphere pitch to cancel it out manually.
I’m not entirely convinced I’ve got everything right so I’m calling it beta. Would benefit from some more tuning finesse. Neither am I sure the derivative is synced up properly but it works reasonably well despite all the probable faults.
Translate Up to ascend (target vertical velocity of 20 by default).
Translate Down to descend (target vertical velocity of -20 by default).
AG 1 to 3 activate gains for respective PID calculation.
AG 4 switches the data displayed to show the gain values.
Slider 1 tunes gain for the proportional calculation.
Slider 2 tunes gain for the integral calculation.
Once fuel runs low a setting down procedure will begin automatically. This can be initiated manually on AG 10.
GENERAL INFO
- Successors 2 craft(s)
- Created On: iOS
- Game Version: 0.8.402.0
- Price: $614k
- Number of Parts: 105
- Dimensions: 3 m x 4 m x 4 m
PERFORMANCE
- Total Delta V: 2.8km/s
- Total Thrust: 141kN
- Engines: 4
- Wet Mass: 10,600kg
- Dry Mass: 3,131kg
STAGES
Stage | Engines | Delta V | Thrust | Burn | Mass |
---|---|---|---|---|---|
2 | 4 | 2.8km/s | 141kN | 2.1m | 10,600kg |
6 Comments
- Log in to leave a comment
-
7,237 Nethereal
@huuminberd I was able to get a hover to within -e07 decimal places of vertical velocity (0.000000X). The main thing that helped with that precision was keeping track of ship mass from previous physics tick, determining the delta with the current tick, and subtracting the delta to determine the 'predicted' upcoming physics tick mass. Set your throttle/TWR in function of that, and your hover will become much tighter.
-
1,155 huuminberd
@Nethereal In the build I'm working on it's stabilised to 0m/s fairly quickly, eventually settling to slight oscillations within an error margin of 0.02. This build I'm not sure, guess it settles down eventually but there's a lot wrong with it.
-
-
1,155 huuminberd
One horrific flaw in this script is that when set point equals measurement the only thing keeping the throttle open is the accumulated value of the integral. This is just wrong for more reasons than I actually understand. I've now remedied this by introducing a control output bias. A variable added to the PID sum equal to the throttle required to provide a TWR of one, the effective null point. I want to add more refinements before the next version but I will do it eventually.
-
@Nethereal wow that's impressive, my brain's fried enough on this one though.. I'm learning controllers from scratch, wanting to do a fairly vanilla PID so, yeah was thinking about experimenting some more but need time to digest. You can have that prize 🙂