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.
Dependents: Omni_2017_z BETA_A ALPHA_A GAMMA_A ... more
Diff: MD_PID.cpp
- Revision:
- 11:b621815834c1
- Parent:
- 10:2351419aff1b
- Child:
- 12:d930cbffd2c9
--- a/MD_PID.cpp Wed Sep 13 02:41:40 2017 +0000
+++ b/MD_PID.cpp Thu Sep 14 00:25:53 2017 +0000
@@ -24,6 +24,7 @@
double MD_PID::Drive(double ref, double stop)
{
+ ref *= 6;
/*
if(ref1 != ref)
{
@@ -44,7 +45,7 @@
Read_Speed();
}
else
- duty = PID(ref);
+ duty -= PID(ref);
if(duty > 1.0)
duty = 1.0;
@@ -55,7 +56,7 @@
if( ( (ref >= 0) ^ (Speed() >= 0) ) && fabs(Speed()) > stop)
duty = 0;
- printf("duty:%.2f\r\n", duty);
+ //printf("duty:%.2f\r\n", duty);
md->rotate(duty);
return duty;
}