Полный переход на C++
*Чтение IMU и обработка его данных выполняется в точности как в рабочей прошивке. *Определение вращения работает корректно.
This commit is contained in:
28
Source/Control/PID.h
Normal file
28
Source/Control/PID.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef PID_H
|
||||
#define PID_H
|
||||
|
||||
#include "stm32g4xx.h"
|
||||
|
||||
struct pid_t
|
||||
{
|
||||
float kp;
|
||||
float ki;
|
||||
float kd;
|
||||
|
||||
float integral;
|
||||
float prev_error;
|
||||
};
|
||||
|
||||
struct control_channels_t
|
||||
{
|
||||
float roll;
|
||||
float pitch;
|
||||
float yaw;
|
||||
};
|
||||
|
||||
float pid_update(pid_t* pid, float error, float gyro_rate, float dt);
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user