This is a test from 30%Throttle to stop, using full service brake

Dependencies:   mbed millis

Revisions of main.cpp

Revision Date Message Actions
33:8286cc0ebfaf 23 months ago 30% Throttle, terminal velocity, then grade level 2 brake, dont use EM File  Diff  Annotate
32:771f6d99a77b 23 months ago Energy Storage display code added. Train Lights code added. Pins updated for brakes and lights. File  Diff  Annotate
31:54292fdb96b3 23 months ago New fork with cleaned up main, more object oritentated. Created a brakes class to implement regen, friction and emergency stop functionality File  Diff  Annotate
30:c65bf90e8f47 23 months ago Code Cleaned up, brakes class implemented. More object orientated File  Diff  Annotate
29:2ed4d9c309fc 23 months ago added brake control redundancy File  Diff  Annotate
28:1086791972d0 23 months ago Update brakes pins, created brakes class and made new functions but still to be tested; File  Diff  Annotate
27:5f801d4ca461 23 months ago Implemented new logic for regen braking using switch case to define braking values File  Diff  Annotate
26:6275acef6bfd 23 months ago Commented out motor1.setforward im regen braking as this over rode direction switching File  Diff  Annotate
25:1e42ee248b89 23 months ago Regen Braking enabled File  Diff  Annotate
24:15239fb901b0 23 months ago In brake code for regen braking, changed motor1.setPark() to motor1.brake(brakeRate); Given the system must be using a motor controller with H bridge PWM and there is an amp circuit for throttle control this should automatically acheieve regen braking File  Diff  Annotate
21:0cc8e3ee53f6 2022-05-17 Removed Park mode thing, job for another day File  Diff  Annotate
20:0add93a69df5 2022-05-17 Changed the serial code. Tried to add braking and coasting ; File  Diff  Annotate
19:a4afd3a6bdfb 2022-05-17 Added old serial print, need to check ; File  Diff  Annotate
18:d28d458824d4 2022-05-17 Reverted to past clear up, Sorry Chai, changed PG_1 to PF_8, issue with the pin out on the control board, works fine when pin swapped. very odd ... File  Diff  Annotate
17:a5d9c9a45cbc 2022-05-04 Park Mode condition (if drivemode==2) commented out from brakeControl function as this is being checked again in the main.; ; Instead invoked brakeControl(4) i.e. full braking under the park mode block in main as this achieves the same result File  Diff  Annotate
16:7c8ef0e0beaa 2022-05-04 Updated toggle on park mode and changes inParkMode flag and motor1.setPark() function invoke before parkmode check in main loop. Changed comments highlight the thought process File  Diff  Annotate
15:4976d145fbd9 2022-04-27 Re-commented old autostop code, as it wouldn't let me compile on site due to undeclared variable. ; ; Added Chai's code for the braking when at 0 speed & 0 throttle, moved to a different area.; ; Commented lines for park brake, needs testing. File  Diff  Annotate
14:aaa46855f00a 2022-04-27 Added a state where the current speed and set throttle speed are both zero for the brakes to be on high (i.e. the train must be stationary and will remain that way) It is left commented out for now File  Diff  Annotate
11:fcf00823f24a 2022-04-22 Added current distance to data logger and the changed the display function to "disp.c_str()" File  Diff  Annotate
10:8415866239cc 2022-04-22 Added desired datalogger output File  Diff  Annotate
9:d1998035418b 2022-04-20 Changed motor disengage to motor1.setPark(); as same think according to Chai File  Diff  Annotate
8:0fe9f7bde2f9 2022-04-20 Cleaned up code so its easier to read ; Removed all unused functions; Added comments; Added new parking brakes; Changed position of Chai's datalogger code; Changed Emergency stop function so motor=0 before disengage , so final signal is 0 throttle File  Diff  Annotate
6:d0ba4c659e9c 2022-04-13 Added braking in emergency stop function and edited out redundancy in setPArk File  Diff  Annotate
5:1911475688a8 2022-04-13 Added newline break in serial display function File  Diff  Annotate
4:d9279fc3a8fb 2022-04-13 Updated display function invoking to under comms good check (line 358) File  Diff  Annotate
3:32e951e05a5b 2022-04-12 Added Chai's code for data logger output, see line 10, 11 and the new function DisplaySerial, which is included at the start of the main loop File  Diff  Annotate
2:d8d92dfc9c82 2022-04-12 Changed Mechanical Braking to accomedate new brakes for testing.; Commented some lines starting from line ~157 File  Diff  Annotate
1:ba85dae98035 2020-03-13 Back to 2019 File  Diff  Annotate
0:4788e1df7b55 2020-03-13 Uncommented RegenBRaking lines to allow capacitors to charge up from the batteries File  Diff  Annotate