ec
Fork of EC by
Diff: SpeedController.cpp
- Revision:
- 15:aef7cc059e50
- Parent:
- 13:caa6db604077
- Child:
- 16:14d05ae8d566
diff -r caa6db604077 -r aef7cc059e50 SpeedController.cpp --- a/SpeedController.cpp Sat Jan 21 07:11:08 2017 +0000 +++ b/SpeedController.cpp Mon Apr 10 09:57:22 2017 +0000 @@ -106,7 +106,7 @@ void SpeedControl::ScZ(double target_RPM){ now_RPM=getRPM(); - if(fabs(now_RPM-target_RPM)>300) Accelarate(target_RPM/C); + //if(fabs(now_RPM-target_RPM)>300) Accelarate(target_RPM/C); diff=target_RPM-now_RPM; integral+=diff; out_duty=0.01*(Kv_p*diff+Kv_d*(diff-diff_old)+Kv_i*integral); @@ -114,7 +114,7 @@ if(out_duty>0.01)out_duty=0.01; if(out_duty<-0.01)out_duty=-0.01; out+=out_duty; - duty=0.0001*out+target_RPM/C; + duty=0.0001/**out+target_RPM/C*/; turnF(duty); }