The rear wheel resistance unit connects to the handlebar computer via a 6pin rj12 cable. The pins are connected as follows:
1 Cadence signal to computer (one pulse per crank revolution), 3.3V pulses.
3 PWM control signal to brake (2.6V pulses).
4 AC power / synchronization signal to computer, ~23V AC signal which appears the +ve part is clipped at ~19.5V (see picture).
5 +18V (~1.5V variation sawtooth profile).
6 Speed signal to computer (4 pulses per brake axle revolution) 3.3V pulses.
I have never used the cadence pickup on the trainer, so I intend to ignore this.
The speed signal on pin 6 is required to be pulled high, with the trainer pulling it low for incoming pulses. I had a lot of problems calculating speed consistently early on as it appeared the result fluctuated randomly no matter how I changed the calculation. The cause was the relatively slow rise/fall time of the speed pulses, passing the signal through a schmitt trigger worked perfectly, averaging the last 3 speed readings gave a nice steady speed reading.
Resistance is created by the interaction between a set of permanent magnets and a set of electromagnets, either reinforcing or negating the permanent magnets field.
To control the trainer resistance a pwm output synchronised to the AC signal on pin 4 needs to generated. Producing a pulse during the +ve part of the sync signal will reduce the resistance of the electromagnetic brake. During the -ve part of the wave will increase resistance. This is a 50Hz wave, being in the UK this is our mains frequency, I presume that in other parts of the world this is likely to be 60Hz.
My aim was to have the arduino generate an interrupt on the falling edge of the sync signal, as this is relatively slow, it should be possible to time a pulse during the first half or second have of the next wave. The length of this pulse effects how much resistance is generated. The arduino timers seem like a nice fit for this.
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.