totalreverse / ttyT1941

Simple demonstrator to show how to control a Tacx T1941 motor brake via a serial connection
GNU General Public License v3.0
16 stars 3 forks source link

Build your own Controller #21

Open MeanHat opened 3 years ago

MeanHat commented 3 years ago

Hi @totalreverse - I have found your wiki really useful in restoring a couple of old Tacx trainers (Fortius and iMagic) for friends & relatives. I have a third trainer for my wife (T1901 Flow) which is complete other than a missing head unit (you note that it is compatible with T1902,T1904 and T932). Ultimately I'd like it use it with @WouterJD's FortuisANT using a RPi with BLE to communicate with a CTP (Zwift). I've struggled to find buy a standalone head unit despite scouring eBay and Gumtree over recent weeks. Is your "Build your own Controller" design a potential solution?

totalreverse commented 3 years ago

If you have a Tacx head unit for the Fortius brake you can use it to drive the T1901 Flow instead. If it is a T1942 (solid blue) head unit, you may have a look at https://github.com/WouterJD/FortiusANT/issues/165#issuecomment-763187675 . To drive your (now) "headless" T1941 Fortius, it would be possible to add (direct) serial support to the FortiusAnt software. The RPi can drive the Fortius brake without additional hardware (you just need a cable, i.e. the Makeblock MB14230).

MeanHat commented 3 years ago

Thanks @totalreverse - unfortunately I still don't have a head unit to use. I've made a cable to connect the brake to the USB/TTL converter (FT232RL based). I've connected this to a Windows PC running @wouterJD's FortiusANT and have confirmed the USB is operational and the connector is receiving signals from the brake. I will revert to the RPi (instead of PC) and use the code you suggest in your wiki

StFalagar commented 3 years ago

Thanks a lot for all the effort put into this @totalreverse. @MeanHat did you get the T1901 working on the RPi? I have the same issue here... non compatible head unit that I would like to replace with the RPi. Can you assist with some steps to get this working for someone without much RPi/Phython experience?

MeanHat commented 3 years ago

Hi @StFalagar - I've not made any progress yet as I have been busy elsewhere. Let's keep in touch via this issues page (along with anyone else).

StFalagar commented 3 years ago

Thanks very much.... will keep an eye out here...

frankhommers commented 3 years ago

@MeanHat: Did you make the cable for a T1901? Because I was under the impression that that unit does talk USB/TTL ?

MeanHat commented 3 years ago

Hi @frankhommers - not yet unfortunately.

StFalagar commented 3 years ago

Hi @frankhommers - not yet unfortunately.

Although... You said you did get it to send signals to Windows... is that correct? What still needs to be done... do you just want to get that working for RPi?

MeanHat commented 3 years ago

I've got an industrial USB to TTL Converter which connects to the trainer brake output and is receiving signals. But that is as far as I got. I am missing a Tacx head unit and would like to use an RPi running @WouterJD's FortiusANT. I've been distracted on another project while keeping a look out for a spare head unit so have not made any progress. If you have any ideas or a design I'd be very interested in seeing it.

StFalagar commented 3 years ago

Yeah... on my side I bought a second hand Fortius with the T1932 Head Unit and I am busy setting that up at the moment. I still have the T1901 brake with the old headunit that does not have USB so would be nice to get that working... also have a RPi lying around here but at least I am able to continue training soon... I met @frankhommers on this github where they are trying to achieve the same using Arduino and told them about the fact that you were receiving signals.... maybe worthwhile for you to also follow there...

https://github.com/krisc-informatica/arduino-smart-bike-trainer/discussions/4

MeanHat commented 3 years ago

Many thanks @StFalagar - I will take a closer look with interest

switchabl commented 3 years ago

@StFalagar Just to be clear: the T1901 (magnetic) brake does not use UART and will not work with a USB/TTL converter. The T1941 motor brake does. Even though both share the same connector and the T1932 head unit works for both, the interface is in fact completely different. The T1901 doesn't have a built-in microcontroller and uses a PWM signal (that needs to be synchronized to the line frequency) to control the resistance instead. Using a Pi as a controller is probably feasible but will require some external circuitry (otherwise you will fry the Pi, the sync signal from the brake is +- 20V) and some care to keep the latency low.

StFalagar commented 3 years ago

@switchabl thanks for that explanation.... Makes much more sense now.
I am totally out of my depth here :) Just looking for a solution to get the T1901 working.
Anyway... I'll keep an eye here and use the Fortius in the meantime.

StFalagar commented 3 years ago

If you have a Tacx head unit for the Fortius brake you can use it to drive the T1901 Flow instead. If it is a T1942 (solid blue) head unit, you may have a look at WouterJD/FortiusANT#165 (comment) . To drive your (now) "headless" T1941 Fortius, it would be possible to add (direct) serial support to the FortiusAnt software. The RPi can drive the Fortius brake without additional hardware (you just need a cable, i.e. the Makeblock MB14230).

Hi @totalreverse I was able to find another Flow without the correct headunit so I now have a full working Fortius with white and blue headunit as well as a flow with yellow (unconnectable) headunit. I am going to use the blue headunit with the flow but is there an example of where Serial Support has been added to FortiusAnt in order to drive the Fortius Trainer with a RPI 3? It would be awesome if I can get this working.