This repository has been archived on 2026-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
hero/Mecanum Wheel moving project 1/Core/Inc/pid.h
2025-11-27 20:08:38 +08:00

22 lines
639 B
C

#ifndef __PID_H
#define __PID_H
#include "main.h"
typedef struct {
float kp; // ????
float ki; // ????
float kd; // ????
float integral; // ???
float prev_error; // ?????
float output; // ???
float integral_limit; // ????
float output_limit; // ????
} PID_Controller_t;
extern void PID_Init(PID_Controller_t* pid, float kp, float ki, float kd, float integral_limit, float output_limit);
extern float PID_Calculate(PID_Controller_t* pid, float error, float dt);
extern void Motor_PID_Init();
extern void PID_PositionClean(PID_Controller_t* pid);
#endif