Vera Stakenborg / Mbed 2 deprecated Project_motor

Dependencies:   Motor_with_encoder MODSERIAL QEI mbed

Fork of Project_motor by Biorobotics Project

Files at this revision

API Documentation at this revision

Comitter:
MarkHeimgartner
Date:
Mon Oct 09 14:47:16 2017 +0000
Parent:
3:4520d0ca4e56
Child:
5:05d09e921b5d
Commit message:
works now with position in rad/s;

Changed in this revision

Encoder_copy.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Encoder_copy.lib	Fri Oct 06 12:14:32 2017 +0000
+++ b/Encoder_copy.lib	Mon Oct 09 14:47:16 2017 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/Biorobotics-Project/code/Motor_with_encoder/#9d3da04c61db
+https://os.mbed.com/teams/Biorobotics-Project/code/Motor_with_encoder/#cea9b4827b28
--- a/main.cpp	Fri Oct 06 12:14:32 2017 +0000
+++ b/main.cpp	Mon Oct 09 14:47:16 2017 +0000
@@ -47,8 +47,8 @@
 volatile float position = 0.0;
 void readpot(){
     potvalue = pot.read();
-    //position = motor1.getPosition();
-    pc.printf("pos: %d, speed %f reference velocity = %.2f\r\n",motor1.getPosition(), motor1.getSpeed(), potvalue);
+    position = motor1.getPosition()/4200.00*6.28;
+    pc.printf("pos: %f, speed %f reference velocity = %.2f\r\n",position, motor1.getSpeed(), potvalue);
     motorspeed = potvalue;
     //motorpid = PID(potvalue - position, M1_KP, M1_KI, M1_KD, M1_TS, m1_err_int, m1_prev_err, m1_f_v1, m1_f_v2, M1_F_A1, M1_F_A2, M1_F_B0, M1_F_B1, M1_F_B2);
     }