Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from
Oct 16, 2023

Conversation

Relys
Copy link
Contributor

@Relys Relys commented Oct 13, 2023

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.

Needs new idelLightIndex (6) in tool
Fix for led  frequency
support for seperate led bar type and frequency
support for reversing led bar
Reads BMS data with OWIE library.
Forwards to VESC as VESC BMS CAN.
Instructions for BMS_ON to specify any GPIO pin as
opposed to just UART.
Move BMS Battery config from broadcastVESCBMS
to private member variables.
@Relys
Copy link
Contributor Author

Relys commented Oct 13, 2023

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
Copy link
Contributor Author

Relys commented Oct 14, 2023

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
Copy link
Contributor Author

Relys commented Oct 14, 2023

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.

Displays battery when pitch >70
This is useful on the XR with no lightbar
Fixed two other config vars
@Relys
Copy link
Contributor Author

Relys commented Oct 14, 2023

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

Copy link
Owner

@thankthemaker thankthemaker left a comment

Choose a reason for hiding this comment

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

Unfortunately I don't have a BMS, so I only can test your other changes / improvements.
We should also talk about what's needed in the rESCueApp in order to support the new features.

src/ILedController.h Outdated Show resolved Hide resolved
src/LightBarController.cpp Show resolved Hide resolved
src/main.cpp Show resolved Hide resolved
src/BleCanProxy.cpp Show resolved Hide resolved
src/AppConfiguration.cpp Outdated Show resolved Hide resolved
src/BMSController.h Show resolved Hide resolved
src/LightBarController.cpp Show resolved Hide resolved
added some vars for future BMS IMBALANCE fault codes.
@thankthemaker
Copy link
Owner

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

@thankthemaker thankthemaker merged commit 7bc90ef into thankthemaker:master Oct 16, 2023
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.

2 participants