215
Junior Member level 1
Accelerating a stepper motor to certain speed without it making any noice?
I am having some issues moving my stepper motors without it making noise.
I read somewhere that ramping the frequency of the pulse modulated signal would help, but seems to have same issues as well. Is the "acceleration" to steep..?
The stepper motor i am using is a [**broken link removed**][1], and it is connected to a driver board, which has requires the input signal enable, direction and step => which is the one i am ramping. [Driverboard][2]
HEre is the code:
The ICR1 value is computes using this formula ICR1 = (cpu_freq)/(2*prescaler*desired_freq)
I guess the problem is that i am not ramping correctly.. ?
I am having some issues moving my stepper motors without it making noise.
I read somewhere that ramping the frequency of the pulse modulated signal would help, but seems to have same issues as well. Is the "acceleration" to steep..?
The stepper motor i am using is a [**broken link removed**][1], and it is connected to a driver board, which has requires the input signal enable, direction and step => which is the one i am ramping. [Driverboard][2]
HEre is the code:
Code:
void setup()
{
Serial.begin(9600);
pinMode(9, OUTPUT); //Step
pinMode(12,OUTPUT); //en
pinMode(13,OUTPUT); //dir
TCCR1A = _BV(COM1A1) | _BV(COM1B1) ; // phase and frequency correct mode. NON-inverted mode
TCCR1B = _BV(WGM13) | _BV(CS11); // Select mode 8
// Prescaled by 8 on main clock.
}
float count = 1000; //
void loop() {
// put your main code here, to run repeatedly:
//output_freq = CPU_clk/(2*8*ICR1_value)
//ICR1 = CPU_clk/2*8*output_freq
digitalWrite(12,HIGH);
delay(1);
digitalWrite(13,HIGH);
delay(1);
ICR1 = count;
OCR1A = int(count/2);
while(1)
{
if(count != 20)
{
count -= 10;
}
}
}
The ICR1 value is computes using this formula ICR1 = (cpu_freq)/(2*prescaler*desired_freq)
I guess the problem is that i am not ramping correctly.. ?