Updated Regen Braking Logic.

Dependencies:   mbed millis

Changes

RevisionDateWhoCommit message
29:2ed4d9c309fc 23 months ago cdevarakonda added brake control redundancy default tip
28:1086791972d0 23 months ago cdevarakonda Update brakes pins, created brakes class and made new functions but still to be tested;
27:5f801d4ca461 23 months ago cdevarakonda Implemented new logic for regen braking using switch case to define braking values
26:6275acef6bfd 23 months ago cdevarakonda Commented out motor1.setforward im regen braking as this over rode direction switching
25:1e42ee248b89 23 months ago cdevarakonda Regen Braking enabled
24:15239fb901b0 23 months ago cdevarakonda 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
23:c25af9a7db8d 24 months ago jamesmcildowietfl Added autostop whistle, added number of points to tacho to 8, removed parking brake test ;
22:4cf934f6e989 24 months ago jamesmcildowietfl Reverted to 8 postitions on tacho ; ;
21:0cc8e3ee53f6 24 months ago jamesmcildowietfl Removed Park mode thing, job for another day
20:0add93a69df5 24 months ago jamesmcildowietfl Changed the serial code. Tried to add braking and coasting ;
19:a4afd3a6bdfb 24 months ago jamesmcildowietfl Added old serial print, need to check ;
18:d28d458824d4 24 months ago jamesmcildowietfl 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 ...
17:a5d9c9a45cbc 2022-05-04 cdevarakonda 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
16:7c8ef0e0beaa 2022-05-04 cdevarakonda 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
15:4976d145fbd9 2022-04-27 jamesmcildowietfl 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.
14:aaa46855f00a 2022-04-27 cdevarakonda 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
13:a9793222af20 2022-04-27 cdevarakonda Uncommented half mechanical braking state in throttle control function.; ; uncommented time to reach target variable in autoStopTriggered() and autoStopControl() functions
12:2ac4b0df4007 2022-04-22 jamesmcildowietfl Updated the number of "magnets" for the hall effect sensor
11:fcf00823f24a 2022-04-22 jamesmcildowietfl Added current distance to data logger and the changed the display function to "disp.c_str()"
10:8415866239cc 2022-04-22 jamesmcildowietfl Added desired datalogger output
9:d1998035418b 2022-04-20 jamesmcildowietfl Changed motor disengage to motor1.setPark(); as same think according to Chai
8:0fe9f7bde2f9 2022-04-20 jamesmcildowietfl 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
7:df2b65dcad49 2022-04-13 cdevarakonda Removed brakes.cpp and brakes.h for now, will fork repo
6:d0ba4c659e9c 2022-04-13 cdevarakonda Added braking in emergency stop function and edited out redundancy in setPArk
5:1911475688a8 2022-04-13 cdevarakonda Added newline break in serial display function
4:d9279fc3a8fb 2022-04-13 cdevarakonda Updated display function invoking to under comms good check (line 358)
3:32e951e05a5b 2022-04-12 jamesmcildowietfl 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
2:d8d92dfc9c82 2022-04-12 jamesmcildowietfl Changed Mechanical Braking to accomedate new brakes for testing.; Commented some lines starting from line ~157
1:ba85dae98035 2020-03-13 rwcjoliver Back to 2019
0:4788e1df7b55 2020-03-13 rwcjoliver Uncommented RegenBRaking lines to allow capacitors to charge up from the batteries