Corrected header file include guards.

Dependencies:   FiniteStateMachine HipControl Knee LinearBlend1 LocalFileSystem_Read dataComm hapticFeedback initExoVars mbed Blend_Generator Brad_poly_gait Gait_Generator MM_gait Encoders IMUdriver

Fork of Motion Control by HEL's Angels

Committer:
perr1940
Date:
Fri Nov 14 22:39:10 2014 +0000
Revision:
0:d38d627c922f
Child:
2:89b78367d173
this is without encoders going to test the knee steppers alone.  They work alone but not with the encoders.  Strange huh?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
perr1940 0:d38d627c922f 1 /**************************************
perr1940 0:d38d627c922f 2
perr1940 0:d38d627c922f 3 This is the main file for the "RyanEXO" control software.
perr1940 0:d38d627c922f 4 This sets up the main control loop that operates at a 1kHz frequency
perr1940 0:d38d627c922f 5 and controls the flow of the rest of the software
perr1940 0:d38d627c922f 6
perr1940 0:d38d627c922f 7 The configuration for the exo system that this software runs:
perr1940 0:d38d627c922f 8 amplifiers: 2 Copley Controls 10A digital amplifiers
perr1940 0:d38d627c922f 9 sensors: 2 Austria Microsystems 12 bit magnetic encoders, handled by encoders.h
perr1940 0:d38d627c922f 10 motors: 2 maxon EC90 DC brushless motors, handled by HipMotorControl.h (called in FSM.h)
perr1940 0:d38d627c922f 11 Knees: wrap spring clutch controlled by Firgelli PQ12P linear actuators, controlled in linearActuatorControl.h
perr1940 0:d38d627c922f 12
perr1940 0:d38d627c922f 13 **************************************/
perr1940 0:d38d627c922f 14 #include "mbed.h"
perr1940 0:d38d627c922f 15 #include "initExoVars.h"
perr1940 0:d38d627c922f 16 #include "FSM.h"
perr1940 0:d38d627c922f 17 int dataIn[3];
perr1940 0:d38d627c922f 18 ///////////////////////////////////////////////////////////////////////////
perr1940 0:d38d627c922f 19 void periodicFcns()
perr1940 0:d38d627c922f 20 {
perr1940 0:d38d627c922f 21 DB_cs=0;
perr1940 0:d38d627c922f 22 dataIn[0]=dataBedSPI.write(7);
perr1940 0:d38d627c922f 23 DB_cs=1;
perr1940 0:d38d627c922f 24 wait_us(5);
perr1940 0:d38d627c922f 25 DB_cs=0;
perr1940 0:d38d627c922f 26 dataIn[1]=dataBedSPI.write(30);
perr1940 0:d38d627c922f 27 DB_cs=1;
perr1940 0:d38d627c922f 28 wait_us(5);
perr1940 0:d38d627c922f 29 DB_cs=0;
perr1940 0:d38d627c922f 30 dataIn[2]=dataBedSPI.write(22);
perr1940 0:d38d627c922f 31 DB_cs=1;
perr1940 0:d38d627c922f 32 //pc.printf("%d, %d, %d, ", dataIn[0], dataIn[1], dataIn[2]);
perr1940 0:d38d627c922f 33 int exoState=fsm.state(dataIn[1]);
perr1940 0:d38d627c922f 34 /*pc.printf("State: %u, ", exoState);
perr1940 0:d38d627c922f 35 pc.printf("Angle: %f, ", translate_L(Read_Encoder()));
perr1940 0:d38d627c922f 36 pc.printf("Data: %u, %u, %u\r\n", dataIn[0], dataIn[1], dataIn[2]);*/
perr1940 0:d38d627c922f 37
perr1940 0:d38d627c922f 38 }
perr1940 0:d38d627c922f 39
perr1940 0:d38d627c922f 40 int main()
perr1940 0:d38d627c922f 41 {
perr1940 0:d38d627c922f 42 pc.printf("ExoStart \r\n");
perr1940 0:d38d627c922f 43 initializeExoIOs();
perr1940 0:d38d627c922f 44 pc.printf("Blah \r\n");
perr1940 0:d38d627c922f 45 pc.printf("Here \r\n");
perr1940 0:d38d627c922f 46 pc.printf("Starting exo...\n\r");
perr1940 0:d38d627c922f 47 //If desired, a startup sound can be played. This function is defined in the DatabedCode, because it will command a sound to be played once it detects a heartbeat from ControlBed
perr1940 0:d38d627c922f 48 wait(2);
perr1940 0:d38d627c922f 49 Ticker doControl;
perr1940 0:d38d627c922f 50 dataBedSPI.format(8,1);
perr1940 0:d38d627c922f 51 doControl.attach(&periodicFcns, SAMPLE_TIME);
perr1940 0:d38d627c922f 52
perr1940 0:d38d627c922f 53 while (1);
perr1940 0:d38d627c922f 54 }