打印
[牛人杂谈]

如何写一个标准的PID算法

[复制链接]
4253|25
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
598330983|  楼主 | 2017-5-24 14:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这是我收藏的一个典型的PID处理程序,包含了最常用的PID算法的基本架构,没有包含输入输出处理部分。适合新手了解PID结构,入门学习用。
注意:
使用不同的MCU的时候,需要进行相应的简化和改写。而且由于单片机的处理速度和ram资源的限制,一般不采用浮点数运算。而将所有参数全部用整数,运算到最后再除以一个2的N次方数据(相当于移位),作类似定点数运算。这样可大大提高运算速度,根据控制精度的不同要求,当精度要求很高时,注意保留移位引起的“余数”,做好余数补偿就好了。


沙发
598330983|  楼主 | 2017-5-24 14:34 | 只看该作者
#include<reg51.h>
#include<intrins.h>
#include<math.h>
#include<string.h>
struct PID {
        unsigned int SetPoint; // 设定目标 Desired Value
        unsigned int Proportion; // 比例常数 Proportional Const
        unsigned int Integral; // 积分常数 Integral Const
        unsigned int Derivative; // 微分常数 Derivative Const
        unsigned int LastError; // Error[-1]
        unsigned int PrevError; // Error[-2]
        unsigned int SumError; // Sums of Errors
        };
struct PID spid; // PID Control Structure
unsigned int rout; // PID Response (Output)
unsigned int rin; // PID Feedback (Input)
sbit data1=P1^0;
sbit clk=P1^1;
sbit plus=P2^0;
sbit subs=P2^1;
sbit stop=P2^2;
sbit output=P3^4;
sbit DQ=P3^3;
unsigned char flag,flag_1=0;
unsigned char high_time,low_time,count=0;//占空比调节参数
unsigned char set_temper=35;
unsigned char temper;
unsigned char i;
unsigned char j=0;
unsigned int s;
        /***********************************************************
        延时子程序,延时时间以12M晶振为准,延时时间为30us×time
        ***********************************************************/
void delay(unsigned char time)
        {
            unsigned char m,n;
            for(n=0;n<time;n++)
            for(m=0;m<2;m++){}
        }
        /***********************************************************
        写一位数据子程序
        ***********************************************************/
void write_bit(unsigned char bitval)
{
          EA=0;
          DQ=0; /*拉低DQ以开始一个写时序*/
        if(bitval==1)
        {
          _nop_();
          DQ=1; /*如要写1,则将总线置高*/
        }
         delay(5); /*延时90us供DA18B20采样*/
         DQ=1; /*释放DQ总线*/
        _nop_();
        _nop_();
        EA=1;
}
        /***********************************************************
        写一字节数据子程序
        ***********************************************************/
void write_byte(unsigned char val)
{
            unsigned char i;
            unsigned char temp;
            EA=0;
            TR0=0;
        for(i=0;i<8;i++) /*写一字节数据,一次写一位*/
        {
          temp=val>>i; /*移位操作,将本次要写的位移到最低位*/
          temp=temp&1;
          write_bit(temp); /*向总线写该位*/
        }
          delay(7); /*延时120us后*/
        // TR0=1;
          EA=1;
}
        /***********************************************************
        读一位数据子程序
        ***********************************************************/
unsigned char read_bit()
{
        unsigned char i,value_bit;
        EA=0;
        DQ=0; /*拉低DQ,开始读时序*/
        _nop_();
        _nop_();
        DQ=1; /*释放总线*/
        for(i=0;i<2;i++){}
        value_bit=DQ;
        EA=1;
        return(value_bit);
}
        /***********************************************************
        读一字节数据子程序
        ***********************************************************/
unsigned char read_byte()
{
        unsigned char i,value=0;
        EA=0;
        for(i=0;i<8;i++)
        {
        if(read_bit()) /*读一字节数据,一个时序中读一次,并作移位处理*/
        value|=0x01<<i;
        delay(4); /*延时80us以完成此次都时序,之后再读下一数据*/
        }
        EA=1;
        return(value);
}
        /***********************************************************
        复位子程序
        ***********************************************************/
unsigned char reset()
{
        unsigned char presence;
        EA=0;
        DQ=0; /*拉低DQ总线开始复位*/
        delay(30); /*保持低电平480us*/
        DQ=1; /*释放总线*/
        delay(3);
        presence=DQ; /*获取应答信号*/
        delay(28); /*延时以完成整个时序*/
        EA=1;
        return(presence); /*返回应答信号,有芯片应答返回0,无芯片则返回1*/
}
        /***********************************************************
        获取温度子程序
        ***********************************************************/
