Hi all,
i'm quite new to the Arduino, so bear with me ;)
I'd like to control a stepper motor and a 12V fan via the Arduino, hence i bought the Motor Shield V2.
Works great so far :)
I connected the fan with Vcc and GND to M1.
The fan is a Noctua NF A14 industrialPPC-3000 PWM.
The fan has a 4pin-connector and can be controlled via PWM, so is there a way to PWM this fan via the Motor Shield instead of just varying the voltage?
Can i somehow also read the speed-signal, the fan sends?
Thank you very much for your help!
Philipp
Controlling PWM fan via Adafruit Motor Shield V2
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
4-wire fans use 2 wires for power and ground. A third wire is for the PWM speed control signal and the fourth is for a tachometer output to monitor the speed.
Unfortunately, the motor shield is not well suited for controlling these fans. Although it has 4 spare PWM outputs, the maximum PWM frequency for the shield is about 1.6KHz. PWM fans expect a signal in the 25KHz range.
http://www.formfactors.org/developer%5C ... public.pdf
Unfortunately, the motor shield is not well suited for controlling these fans. Although it has 4 spare PWM outputs, the maximum PWM frequency for the shield is about 1.6KHz. PWM fans expect a signal in the 25KHz range.
http://www.formfactors.org/developer%5C ... public.pdf
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
So, in my case, the speed-range for the the fan is much narrower, because, the shield only outputs a max frequency of 1.6kHz rather than the 25kHz, the fan expects, right?
There is no way to increase this value with?
There is no way to increase this value with
Code: Select all
void begin(uint16_t freq = 1600);
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
The speed is not controlled by the PWM frequency. It is proportional to the PWM duty cycle.
I don't know how your particular fan would respond to the slower frequency. It is quite a bit lower than the standard, but it might handle it anyway. It would not hurt anything to try.
You can specify any frequency in the 'begin()' call, but the actual available frequencies are governed by what the internal clock on the chip is capable of generating. In this case, 1.6KHz is the max.
I don't know how your particular fan would respond to the slower frequency. It is quite a bit lower than the standard, but it might handle it anyway. It would not hurt anything to try.
You can specify any frequency in the 'begin()' call, but the actual available frequencies are governed by what the internal clock on the chip is capable of generating. In this case, 1.6KHz is the max.
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Thanks for your answer.
But just that i get things right, the setSpeed(speed) function uses PWM to adjust the speed, right? It does not only vary the voltage-output to the motor?
Sorry, for asking such dumb questions, but i'd like to understand, how this works :)
Thanks a lot!
But just that i get things right, the setSpeed(speed) function uses PWM to adjust the speed, right? It does not only vary the voltage-output to the motor?
Sorry, for asking such dumb questions, but i'd like to understand, how this works :)
Thanks a lot!
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Yes. SetSpeed varies the PWM duty cycle between 0 and 100%. So the output is always 0v or the supply voltage, but the average voltage changes.
This works well for controlling the speed of a simple 2-wire brushed DC motors. Most computer fans use brushless motors.
Brushless motors have a control circuit inside that switches power between the coils on the motor. The switching speed determines the fan speed. But the control circuit needs a constant supply voltage to operate. So they use a 3rd wire for the speed control signal.
This works well for controlling the speed of a simple 2-wire brushed DC motors. Most computer fans use brushless motors.
Brushless motors have a control circuit inside that switches power between the coils on the motor. The switching speed determines the fan speed. But the control circuit needs a constant supply voltage to operate. So they use a 3rd wire for the speed control signal.
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Thank you, Bill!
Btw:
The fan responds to changing speed values :)
However, i have to start it using a higher speed. Otherwise it won't start turning.
When the fan's running, i can adjust it's speed to almost any value higher than ~70 :)
Btw:
The fan responds to changing speed values :)
However, i have to start it using a higher speed. Otherwise it won't start turning.
When the fan's running, i can adjust it's speed to almost any value higher than ~70 :)
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
That's good to hear. The other option you have is to use one of the PWM pins from the Arduino. These are capable of higher PWM speeds and might be able to exercise the full speed range of your fan: https://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Would i also be possible to use one of the Arduinos PWM-Pins while the motor shield is stacked on the Arduino?
I need the shield in order to control a stepper motor besides the fan.
I need the shield in order to control a stepper motor besides the fan.
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Yes, that is possible. All of the Arduino pins are accessible on the shield via the breakout holes that run parallel to the Arduino headers. The only 'reserved' pins are A4(SDA) and A5(SCL) - since these are used for communication with the shield.
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Sounds good! :)
So, that way i could set the duty cycle to 255 on the motor shield to have an average of 12V - full speed. Then i would use one of the pwm pins to control the fan speed via the pwm wire?
So, that way i could set the duty cycle to 255 on the motor shield to have an average of 12V - full speed. Then i would use one of the pwm pins to control the fan speed via the pwm wire?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Yes. That should work.
- phischmi
- Posts: 14
- Joined: Thu Jul 21, 2016 3:45 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Is there also a way to vary the voltage output to the motor in order to controll the speed of a fan?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Controlling PWM fan via Adafruit Motor Shield V2
Maybe. With simple 2 or 3-wire fans, you can sometimes PWM the power via a transistor or MOSFET. Some brushless controllers handle it fine. Others not-so well.
Please be positive and constructive with your questions and comments.