Page 1 of 2

closed loop cooling fan PWM control - feature request

Posted: Sat Nov 18, 2017 4:40 pm
by ca434sbc4
I'm running a cooling fan out of a Ford Crown Vic. The later designs used a PWM power controller (DC in, PWM +12 out, control input PWM 0 - 100%) to control the fan speed.

Can a closed loop PWM be added to the fan control based on the CLT sensor and a logic input to run at a higher speed ( possibly an adder the the PWM value) when the A/C is turned on?

Re: closed loop cooling fan PWM control - feature request

Posted: Sun Nov 19, 2017 2:09 pm
by arran
Have you checked out Generic PWM under Advance Engine menu?

Re: closed loop cooling fan PWM control - feature request

Posted: Sun Nov 19, 2017 10:34 pm
by ca434sbc4
I did look at it, I may be missing how the clt sensor feedback is converted from temp (*F) into the load axis scaling from 0-100?

The manuals are a bit light on this. An example would go a long way to understanding the setup process.

Re: closed loop cooling fan PWM control - feature request

Posted: Mon Nov 20, 2017 2:52 am
by arran
Something like this maybe,
coolant pwmJPG.JPG
coolant pwmJPG.JPG (119.09 KiB) Viewed 1730 times

Re: closed loop cooling fan PWM control - feature request

Posted: Mon Nov 20, 2017 7:22 pm
by ca434sbc4
pwmb.png
pwmb.png (49.28 KiB) Viewed 1692 times
When I try to duplicate - in offline mode, the load axis scaling is still not setting up to the clt sensor range nor label is the load axis label updating to coolant.

So I'm still missing a step.

Re: closed loop cooling fan PWM control - feature request

Posted: Tue Nov 21, 2017 2:36 am
by arran
Dude hit the three dots button top right hand side and the table will be shown

Re: closed loop cooling fan PWM control - feature request

Posted: Tue Nov 21, 2017 6:45 am
by elaw
And if you hit the button with the three dots at the upper left of the graph, there are options there for scaling the axes.

The labels do not update... they always say "load" for whatever reason. But the PWM will use the parameter you select from the dropdown in spite of how the graph and table are labeled.

Re: closed loop cooling fan PWM control - feature request

Posted: Fri Nov 24, 2017 6:54 pm
by ca434sbc4
That makes sense. Thanks.

The one item missing is the ability to goto a high PWM value is the A/C pressure switch goes -> high pressure cutout >> which requires additional air flow to correct.

Re: closed loop cooling fan PWM control - feature request

Posted: Mon May 28, 2018 6:46 pm
by goodysgotacuda
ca434sbc4 wrote:That makes sense. Thanks.

The one item missing is the ability to goto a high PWM value is the A/C pressure switch goes -> high pressure cutout >> which requires additional air flow to correct.

was this ever figured out? I am trying to figure out how to PWM my fan but still ramp-up with a/c on. I would really hate to go to an aftermarket controller to manage this, my MS3 knows the ECT and a/c status already.

Re: closed loop cooling fan PWM control - feature request

Posted: Tue May 29, 2018 7:53 am
by Laminar
Ditto on this. As common as these OEM PWM fan controllers seem to be (I got fan+shroud+controller at the junkyard for $25), it seems like it'd be a nice feature to have.

The built in on/off fan control offers the ability to shut the fan off dependent on TPS and VSS, and has the correct on/off hysteresis, which are all important for proper fan control. None of those things are possible with the generic PWM configuration. Theoretically I could put a relay inline between the MS PWM output and the fan PWM input, then activate that relay with a discrete from the MS fan control function, but that just seems like an additional point of failure.

Re: closed loop cooling fan PWM control - feature request

Posted: Wed May 30, 2018 4:34 pm
by amtaustin
Would it be possible to use both the fan control and generic PWM output, where the PWM is controlling a SSR, but the output of the SSR is then wired to a regular relay, that is controlled by the fan control output? This way you can at least override turning the fan off above certain rpm, but i guess you could not override turning fan to full 12v when a/c request is on. Actually, maybe that is stil possible if the a/c relay output also feeds input to the SSR.