void get_temper()
{
        unsigned char i,j;
        do
        {
           i=reset(); /*复位*/
        }  while(i!=0); /*1为无反馈信号*/
            i=0xcc; /*发送设备定位命令*/
           write_byte(i);
           i=0x44; /*发送开始转换命令*/
           write_byte(i);
           delay(180); /*延时*/
        do
        {
           i=reset(); /*复位*/
        }  while(i!=0);
           i=0xcc; /*设备定位*/
           write_byte(i);
           i=0xbe; /*读出缓冲区内容*/
           write_byte(i);
           j=read_byte();   
           i=read_byte();
           i=(i<<4)&0x7f;
           s=(unsigned int)(j&0x0f);            //得到小数部分
           s=(s*100)/16;
           j=j>>4;
           temper=i|j; /*获取的温度放在temper中*/
        }
        /*====================================================================================================
        Initialize PID Structure
        =====================================================================================================*/
void PIDInit (struct PID *pp)
{
        memset ( pp,0,sizeof(struct PID));           //全部初始化为0
}
        /*====================================================================================================
        PID计算部分
        =====================================================================================================*/
unsigned int PIDCalc( struct PID *pp, unsigned int NextPoint )
{
        unsigned int dError,Error;
        Error = pp->SetPoint - NextPoint;          // 偏差           
        pp->SumError += Error;                     // 积分                                   
        dError = pp->LastError - pp->PrevError;    // 当前微分  
        pp->PrevError = pp->LastError;                           
        pp->LastError = Error;                                       
        return (pp->Proportion * Error             // 比例项           
        + pp->Integral * pp->SumError              // 积分项
        + pp->Derivative * dError);                // 微分项
}
        /***********************************************************
        温度比较处理子程序
        ***********************************************************/
void compare_temper()
{
        unsigned char i;
        if(set_temper>temper)      //是否设置的温度大于实际温度
        {
           if(set_temper-temper>1)         //设置的温度比实际的温度是否是大于1度
          {
           high_time=100;                     //如果是,则全速加热
           low_time=0;
          }
       else                                         //如果是在1度范围内,则运行PID计算
          {
            for(i=0;i<10;i++)
          {
            get_temper();                          //获取温度
            rin = s; // Read Input
            rout = PIDCalc ( &spid,rin ); // Perform PID Interation
          }
            if (high_time<=100)
              high_time=(unsigned char)(rout/800);
            else
          high_time=100;
              low_time= (100-high_time);
          }
        }
        else if(set_temper<=temper)
        {
           if(temper-set_temper>0)
          {
            high_time=0;
            low_time=100;
          }
           else
          {
             for(i=0;i<10;i++)
           {
         get_temper();
         rin = s; // Read Input
             rout = PIDCalc ( &spid,rin ); // Perform PID Interation
           }
             if (high_time<100)
              high_time=(unsigned char)(rout/10000);
             else
              high_time=0;
              low_time= (100-high_time);
          }
        }
        // else
        // {}
}
        /*****************************************************
        T0中断服务子程序,用于控制电平的翻转 ,40us*100=4ms周期
        ******************************************************/
void serve_T0() interrupt 1 using 1
{
        if(++count<=(high_time))
        output=1;
        else if(count<=100)
        {
        output=0;
        }
        else
        count=0;
        TH0=0x2f;
        TL0=0xe0;
}
        /*****************************************************
        串行口中断服务程序,用于上位机通讯
        ******************************************************/
void serve_sio() interrupt 4 using 2
{
        /* EA=0;
        RI=0;
        i=SBUF;
        if(i==2)
        {
        while(RI==0){}
        RI=0;
        set_temper=SBUF;
        SBUF=0x02;
        while(TI==0){}
        TI=0;
        }
        else if(i==3)
        {
        TI=0;
        SBUF=temper;
        while(TI==0){}
        TI=0;
        }
        EA=1; */
}
void disp_1(unsigned char disp_num1[6])
{
        unsigned char n,a,m;
        for(n=0;n<6;n++)
        {
        // k=disp_num1[n];
         for(a=0;a<8;a++)
         {
            clk=0;
          m=(disp_num1[n]&1);
          disp_num1[n]=disp_num1[n]>>1;
          if(m==1)
           data1=1;
          else
           data1=0;
           _nop_();
           clk=1;
           _nop_();
         }
        }
}
        /*****************************************************
        显示子程序
        功能:将占空比温度转化为单个字符,显示占空比和测得到的温度
        ******************************************************/
void display()
{
        unsigned char code number[]={0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6};
        unsigned char disp_num[6];
        unsigned int k,k1;
        k=high_time;
        k=k%1000;
        k1=k/100;
        if(k1==0)
        disp_num[0]=0;
        else
        disp_num[0]=0x60;
        k=k%100;
        disp_num[1]=number[k/10];
        disp_num[2]=number[k%10];
        k=temper;
        k=k%100;
        disp_num[3]=number[k/10];
        disp_num[4]=number[k%10]+1;
        disp_num[5]=number[s/10];
        disp_1(disp_num);
}
        /***********************************************************
        主程序
        ***********************************************************/
void main()
{
        unsigned char z;
        unsigned char a,b,flag_2=1,count1=0;
        unsigned char phil[]={2,0xce,0x6e,0x60,0x1c,2};
        TMOD=0x21;
        TH0=0x2f;
        TL0=0x40;
        SCON=0x50;
        PCON=0x00;
        TH1=0xfd;
        TL1=0xfd;
        PS=1;
        EA=1;
        EX1=0;
        ET0=1;
        ES=1;
        TR0=1;
        TR1=1;
        high_time=50;
        low_time=50;
        PIDInit ( &spid );    // Initialize Structure
        spid.Proportion = 10; // Set PID Coefficients  比例常数 Proportional Const
        spid.Integral = 8;    //积分常数 Integral Const
        spid.Derivative =6;   //微分常数 Derivative Const
        spid.SetPoint = 100; // Set PID Setpoint 设定目标 Desired Value
        while(1)
{
        if(plus==0)
{
        EA=0;
        for(a=0;a<5;a++)
        for(b=0;b<102;b++){}
        if(plus==0)
  {
        set_temper++;
        flag=0;
  }
}
        else if(subs==0)
  {
        for(a=0;a<5;a++)
        for(b=0;a<102;b++){}
        if(subs==0)
        {
         set_temper--;
         flag=0;
        }
  }
        else if(stop==0)
        {
            for(a=0;a<5;a++)
            for(b=0;b<102;b++){}
            if(stop==0)
        {
           flag=0;
           break;
        }
           EA=1;
        }
       get_temper();
           b=temper;
        if(flag_2==1)
          a=b;
        if((abs(a-b))>5)
          temper=a;
        else
          temper=b;
          a=temper;
          flag_2=0;
        if(++count1>30)
        {
          display();
          count1=0;
        }
          compare_temper();
        }
           TR0=0;
           z=1;
        while(1)
        {
            EA=0;
        if(stop==0)
        {
            for(a=0;a<5;a++)
            for(b=0;b<102;b++){}
            if(stop==0)
            disp_1(phil);
        // break;
        }
        EA=1;
}
}

使用特权

评论回复
板凳
598330983|  楼主 | 2017-5-24 14:34 | 只看该作者
以上转来的,不知道好不好用,哈哈。大家可以过过目。

使用特权

评论回复
地板
598330983|  楼主 | 2017-5-24 14:35 | 只看该作者
一会儿再找个来分享。

使用特权

评论回复
5
598330983|  楼主 | 2017-5-24 14:36 | 只看该作者
经典控制算法PID程序
PID代码

//定义变量
float Kp; //PI调节的比例常数
float Ti; //PI调节的积分常数
float T; //采样周期
float Ki;
float ek; //偏差e[k]
float ek1; //偏差e[k-1]
float ek2; //偏差e[k-2]
float uk; //u[k]
signed int uk1; //对u[k]四舍五入取整
signed int adjust; //调节器输出调整量

//变量初始化
Kp=4;
Ti=0。005;
T=0.001;
// Ki=KpT/Ti=0.8,微分系数Kd=KpTd/T=0.8,Td=0.0002,根据实验调得的结果确定这些参数
ek=0;
ek1=0;
ek2=0;
uk=0;
uk1=0;
adjust=0;

int piadjust(float ek) //PI调节算法
{
if( gabs(ek)<0.1 )
{
adjust=0;
}
else
{
uk=Kp*(ek-ek1)+Ki*ek; //计算控制增量
ek1=ek;

uk1=(signed int)uk;
if(uk>0)
{
if(uk-uk1>=0.5)
{
uk1=uk1+1;
}
}
if(uk<0)
{
if(uk1-uk>=0.5)
{
uk1=uk1-1;
}
}
adjust=uk1;
}


return adjust;
}

