//
// Created by ZK on 2023/3/14.
//

#ifndef BOOOOMFOC_STSPIN32G4_EVB_PID_H
#define BOOOOMFOC_STSPIN32G4_EVB_PID_H

typedef struct pid {
    float kp;//比例系数
    float ki;//积分系数
    float kd;//微分系数

    float target;
    float value;
    float error;

    float errSum;
    float errSumMax;

    float errMin;
    float valMax;

    float lastErr;
    float errDt;

    float result;
} PID;

float PID_Generate(PID *pid);


#endif //BOOOOMFOC_STSPIN32G4_EVB_PID_H
