camcamfresh / Xiaomi-M365-BLE-Controller-Replacement

Replacing the BLE Controller with a Cellular Controller
142 stars 34 forks source link

Control two ESCs from one stock (or other) Controller? #12

Open galstaf opened 5 years ago

galstaf commented 5 years ago

This project is in the same ballpark as what I am trying to do, so looking for some input from those who have way more knowledge than me. I have an M365 and that got me interested in the Bird scooters. I became a charger and briefly a mechanic (although that was frustrating), so now I just stick to the charging. Via my mechanic friends, I got a bunch of parts that Bird were dumping in the trash so I have a built a bench rig up with 2 motor wheels, 2 ESCs and 2 batteries packs.

I am not sure I need the cellular capabilities of the Particle Electron.. If anything I would like to use the stock BLE board and speed controlling rheostat switch on the stock scooter to control both ESCs and Both wheels to run at the same speed and power at the same time. I want to do this to build an two wheel drive scooter with a new custom body.

Would it be as simple as splicing the TX wire off and running it to the second ESC? From what I understand from this project, this is how the wires go... ground (black) -- Yellow (TX) -- Green (40V pwr) -- Red (5V pwr)

It seems like there may be an issue with the BLE board getting communication from two ESCs, but perhaps not?

Can anyone help here? What would be the best way to address this and achieve my goal of one throttle control switch controlling two wheels at the same time?

BPitts2 commented 5 years ago

If you don't care to RX any info, you'll probably be fine. I haven't went deep enough to have a consideration for handling messages from two machines at the same time.

I don't see a reason that you couldn't at least have dual motor control from one BLE replacement on one communication bus.

I also have two units at home. Now I'm really interested in making a 4 wheeled electric go-kart of some sort....

On Thu, Dec 13, 2018, 23:33 galstaf <notifications@github.com wrote:

This project is in the same ballpark as what I am trying to do, so looking for some input from those who have way more knowledge than me. I have an M365 and that got me interested in the Bird scooters. I became a charger and briefly a mechanic (although that was frustrating), so now I just stick to the charging. Via my mechanic friends, I got a bunch of parts that Bird were dumping in the trash so I have a built a bench rig up with 2 motor wheels, 2 ESCs and 2 batteries packs.

I am not sure I need the cellular capabilities of the Particle Electron.. If anything I would like to use the stock BLE board and speed controlling rheostat switch on the stock scooter to control both ESCs and Both wheels to run at the same speed and power at the same time. I want to do this to build an two wheel drive scooter with a new custom body.

Would it be as simple as splicing the TX wire off and running it to the second ESC? From what I understand from this project, this is how the wires go... ground (black) -- Yellow (TX) -- Green (40V pwr) -- Red (5V pwr)

It seems like there may be an issue with the BLE board getting communication from two ESCs, but perhaps not?

Can anyone help here? What would be the best way to address this and achieve my goal of one throttle control switch controlling two wheels at the same time?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/camcamfresh/Xiaomi-M365-BLE-Controller-Replacement/issues/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AGp40pyEDYhCU3HYgaGOKtlBngIW1yRBks5u4yoRgaJpZM4ZS3wd .

galstaf commented 5 years ago

If you don't care to RX any info, you'll probably be fine. I haven't went deep enough to have a consideration for handling messages from two machines at the same time. I don't see a reason that you couldn't at least have dual motor control from one BLE replacement on one communication bus. I also have two units at home. Now I'm really interested in making a 4 wheeled electric go-kart of some sort....

Right? That sounds awesome too!

However, it would be nice to get the RX info from at least one of the ESC units for speed and battery remaining information. I don't know how the BLE board would handle input from two ESCs at once. However it may be interesting to just try it and find out.

Does anyone else have any thoughts on this?

galstaf commented 5 years ago

PARTIAL SUCCESS!

Just some feedback on using the stock BLE ... I tried controlling the two ESCs by splicing into the control wiring. With a little thought, obviously one cannot just connect the yellow, because the ESC requires the 40V and ground to tell it to turn on and off. It turns out also it needs the 5V for something otherwise the motor will not activate... not entirely sure what the 5V is used for tho. So all 4 wires need to be connected to both of the ESC units.

The flashed Botox firmware was then applied to both ESC units separately. Can anyone tell me if the firmware is applied at the BLE level or the ESC level or both?

ISSUES WITH THIS SOLUTION:

So it is kinda working, but not great. Still looking for suggestions on a better solution.

camcamfresh commented 5 years ago

Firmware for like the hard speed limit and throttle control reside within the motor controller's firmware, but it's usually flashed through the microcontroller.

For your third bullet point, have you tried changing the timing of the poweroff command? also if you're using your own microcontroller, make sure the usb power isn't turning the scooter back on again.

galstaf commented 5 years ago

It is a factory BLE (microcontroller as you call it)... the long press shutdown command doesn't seem to work with multiple ESCs connected. I think short of making a controller, the only resolution is to have a manual power switch to kill power to all the ESCs.

On further testing, you are correct.. the firmware lives on the ESC, not the BLE. I can swap BLE boards and the same firmware is still on there.

Thanks again for your input!

Foujiwara commented 4 years ago

Hello i make Xiaomi M365 with 2 Motors and add Towing with 2 motor (Total road 4 Motor) I want use Arduino between the controllers and the display for dispatch information

exemple : BLE - > Arduino -> ESC 1 ................................| -> ESC 2 ................................| -> ESC 3 ................................| -> ESC 4 or

BLE - > Arduino -> ESC 1 ................................|-> ESC 2 ................................|-> Arduino -> ESC 3 .......................................................| -> ESC 4

i try with 2 ESC and one BLE with Data line connected with Y its working for Throttle and brake (down information), but for power on, turn on light, battery indicator and eco mode, and all ESC to BLE communication its not good (Up Information) for this i want use Arduino for intercept up and down information and send or resend just what I need

You can help me ? you have finish your project ?

Sorry i'm french my English is not good

thomz0r commented 4 years ago

funny , i was googling to find an arduino implentation and found that projet , i have in mind exactly the same goal . i think best is to. drive natively both ESC and even add the abbility to enable it . i will try to port the dev on arduino only , no need GPS , not even BT .

bartoszwarszawa commented 4 years ago

I think it would be the best to use boards like ESP with dual thread functionality as the timings on sending and reciving messages from drv controller is quite delicate and can't be disturbed by other processes. I already succeed in recreating the project with ESP32 and SIM808 GSM module instead of Proton board