下面是在AD中断程序中调用的代码。

。。。。。。。。。。。
else //退出软启动后,PID调节,20ms调节一次
{
EvaRegs.CMPR3=EvaRegs.CMPR3+piadjust(ek);//误差较小PID调节稳住
if(EvaRegs.CMPR3>=890)
{
EvaRegs.CMPR3=890; //限制PWM占空比
}
}
。。。。。。。。。。。。。。。。

使用特权

评论回复
6
598330983|  楼主 | 2017-5-24 14:37 | 只看该作者
PID调节经验总结

PID控制器参数选择的方法很多,例如试凑法、临界比例度法、扩充临界比例度法等。但是,对于PID控制而言,参数的选择始终是一件非常烦杂的工作,需要经过不断的调整才能得到较为满意的控制效果。依据经验,一般PID参数确定的步骤如下[42]:
(1) 确定比例系数Kp
确定比例系数Kp时,首先去掉PID的积分项和微分项,可以令Ti=0、Td=0,使之成为
纯比例调节。输入设定为系统允许输出最大值的60%~70%,比例系数Kp由0开始逐渐增大,直至系统出现振荡;再反过来,从此时的比例系数Kp逐渐减小,直至系统振荡消失。记录此时的比例系数Kp,设定PID的比例系数Kp为当前值的60%~70%。
(2) 确定积分时间常数Ti
比例系数Kp确定之后,设定一个较大的积分时间常数Ti,然后逐渐减小Ti,直至系统出现振荡,然后再反过来,逐渐增大Ti,直至系统振荡消失。记录此时的Ti,设定PID的积分时间常数Ti为当前值的150%~180%。
(3) 确定微分时间常数Td
微分时间常数Td一般不用设定,为0即可,此时PID调节转换为PI调节。如果需要设定,则与确定Kp的方法相同,取不振荡时其值的30%。
(4) 系统空载、带载联调
对PID参数进行微调,直到满足性能要求。

使用特权

评论回复
7
598330983|  楼主 | 2017-5-24 14:39 | 只看该作者
上面的实际是PI调节的代码,现附上PID的。
1. //声明变量
2.
3. //定义变量
4. float Kp; //PID调节的比例常数
5. float Ti; //PID调节的积分常数
6. float T; //采样周期
7. float Td; //PID调节的微分时间常数
8. float a0;
9. float a1;
10. float a2;
11.
12. float ek; //偏差e[k]
13. float ek1; //偏差e[k-1]
14. float ek2; //偏差e[k-2]
15. float uk; //u[k]
16. int uk1; //对uk四舍五入求整
17. int adjust; //最终输出的调整量
18.
19. //变量初始化,根据实际情况初始化
20. Kp=;
21. Ti=;
22. T=;
23. Td=;
24.
25. a0=Kp*(1+T/Ti+Td/T);
26. a1=-Kp*(1+2*Td/T);
27. a2=Kp*Td/T;
28. // Ki=KpT/Ti=0.8,微分系数Kd=KpTd/T=0.8,Td=0.0002,根据实验调得的结果确定这些参数
29. ek=0;
30. ek1=0;
31. ek2=0;
32. uk=0;
33. uk1=0;
34. adjust=0;
35.
36.
37. int pid(float ek)
38. {
39. if(gabs(ek)<ee) //ee 为误差的阀值,小于这个数值的时候,不做PID调整,避免误差较小时频繁调节引起震荡。ee的值可自己设
40. {
41. adjust=0;
42. }
43. else
44. {
45. uk=a0*ek+a1*ek1+a2*ek2;
46. ek2=ek1;
47. ek1=ek;
48. uk1=(int)uk;
49.
50. if(uk>0)
51. {
52. if(uk-uk1>=0.5)
53. {
54. uk1=uk1+1;
55. }
56. }
57. if(uk<0)
58. {
59. if(uk1-uk>=0.5)
60. {
61. uk1=uk1-1;
62. }
63. }
64.
65. adjust=uk1;
66. }
67. return adjust;
68.
69. }
70.
71. float gabs(float ek)
72. {
73. if(ek<0)
74. {
75. ek=0-ek;
76. }
77. return ek;
78. }

使用特权

