Modbus PC fan control - Page 1
Forum section: electronics / projects

author: Lomax
author_rank: Frequent Contributor
timestamp: September 04, 2020, 10:24:44 am
content: Hi all,In my quest for the ultimate houseboat home automation system I've hit on many false starts, dead ends and unexpected problems. I have some pretty strong opinions about how things should work, with which the real world doesn't always agree. The latest snag is that the (expensive)Modbus PWM dimmersI've bought don't play nice with thebrushless PC fansI use for the ventilation system - I get a lot of acoustic noise coming from the fans and from the dimmers at anything less than 100% duty.This is not entirely surprising, since the dimmers only operate at relatively low (audible) PWM frequencies of 300/600/1200 Hz. But I need the ventilation system to run silently at low speeds, so I've played with various combinations of R/L/C filtering. I've found that at 1200 Hz with a 470uH inductor in series and a 470uF capacitor in parallel the noise completely disappears, but this "solution" has several drawbacks: I lose a bit at top end due to the DC resistance of the inductor (~1V drop), and lower duty is not linear with RPM, making it difficult to set the desired speed. At < ~25% duty the fans don't spin at all, and their built-in stall protection kicks in. There's also cost, space and temperature considerations (the inductor does get rather warm). So I've begun to accept that I may have to re-think how the ventilation fans are controlled, and use those pricey PWM dimmers only to control lighting. I see in the datasheet that the fans' starting voltage is 6 V, and I've confirmed this with a bench supply, so a variable voltage control might be a better option? The key requirements are:That the fans can be run at inaudible speedsThat I can get them close to 100% speedThat as little power as possible is lost as heatThat the fans can be controlled via Modbus commandsThat they're independently controllable by push button commandsThat I don't have to spend a huge amount of moneyIt is important to me that everything on board remains functional even if the automation system is off-line. This is what led me to the Dalcnet dimmers I purchased; they were the only ones I could find which had both Modbus and push-button control input, so that I can still turn the lights on if (when!) the computer is down. Should be a no-brainer, but you'd be surprised... I need the ventilation system to have similar functionality, though the fan speeds don't need to be infinitely adjustable; I'd be happy with high/medium/low/off settings - in fact this is probably a more user friendly way to control them. The ideal solution would be a small (and cheap) Modbus RTU which provides a 6-12 V output, a tachometer input (which can be read via Modbus), a push-button control input and status LED outputs (three LEDs for low/medium/high). Hardly rocket science, and probably something Icouldbuild myself from scratch - but I don't have a proper workshop set up on board yet, nor do I have time to spend on such a project. So as I often do when I'm not sure which way to go I turn to my fellow EEVBloggers for adviceAny thoughts? It seems unlikely, but perhaps a suitable solution can be cobbled together from off-the-shelf parts?Cheers,Lomax

author: phil from seattle
author_rank: Super Contributor
timestamp: September 04, 2020, 01:22:45 pm
content: My first thought is get better fans but may not be possible.Instead of filtering, I'd look at some sort of power supply that is controllable via PWM or voltage. Kind of a waste of your modbus controller though.

author: Lomax
author_rank: Frequent Contributor
timestamp: September 04, 2020, 08:35:08 pm
content: Quote from: phil from seattle on September 04, 2020, 01:22:45 pmI thought I did buy the best fans I could find (for a reasonable price) - in fact I bought ten of them. But I only looked at CFMs and dBs in the datasheets; AFAICT "acoustic noise produced while under PWM control" is not a parameter commonly provided by fan manufacturers. Perhaps I've been looking in the wrong place?Quote from: phil from seattle on September 04, 2020, 01:22:45 pmIndeed. But where might I find such a device?Quote from: phil from seattle on September 04, 2020, 01:22:45 pmExactly. I didn't pay the currently listed price for my dimmers, but it was still a significant pile of £££ (IIRC, they were something like €120 a piece in 2018). I don't mind if they can only be used to control LED lighting - I have a ton of lights planned so I'm sure I'll have little trouble using up what channels I have available. But if I can't use them to control the fans I'll need to find something else for that...

