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: Motor_with_encoder MODSERIAL QEI mbed
Fork of Project_motor by
Revision 4:abdc2d24d0bc, committed 2017-10-09
- 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);
}