评论回复
8
598330983|  楼主 | 2017-5-24 14:40 | 只看该作者
这是一个比较典型的PID处理程序,在使用单片机作为控制cpu时,请稍作简化,具体的PID
参数必须由具体对象通过实验确定。由于单片机的处理速度和ram资源的限制,一般不采用浮点数运算,
而将所有参数全部用整数,运算到最后再除以一个2的N次方数据(相当于移位),作类似定点数运算,可
大大提高运算速度,根据控制精度的不同要求,当精度要求很高时,注意保留移位引起的“余数”,做好余
数补偿。这个程序只是一般常用pid算法的基本架构,没有包含输入输出处理部分。
#include <string.h>
#include <stdio.h>
    PID Function
   
    The PID (比例、积分、微分) function is used in mainly
    control applications. PIDCalc performs one iteration of the PID
    algorithm.
    While the PID function works, main is just a dummy program showing
    a typical usage.

typedef struct PID {
        double  SetPoint;           //  设定目标 Desired Value
        double  Proportion;         //  比例常数 Proportional Const
        double  Integral;           //  积分常数 Integral Const
        double  Derivative;         //  微分常数 Derivative Const
        double  LastError;          //  Error[-1](上一次误差)
        double  PrevError;          //  Error[-2](上上次误差)
        double  SumError;           //  Sums of Errors
} PID;
PID计算部分
double PIDCalc( PID *pp, double NextPoint )
{
    double  dError,Error;   
        Error = pp->SetPoint - NextPoint;          // 偏差
        pp->SumError += Error;                      // 积分
        dError = pp->LastError - pp->PrevError;     // 当前微分
        pp->PrevError = pp->LastError;           //把上一次误差赋给上上次误差
        pp->LastError = Error;                   //当前误差赋给上一次误差
        return (pp->Proportion * Error              // 比例项
              + pp->Integral * pp->SumError         // 积分项
              + pp->Derivative * dError             // 微分项
        );
}
Initialize PID Structure
void PIDInit (PID *pp)
{
    memset ( pp,0,sizeof(PID));
}
  Main Program
double sensor (void)                    //  Dummy Sensor Function
{
    return 100.0;
}
void actuator(double rDelta)            //  Dummy Actuator Function
{}
void main(void)
{
    PID         sPID;                   //  PID Control Structure
    double      rOut;                   //  PID Response (Output)
    double      rIn;                    //  PID Feedback (Input)
    PIDInit ( &sPID );                  //  Initialize Structure
    sPID.Proportion = 0.5;             //  Set PID Coefficients(KP,KI,KD系数设定)
    sPID.Integral   = 0.5;
    sPID.Derivative = 0.0;
    sPID.SetPoint   = 100.0;            //  Set PID Setpoint
    for (;;) {                          //  Mock Up of PID Processing(PID处理示例)
        rIn = sensor ();                //  Read Input
        rOut = PIDCalc ( &sPID,rIn );   //  Perform PID Integration
        actuator ( rOut );              //  Effect Needed Changes
    }
}

使用特权

评论回复
9
598330983|  楼主 | 2017-5-24 14:41 | 只看该作者
PIDIncCalculator calculate pid coff
    增量式PID 控制


void PIDIncCalculator(void)
{
当前误差
stPid.mIError = 0; stPid.mIncPid= 0; stPid.mCoff = 0;

stPid.mIncPid =   stPid.mSetPoint - stPid.mNextPoint;  增量计算值
stPid.mCoff =    stPid.mProportion * stPid.mIError \   E[K]
           - stPid.mIntegral * stPid.mLastError \   E[K-1]
           + stPid.mDerivate * stPid.mPrevError;   E[K-2]
存储误差便于下次计算
stPid.mPrevError = stPid.mLastError;
stPid.mLastError = stPid.mIError;

return;
}

PIDLocCalculator calculate pid coff
    位置式PID 控制

void PIDLocCalculator(void)
{
当前误差
stPid.mIError = 0; stPid.mIncPid= 0; stPid.mCoff = 0;
stPid.mIError =   stPid.mSetPoint - stPid.mNextPoint;   偏差
stPid.mSumError += stPid.mIError;       积分
stPid.mDError += stPid.mIError - stPid.mLastError;   微分
stPid.mLastError = stPid.mIError;

stPid.mCoff =    stPid.mProportion * stPid.mIError \   比例项
           + stPid.mIntegral * stPid.mSumError \       积分项
           + stPid.mDerivate * stPid.mDError;          微分项
return;
}

使用特权

