12-12-2018 07:30 AM
I am doing a college project that involve with DAQ. i am using LM-35 temperature to control the fan speed. when the temperature get hotter, the fan would increase. how can this be done? i thought of using case structure but i cant figure it out how to control the fan speed.
12-12-2018 09:32 AM - edited 12-12-2018 09:33 AM
Well the most common way to control a fan or any DC motor speed is by using Pulse Width Modulation (PWM).
You did not mention what DAQ you are using, can one of the DIO pins be used as a PWM output?
But in general I would do this: Set a few threshold temperatures and increase or decrease the PWM duty cycle as the temperature crosses the thresholds
12-12-2018 09:32 AM - edited 12-12-2018 09:33 AM
Duplicate post...
12-12-2018 10:08 AM
i am currently using NI DAQ device.
12-12-2018 10:28 AM
@mynameismickeymouse wrote:
i am currently using NI DAQ device.
Pulse Width Modulation (PWM) Using NI-DAQmx and LabVIEW
12-13-2018 01:15 AM
i'm apologize but i didnt learn PID controller. i thinking about using case structure but i dont know how to apply it to the fan driver.
here is a simple of the project. Thank
12-13-2018 09:49 AM - edited 12-13-2018 09:52 AM
I am sorry I cannot look at your project because I only have LV2016 here.
The tutorial I linked to was not about PID control, it showed how to use a NI-DAQ device for PWM.
Anyway I would do something like this:
Here's a couple more tips
12-13-2018 02:19 PM
@RTSLVU wrote:
I am sorry I cannot look at your project because I only have LV2016 here.
The tutorial I linked to was not about PID control, it showed how to use a NI-DAQ device for PWM.
Anyway I would do something like this:
- Decide on a few temperature ranges and PWM %Duty Cycle settings.
- t <= 25c Fan Off
- t > 25c and <30c Duty Cycle = 50%
- t > 30c and <35c Duty Cycle = 75%
- t > 35c Duty Cycle = 100%
- Measure t and convert it to an I32 integer
- Use that I32 to drive the selector on a Case Structure
Here's a couple more tips
- Read the LV Help on Case Structures
- Scroll to the bottom and open the example program
- Notice when using integers as the case selector you can set a numeric range for each case in the Case Structure
Your going to need to put some hysteresis in that so that the transitions with falling temp are are at a slightly lower temp that transitions with a rising temp. There will be more overshoot but the fans will last a lot longer.