increasing speed of the motor

Discussion in 'Programmer's Corner' started by hcwickz, Nov 29, 2011.

  1. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    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=analogRead(potpin1);
    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
    }
     
  2. hgmjr

    Moderator

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

    hgmjr
     
  3. hcwickz

    Thread Starter New Member

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

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Try 4 and see how it runs.

    5mS is a long time to a microcontroller.
     
  5. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    the speed is still the same , so is there any way i can control the speed?
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  7. hcwickz

    Thread Starter New Member

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

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  9. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    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?
     
  10. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
  11. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    so how can i increase the field to increase the speed?
     
  12. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
  13. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    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?
     
  14. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Put a 63v 2200uF cap on the power input pins of your circuit. ;)
     
  15. hcwickz

    Thread Starter New Member

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

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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).
     
  17. hcwickz

    Thread Starter New Member

    Oct 31, 2011
    21
    0
    okay thks for the help :)
     
Loading...