Fertig
Dependencies: mbed
Fork of RT2_P3_students by
Diff: main.cpp
- Revision:
- 7:72982ede2ff6
- Parent:
- 6:2cc56521aa16
- Child:
- 8:8ed679044a72
diff -r 2cc56521aa16 -r 72982ede2ff6 main.cpp --- a/main.cpp Tue Apr 10 11:44:36 2018 +0000 +++ b/main.cpp Tue Apr 17 09:06:47 2018 +0000 @@ -44,12 +44,13 @@ AnalogOut out(PA_5); // Analog OUT on PA_5 1.6 V -> 0A 3.2A -> 2A (see ESCON) float out_value = 1.6f; // set voltage on 1.6 V (0 A current) float w_soll = 10.0f; // desired velocity -float Ts = 0.002f; // sample time of main loops +float Ts = 0.2f; // sample time of main loops int k = 0; //------------------------------------------ // ... here define variables like gains etc. //------------------------------------------ +LinearCharacteristics i2u(1.5f,2.5f); //------------------------------------------ Ticker ControllerLoopTimer; // interrupt for control loop @@ -85,10 +86,10 @@ short counts = counter1; // get counts from Encoder float vel = diff(counts); // motor velocity // ... your code - if(++k >= 249){ - k = 0; - pc.printf("Pulse: %d Velocity: %3.2f\r\n",counts,vel); - } + // if(++k >= 249){ + // k = 0; + pc.printf("i2u(8): %3.3f\r\n",i2u(8.0f)); + //} } //****************************************************************************** //********** User functions like buttens handle etc. **************