author: Siwastaja
author_rank: Super Contributor
timestamp: September 04, 2020, 08:42:38 pm
content: If you have a nearly working solution with the only problem being excess power loss due to inductor DC resistance, the obvious question is, why not pick an inductor with lower DC resistance?(This basically is an open-loop buck converter, and relies on the PWM controller being well engineered, with freewheeling diode and proper current sensing; but if it works, it works. Open-loop buck isn't too stupid for fan control, IMHO.)I would expect any solution based on industrial modules to be horribly expensive and carry a lot of dead material and engineering hours behind it, but it's obviously simple to develop for the end-user.

author: Lomax
author_rank: Frequent Contributor
timestamp: September 04, 2020, 09:29:43 pm
content: Quote from: Siwastaja on September 04, 2020, 08:42:38 pmThis was actually my original intention; I even locateda suitable devicewith < 500 mΩ DC resistance and an Imax of 600 mA, which while rather expensive (at ~£1.25 a pop inc VAT) should do a lot better than the (unspecified) inductors I happened to have in my parts bin. But then I realised how awful the UI became when filtering PWM to DC this way; with the push-button interface it is nearly impossible to set even a rough speed, and using a 22 kΩ pot (which the dimmers also accept) a quarter turn results in no fan movement at all. Which led me to think a bit more about what would be the ideal behaviour - i.e. off/low/medium/high cycled through a push-button, with a three-LED feedback. Now I'm stuck with this image in my head. Icoulduse four position rotary switches, with fixed resistors for each step, but this UI would soon get out of sync with the actual fan speed (as soon as the computer gives a different command) - and, other than the fan noise, there would be no feedback.Quote from: Siwastaja on September 04, 2020, 08:42:38 pmPretty sure these dimmers are well engineered, considering their cost, but I already added my own flyback diodes, just in case. I haven't been able to break anything yet - and not for lack of trying...Quote from: Siwastaja on September 04, 2020, 08:42:38 pmThere's always eBayI buy a lot of industrial gear for surprisingly little money - people don't seem to appreciate quality and prefer Google/Apple/Amazon/Microsoft based idIoT gadgets. Sucks to be them when they find theyare being held prisoners because some internet server is down

author: Renate
author_rank: Super Contributor
timestamp: September 04, 2020, 11:29:32 pm
content: Quote from: Lomax on September 04, 2020, 08:35:08 pmIn the RV world the standard for vent fan was the Fantastic.It takes a standard 14" opening.This model is brushless, unlike older models.https://www.walmart.com/ip/Fan-Tastic-Vent-801200-Model-Create-A-Breeze/161957442Me, I wouldn't buy anything unless it was two arm. The vent cover flops in high wind with only one arm.Your little fans are going to make more noise for less air.If you were going to PWM them, why didn't you get PWM fans?It's more efficient and you could tie a few fans together with one controller.I have no idea how/where you are putting these fans.I run everything in my RV on Modbus, but it's all little boards that I made.

author: Siwastaja
author_rank: Super Contributor
timestamp: September 05, 2020, 05:43:55 am
content: Get an Arduino or similar, a logic-level N-channel FET, and roll your own PWM module with your own requirements for the interface? Then you can use high enough PWM frequency to get rid of the problem.

author: Lomax
author_rank: Frequent Contributor
timestamp: September 05, 2020, 09:12:09 am
content: Quote from: Renate on September 04, 2020, 11:29:32 pm14"! In the (house)boat world the standard is 100mm... I had to have my six brass "mushroom vents" custom made in India, at great expense. 100mm fans are also quite rare, and 80mm fans would sound like hair dryers if they were to move any significant amount of air - I wanted to use 120mm fansspecificallyto reduce the fan noise. It certainly felt like I was cuttinghugeholes when I put the jigsaw to my roof...Quote from: Renate on September 04, 2020, 11:29:32 pmNot a problem in my caseQuote from: Renate on September 04, 2020, 11:29:32 pmThey move more than enough air at silent speeds, with plenty of extra ooomph if needed. I am happy with their performance!Quote from: Renate on September 04, 2020, 11:29:32 pmBecause I wanted to use the pricey Modbus dimmers I had already bought. But I'd be very interested to hear if anyone knows of a PWM fan controller that has a push-button interface and talks Modbus (see requirements in my original post) - it wouldn't cost methatmuch to replace the fans, and the dimmers can find use for lighting alone.Quote from: Renate on September 04, 2020, 11:29:32 pmSee attached photos. They will disappear inside the 32mm roof insulation.Quote from: Renate on September 04, 2020, 11:29:32 pmGreat to hear - Modbus is an excellent protocol for off-grid home automation projects; simple, reliable and low power. I'm trying to keep the number of networks to a minimum; I have Ethernet between the three on board computers (automation, navigation and entertainment), 1-Wire for environmental sensors (weather, temperature, etc), Modbus for power control (lighting, ventilation, bilge pumps, PV controller, inverter/charger, heater) and NMEA0183 for navigational instruments. Thatshouldbe all that's needed and I didn't want to add another (DMX, Dali) just to control the lights. And I cannot stress enough the importance that all this gear remains 100% functional even if the computer(s) are off-line - every device must be able to operate stand-alone, with any automation layered on top.

author: Siwastaja
author_rank: Super Contributor
timestamp: September 05, 2020, 10:13:58 am
content: There's nothing wrong PWMing the typical BLDC PC fans, you are basically doing the right thing. Those with "PWM" feature mostly means you get the tacho output properly because you don't need to break the ground or power net.The only issue with your expensive PWM modules is, they have too low modulation frequency. Which I don't like because even the highest frequency they offer, 1200Hz, causes flicker issues with very high-power LEDs run at very low intensities (which is clearly the intended usage, given the 16-bit resolution!). They are not up to their intended task.If you tried a quick mockup with Arduino or similar, you would be able to test different PWM frequencies. If you are sensitive to high-pitched noise, you may need to go up to above 20kHz, though.

author: Renate
author_rank: Super Contributor
timestamp: September 05, 2020, 12:59:14 pm
content: Quote from: Siwastaja on September 05, 2020, 10:13:58 amWell, not wrong, but you already have 6 MOSFETs powering the 3 phases, putting another MOSFET in series is not absolutely optimal.(Even if it's a 2 MOSFET, 2 phase.)If you used PWM fans you could use a small slide switch near the fan to be OFF - AUTO - ON.The switch would connect the PWM wire of the fan to ground - controller - open (respectively).I like your little brass vents.Just curious, what do you have for solar, EPEver?That's how I got started with Modbus.The Tracer A was balky and sometimes slow to respond.The Tracer B is more consistent.

author: Lomax
author_rank: Frequent Contributor
timestamp: September 06, 2020, 06:24:10 pm
content: Quote from: Renate on September 05, 2020, 12:59:14 pmNot an ideal solution since I wouldn't be able to activate the fans remotely if I had forgotten to switch them to "auto" before leaving the boat.Quote from: Renate on September 05, 2020, 12:59:14 pmI've got aMorningstar TS-MPPT-45and two 300W LG panels. This controller also has a Modbus interface, and like you that (and the inverter/charger) is what made me go down the Modbus route.Quote from: Renate on September 05, 2020, 12:59:14 pmLittle!?I guess it's all relative

author: Lomax
author_rank: Frequent Contributor
timestamp: September 06, 2020, 07:12:08 pm
content: Quote from: Siwastaja on September 05, 2020, 10:13:58 amThanks, that's good to hear.Quote from: Siwastaja on September 05, 2020, 10:13:58 amI worried about this when I bought the dimmers, but to be honest I don't notice the least bit of flicker even at 300 Hz. I will of course run them on 1200 Hz nonetheless, and would have preferred an even higher frequency. None of my LED lights are very high power though; the main ceiling lights are 12 recessed 3W COB modules, which I picked outafter trialing three different models. The most powerful lights aretwo 40W downlights up in the mast, which will only really be used for safety & security purposes, so basically either fully on or fully off. I haven't tested these with the dimmers yet, but I'm sure they will be fine.

author: Renate
author_rank: Super Contributor
timestamp: September 06, 2020, 07:55:08 pm
content: Quote from: Lomax on September 06, 2020, 06:24:10 pmI meant that that switch should always be in auto unless you had a major system failure.I would want the switch to be low key, so it's not accidentally activated, but there if you need it.Quote from: Lomax on September 06, 2020, 06:24:10 pmOk, I wouldn't want one of those upside my head!

author: Lomax
author_rank: Frequent Contributor
timestamp: September 06, 2020, 08:23:41 pm
content: Quote from: Renate on September 06, 2020, 07:55:08 pmThat could work, but I want manual control to be always available, e.g. when you take a shower, or boil something on the cooker - or if a sleep-over guest gets uncomfortable in the summer heat, or gets annoyed by the fans running at full whack. In my mind the fan button sits next to the lighting button in each "zone" (kitchen/bathroom/mid and forward cabins) and is easily identified. Its use isencouraged.Edit:Just to clarify, the automation has four states: "aboard", "asleep", "away" and "off" - the computer only takes full control of things like ventilation in the "away" state, which gets automatically set when no internal PIR has been triggered for twelve hours, or manually by myself.Quote from: Renate on September 06, 2020, 07:55:08 pmThey'd make a good Agatha Christie style murder weapon that's for sure - they are pretty hefty, but not as sturdy as they look. In fact I'm a little unhappy with the casting quality and engineering, considering the price paid (~$60 a piece). One out of six arrived broken and had to be replaced, which took another two months to arrive... They wouldn't put up with anyone stepping on them, and if you used one to murder someone it would probably end up in piecesTBH, I would have been just as happy with steel, plastic or aluminium but my 120mm requirement made it impossible to find anything suitable off the shelf, so a custom brass casting was the only way.

author: Renate
author_rank: Super Contributor
timestamp: September 07, 2020, 01:42:23 am
content: You probably already know about them (or somebody similar), but I'm a fan of Blue Sea Systems marine electrical stuff.https://www.bluesea.com/I use their fuse block:https://www.bluesea.com/products/5029/ST_Blade_Fuse_Block_-_12_Circuits_with_CoverAnd also the big fuse:https://www.bluesea.com/products/5503/ANL_Fuse_Block_with_Insulating_Cover_-_35_to_750A

author: Lomax
author_rank: Frequent Contributor
timestamp: September 07, 2020, 07:23:50 am
content: Quote from: Renate on September 07, 2020, 01:42:23 amYep, I use one of their blade fuse blocks in the computer enclosure, and plan to get one of theirML ACR voltage sensitive latching relaysfor linking the house battery bank with the starter battery. Pricey though! There's alsoBEP(even pricier),VictronandDurite.

author: Renate
author_rank: Super Contributor
timestamp: September 07, 2020, 12:52:39 pm
content: That looks very nice!I love all that fancy power stuff from the manufacturers you quoted.BEP is part of the same group as Blue Sea and some of the products cross over.I had posted elsewhere about using a fuse as a current shunt for monitoring.Not as accurate as a real shunt, but I begrudge the resistance of an added shunt.And the accuracy is not critical, the direction of the flow is.https://www.eevblog.com/forum/beginners/suitable-amp-to-sense-current-over-a-shunt-in-both-directions/msg2884764/#msg2884764Your Sierra System RV-50 cell bridge caught my eye.Still, it seems to miss a few Verizon bands?I don't understand why it's rocket science to cover everything.I would be grateful for a real unit with RJ45 vs. my crappy Verizon Ellipse JetPack.Do you like your unit?

author: wizard69
author_rank: Super Contributor
timestamp: September 07, 2020, 04:48:44 pm
content: If you have a number of fans why not run each of them at full speed and power one or more as the ventilation need changes? No need for a special PWM controller and manual operation is a snap to achieve. This is certainly KISS thinking but the alternative will likely to be to design your own custom PWM controller with Modbus support.Which brings up another thing, why Modbus? Modbus will most certainly limit you choices and frankly support for the standard is on the decline. Mind you I work in a plant with tons of old Modicon equipment and frankly I'd avoid the standard today if I had oversight in the selection process. If you do implement your own controller an RS232 link would be easy or if you are adventurist you could implement something over Ethernet.

author: Renate
author_rank: Super Contributor
timestamp: September 07, 2020, 07:47:25 pm
content: Quote from: wizard69 on September 07, 2020, 04:48:44 pmYes, Modbus is old.I wouldn't use it in a large industrial setting.It can't really do multi-master.But it's RS485, a heck of a lot better idea than talking about anything RS232, whether "real" ±12 V or "TTL".It's not difficult to implement in both hardware and software, CAN is more of a pain.You can tee in another unit, unlike Ethernet (unless you meant coax Ethernet).If you don't buy industrial modules from Schneider, it doesn't have to be expensive.If you get bored building modules, there's relays and sensors on ebay out of China.I'm running about 10 RTUs, displays, sensors, relays.It's been working fine for about 3 years now.

author: Lomax
author_rank: Frequent Contributor
timestamp: September 07, 2020, 09:25:25 pm
content: Quote from: Renate on September 07, 2020, 12:52:39 pmThank youI know I'm going completely over the top... In fact the automation/security/alarm system has become one of the most expensive bits of kit I have on board - if you burgled my boat it would probably be the best thing to steal!The computer is just a Pi 2 (I will be upgrading this, though it actually copes quite well with the workload), but the modem and the UPS were rather pricey, and the Pi talks to the outside via aMonarco Hat(which also provides the RS-485 port, 1-Wire port and RTC), plus the switch, WiFi AP, battery etc - it all adds up! It's an expensive passion for sure.Quote from: Renate on September 07, 2020, 12:52:39 pmSo do I - I'd much rather buy their stuff than any Alibaba junk, no matter the price difference. My wallet disagrees of course - but there's always eBayBetter second hand pro gear than shiny new tat from Wan Hung Lo (inevitably festooned with blue LEDs). Also take a look atMastervoltand (whisper it)StuderQuote from: Renate on September 07, 2020, 12:52:39 pmI had no idea! I guess that explains why some of their kit looks weirdly similarBut AFAIK Blue Sea is American and BEP New Zealand? Victron are Dutch. So are Mastervolt. Studer of course, are Swiss - with price & quality to match.Quote from: Renate on September 07, 2020, 12:52:39 pmI haven't installed any current sensors yet, but I'm leaning heavily towards Hall sensors via Modbus or 1-Wire. What benefits do you see with using shunts instead? And great idea about using a fuse btw - we all have to have those!Quote from: Renate on September 07, 2020, 12:52:39 pmI love the device itself! It's extremely reliable; I've clocked >500 days of continuous uptime without a hitch, which is important for me since I often have to be away from the boat for months at a time. It has two SIM slots with highly configurable fail-over conditions. And the built in GPS is more useful than I thought it would be; it publishes GPS data over UDP and I use this (among other things) to adjust the RTC on the master computer, which then acts as the local NTP server. Importantly for my "off-grid" plans it runs off the whiff of an oily rag; in fact the whole system pictured earlier draws just 500 mA (at 12 V) with everything switched on, which gives me ~15-20 hours of UPS power from the built in SLA battery. Another great feature is the SMS gateway, which sends and receives SMS messages over Ethernet, making it an absolute doddle to get Node-RED to send alerts and respond to commands sent via SMS - which never ceases to give me geekbumps. And there's a serial port, and a (single) GPIO pin, which I plan to hook up to the Pi's "run" pin, making it possible to reset the Pi by sending an SMS to the modem, which may prove handy. It comes with a bunch of built in utilities, watchdogs, geofencing, firewall, VPN clients, etc, and you can write your own apps for it with theALEOS framework. They also provide aweb portalfor remote (fleet) management but I've never bothered with any of that. So it's a highly capable device, befitting its price tag. Check outtheir MP-70for the ultimate vehicle router/modem (and wallet buster), which adds WiFi, a four port switch, and more GPIOs.BUT.Yep, there is one: the support isabysmal. Just as one example, I tried to point out to them that the shipped OpenVPN client was years out of date, with several known and very serious vulnerabilities - in fact even incompatible with current versions - but despite repeated attemps I never got a response of any kind from them. In the end it took them overa yearand three firmware updates before this was fixed. Extremely poor for a company which prides itself on selling their gear to first-respondent and other mission critical applications all over the world. Shocking in fact. A recent firmware update broke the internal temperature reporting (permanently stuck at 0 deg C), and again there's no response to repeated support forum queries. By all means, buy their equipment, for it is awesome, just don't expect any help whatsoever from Sierra.WRT the "missing" Verizon bands - this is not a problem for me since I'm across the pond. Nor is the lack of 4/5G support; 3G/LTE speeds are more than enough for my needs! The RV50 is quite an old model though (2016); I'm sure their more recent units support the latest mobile data standards.P.S. Did I say I'm going completely over the top? I couldn't resist fitting light-pipes in the enclosure door, which feed the indicator LEDs on the modem through to the front(yes, I screwed up the vertical position of the second hole!)

author: Lomax
author_rank: Frequent Contributor
timestamp: September 08, 2020, 09:48:42 am
content: Quote from: wizard69 on September 07, 2020, 04:48:44 pmThe fans I chose are quite powerful; at full whack they draw ~450 mA (5.4 W), delivering 108 CFM. This is useful, particularly for the kitchen and bathroom fans, but too noisy to leave running permanently. Backing off a bit makes them very quiet, and they can run inaudibly while still shifting a useful amount of air. So I get a pretty wide range of ventilation depending on need, from a whisper quiet 200 CFM when sleeping to roaring 600 CFM when the sun is beating down.Quote from: wizard69 on September 07, 2020, 04:48:44 pmThere's nothing wrong with Modbus! It's an old standard, yes, but in my bookthat is a good thing; there'stonsofinterestingandusefuldevicesavailable, many of them for DIN rail mounting, which is what I use in my distribution cabinets. Modbus RTU is simple to use, reliable in noisy environments and over long distances, and uses very little power. Lots of equipment on board speaks Modbus RTU, including my PV controller and my inverter/charger - I definitely want to talk to them so a Modbus interface is already arequirement. Ethernet is great for high-bandwidth data, but both the hardware and software layers are bulky, complex and power hungry compared to RS-485. Ethernet also uses a star topology, when a bus topology is more suitable. And sending "12.34" once a minute hardly requires gigabit LAN speeds...Just what would I gain by adding yet more networks like CAN, DALI or DMX, other than increased complexity? Would any of them address the problem this thread was originally about?

author: Lomax
author_rank: Frequent Contributor
timestamp: March 26, 2021, 11:01:02 am
content: I still haven't come up with a solution to this. I think I'll have to cobble together something based on an Arduino - does anyone know of an Arduino board that includes 4x 2A capable PWM outputs that can be powered from 12V?I found this on AliExpress, which isreallyclose to what I need - but it doesn't have any drivers on board. Surely such a beast exists?Edit:Fate dictates that this is my post number 485Edit2:I guess what I'm looking for is more themechanicalplatform than the electronics. Of course I could stick an Arduino Nano on some perfboard, add a MAX485 interface, add a 12 -> 5 volt DC/DC, add some MOSFETs and hook everything up to screw-terminals, but it would be an unwieldy creation.