Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //PID Code
- Error = TargetP - Pitch;
- Integral = Integral + (Error*1);
- Derivitive = (Error - PrevError)/1;
- Output = (Kp*Error) + (Ki*Integral) + (Kd*Derivitive);
- // 0.00375 For Launch
- // 0.00375
- PrevError = Error;
- if(Error > 0.5){SetThrusterGroupLevel(THGROUP_ATT_PITCHUP,Output); SetThrusterGroupLevel(THGROUP_ATT_PITCHDOWN,0);}
- if(Error < -0.5){SetThrusterGroupLevel(THGROUP_ATT_PITCHDOWN,-Output); SetThrusterGroupLevel(THGROUP_ATT_PITCHUP,0);}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement