mirror of
https://github.com/avem-labs/Avem.git
synced 2023-09-01 15:18:49 +08:00
[MOD]: Removed Constant Argument
This commit is contained in:
parent
5dc49f5d65
commit
b62633619d
3
pid.md
3
pid.md
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user