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

📄 pid.h

📁 无刷电机驱动器源代码。基于无传感器方案的无刷电机启动器。核心是换向角度检测:即电机反电势波形数据处理
💻 H
字号:
//*****************************************************************************//// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -