Minor BioRobotics BMT Hierbij publish ik mijn code public ter inspiratie voor komende jaarlagen. Het gaat om een serial robot met twee links en een haak als end-effector. Veel plezier ermee!

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Revision:
20:682ac5b520a0
Parent:
19:483fc61778f0
Child:
21:0d86a17f9974
--- a/main.cpp	Wed Oct 30 15:11:06 2019 +0000
+++ b/main.cpp	Wed Oct 30 18:36:52 2019 +0000
@@ -510,6 +510,17 @@
 
 void main_loop() { //Beginning of main_loop()
 //    pc.printf("main_loop is running succesfully \r\n"); //confirmation that main_loop is running (als je dit erin zet krijg je elke duizendste dit bericht. Dit is niet gewenst)
+
+
+
+
+
+
+//test stuff:
+//Yref_motor1= 4200*pot2_rechts.read();
+//Yref_motor2= 4200*pot1_links.read();
+
+// 5.1 Measure Analog and Digital input signals ********************************
 emg0_processing();
 emg1_processing();
 emg2_processing();
@@ -517,22 +528,14 @@
 
 fencoder_motor1() ;
 fencoder_motor2() ;
+// 5.2 Run state-machine(s) ****************************************************
+state_machine() ;
+// 5.3 Run controller(s) *******************************************************
 PID_controller_motor1(error_integral_motor1, error1_prev_motor1);
 PID_controller_motor2(error_integral_motor2, error1_prev_motor2);
+// 5.4 Send output signals to digital and PWM output pins **********************
 motor1_controller();
 motor2_controller();
-
-state_machine() ;
-
-//test stuff:
-Yref_motor1= 4200*pot2_rechts.read();
-Yref_motor2= 4200*pot1_links.read();
-
-// 5.1 Measure Analog and Digital input signals ********************************
-
-// 5.2 Run state-machine(s) ****************************************************
-// 5.3 Run controller(s) *******************************************************
-// 5.4 Send output signals to digital and PWM output pins **********************
                     
 
 }                   //Ending of main_loop()