Speed control with Arduino PWM – Papbst ebm G1G133-DE19-15* fan

Experiment to control the speed of a Pabst ebm G1G133-DE19-15 * fan with an Arduino via pulse width modulation PWM. Includes wiring diagrams, C code.

Speed control with Arduino

Fortunately, I still had some ‘power electronics’ from my experiments with an alternator in the toolbox.
With the used MOSFET transistor, it is definitely no problem to switch 24V / 2A.
Pulse width modulation with Arduino is ‘normally’ implemented with one single command.

Video of the test run

Code Arduino Sketch

A single instruction and Arduino outputs a PWM signal.
The standard PWM frequency of 62500 HZ was not suitable for braking the fan in its run.
This caused me that the engine depending on the pulse width was either on or off.
I think times the reason is the fan motor itself, which in itself is equipped with a lot of control electronics.
With the instruction: TCCR1B = TCCR1B & 0b11111000 | 0x03; I set the PWM frequency down to nearly 500 HZ. further information: http://forum.arduino.cc/index.php?topic=16612#msg121031

int Luefter = 10;          // the PWM pin the Luefter is attached to
int sensorValue = 250;
int oldsensorValue = 0;
volatile unsigned long count;
 
 
// the setup routine runs once when you press reset:
void setup() {
    //PWM Frequenz runter regeln
    //http://forum.arduino.cc/index.php?topic=16612#msg121031
    TCCR1B = TCCR1B & 0b11111000 | 0x03; //PWM Frequenz Pin10 - 488.28125 Hz Standard 31250 / 64
 
    Serial.begin(9600);
 
    // declare pin 'Luefter' to be an output:
    pinMode(Luefter, OUTPUT);
 
    setPwmFrequency(Luefter,32);
    analogWrite(Luefter, sensorValue);
}
// the loop routine runs over and over again forever:
void loop() {
 
 
  sensorValue = analogRead(A0)/4;
  if ( sensorValue > oldsensorValue + 1 || sensorValue < oldsensorValue - 1 ) {
    //print out the value you read:
    Serial.print("PWM------");
    Serial.println(sensorValue);
    analogWrite(Luefter, sensorValue);
 
    oldsensorValue = sensorValue;
  }
  count=0;
  delay(2000);
  Serial.print("gemessen-u/min--");
  Serial.println(count*15);
  delay(1);
}

Restless run at middle speed

As can be seen in the video, the engine runs normally at low speeds (up to 300 rpm) and at higher speeds (from 1500).
The engine does not run smoothly in between.  On the following page, I test stabilizing the voltage with an elko.
The included technology in the motor itself makes this relatively simple solution of the control with a PWM signal nearly impossible..