Generic open source open hardware DIY controller?

cdtelting

1 µW
Joined
Jun 20, 2021
Messages
3
I have the TSDZ2. The open source firmware is capable but I'd like more features and to move the mosfets outside the motor housing for better cooling.

I feel like doing most of it on my own as far as the microcontroller and programming. But generic driver boards must surely exist. Looking for 1500/2000 watts. Not that the TSDZ2 could handle that but rather I'd like to be able use it with other motors later.

Are there any open source generic controllers or driver projects to drive these motors out there?

I want throttle, temp, bluetooth, and relay control for a headlamp. Possibly later I'd want to control animated led strips.
 
There's many VESC variants (some here on ES, others out on various sites including the original). I think at least some of them support BT in various ways.

There's the Lebowski brain chip (documented here on ES) that you could use to drive whatever power stage you want to buy or build. No BT though.

There are also a number of controller development threads here on ES for various types from low power to drag racing power, some of which have enough info to build one from. Don't know if any have BT.

The OS motor controllers aren't likely to have lighting controls in them, but you can add that code and hardware to them if you really need that integrated (personally I'd rather have that as a completely separate system so it would be working even if the motor system failed, and vice-versa).
 
cdtelting said:
I want throttle, temp, bluetooth, and relay control for a headlamp. Possibly later I'd want to control animated led strips.
So retaining the torque sensing PAS is not a requirement?
 
cdtelting said:
I have the TSDZ2. The open source firmware is capable but I'd like more features and to move the mosfets outside the motor housing for better cooling.

I feel like doing most of it on my own as far as the microcontroller and programming. But generic driver boards must surely exist. Looking for 1500/2000 watts. Not that the TSDZ2 could handle that but rather I'd like to be able use it with other motors later.

Are there any open source generic controllers or driver projects to drive these motors out there?

I want throttle, temp, bluetooth, and relay control for a headlamp. Possibly later I'd want to control animated led strips.

I'm working on replacing the TSDZ2 controller with a nrf52840 controlling a flipsky mini vesc controller. I don't expect to get much more power out of the motor over and above what I get with Casainho's OSF but it's also a stepping stone for me to a different motor - I can upgrade to a larger VESC and keep the rest of the system much the same (changing sensors when needed).

Is very early days - haven't got much to show apart from a test rig with the vesc connected to a tsdz2 and an nrf with all the required sensors connected. Haven't had much time to get started on the code in the last week or so - I did upgrade the nrf SDK to the latest - then had to roll back since the code no longer booted...

https://endless-sphere.com/forums/viewtopic.php?f=28&t=79788&start=9700#p1744275

One thing I do need help with - if you're any good with electronics - is replicating the circuit that's used to activate and read the tsdz2 torque sensor. At teh moment i've piggy-backed onto an old tsdz2 controller and I hope that will work to enable me to write the code until I can work out how to replicate the circuit.

https://endless-sphere.com/forums/viewtopic.php?f=28&t=118722

I have at least proven that the flipsky mini fits into the controller shell

file.php


Casainho is working on a similar project to interface a VESC to a Bafang motor (and/or scooter) using an ESP32 board which is further along - that could also be hooked up to a TSDZ2 but currently works with an external torque sensor

https://github.com/OpenSourceEBike/EBike_EScooter_app_pyhton
 
I'm working on replacing the TSDZ2 controller with a nrf52840 controlling a flipsky mini vesc controller. I don't expect to get much more power out of the motor over and above what I get with Casainho's OSF but it's also a stepping stone for me to a different motor - I can upgrade to a larger VESC and keep the rest of the system much the same (changing sensors when needed).

Is very early days - haven't got much to show apart from a test rig with the vesc connected to a tsdz2 and an nrf with all the required sensors connected. Haven't had much time to get started on the code in the last week or so - I did upgrade the nrf SDK to the latest - then had to roll back since the code no longer booted...


One thing I do need help with - if you're any good with electronics - is replicating the circuit that's used to activate and read the tsdz2 torque sensor. At teh moment i've piggy-backed onto an old tsdz2 controller and I hope that will work to enable me to write the code until I can work out how to replicate the circuit.


I have at least proven that the flipsky mini fits into the controller shell

file.php


Casainho is working on a similar project to interface a VESC to a Bafang motor (and/or scooter) using an ESP32 board which is further along - that could also be hooked up to a TSDZ2 but currently works with an external torque sensor

Hi, could figure out the Torque sensor solution ? I m trying to go the same.
 
Hi, could figure out the Torque sensor solution ? I m trying to go the same.
Yes I got it working and have a test board that has all the required inputs linked up to an nrf52840 but now it's spring I've got less time for coding so things have slowed down a bit. I have the codebase compiling - using the latest casainho code minus the motor control parts - so it has the android app, ble/ant+ lev, wired/wireless remote and support for pas/torque/dual uarts - one for the vesc and one for a display if needed/temp/brake sensor/speed sensor and the bldc library for vesc control. With those functions supported there aren't enough gpio/adc pins free on the nrf blue dongle to support any other functions like throttle but that's easy to remedy using either a gpio expander or a different nrf board (or soldering to pads on the underside).

The circuit to read the torque sensor is detailed in this post. I've not yet done any qualitative testing to see if the response is more linear or the same as the stock controller but it seems to work ok. the next step hardware-wise is to get it into KiCAD and have a board made up by pcbway or similar so it's small enough to fit in the tsdz2 case with the vesc.
 
Last edited:
Yes I got it working and have a test board that has all the required inputs linked up to an nrf52840 but now it's spring I've got less time for coding so things have slowed down a bit. I have the codebase compiling - using the latest casainho code minus the motor control parts - so it has the android app, ble/ant+ lev, wired/wireless remote and support for pas/torque/dual uarts - one for the vesc and one for a display if needed/temp/brake sensor/speed sensor and the bldc library for vesc control. With those functions supported there aren't enough gpio/adc pins free on the nrf blue dongle to support any other functions like throttle but that's easy to remedy using either a gpio expander or a different nrf board (or soldering to pads on the underside).

The circuit to read the torque sensor is detailed in this post. I've not yet done any qualitative testing to see if the response is more linear or the same as the stock controller but it seems to work ok. the next step hardware-wise is to get it into KiCAD and have a board made up by pcbway or similar so it's small enough to fit in the tsdz2 case with the vesc.
Nice!
 
Back
Top