pid.h

来自「luminary芯片直流无刷电机控制程序」· C头文件 代码 · 共 72 行

H
72
字号
//*****************************************************************************//// pid.h - Prototypes for the PID feedback control algorithm.//// Copyright (c) 2005,2006 Luminary Micro, Inc.  All rights reserved.//// Software License Agreement//// Luminary Micro, Inc. (LMI) is supplying this software for use solely and// exclusively on LMI's microcontroller products.//// The software is owned by LMI and/or its suppliers, and is protected under// applicable copyright laws.  All rights are reserved.  Any use in violation// of the foregoing restrictions may subject the user to criminal sanctions// under applicable laws, as well as to civil liability for the breach of the// terms and conditions of this license.//// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.//// This is part of revision 196 of an01238.////*****************************************************************************#ifndef __PID_H__#define __PID_H__//*****************************************************************************//// The internal state of the PID algorithm.////*****************************************************************************typedef struct{    //    // The integrator, along with its value limits.    //    long lIntegrator;    long lIntegMax;    long lIntegMin;    //    // The position from the previous call to the algorithm.  This is used for    // determining the derivitive of the position.    //    long lPrevPosition;    //    // The gain factors for the algorithm.    //    long lPGain;    long lIGain;    long lDGain;}tPIDState;//*****************************************************************************//// Prototypes for the PID algorithm APIs.////*****************************************************************************extern void PIDInitialize(tPIDState *psState, long lIntegMax, long lIntegMin,                          long lPGain, long lIGain, long lDGain);extern void PIDSetGains(tPIDState *psState, long lPGain, long lIGain,                        long lDGain);extern long PIDUpdate(tPIDState *psState, long lPosition, long lError);#endif // __PID_H__

⌨️ 快捷键说明

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