Emdrive float - #53
Open
cfallon61 wants to merge 66 commits into
Open
Conversation
…ller was writing to the wrong register. Need to investigate further what value to set the can timout too. Wheels do spin.
Takes high_cell_temp reading to limit based off of power. Relatively arbitrary values were used. Does the same for low_volt_cell and power output. Changed the can filter on CAN1 to accept the BMS can message.
should have rinehart, lcd, and power lim
Merged traction control into power limiting branch (untested)
I think i fully integrated traction and power limiting
added an acknowledgement function and utilized it for all dashboard messages
No warnings perfect compile
Merged all rinehart_int changes back into the power_limiting code
power limiting algorithm tested and works correctly for simulated inputs.
percepio works and added them to gitignore
…with power limiting
added 19 commits
October 10, 2019 13:44
DMoore12
reviewed
Jan 30, 2021
| #define HIGH_Temperature_BITS_0_7 0 | ||
| #define HIGH_Temperature_BITS_11_8 1 | ||
| #define LOW_Temperature_BITS_0_7 0 | ||
| #define LOW_Temperature_BITS_0_7 0 |
DMoore12
reviewed
Jan 30, 2021
| #define PACK_INST_VOLTAGE_BITS_0_7 0 | ||
| #define PACK_INST_VOTLAGE_BITS_11_8 1 | ||
|
|
||
| #define PACK_FULL_VOLTAGE 300 |
Member
There was a problem hiding this comment.
Also, should be part of EEPROM stuff now
mflanag
reviewed
Jan 30, 2021
|
|
||
| BRAKE_2_MIN = 0x026F, | ||
| BRAKE_2_MAX = 0x0900, | ||
| } Brake_Thresholds_t; |
There was a problem hiding this comment.
Brakes and throttle would be great values to store in eeprom.
You could also potentially save config files on PI and transfer them over on boot but that seems more hacky.
| PEDALBOX_STATUS_ERROR_APPSIMP = 0b00000100, //APPS Implausibility error, EV 2.3.5, | ||
| PEDALBOX_STATUS_ERROR_APPSIMP_PREV = 0b00001000, //APPS Implausibility error, provisional (before it has lasted .1 second) | ||
| PEDALBOX_STATUS_ERROR_BPIMP = 0b00010000, //brake pedal implaus //EV 2.5.1, | ||
| } Pedalbox_status_t; |
| MOTOR_FEEDBACK_ERR = 0xFF0B, | ||
| DC_LINK_UNDER_VOLT_ERR = 0xFF0C , | ||
| PULS_MODE_FINISHED_ERR = 0xFF0D, | ||
| EMRGNCY_BUTT_PRSD_ERR = 0xFF0E, |
| REMOTE = 8, | ||
| TARGET_REACHED = 10, | ||
| INTERNAL_LIMIT_ACTIVE = 11, | ||
| } status_word_masks_t; |
mflanag
reviewed
Jan 30, 2021
| #define IMU_16G 4 | ||
| #define IMU_ACCEL 0 | ||
| #define IMU_8G_VAL 0x3FFF | ||
| #define IMU_8G_NEG 0xC001 //negative 0x3FFF |
DMoore12
requested changes
Jan 30, 2021
| { | ||
| // TODO possibly make this be values ORed together | ||
| NO_FAULT = 0, | ||
| OVER_POWER_FAULT = 1, |
| typedef struct | ||
| { | ||
| BMS_Fault_t fault; //flag that tells what limit was broken 1 -> Power, 2 -> Temp, 3 -> Volt | ||
| uint8_t pack_soc; //pack SOC |
| void processBamoCar(CanRxMsgTypeDef* rx); | ||
| void processWheelModuleFrame(CanRxMsgTypeDef* rx); | ||
| void processPedalboxFrame(CanRxMsgTypeDef* rx); | ||
| //void processPedalboxFrame(CanRxMsgTypeDef* rx); |
| #ifndef CAN_BUS_H | ||
| #define CAN_BUS_H | ||
|
|
||
| #include "stm32f4xx_hal.h" |
Member
There was a problem hiding this comment.
Can probably just use stdint.h
|
|
||
| typedef enum | ||
| { | ||
| ID_RINEHART_STATION_TX = 0x069, |
| torque_to_send = TractionControl(current_time_ms, &last_time_tc, torque_to_send, &int_term_tc, &prev_trq_tc); | ||
| } | ||
|
|
||
| emdrive_move_the_car_yo((emdrive_t *) &car.emdrive, torque_to_send, (CAN_Bus_TypeDef *) &car.vcan); |
Member
There was a problem hiding this comment.
Doesn't actually move the car 👎🏻
|
|
||
| emdrive_move_the_car_yo((emdrive_t *) &car.emdrive, torque_to_send, (CAN_Bus_TypeDef *) &car.vcan); | ||
| //wait until Constant 50 Hz rate | ||
| vTaskDelayUntil(¤t_tick_time, PERIOD_TORQUE_SEND); |
| //wait until Constant 50 Hz rate | ||
| vTaskDelayUntil(¤t_tick_time, PERIOD_TORQUE_SEND); | ||
| } | ||
| vTaskDelayUntil(¤t_tick_time, pdMS_TO_TICKS(1)); |
Member
There was a problem hiding this comment.
Have full wait time (50 ms) here
| vTaskDelayUntil(¤t_tick_time, pdMS_TO_TICKS(1)); | ||
| } | ||
|
|
||
| vTaskDelete(NULL); |
| tx.Data[0] = val; | ||
|
|
||
| xQueueSendToBack(car.dcan.q_tx, &tx, 100); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
holy cow our first merge to master in 2 years