Re: closed loop cooling fan PWM control - feature request

Posted: Wed May 30, 2018 5:50 pm
by Laminar
Yeah, that’s the second half of my second paragraph.

Re: closed loop cooling fan PWM control - feature request

Posted: Wed May 30, 2018 8:22 pm
by dontz125
What you can do is assign the Fan Control output pin to something fairly underused - K1. Set up your Generic Closed Loop PWM, presumably with 'Coolant' as your PV feedback variable, to use K3 as its output. Note that neither K-pin actually needs anything wired to it.

Now set up a Programmable Output; if you're sending a PWM signal to a controller, you can use something light-duty, like Spark H. If you're actually PWM-ing the fan motor, you'll need something a little more robust, like INJ1 (or SpkH driving a substantial SSR). Set up the ProgO to come on when both K1 and K3 are ON ==> [portk] [AND] [10] hyst [10]. (I had originally started writing [portk] [AND] [2] hyst [2] [AND] [portk] [AND] [8] hyst [8], then realised I was being silly ... )

This will allow the fan control function to turn the fan on and off for its various reasons, as well as invoking the Idle Up function if desired, but whenever the fan comes on it will be under PWM control from the Generic output. No extra relays or wiring.

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 7:26 am
by Laminar
Very interesting!
if you're sending a PWM signal to a controller, you can use something light-duty, like Spark H. If you're actually PWM-ing the fan motor, you'll need something a little more robust, like INJ1 (or SpkH driving a substantial SSR).
INJ1 is rated for 7A, I doubt that would drive a fan. It sounds like most in this thread are utilizing an OEM fan driver module.
Set up the ProgO to come on when both K1 and K3 are ON ==> [portk] [AND] [10] hyst [10].
Can you break down the syntax for me? I want to understand what's going on!

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 8:32 am
by dontz125
My apologies if part of this answer involves telling you how to suck eggs - I have no idea of your knowledge and understanding ... :?

The values in the 'Active Conditions' work quite differently with the AND test than they do with the normal < = > operators. Each port has 8 pins numbered 0-7; not all pins are available to use in each port. When trying to examine a specific pin in a port, you do so with 'bitwise' values - pin 0 has a value of 2^0 = 1, pin 1 has a value of 2^1 = 2, pin 3 has a value of 2^3 = 8 ... pin 7 has a value of 2^7 = 128. The status of the port can be read as a number from 0-255, with each ON pin contributing its value. If the pin is OFF, it contributes 0. A port with all the pins ON except pin 0 ( 1 1 1 1 1 1 1 0 )would have a value of ( 128 + 64 +32 +16 +8 +4 + 2 = ) 254.

During our last episode, pin K1 was selected as the Fan Control output, and pin K3 was selected as the Generic PWM output, thus we're trying to monitor pin 1 and pin 3, each with a value of 2 and 8, respectively. The function is looking for something that looks like this: x x x x 1 x 1 x, where a '1' is ON, and 'x' is "Don't care!" - the state of pins 0, 2, 4, etc don't matter to this operation. The code is thus looking for an 8 from K3, and a 2 from K1.

Back to the Activation Conditions - the number in the Threshold spot when using AND is actually the bitmask to be applied - which bits / pins are you looking for? K3 + K1 == 8 + 2 = 10, so by specifying a bit mask of 10, you're only looking at K3 and K1. If the bitmask was 138 (128 + 8 +2), you'd also be looking at K7.

The Hysteresis value is the desired trigger value - just like turning on when 'coolant > 210F', the ProgO turns on when the bitmasked value is equal to the number in the Hysteresis spot. In this case, we want [portk] AND'd with a bitmask of [10] to have a value of [10] - both pins are on, 8 + 2 = 10. If you wanted to trigger with pin 1 on but pin 3 off, the hysteresis value would be ( 0 + 2 ) = 2, so [portk] [AND] [10] [2].

