Part of SHKYERA project
With this software, you can tune your PID values for a thrust vector controlled rockets. It has been experimentally tested and simulator accuracy is more than enough for amateur rocketry.
The Python script simulates rocket's orientation on a purely mechanical basis (no aerodynamics 🙁). Angular momentum equations are applied to check how good a set of PID values is for a particular rocket.
- Find physical parameters of the rocket, that is:
- Mass
- Distance from the engine to the center of mass
- Mass moment of inertia (tutorial)
- Engine's thrust
- Delay of the actuator (time between sending a command to a physical movement of TVC mount)
- Run the script with above parameters and find accurate PID values!
python MomentumSimulator.py -delay 0.04 -moment 0.0344 -distance 0.21 -thrust 2 -mass 0.431 -length 4 -angle 12 -p 0.45 -i 0.1 -d 0.22
As you can see, the top-left plot goes to zero pretty quickly (the rocket stabilizes), so the PID values are good and ready to be pasted into your controller!
Check
python MomentumSimulator.py -h
or post an issue.