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: Encoder HIDScope MODSERIAL mbed
Fork of week6ordenenscript by
Diff: main.cpp
- Revision:
- 5:987cc578988e
- Parent:
- 4:c119259c1ba5
- Child:
- 6:083bd713670b
diff -r c119259c1ba5 -r 987cc578988e main.cpp
--- a/main.cpp Fri Oct 13 12:22:14 2017 +0000
+++ b/main.cpp Mon Oct 23 07:58:28 2017 +0000
@@ -33,15 +33,15 @@
float FeedBackControl(float error, float &e_prev, float &e_int) // schaalt de snelheid naar de snelheid zodat onze chip het begrijpt (is nog niet in werking)
{
- float kp = 2.5; // has jet to be scaled
+ float kp = 0.002; // kind of scaled.
float Proportional= kp*error;
- float kd = 1; // has jet to be scaled
+ float kd = 0.00025; // kind of scaled.
float VelocityError = (error - e_prev)/Ts;
float Derivative = kd*VelocityError;
e_prev = error;
- float ki = 0.5; // has jet to be scaled
+ float ki = 0.00001; // kind of scaled.
e_int = e_int+Ts*error;
float Integrator = ki*e_int;
@@ -90,7 +90,7 @@
int main()
{
- M1E.period(PwmPeriod)
+ M1E.period(PwmPeriod);
Treecko.attach(MeasureAndControl, Ts); //Elke 1 seconde zorgt de ticker voor het runnen en uitlezen van de verschillende
//functies en analoge signalen. Veranderingen worden elke 1 seconde doorgevoerd.
