arduino_rov_just_depth_pid

PID_D(int rov_depth,float kp_D,float ki_D,float kd_D){
  static float sum1,new_e;
  new_e=rov_depth_target-rov_depth,D_flag=0;
  if(new_e<0)
  {
    D_flag=1;
    new_e=-new_e;
  }  
  float r;
  sum1+=new_e;
  rov_deep_pid=kp_D*new_e+ki_D*sum1+kd_D*pid_d_kd;
  if(rov_deep_pid<-250)
  {
     rov_deep_pid=-250;
  }else if(rov_deep_pid>250)
  {
     rov_deep_pid=250;
  }
  pid_d_kd=new_e-e;
  e=new_e;
©️2020 CSDN 皮肤主题: 游动-白 设计师:上身试试 返回首页