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: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of Project_script_union by
Revision 34:b8b18ba0c336, committed 2018-11-05
- Comitter:
- Esmee
- Date:
- Mon Nov 05 15:19:42 2018 +0000
- Parent:
- 33:976be2825a23
- Commit message:
- finalfinalfinal
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Nov 02 11:57:51 2018 +0000
+++ b/main.cpp Mon Nov 05 15:19:42 2018 +0000
@@ -350,16 +350,10 @@
}
void engine_control1() //Engine 1 is translational engine, connected with left side pins
{
- //pc.printf("ik doe het, engine control 1\n\r");
encoder_radians1 = (double)encoder1.getPulses()*(2.0*PI)/8400.0;
- //pc.printf("encoder1 %f \n\r", (float)encoder1.getPulses());
- //pc.printf("encoder_radians1 %f \n\r",(float) encoder_radians1);
err1 = q1_motor - encoder_radians1;
- //pc.printf("err1 = %f\n\r",err1);
PID_control1(); //PID controller function call
-
- //pc.printf("u1 = %f\n\r",u1);
-
+
//if(encoder1.getPulses()<12000 && encoder1.getPulses()>-1) //limits translation in counts, eerst 12600
//{
pwmpin1 = fabs(u1); //u_total moet nog geschaald worden om in de motor gevoerd te worden!!!
@@ -433,11 +427,7 @@
//------------------ Inversed Kinematics --------------------------------//
void inverse_kinematics()
-{
- //pc.printf("v_x is %f en v_y is %f\n\r",v_x, v_y);
-
- //Lq1 = q1ref*r_trans;
- //Cq2 = q2ref/5.0;
+{
q1_dot = (v_x*cos(q2ref) + v_y*sin(q2ref))/cos(q2ref); //RKI systeem
q2_dot = v_y/(L3*cos(q2ref)); //
@@ -539,7 +529,6 @@
movag_tick.attach(&MovAg,T);
func_tick.attach(&v_des_calculate_qref,T); //v_des determined every T
print_tick.attach(&printFunction,T2);
- // HIDScope_tick.attach(&HIDScope_sample,T); //EMG signals raw + filtered to HIDScope every T sec.
button1.rise(switch_to_calibrate); //Switch state of calibration (which muscle)
//wait(0.2f); //Wait to avoid bouncing of button
