thankthemaker / rESCue

rESCue - add more safety and control to your VESC based vehicle
GNU General Public License v3.0
104 stars 27 forks source link

VESC BLE Proxy Fix, Advanced Light bar support, OneWheel Stock BMS support. #69

Closed Relys closed 10 months ago

Relys commented 11 months ago

I have fixed the VESC proxy. It now supports writing to custom configs (i.e. float package).

I have also added additional options for light bar:

config.lightBarLedType = doc["lightBarLedType"] | "GRB";
config.lightBarLedFrequency = doc["lightBarLedFrequency"] | "KHZ800";
config.isLightBarReversed = doc["isLightBarReversed"] | "false";
config.isLightBarReversed = doc["isLightBarLedTypeDifferent"] | "false";
config.mallGrab = doc["mallGrab"] | false;

These will need to be added to the rESCue tool, but in the meantime the defaults make it so no behavior changes.

I have also added a new pattern for displaying the transgender pride flag. This will need an update in the rESCue tool as well: config.idleLightIndex new index is 6.

Additionally, there is now support for turning the stock OneWheel BMS into a smart VESC BMS! It uses the OWIE library (shoutout to my friend and fellow (former lol) REWheel developer lolwheel/datboig42069) to read in OneWheel BMS data over the RX line. It then constructs VESC BMS CAN packets and forwards them to the VESC! There is also a pin that can be used with an N-Channel mosfet to trigger turning the BMS on. That way you can still get live BMS data while riding (instead of just when powered on while charging).

I should mention that the battery settings for the BMS are configured for a Pint Quart battery. They can be configured in the private member variables in BMSController.

Finally, I forgot to mention this, but I have also fixed the issue of some parameters not being available due to the deprecation of COMM_GET_DECODED_BALANCE.

I have also added support for FLOAT_COMMAND_GET_RTDATA instead. This should now fix issues with ADC values not showing up for the light bar as well as a few other parameters.

Relys commented 11 months ago

After talking to @surfdado I'm also going to add support for new BMS State feature for BMS to throw faults. This will be eventually used in float package to have tiltback based on BMS.

Relys commented 11 months ago

Added basic support based on fault states from the stock bms.

if(relay->isBatteryOvercharged()) fault_state=BMS_FAULT_CODE_PACK_OVER_VOLTAGE; if(relay->isBatteryTempOutOfRange()) fault_state=BMS_FAULT_CODE_CHARGE_OVER_TEMP_CELLS;

For other fault codes (like individual cell over/under voltage, etc, over current, etc) this will need to be calculated manually and implemented.

Relys commented 11 months ago

Added support for all BMS FAULT codes (after talking about thresholds with @surfdado). The only one not implemented is for cell imbalances as I am waiting on us to finalize spec to add that to BMS FAULT code list.

Relys commented 11 months ago

Fixed the config file and added support for reading battery voltage from led bar while mall grabbing. XD This is very useful on the XR. Of course this is a config param that's set to false by default and will need an update to the rESCue tool

thankthemaker commented 10 months ago

I'll merge the pull request and make a 2.5.0 version as sonn as I find time.