PWM period forced to 10ms

Just made the jump to BrewBlox here and really loving it so far! :smiley:

I’m using it for a HERMS and want to control a TD-5 mashing pump. On the forum, I read the recommendation of setting the PWM period of the PWM block driving the pump actuator to 100 ms in order to do this. However, when changing the PWM period to something under 1s in the BrewBlox UI, the software always seems to force it to 10ms. (I.e. after putting in ‘100ms’ in the dialog box and pressing ok the value of the period of the PWM block is set to 10ms.) This seems to be the case for all blocks and all values < 1s.

Just to check: is this expected behavior or should I be able to set a PWM value between 10 and 1000ms?

Happy to hear you like it!

Yes, PWM being either 10ms or >1s is expected behavior. The 10ms mode is implemented as a special case to improve performance and avoid timing issues.

I suspect that in the other thread either someone made a typo, or was thinking about 100Hz (==10ms).

Thanks for the quick reply!

Set the PWM to 10ms, but the TD5 seems to be acting a bit odd to its output.

The PWM (together with the Spark) seems to be working as expected at this interval. When measuring the voltage on the blue/black wire just before it enters the pump I measured:
PWM | Voltage
100% 4.63V
90% 4.15V
80% 3.70V
70% 3.23V
60% 2.77V
50% 2.30V
40% 1.84V
30% 1.38V
20% 0.92V
10% 0.46V

And at all steps red/black has been giving 24.23V

However, the pump itself pumps just a fraction - way less than 90%, maybe even less that 50% - of its capacity when the PWM is set to 90%, and will in fact only pump at this rate if it has been brought to this state from 100%. (So when the PWM is set to 90% from a 0% position it will not result in the pump actually pumping through nearly as much volume as it would when the PWM was set to 90% from a 100% position.)

All of the above would lead me to conclude that the PWM functionality is working just fine and that I would appear to have a faulty pump. Would you guys agree, or am I missing another possible factor?

EDIT: Maybe I damaged the pump with the supplied voltage? I just saw that the version of the TD-5 which I have (older thatn the model currently sold on the BrewPi store) states a lower voltage for red on the sticker on the outside.

You probably don’t have a PWM version of the pump, but one that takes an analog voltage (0-5V).
It will not respond well to PWM, which is a fast switching digital signal that is either 0 or 5V, which only is 0 to 5V when averaged.

You can add an RC low pass filter to convert the PWM signal to an analog signal that will work with the older version of the pump. A 10k resistor and 47 uF capacitor will work well for example.
The exact values are not that important, just make sure that R*C > 0.5 seconds. A resistor in the 10-100k range and a capacitor in the 10-100uF range.

Spark +  ----= R =----------- Pump blue
                      |
                   ------- +
                 C -------
                      |
Spark -  -------------------- Pump black

Thanks for the explanation. That makes a lot of sense. :slightly_smiling_face:

It sounded like the pump was actually pulsing on and off, so that would indicate that I indeed have an older version of the pump which doesn’t support PWM. It also came with a controlbaord with a pot-meter which in retrospect should have rung a bell that it was passing an analogue signal. Do the newer pumps come with a LPF built into the circuitry of the pump itself in order to to handle the PWM?

As for your scheme, I looked at the closest match in response time (using this tool) with the capacitors and resitors I had lying around in the range you mentioned and came to a combination of 22uF and 22k which should result in 1.11 secs, which is pretty close to the 1.08 secs that the tool calculated for your example. Going to put that combination in the circuitry. Thanks again for the help! :smiley:

The PWM signal is not low passed, but read digitally by the microcontroller in the pump. This makes it insensitive to voltage level. If it was just a low pass filter, your analogue signal would work.
Your values are good.

The RC LPF is installed and it works as a ‘tierelier’! :smile:

Can’t wait for the next brewday to fully experience the awesomeness the new software.

1 Like

I try to set pump time to 10ms (.01 sec) but it always rounds up to 1 s causing pump to turn on and off at any setting from 90% to 10% instead of the speed just slow down. How can I tell if the pump is the older one and needs thew RC modification?