most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Committer:
tnhnrl
Date:
Mon Jul 30 16:48:48 2018 +0000
Revision:
73:f6f378311c8d
Child:
74:d281aaef9766
work in progress 7/30 12:48 pm

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tnhnrl 73:f6f378311c8d 1 /*
tnhnrl 73:f6f378311c8d 2 Modified FSG PCB V_1_1
tnhnrl 73:f6f378311c8d 3 - Freezes when doing a dive or any timed sequence (commented out SD card references)
tnhnrl 73:f6f378311c8d 4 - commented out sdLogger().appendLogFile(current_state, 0); //open SD file once
tnhnrl 73:f6f378311c8d 5 - commented out sdLogger().appendLogFile(current_state, 1); //writing data
tnhnrl 73:f6f378311c8d 6 - commented out sdLogger().appendLogFile(current_state, 0); //close log file
tnhnrl 73:f6f378311c8d 7 - reduced timer to 20 seconds for bench testing
tnhnrl 73:f6f378311c8d 8 - modified ConfigFileIO for rudder()
tnhnrl 73:f6f378311c8d 9 - added in getFloatUserInput function from newer code
tnhnrl 73:f6f378311c8d 10 - changed LinearActuator & batt() in StaticDefs to match new pinouts from Bob/Matt/Troy fixes
tnhnrl 73:f6f378311c8d 11 - slowed down battery motor because it's silly fast at 30 volts (bench test)
tnhnrl 73:f6f378311c8d 12 * BCE gain is proportional 0.1 now 0.01
tnhnrl 73:f6f378311c8d 13 - BATT was moving in the wrong direction, gain was P: 0.10, I: 0.0, D: 0.0
tnhnrl 73:f6f378311c8d 14 * change gain to P: -0.10 (gain was flipped, I think the old circuit board had the voltages flipped ? ?)
tnhnrl 73:f6f378311c8d 15 - StateMachine changes for testing
tnhnrl 73:f6f378311c8d 16 * added keyboard_menu_STREAM_STATUS();
tnhnrl 73:f6f378311c8d 17 * added keyboard_menu_RUDDER_SERVO_settings();
tnhnrl 73:f6f378311c8d 18 - modified the zero on the battery position from 610 to 836
tnhnrl 73:f6f378311c8d 19 - BMM (batt) slope may be incorrect, seems low, currently 0.12176
tnhnrl 73:f6f378311c8d 20 - modified the zero on BCE from 253 to 460
tnhnrl 73:f6f378311c8d 21 - Pressure readings are wrong
tnhnrl 73:f6f378311c8d 22 * added readADCCounts() to omegaPX209 class to see channel readings
tnhnrl 73:f6f378311c8d 23 * modified omegaPX209 class to use filtered ADC readings from SpiADC.readCh4()
tnhnrl 73:f6f378311c8d 24 - fixed rudderLoop to headingLoop from newer code
tnhnrl 73:f6f378311c8d 25 Modified FSG PCB V_1_2
tnhnrl 73:f6f378311c8d 26 - added init headingLoop to main
tnhnrl 73:f6f378311c8d 27 - added pitch and heading outputs to STREAM_STATUS
tnhnrl 73:f6f378311c8d 28 NOTE: Flipped motor controller output on connector side with battery mass mover (BMM)
tnhnrl 73:f6f378311c8d 29 - Motor direction was opposite the BCE motor (because of gearing)
tnhnrl 73:f6f378311c8d 30 - BMM P gain is now positive 0.02 (from -0.10)
tnhnrl 73:f6f378311c8d 31 Modified FSG PCB V_1_3
tnhnrl 73:f6f378311c8d 32 - added timing code for interrupt that drives the rudder (testing with o-scope)
tnhnrl 73:f6f378311c8d 33 - PID controller replaced with newer version from 5/29 code branch
tnhnrl 73:f6f378311c8d 34 - StateMachine hanged style of variables to match convention in code
tnhnrl 73:f6f378311c8d 35 Modified FSG PCB V_1_4
tnhnrl 73:f6f378311c8d 36 - adc tests
tnhnrl 73:f6f378311c8d 37 Modified FSG PCB V_1_5
tnhnrl 73:f6f378311c8d 38 - IMU update
tnhnrl 73:f6f378311c8d 39 - Testing print outs
tnhnrl 73:f6f378311c8d 40 Modified FSG PCB V_1_6
tnhnrl 73:f6f378311c8d 41 - new BMM zero count of 240 (confirmed manually)
tnhnrl 73:f6f378311c8d 42 - new BCE zero count of 400 (confirmed manually)
tnhnrl 73:f6f378311c8d 43 - Modified emergency climb to go to position 10 on the BMM, not zero (almost relying on the limit switch)
tnhnrl 73:f6f378311c8d 44 - fixed keyboard input; including typing in the timeout (can enter exact times)
tnhnrl 73:f6f378311c8d 45 Modified FSG PCB V_1_7
tnhnrl 73:f6f378311c8d 46 - removed data logger references
tnhnrl 73:f6f378311c8d 47 - fixed bug where I was logging data twice in the interrupt code and the main file
tnhnrl 73:f6f378311c8d 48 - fixed bug where Multi-Dive sequence wasn't restarting (the counter used to get the current state was not reset)
tnhnrl 73:f6f378311c8d 49 Modified FSG PCB v_1_7C
tnhnrl 73:f6f378311c8d 50 - fixing a bug with the data transmission (output had newline character) because of packet lengths
tnhnrl 73:f6f378311c8d 51 - new version blasts data and Python program requests lost packets, dramatically faster over USB, slightly faster over XBee
tnhnrl 73:f6f378311c8d 52 - fixed some format and terminal errors
tnhnrl 73:f6f378311c8d 53 */
tnhnrl 73:f6f378311c8d 54
tnhnrl 73:f6f378311c8d 55
tnhnrl 73:f6f378311c8d 56 Fixed callback thing on linear actuator
tnhnrl 73:f6f378311c8d 57
tnhnrl 73:f6f378311c8d 58 "callback" added before this, ticker thing
tnhnrl 73:f6f378311c8d 59
tnhnrl 73:f6f378311c8d 60
tnhnrl 73:f6f378311c8d 61 float depth_freq = depthLoop().getFilterFrequency();
tnhnrl 73:f6f378311c8d 62 float depth_deadband = depthLoop().getDeadband();
tnhnrl 73:f6f378311c8d 63
tnhnrl 73:f6f378311c8d 64 pitch
tnhnrl 73:f6f378311c8d 65
tnhnrl 73:f6f378311c8d 66
tnhnrl 73:f6f378311c8d 67
tnhnrl 73:f6f378311c8d 68 pc().printf("PITCH P: %3.3f, I: %3.3f, D %3.3f, offset: %3.1f mm (filter: %0.2f, deadband: %0.2f)\r\n", pitchLoop().getControllerP(), pitchLoop().getControllerI(), pitchLoop().getControllerD(), pitchLoop().getOutputOffset(),pitchLoop().getFilterFrequency(),pitchLoop().getDeadband());
tnhnrl 73:f6f378311c8d 69 DEPTH TOO