Skip to content

Conversation

@EmadsGitHub
Copy link
Collaborator

No description provided.

sendCAN_VCU_Throttle_Failure();
int currentState = fsmGetState(&VCUFsmHandle);
DEBUG_PRINT("Throttle read failure, trans to fatal failure\n");
sendDTC_FATAL_VCU_F7_EV_FATAL();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's send DTC 30 before invoking VCU FATAL DTC. Without it, the fatal DTC doesn't tell us anything about the root cause.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are called before you call that function pretty sure.

SG_ ChannelCurrentMCRight : 0|16@1+ (0.01,0) [0|0] "Amps" Vector__XXX
SG_ ChannelCurrentAUX : 0|16@1+ (0.01,0) [0|0] "" Vector__XXX

BO_ 2287668226 VCU_Toggle_EM_Off: 8 VCU_F7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put this all in one message and have distinct signals

{ STATE_EM_Enable, EV_EM_Toggle, &ToggleMotorsOff },
{ STATE_Failure_Fatal, EV_ANY, &fatalTransition },
{ STATE_ANY, EV_CAN_Receive_HV, &processHvState}, // From DCU. Check HV toggle response from the BMU
// { STATE_ANY, EV_CAN_Receive_EM, &processEmState}, // From DCU. Happens locally now so remove it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove any events nots used, especially stuff commented out

{ STATE_ANY, EV_BTN_HV_Toggle, &sendHvToggle}, // From DCU
{ STATE_ANY, EV_BTN_EM_Toggle, &sendEmToggle}, // From DCU
{ STATE_EM_Enable, EV_BTN_TC_Toggle, &toggleTC}, // From DCU
// { STATE_EM_Enable, EV_BTN_Endurance_Mode_Toggle, &toggleEnduranceMode}, // From DCU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Endurance mode not in use, remove for now as we don't even have a working endurance mode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debounce timer, I can't comment on it since it wasn't modified, see line 156

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought keep the transition and add a note endurance mode not currently in use, also remove everything that says "from DCU"

{
sendDTC_WARNING_Throttle_Failure(3);
return EM_Fault(EV_Throttle_Failure);
return Throttle_Shutdown(EV_Throttle_Failure);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comments on lines 216 and 217

VCU_States_t state = shutDownMotors(STATE_HV_Disable);
return state;
}
uint32_t Generic_EM_Fault(uint32_t event){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change all function return types to be VCU_States_t instead as necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its supposed to be uint32_t but I think I messed up by declaring it as VCU_States_t in the function

BO_ 2287668226 VCU_Toggle_EM_Off: 8 VCU_F7
SG_ EMFaultEvent : 0|8@1+ (1,0) [0|255] "" Vector__XXX

BO_ 2287733762 VCU_HV_Disable_Twice: 8 VCU_F7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Disable twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its for disableRedundancy, tbh idk why I didn't keep it the same name

uint32_t EM_Fault(uint32_t event)
{
int newState = STATE_Failure_Fatal;
uint32_t BPS_Failure_Shutdown(uint32_t event){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BPS is brake pressure sensor. you have redundant transitions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just copying the transitions from how it was initially lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is when working on something, don't assume what was previously done is perfect. Investigate what it is you're working on and find ways to improve it outside of what was just asked of you. It's some good feedback one of my previous employers gave me to improve as an engineer. For example in this case the VCU state machine isn't perfect and could use some optimization

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I found out that BPS_Failure wasn't implemented out so I removed it

{ STATE_EM_Enable, EV_EM_Toggle, &EM_Fault },
{ STATE_HV_Enable, EV_Hv_Disable, & DisablingHV},
{ STATE_EM_Enable, EV_Bps_Fail, &BPS_Failure_Shutdown },
{ STATE_EM_Enable, EV_Hv_Disable, & DisablingHV},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra space between & and DisablingHV

sendCAN_VCU_Toggle_EM_Off();
DEBUG_PRINT("EM Toggle, trans to EM Disabled\n");
//disable TC
disableRegen();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move disableRegen and disable_TC to MotorStop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants