Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: fmea.cpp
- Revision:
- 1:fec1d091fa34
- Parent:
- 0:30ff725706d2
- Child:
- 2:eb4101b574bc
--- a/fmea.cpp Tue Mar 05 01:19:30 2013 +0000 +++ b/fmea.cpp Wed Mar 06 13:58:03 2013 +0000 @@ -8,7 +8,7 @@ //FMEA parameters const float steering_diff_limit = 7; -const float throttle_diff_limit = 0.5; +const float throttle_diff_limit = 0.4; int fmea_recheck_iteration = 3; float fmea_recheck_time = 0.3; @@ -21,7 +21,6 @@ int flag_throttle_Left_pulldown = 0; int flag_throttle_Right_pulldown = 0; - //FMEA Flags bool flag_use_openloop = false; bool flag_use_steering = false; @@ -33,6 +32,7 @@ Ticker for_throttle_Left_pulldown_fmea; Ticker for_throttle_Right_pulldown_fmea; Ticker for_steering2_pulldown_fmea; +Ticker for_steering_comparison_fmea; //Left RPM sensor fails. Sensor output is pulled down to zero. void rpm_Left_pulldown_fmea() @@ -111,7 +111,6 @@ else { flag_throttle_Right_pulldown = 0; - return; } } @@ -132,7 +131,6 @@ else { shutdown = true; - return; } } @@ -141,14 +139,16 @@ { if (!flag_use_steering) { + for_steering_comparison_fmea.detach(); if (abs(steering2-steering) > steering_diff_limit) { flag_steering_comparison++; if (flag_steering_comparison >= fmea_recheck_iteration) { steering2_pulldown_fmea(); + return; } - steering_comparison_fmea(); + for_steering_comparison_fmea.attach(&steering_comparison_fmea,fmea_recheck_time); } else {