⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pid_header.h

📁 this is matlab pid tuning code
💻 H
字号:
// Two 16-bits fixed-point PID implementations in C with 
// the Legacy code tool.
//
// Usage :
// Macros definitions
// Header file inclusions
// PID functions declarations
//
// Warning :
// Check the installation of the C compiler with
// the command "mex -setup".
//
// Author :
// Gilles Bailly, nov. 2008.
// LCAR UMR5589-CNRS, Toulouse, France.

#ifndef PID_HEADER_H

#define PID_HEADER_H

#include "pid_types.h"

// The pid coefficient are scaled with 2^12
#define COEFF_FRAC_PART ( 12 )

// The data values are scaled with 2^10
#define DATA_FRAC_PART  ( 10 )
// Define 1/2 data lsb used for rounding during fixed-point multiplications
#define DATA_HALF_LSB   ( (int32_t)(1)<<( DATA_FRAC_PART-1) )

// 16-bits PID fixed-point PID controller in single precision
extern int16_t pid_sp(
int16_t yr,
int16_t ym,
int16_t kp,
int16_t ki,
int16_t rounding_enable,
int16_t *pid_state);

// 16-bits PID fixed-point PID controller in double precision
extern int16_t pid_dp(
int16_t yr,
int16_t ym,
int16_t kp,
int16_t ki,
int16_t rounding_enable,
int32_t *pid_state);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -