# increasing speed of the motor

#### hcwickz

Joined Oct 31, 2011
21
Hi everyone. i have to increase the speed of my brushless motor to lift up the helicopter . i need to check if i can do anything to my code below to increase the speed? which part below is link to the speed rpm?

#include <Servo.h>

Servo myservo;
Servo myservo1;// create servo object to control a servo

int potpin = 120;
int potpin1=150;// analog pin used to connect the potentiometer
int val;
int vall;// variable to read the value from the analog pin Use the analog joystick to throttle the helicopter
void setup()
{
myservo.attach(9);
myservo1.attach(10);
// attaches the servo on pin 9 to the servo object
}

void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 90, 1023, 90, 179);
vall=map(vall,90,1023,90,179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(5);
myservo1.write(vall);
delay(5); // waits for the servo to get there
}

#### hgmjr

Joined Jan 28, 2005
9,029
You should be able to decrease the constant in the two delay statements in the
loop() function.

hgmjr

#### hcwickz

Joined Oct 31, 2011
21
so now the delay is 5 , decreasing the value will mean increasing the speed ? but its already very low .

#### thatoneguy

Joined Feb 19, 2009
6,359
Try 4 and see how it runs.

5mS is a long time to a microcontroller.

#### hcwickz

Joined Oct 31, 2011
21
the speed is still the same , so is there any way i can control the speed?

#### thatoneguy

Joined Feb 19, 2009
6,359
What kind of servo is it? R/C type? It will only turn as fast as it's gearing allows. Faster servos with more torque = more \$

What is the servo doing? If you are positioning something, that's one thing.

If you have de-geared it and are using it for a drive motor, that's another. Use a faster gearhead motor and H-Bridge for the drive case.

#### hcwickz

Joined Oct 31, 2011
21
is a brushless motor not a servo . so any good way to increase the speed?

#### thatoneguy

Joined Feb 19, 2009
6,359
BLDC motor controller changes the speed by changing how fast the field rotates. If that is integrated into your program, than that is the fastest it will go. Switch to a faster processor, like an Uno 32 which is PIC based.

If you are driving a BLDC driver, which gives 3 phase output, look at the datasheet for it and what inputs relate to RPM.

#### hcwickz

Joined Oct 31, 2011
21
what u mean by how fast the field rotate? Ya i am using arduino mini pro to program everything. so cant make use of the code to edit the speed?

#### thatoneguy

Joined Feb 19, 2009
6,359
A BLDC Driver is simply an oscillator that creates 3 fields that "chase" each other, the faster the fields chase each other, the higher the frequency is, the higher the frequency is, the faster the motor runs.

#### hcwickz

Joined Oct 31, 2011
21
so how can i increase the field to increase the speed?

#### THE_RB

Joined Feb 11, 2008
5,438
You need to increase the system voltage (to compensate motor inductance) so that you can use a higher frequency and still get enough current to deliver the desired power.

#### hcwickz

Joined Oct 31, 2011
21
Ok thks for the info . i juz up my system voltage , however when my brushless motor is spinning , i cant up my voltage becoz there is a blink in c.c (constant current) in the dc power supply , isnt short circuit anywhere?

#### THE_RB

Joined Feb 11, 2008
5,438
Put a 63v 2200uF cap on the power input pins of your circuit.

#### hcwickz

Joined Oct 31, 2011
21
so power input pin such as ground and power source right?
sorry i am a noob , not so good at circuit

#### thatoneguy

Joined Feb 19, 2009
6,359
so power input pin such as ground and power source right?
sorry i am a noob , not so good at circuit
Yes, across the power lines.

And a 0.1uF cap across V+ and GND of the microcontroller if you don't have one already (see sigline link on decoupling caps).