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: mbed
Fork of RT2_P3_students_G4 by
Diff: main.cpp
- Revision:
- 3:d79c437626e7
- Parent:
- 2:769ce5f06d3e
- Child:
- 4:2cc56521aa16
diff -r 769ce5f06d3e -r d79c437626e7 main.cpp
--- a/main.cpp Mon Apr 09 08:01:29 2018 +0000
+++ b/main.cpp Mon Apr 09 09:26:58 2018 +0000
@@ -7,7 +7,7 @@
#include "DiffCounter.h"
#include "IIR_filter.h"
#include "LinearCharacteristics.h"
-//#include "PI_Cntrl.h"
+#include "PI_Cntrl.h"
/* Cuboid balance on one edge on Nucleo F446RE
**** IMPORTANT: use ..\Labormodelle\RT-MOD054 - Würfel\Escon_Parameter_4nucleo.edc
@@ -75,11 +75,7 @@
counter1.reset(); // encoder reset
diff.reset(0.0f,0.0f);
ControllerLoopTimer.attach(&updateControllers, Ts); //Assume Fs = ...;
-
- float value = i2u(22.2);
-
-
-
+
}
//******************************************************************************
@@ -88,12 +84,11 @@
void updateControllers(void){
short counts = counter1; // get counts from Encoder
float vel = diff(counts); // motor velocity
-
+ out.write(i2u(0.0f)/3.3f);
// ... your code
- out.write(i2u(1.5f)/3.3f);
- if(++k >= 199){
+ if(++k >= 249){
k = 0;
- pc.printf("omega_soll=%3.2f omega=%3.2f \r\n",w_soll,vel);
+ pc.printf("Pulse: %d Velocity: %3.2f\r\n",counts,vel);
}
}
//******************************************************************************
