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.
Revision 0:ff7b9471ae82, committed 2013-10-31
- Comitter:
- Tess
- Date:
- Thu Oct 31 15:01:47 2013 +0000
- Commit message:
- Yeah doesn't work. inverse kinematics
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r ff7b9471ae82 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 31 15:01:47 2013 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "math.h" + +AnalogIn EMG1(PTB0); +AnalogIn EMG2(PTB1); +AnalogIn EMG3(PTB2); +AnalogIn EMG4(PTB3); + +//float X_positiewaarde_waarheenwil; +//float Y_positiewaarde_waarheenwil; +//float phi_A; // motorhoek A in graden +//float phi_B; // motorhoek B in graden +float EMG_signaal_x; //ook wel x-dot, het verschil tussen flexoren en extensoren in onderarm +float EMG_signaal_y; // ook wel y-dot, het verschil tussen biceps en triceps +const float delta_t = 0.01; // tijd tussen twee meetpunten +float X_positiewaarde_huidig; +float Y_positiewaarde_huidig; +float lengte_arm; + + +X_positiewaarde_waarheenwil = EMG_signaal_x * delta_t + X_positiewaarde_huidig; +Y_positiewaarde_waarheenwil = EMG_signaal_y * delta_t + Y_positiewaarde_huidig; + +phi_A = 180 - 1 / (cos(sqrt((X_positiewaarde_waarheenwil)^2 + (Y_positiewaarde_waarheenwil)^2)/(2 * lengte_arm^2)))) - 1 / tan(fabs(Y_positiewaarde_waarheenwil / X_positiewaarde_waarheenwil)); +phi_B = 180 - 1 / (cos(sqrt((X_positiewaarde_waarheenwil)^2 + (Y_positiewaarde_waarheenwil)^2)/(2 * lengte_arm^2)))) - 1 / tan(Y_positiewaarde_waarheenwil / X_positiewaarde_waarheenwil) - 1/(cos(-(X_positiewaarde_waarheenwil^2 + Y_positiewaarde_waarheenwil^2)/(2*lengte_arm^2)+1)); +
diff -r 000000000000 -r ff7b9471ae82 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 31 15:01:47 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file