Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_Practice1 by
Diff: encorder.h
- Revision:
- 49:b041c815c063
- Parent:
- 33:64fd1bd83bac
--- a/encorder.h Wed Sep 13 00:19:44 2017 +0000
+++ b/encorder.h Wed Sep 13 01:25:07 2017 +0000
@@ -27,11 +27,20 @@
float duty() {
return result;
}
+
+ float duty_enableWidth(float duty_min, float duty_max){
+ if(now > duty_min && now < duty_max){ //nowは差
+ return 0.0;
+ }else{
+ return result;
+ }
+ }
private :
float kp, ki, kd,
old, now,
- p, i, d, result;
+ p, i, d, result,
+ duty_min, duty_max;
};
/*
class Speed_pid