评论回复
10
598330983|  楼主 | 2017-5-24 14:42 | 只看该作者
当执行机构需要的不是控制量的绝对值,而是控制量的增量(例如去驱动步进电动机)时,需要用PID的“增量算法”。

51单片机增量式PID算法程序

     增量式PID控制算法可以通过(2-4)式推导出。由(2-4)可以得到控制器的第k-1个采样时刻的输出值为:
51单片机增量式PID算法程序(2-5)
将(2-4)与(2-5)相减并整理,就可以得到增量式PID控制算法公式为:

51单片机增量式PID算法程序(2-6)
其中
51单片机增量式PID算法程序

        由(2-6)可以看出,如果计算机控制系统采用恒定的采样周期T,一旦确定A、B、C,只要使用前后三次测量的偏差值,就可以由(2-6)求出控制量。
增量式PID控制算法与位置式PID算法(2-4)相比,计算量小得多,因此在实际中得到广泛的应用。
位置式PID控制算法也可以通过增量式控制算法推出递推计算公式:

51单片机增量式PID算法程序(2-7)
(2-7)就是目前在计算机控制中广泛应用的数字递推PID控制算法。

增量式PID控制算法C51程序

PID Function
The PID (比例、积分、微分) function is used in mainly
control applications. PIDCalc performs one iteration of the PID
algorithm.
While the PID function works, main is just a dummy program showing
a typical usage.
typedef struct PID
{
int SetPoint; //设定目标 Desired Value
long SumError; //误差累计
double Proportion; //比例常数 Proportional Const
double Integral; //积分常数 Integral Const
double Derivative; //微分常数 Derivative Const
int LastError; //Error[-1]
int PrevError; //Error[-2]
} PID;


static PID sPID;
static PID *sptr = &sPID;

Initialize PID Structure PID参数初始化
void IncPIDInit(void)
{
sptr->SumError = 0;
sptr->LastError = 0; //Error[-1]
sptr->PrevError = 0; //Error[-2]
sptr->Proportion = 0; //比例常数 Proportional Const
sptr->Integral = 0; //积分常数Integral Const
sptr->Derivative = 0; //微分常数 Derivative Const
sptr->SetPoint = 0;
}


增量式PID计算部分
int IncPIDCalc(int NextPoint)
{
register int iError, iIncpid; //当前误差
iError = sptr->SetPoint - NextPoint; //增量计算
iIncpid = sptr->Proportion * iError //E[k]项
- sptr->Integral * sptr->LastError //E[k-1]项
+ sptr->Derivative * sptr->PrevError; //E[k-2]项
//存储误差,用于下次计算
sptr->PrevError = sptr->LastError;
sptr->LastError = iError;
//返回增量值
return(iIncpid);
}

使用特权

评论回复
11
捉虫天师| | 2017-5-24 15:28 | 只看该作者
标准的实际上不好用。

使用特权

评论回复
12
zhuotuzi| | 2017-5-24 18:48 | 只看该作者
如果有一个完全封装好的就Ok了,一个函数配置参数,一个函数配置输入输出等接口,就Ok。还有一个就是启动它

使用特权

评论回复
13
598330983|  楼主 | 2017-5-26 23:23 | 只看该作者
漂亮,不过我还是参考新唐提供的。

使用特权

评论回复
14
Harvard| | 2017-5-27 00:31 | 只看该作者
有时候资料太多也是麻烦的事情 .良莠不齐 , 需要去过滤垃圾信息 .无形中增加了 寻求真相的难度.

使用特权

评论回复
15
tianjiu| | 2017-5-27 09:25 | 只看该作者
谢谢分享。

使用特权

评论回复
16
LUOYANGL| | 2017-7-11 09:04 | 只看该作者
学习了,谢谢!

使用特权

评论回复
17
643757107| | 2017-7-11 09:15 | 只看该作者
用带DSP内核的单片机,直接调用库函数。

使用特权

评论回复
18
huhaibin2| | 2017-9-12 20:05 | 只看该作者
598330983 发表于 2017-5-24 14:40
这是一个比较典型的PID处理程序,在使用单片机作为控制cpu时,请稍作简化,具体的PID
参数必须由具体对象通 ...

使用特权

评论回复
19
734774645| | 2017-9-12 22:08 | 只看该作者
参考参考,正需要呢。

使用特权

评论回复
20
598330983|  楼主 | 2017-9-26 16:52 | 只看该作者
其实算法无所谓标准不标准。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

227

主题

5279

帖子

22

粉丝