[MOD]: Removed Constant Argument

This commit is contained in:
but0n 2016-12-09 18:36:05 +08:00
parent 5dc49f5d65
commit b62633619d

3
pid.md
View File

@ -63,6 +63,7 @@ typedef struct {
} pid_st, *pid_pst;
```
``` c
void pid_SingleAxis(pid_pst temp, float setPoint) {
temp->Error = *temp->Feedback - setPoint;
@ -76,7 +77,7 @@ void pid_SingleAxis(pid_pst temp, float setPoint) {
temp->output = (short)(OUTTER_LOOP_KP * (temp->Error) + OUTTER_LOOP_KI * temp->i + OUTTER_LOOP_KD * temp->d);
temp->OutterLast = *temp->Feedback; //Save Old Data
//Inner Loop PD
temp->p = temp->output + *temp->Gyro * 3.5f;
temp->p = temp->output + *temp->Gyro;
temp->d = *temp->Gyro - temp->InnerLast;
temp->output = (short)(INNER_LOOP_KP * temp->p + INNER_LOOP_KD * temp->d);