TIM-6 ignition > Arduino

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

Tim Wescott

Well-Known Member
Joined
Jun 3, 2018
Messages
328
Reaction score
99
... eg feed them into a ring buffer and take a weighted average, but that should be after trying to reduce noise electronically....

Aaaagh! My eyes, my eyes, I'll never un-see that.

Actually, it's a pretty common beginners mistake. There are some very good, very narrowly-focused reasons to put a moving-average (or other FIR) filter in a control loop, but this isn't one of them.

You should be able to make the temperature readings fairly quiet. If so, and if the pump control is on-off, just use hysteresis to prevent chatter (i.e., if the pump is on then turn off at 150 degrees, if it's off then turn on at 160 degrees).

If you're continually changing the speed of the pump then you're probably using a PI controller, in which case you may not need filtering at all.

If you do need low-pass filtering, use a first-order IIR:

temperature_state = temperature_state + some_gain * (temperature_measurement - temperature_state);

Just put the above line in your code after you read the temperature into temperature_measurement; it'll filter nicely, without using much resources, and the filter will be minimum phase, and thus won't contribute to loop instability. The number "some_gain" will need to be tuned, but it roughly has the same effect as the reciprocal of the length of your moving-average filter.
 

Tim Wescott

Well-Known Member
Joined
Jun 3, 2018
Messages
328
Reaction score
99
Hi Charles,

Texas Instruments make linear thermistors in surface mount packages. It would be easy to solder wires to them and then bond them to your radiator body with epoxy.

I don't see where a specific temperature sensor was mentioned, but if you're going to use a thermistor (which is easy to use with a micro if it's for a limited temperature range) then you can get really teeny ones. Here's an example, but I suggest looking on DigiKey and Mouser: https://www.digikey.com/product-detail/en/littelfuse-inc/GR103E1K/GR103E1K-ND/6009533.

A thermocouple would be a bit harder to apply electrically, but should be more rugged in small sizes than a thermistor.
 

ICEpeter

Well-Known Member
Joined
Feb 27, 2010
Messages
159
Reaction score
62
Location
Tampa FL USA
Hello Charles,
Regarding your radiator temperature monitoring, I build my own temperature sensors in miniature for monitoring radiator temperatures and described it in the post: A Radiator Story part 2
If you search for that post it may assist you in what you want to accomplish..

Peter J.
 

bluejets

Well-Known Member
Joined
Apr 22, 2014
Messages
428
Reaction score
154
Thanks for suggesting the DS18B20. I think it is much too big to be fitted on the engine. In a pocket by the radiator might be the answer, but even then, at 30mm long it would be nearly half the size of the 80mm fan and radiator!

Welcome to model engines where it is a fact of life that not all things can be miniaturised.
We use them in the return water line adjacent to the head.
The stainless tube type does not have to be installed in an upright position and there is also the option of using the to92 case device if space is a problem.
Averaging can work to a degree but not always .
 
Joined
Mar 24, 2011
Messages
968
Reaction score
326
Location
UK, West Midlands
Thanks for the input chaps, this is getting interesting. To clarify, the coolant pump will be driven continuously by the crankshaft. (There is enough going on here without thinking about miniature electromagnetic clutches!) The temperature input will be used to switch the fan on above a threshold temperature and then ramp its speed up with rising temperature.

If the fan speed hunts a little under a steady engine load it does not matter much. I do like Tim's IIR instead of a moving average and evidently have some reading to do.

I am moving things about on the website, and have expanded the ignition page to be the home for all the electrical jiggery pokerey:
 
Last edited:

Tim Wescott

Well-Known Member
Joined
Jun 3, 2018
Messages
328
Reaction score
99
I was stuck on thinking you were going to pump (or not pump) water, and then how in heck would you read block temperature from the water in the radiator?

You may be able to control temperature adequately with a simple integrator, although you may need a PI controller. If that's not in your background, you may find this article helpful: http://wescottdesign.com/articles/pid/pidWithoutAPhd.pdf
 

BaronJ

Grumpy Old Git.
Joined
Dec 6, 2013
Messages
1,342
Reaction score
819
Location
York, North Yorkshire
Hi Tim,
This book was one of those recommended when I was at Uni !

"Applied Control Theory for Embedded Systems"

Not that I remember that much of it nowadays :rolleyes:
 
Top