set PWM profile for motor speed control

Hi all,

I am using an Arduino Mega to control a Variable Frequency drive that drives a motor. The VFD accepts a 0-10V PWM signal to run the motor between 0 and 60Hz. I build a circuit to make a 0-10V PWM out of the 10V output voltage of the VFD, controlled by the Arduino PWM. Here’s the code I have so far:

void setup()
{
  //initialize all timers except for 0, to save time keeping functions
 // InitTimersSafe(); 

  
  
  //if the pin frequency was set successfully, turn pin 13 on

    pinMode(3, OUTPUT);
  //  digitalWrite(3, HIGH);    

}

void loop()
{
  //use this functions instead of analogWrite on 'initialized' pins


 setSpeed(50);
      
  
  delay(30);      
}

void setSpeed(int freq)
{
    float output = -5*freq+255;
    if(output > 255)
      output = 255;
    else if(output < 0)
      output = 0;
    analogWrite(3, output);
}

So, I need to run the attached profile with it. What’s the easiest way to set a profile on the arduino? I couldn’t find anything in the whole WWW.

http://postimg.org/image/lvducdmd1/

What profile ? The image is missing.

bdellal:
Hi all,

So, I need to run the attached profile with it. What’s the easiest way to set a profile on the arduino? I couldn’t find anything in the whole WWW.

[img ]http://postimg.org/image/lvducdmd1/[/img ]

Fixed it for you:

http://s10.postimg.org/jqthbakqh/Capture.jpg

http://s10.postimg.org/jqthbakqh/Capture.jpg