Er is uitleg bijgeschreven en pwm_percentage heeft een andere naam

Dependencies:   Encoder HIDScope MODSERIAL mbed-dsp mbed

Fork of Lampje_EMG_Gr6 by Iris van Leeuwen

Files at this revision

API Documentation at this revision

Comitter:
irisl
Date:
Sat Nov 01 11:34:33 2014 +0000
Parent:
24:a61c2cadbd36
Child:
26:9859a71456fd
Commit message:
Met andere filters, werkt niet als motorvoeding aangesloten is

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 31 16:36:30 2014 +0000
+++ b/main.cpp	Sat Nov 01 11:34:33 2014 +0000
@@ -30,7 +30,7 @@
 //Define objects
 AnalogIn    emg0(PTB0); //Analog input
 AnalogIn    emg1(PTC2); //Analog input
-HIDScope scope(2);
+HIDScope scope(4);
 
 //motor 25D
 Encoder motor1(PTD3,PTD5); //wit, geel
@@ -64,15 +64,15 @@
 
 arm_biquad_casd_df1_inst_f32 lowpass_biceps;
 arm_biquad_casd_df1_inst_f32 lowpass_deltoid;
-//lowpass filter settings: Fc = 225 Hz, Fs = 500 Hz, Gain = -3 dB
-float lowpass_const[] = {0.8005910266528647, 1.6011820533057295, 0.8005910266528647, -1.5610153912536877, -0.6413487153577715};
+//lowpass filter settings: Fc = 5 Hz, Fs = 500 Hz, Gain = -3 dB
+float lowpass_const[] = {0.0009446914586925257, 0.0018893829173850514, 0.0009446914586925257, 1.911196288237583, -0.914975054072353};
 //state values
 float lowpass_biceps_states[4];
 float lowpass_deltoid_states[4];
 arm_biquad_casd_df1_inst_f32 highnotch_biceps;
 arm_biquad_casd_df1_inst_f32 highnotch_deltoid;
-//highpass filter settings: Fc = 20 Hz, Fs = 500 Hz, Gain = -3 dB
-float highnotch_const[] = {0.9149684297741606, -1.8299368595483212, 0.9149684297741606, 1.8226935021735358, -0.8371802169231065 ,0.7063988100714527, -1.1429772843080923, 0.7063988100714527, 1.1429772843080923, -0.41279762014290533};
+//highpass filter settings: Fc = 20 Hz, Fs = 500 Hz, Gain = -3 dB, notch Fc = 50, Fs =500Hz, Gain = -3 dB
+float highnotch_const[] = {0.9149684297741606, -1.8299368595483212, 0.9149684297741606, 1.8226935021735358, -0.8371802169231065 ,0.969531252908746, -1.18733334554802E-16, 0.969531252908746, -1.18733334554802E-16, 0.939062505817492};
 //state values
 float highnotch_biceps_states[8];
 float highnotch_deltoid_states[8];
@@ -154,10 +154,10 @@
     /*send value to PC. */
     //scope.set(0,emg_value1);     //Raw EMG signal biceps
     //scope.set(1,emg_value2);    //Raw EMG signal Deltoid
-    //scope.set(0,filtered_biceps);  //processed float biceps
-    scope.set(0,filtered_average_bi); //processed float deltoid
-    //scope.set(2,filtered_deltoid);  //processed float biceps
-    scope.set(1,filtered_average_del); //processed float deltoid
+    scope.set(0,filtered_biceps);  //processed float biceps
+    scope.set(1,filtered_average_bi); //processed float deltoid
+    scope.set(2,filtered_deltoid);  //processed float biceps
+    scope.set(3,filtered_average_del); //processed float deltoid
     scope.send();
 
 }
@@ -610,7 +610,8 @@
                         break;
                     }
                 }
-
+                batje_hoek = 0;
+                arm_hoogte = 0;
             }
 
         }