Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   Insert BS here (https://www.miataturbo.net/insert-bs-here-4/)
-   -   Looking for PID controller for 120v fan (https://www.miataturbo.net/insert-bs-here-4/looking-pid-controller-120v-fan-105712/)

fooger03 Aug 23, 2021 12:41 PM

Looking for PID controller for 120v fan
 
I hope this is way easier than I'm making it out to be.
I recently installed a 6" in-duct booster fan for the HVAC vent to our home office. It's been getting to 80 degrees or more in there during the day, especially with the sun coming through the picture window every morning until about 1130 am. I installed the booster fan as far away from the actual heat/cool register vent as possible (nearest the HVAC trunk line), but even so, it's extremely loud at full blast, though it does probably quadruple the volume of air going through the single register vent in the office. I've found plenty of what appear to be PID switches on amazon and such, but it looks like they use electric relays for on/off performance versus variable speed, which means the fan would just be alternating between LOUD and OFF all day long, which sort of defeats the purpose of the office. I'm guessing that since it uses 120V AC power, I need to be using a voltage regulator instead of a pulse width modulator, but I'm not even sure that's correct. The fan has a simple knob controller for speed on the power cord to vary the fan speed, which I'm guessing is just a simple voltage controller, so I know that regulating fan speed is obviously possible.

Is there a solution out there which I'm totally forgetting exists which consists of a temperature probe to mount in the office, an interface to set the temperature (and possible pid parameters), and a voltage regulator or perhaps a PWM controller to control the speed of the 120VAC inline duct booster fan?

Thanks, electrical engineers, arduino geeks, IFTTT power-users and all other all-knowing peoples.

deezums Aug 23, 2021 02:07 PM

A voltage regulator would require rectifying to DC and then getting a new fan, either that or getting an expensive variac. If the AC motor has multiple speeds, they usually do it with capacitor. If you wanted to PWM, you'd have to use a triac since you are switching AC. That is going to greatly limit the frequency you can PWM at, and that's probably going to make it sound like shit.

I don't know of any cheap way to do what you want, but you want a VFD.

gesso Aug 23, 2021 02:19 PM


Originally Posted by fooger03 (Post 1606958)
[...]The fan has a simple knob controller for speed on the power cord to vary the fan speed[...]

Did the fan wire directly into the house mains or does it have a wall wart/plug?
Do you have a link to the fan in question?
Mostly I'm wondering if it's actually a 120v fan or if its a DC fan with a rectifier already attached (the speed control knob is what makes me wonder).

fooger03 Aug 23, 2021 03:49 PM


Fan @ attached link. Thank you for the response so far.

I'm not opposed to buying a different fan if that's the best solution.

Joe Perez Aug 23, 2021 04:24 PM

For a simple AC motor like that, you can buy fan speed controllers right off the shelf at Home Depot.

thebeerbaron Aug 23, 2021 07:50 PM


Originally Posted by Joe Perez (Post 1606983)
For a simple AC motor like that, you can buy fan speed controllers right off the shelf at Home Depot.

He's already got the fan speed controller built into the product, what he's looking for is to replace the three position knob with thermostatic control.

I have no idea how to do that, but I suspect you do, Joe.

Spaceman Spiff Aug 24, 2021 01:32 PM

Looks like the speed control done by the little knob box thingy is nothing fancy. VFD would be proper, but also way overkill for this application (that said if you're interested, Automation Direct sells a great, cheap micro VFD for ~$100).

If I had to guess (as most cheap fans use this) it's a permanent split capacitor motor. Basically, you have different valued capacitors attached to a rotary/multi-pos switch between line and one of the motor windings. Changing capacitor value changes the phase/amplitude of the waveform sent to the windings and thus the motor torque.

https://cimg2.ibsrv.net/gimg/www.mia...282e07ae08.png

You could take apart the little controller thing, but odds are the circuit looks something like this (though obviously capacitor values vary with exact motor, https://www.circuitlab.com/editor/#?id=84x8uw, https://electronics.stackexchange.co...17837#217837):

https://cimg4.ibsrv.net/gimg/www.mia...cd18fe2aa5.png

where your speed control might follow:
Code:

SW1  SW2  SW3  Speed
Off  Off  Off  Off
On    Off  Off  Low
Off  On    Off  Medium
Off  Off  On    High

You could do a little testing with some common capacitor values to see what gives you acceptable noise levels, and then setup a small home automation setup over ZigBee/Z-wave with a ras pi controlling some relays which adjust capacitor value to the winding, and a temp-sensing light switch or something along those lines in your office to act as the process value for the "thermostat" (i.e. prefer fan on when room unoccupied, temp high, lowest setting when room occupied, temp high, off when temp low). In all likelihood you'll be using something closer to bang-bang control vs. PID, but it should work!

Some smart home links:
https://www.home-assistant.io/installation/raspberrypi/
https://magpi.raspberrypi.org/articl...h-raspberry-pi

Hope that helps! Not an expert by any means but you gotta occupy the time somehow when you're pooping at work.

fooger03 Aug 24, 2021 05:56 PM

Thanks so much! this is awesome! My poops are way cooler with MT.Net on my side!

The rotary dial on the fan has markings for "low", "medium", and "high", but its actually infinitely adjustable - there are no detents for those three fan speed positions.

deezums Aug 24, 2021 06:08 PM

I could send you some links for controlling a stepper motor with arduino, plus adding a temp sensor and PID loop for calculating stepper position. Duct tape the motor shaft to the dial. You'd be able to kick start the fan if it's needed to get it moving. You could probably even add a trigger off the AC, so the fan only tries to run when the AC is on. What I'm picturing is just a bunch of "libraries" piled together with maybe two or three variables for you to manage yourself, no real coding on your part.

Parts off ebay or amazon would probably be less than ~$20, and you wouldn't be playing with any dangerous voltages...

fooger03 Aug 24, 2021 07:25 PM

that sounds like a great idea; I think I'd enjoy the challenge of learning arduino. I imagine I could print a mount for the stepper motor to the fan controller with the 3D printer.

gesso Aug 24, 2021 08:23 PM

Attach the stepper to the side of the controller, and connect the stepper shaft to the controller knob with a rubber band (a big broccoli one would likely work well). The smaller stepper shaft and larger control knob would give you nice "gear" reduction for the stepper motor.

Spaceman Spiff Aug 24, 2021 08:27 PM


Originally Posted by fooger03 (Post 1607066)
Thanks so much! this is awesome! My poops are way cooler with MT.Net on my side!

The rotary dial on the fan has markings for "low", "medium", and "high", but its actually infinitely adjustable - there are no detents for those three fan speed positions.

In which case ignore everything I've said haha.

I like deezums idea, you could just mount the fan controller to a plate and use standoffs to mount a standard nema stepper to the same plate. no fab necessary beyond some holes.

deezums Aug 24, 2021 08:59 PM

You might even be able to pull the knob off the controller and use a piece of 5MM ID tube as a very low tech coupler. I think those potentiometer/encoder/rheostat shafts are usually 5mm?

I'd get a basic arduino uno, the one with the barrel jack. You'll also need a 9VDC wal-wart, or the one from a jimstim works most times. I think unos are good for 16V. That will be enough to run the stepper motor, too.



I would look for DRV8825/A4988 stepper drivers on the little breakout boards meant for 3d printers. You'll need some male to female jumper leads to hook it up. Any nema17 motor will probably be more than enough with no gearing, if there aren't any detents.


Depending on where you want the temp sensor compared to where your speed controller is kinda matters. If it's a long way away, more than a few feet, I'd get a thermistor style, otherwise you could try a digital style. With an analog one you'll need to make a voltage divider with a single resistor and thermistor, otherwise the digital ones just plug in. It seems BMP180 breakout boards are getting cheap, with one of those you could sense temperature and pressure. If it's in the duct you could probably pick up when the main blower was actually running. Some soldering required.



That's more or less where I would start.

https://github.com/laurb9/StepperDriver
https://github.com/laurb9/StepperDri...pperDriver.ino

That's an arduino stepper library and a really basic example. You'd want to use the setup function to make sure the motor is cranked all the way back. I'd probably also use the enable feature to keep the stepper motor from burning up when it's not doing anything.

Here's the PID library, which should work.
https://playground.arduino.cc/Code/PIDLibrary/

This is more or less how you "start" PID on the arduino using the library. Input, output, and setpoint. Going through the documentation a bit more and you'll find the way to set the limits of the output and other stuff.
https://playground.arduino.cc/Code/P...ryConstructor/

https://playground.arduino.cc/Code/P...yBasicExample/

That's a really basic example. Instead of calling "analogWrite(3,Output);" you'd be able to write an alternative function controlMotor() or whatever that does stuff like enabling the motor and letting it have time to adjust before calculating a new move, ignoring no change or small changes in outputs, bump starting the motor from being stopped and all that other good stuff.

fooger03 Aug 24, 2021 10:49 PM

So if i wanted to measure temperature approximately 20' away, it wouldn't be as simple as wiring in a TMP36? It seems like the voltage is appropriate for the arduino. I feel like I'm missing a fundamental rule here.

Except for the temp sensor, I'm now about $45 poorer. :-)

deezums Aug 25, 2021 01:38 AM

That would be alright, it might pick up some noise but I doubt it's enough to matter.


All times are GMT -4. The time now is 04:05 AM.


© 2026 MH Sub I, LLC dba Internet Brands