It can be pretty easy to give nonsense values that can't turn on; [portk] [AND] [10] [255] is a legitimate expression, but it'll never work. Even if all the pins are on (port value of 255), the function is only looking at the masked pins, 1 and 3. Not even a government lobbyist can make 8+2 = 255 ... :shock:

This also works with different ports. If you wanted Fan Control on K7 and the Generic PWM on M2, you would use the expression
[portk] [AND] [128] [128]
[AND]
[portm] [AND] [4] [4]

Simple, right? :D

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 9:11 am
by Laminar
Brilliant! Thank you!

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 9:28 am
by Laminar
Next possibly dumb question - I don't see K-anything as an option in the output port/pin menus for Fan Control or Generic PWMs. What am I missing there? I'm running pre-1.4.1 b3 right now.

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 9:36 am
by dontz125
Ah - I think those pins were added in the 1.5 development process; they're certainly present for the 1.5.0 and 1.5.1 releases.

The process holds true for whichever pin(s) you choose. The ProgO panel has all the port names as well as the 'common name'; for instance, Spark E on the MS3X card is PB4 - port B, pin 4, bitwise value = 16.

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 9:38 am
by Laminar
Makes sense - I need to get around to upgrading to 1.5.1, though I need to get this car put together in the next two days so I may not have time for that before Sunday.

Re: closed loop cooling fan PWM control - feature request

Posted: Thu May 31, 2018 4:44 pm
by goodysgotacuda
dontz125 wrote:My apologies if part of this answer involves telling you how to suck eggs - I have no idea of your knowledge and understanding ... :?

The values in the 'Active Conditions' work quite differently with the AND test than they do with the normal < = > operators. Each port has 8 pins numbered 0-7; not all pins are available to use in each port. When trying to examine a specific pin in a port, you do so with 'bitwise' values - pin 0 has a value of 2^0 = 1, pin 1 has a value of 2^1 = 2, pin 3 has a value of 2^3 = 8 ... pin 7 has a value of 2^7 = 128. The status of the port can be read as a number from 0-255, with each ON pin contributing its value. If the pin is OFF, it contributes 0. A port with all the pins ON except pin 0 ( 1 1 1 1 1 1 1 0 )would have a value of ( 128 + 64 +32 +16 +8 +4 + 2 = ) 254.

During our last episode, pin K1 was selected as the Fan Control output, and pin K3 was selected as the Generic PWM output, thus we're trying to monitor pin 1 and pin 3, each with a value of 2 and 8, respectively. The function is looking for something that looks like this: x x x x 1 x 1 x, where a '1' is ON, and 'x' is "Don't care!" - the state of pins 0, 2, 4, etc don't matter to this operation. The code is thus looking for an 8 from K3, and a 2 from K1.

Back to the Activation Conditions - the number in the Threshold spot when using AND is actually the bitmask to be applied - which bits / pins are you looking for? K3 + K1 == 8 + 2 = 10, so by specifying a bit mask of 10, you're only looking at K3 and K1. If the bitmask was 138 (128 + 8 +2), you'd also be looking at K7.

The Hysteresis value is the desired trigger value - just like turning on when 'coolant > 210F', the ProgO turns on when the bitmasked value is equal to the number in the Hysteresis spot. In this case, we want [portk] AND'd with a bitmask of [10] to have a value of [10] - both pins are on, 8 + 2 = 10. If you wanted to trigger with pin 1 on but pin 3 off, the hysteresis value would be ( 0 + 2 ) = 2, so [portk] [AND] [10] [2].

It can be pretty easy to give nonsense values that can't turn on; [portk] [AND] [10] [255] is a legitimate expression, but it'll never work. Even if all the pins are on (port value of 255), the function is only looking at the masked pins, 1 and 3. Not even a government lobbyist can make 8+2 = 255 ... :shock:

This also works with different ports. If you wanted Fan Control on K7 and the Generic PWM on M2, you would use the expression
[portk] [AND] [128] [128]
[AND]
[portm] [AND] [4] [4]

Simple, right? :D
I sure wish I understood how all of this would work.. The nitty-gritty of how these things function is greek to me. :RTFM: