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

Patch 2 #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/generate_bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: C/C++ CI

on:
push:
branches: [ master ]
branches: [ v0.5 ]
pull_request:
branches: [ master ]
branches: [ v0.5 ]

jobs:
build:
Expand Down
18 changes: 9 additions & 9 deletions Core/Inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@
#define GEAR_RATIO 11 //15 for original M365 motor

// speed limits for invividual modes in kph
#define SPEEDLIMIT_ECO 6
#define SPEEDLIMIT_ECO 15
#define SPEEDLIMIT_NORMAL 20
#define SPEEDLIMIT_SPORT 50

// motor current limits for invividual modes in mA
#define PH_CURRENT_MAX_ECO 5000
#define PH_CURRENT_MAX_NORMAL 9000
#define PH_CURRENT_MAX_SPORT 14000
// motor current limits for invividual modes in mA, see default settings at https://max.cfw.sh/#
#define PH_CURRENT_MAX_ECO 16000
#define PH_CURRENT_MAX_NORMAL 28000
#define PH_CURRENT_MAX_SPORT 55000

// motor current limit for regen in mA
#define REGEN_CURRENT 20000
#define REGEN_CURRENT 2000

// maximum current for flux weakening in mA
#define FW_CURRENT_MAX 18000 //max id
#define FW_CURRENT_MAX 12000 //max id

// maximum battery currents in mA
#define BATTERYCURRENT_MAX 8000
#define BATTERYCURRENT_MAX 25000
#define REGEN_CURRENT_MAX 10000

// battery voltage limits in mV
#define BATTERYVOLTAGE_MIN 33000
#define BATTERYVOLTAGE_MIN 31000
#define BATTERYVOLTAGE_MAX 42000


Expand Down
2 changes: 1 addition & 1 deletion Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ int main(void) {

#ifdef ADCTHROTTLE

MS.i_q_setpoint=map(ui16_reg_adc_value,THROTTLEOFFSET,THROTTLEMAX,0,MS.phase_current_limit);
MS.i_q_setpoint=map(ui16_reg_adc_value,THROTTLEOFFSET,THROTTLEMAX,0,MP.phase_current_limit);
#endif
// set power to zero at low voltage
if(MS.Voltage<BATTERYVOLTAGE_MIN){
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Fork of EBiCS firmware for Lishui devices. Ported to Xaiomi M365 controller.
Use JST PA series 2mm pitch for the connectors. (need to be confirmed)

This branch works with the original M365 dashboard
This branch works with the original M365 dashboard with BLE Ver 90 and 122, thanks to M0g13r

How to use:
Method 1 (github account needed):
Expand Down