This morning Geoff and I ran the program on the completely assembled system. It ran extremely slowly, even when the PWM was at 100%. We tried various experiments, but only concluded that the system was providing considerably less voltage than the manual controller.
I returned this afternoon, having realised what the problem was. Back in December, the belief was that it would only take 7 to 9 V to drive the trains at max and min speeds. This wasn't a problem then because I believed that the Motor Drive Board in the system could deliver that. The problem now is that the lighting rails have been added since then and they add a considerable amount of rolling resistance because there are four pickup contacts per carriage and they rely on running against the track. The upshot is that with the Manual Controller attached, the train needs around 10 V to run at a reasonable speed.
The problem with that is that the L298N chip in the Motor Drive Board drops anything from 1.8 V and 3.2 A at 1 A current draw and up to 3.9 A at 2 A. The drop we are getting is significantly less than the worse case scenario, because we are only drawing up to 0.5 A during acceleration. However, we only get an RMS reading of about 8.9 V when measured across the track. This afternoon I put my scope on the track and the pulses were only about 10 V amplitude which equates to the aforesaid 8 to 9 V when developed across the motor.
There are a number of solutions to this:
- Best - Somehow reduce the rolling resistance of the track. It is quite variable; at the two ends the train speeds up and at a point about half-way between the tunnel and the door end, the train really struggles.
- Increase the power supply voltage to compensate for the volt drop. Today I used my Bench PSU to put 14 V into the system and the train ran pretty well, (but still had a noticeable slow down near the door end. There are two problems with this solution; one of which is easy to fix and which is less so:
- We have to be careful that increasing the input voltage doesn't upset the DC/DC Converter in the system; we don't want to blow up the Pi.
- We have to protect the train. If there was a failure in the Motor Drive Board, it is possible that the full PSU voltage might appear on the track. We can mitigate this by putting a couple of Zener Diodes across the track so that they will absorb the excess voltage by breaking down. (We need two so that the track is protected both ways and to get the right values we need to know the maximum safe voltage that the train can take. (It may aleady be protected.))
- Completely redesign the hardware to use MOSFETs instead of the L298N which uses bipolar transistors. The problem with this is that the design for these MOSFETs isn't easy (we tried for the River System Gate Valves and switched to the L298N instead.)
Any other ideas?