ec
Fork of EC by
Diff: SpeedController.cpp
- Revision:
- 18:31058ca8fc8a
- Parent:
- 17:e0b465d9b579
- Child:
- 19:36406ea61728
diff -r e0b465d9b579 -r 31058ca8fc8a SpeedController.cpp --- a/SpeedController.cpp Tue Apr 11 07:51:08 2017 +0000 +++ b/SpeedController.cpp Thu Apr 13 02:39:23 2017 +0000 @@ -113,7 +113,7 @@ diff_old=diff; if(out_duty>0.01)out_duty=0.01; if(out_duty<-0.01)out_duty=-0.01; - if((duty>0)&&(duty<0.95)) out+=out_duty; + if((duty>=0)&&(duty<=0.95)) out+=out_duty; duty=0.0001*out/*+target_RPM/C*/; turnF(duty); }