Page 1 of 1

Multiwii Airplane #USE_THROTTLESERVO

Posted: Sun May 10, 2015 10:38 pm
by beryl.wicaksono
Hi all,

Currently, I'm building an ornithopter based on Multiwii 2_3. My autopilot board is atmega328P, so it based on Promini. I have problem with the main motor. I use coreless motor and this brushed esc http://www.micronwings.com/Products/ESC ... ndex.shtml.

I've done setting up airplane with Multiwii, but my main motor didn't spin. When I moved to arduino and made a simple program (read RC signal --> PWM Motor (using servo library)), it worked. But the minimum throttle must be set to 700 and it needs about 2 second to start.

So How do I setup in Multiwii? I tried to uncomment #USE_THROTTLESERVO, but still didn't work. I connect motor to Pin B 1 or pin 9 in Arduino pro mini.

Any respons will be very helpful.

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Sun May 10, 2015 10:48 pm
by Cereal_Killer
The basics first, you did enable brushed motor ESC output right? Can you post your code? Either as a .zip or in [code] tags in a post.

Just so I'm clear, do you need the motor to continue going one direction? I'm not sure how an ornithopter works, does the motor have to reverse back and forth a million times a sec?

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Mon May 11, 2015 5:45 am
by beryl.wicaksono
How to enable it? I just define #define MEGA_HW_PWM_SERVOS. Btw in the comment says that motor connected to pin8, but in Patrik Emilson tutorial, engine is connected to pin 9. Which one is true?

Right, I've made a crank-shaft mechanism so the motor needs to spin just in one direction from 0 - topspeed.

Here I attach my code as rar. Hope you can help me. Thanks!

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Mon May 11, 2015 6:25 am
by Cereal_Killer
The problem is that the signal sent to a BLDC ESC is a servo signal, it varies the pulse duration. A brushed ESC works 100% differently, it uses a PWM signal (varies the duty cycle). This is for sure your problem, you must tell it you're using brushed motors...

First use this ESC choice
//#define MINTHROTTLE 1050 // for brushed ESCs like ladybird

Then go down near the bottom, find this section and enable the appropriate line for your MCU (pick the highest rate first, if that doesnt work with your motor step down one rate at a time till it works)

Code: Select all

  /********  brushed ESC ****************************************************************/
  /**************************************************************************************/
    // for 328p proc
    //#define EXT_MOTOR_32KHZ
    //#define EXT_MOTOR_4KHZ
    //#define EXT_MOTOR_1KHZ
 
    // for 32u4 proc
    //#define EXT_MOTOR_64KHZ
    //#define EXT_MOTOR_32KHZ
    //#define EXT_MOTOR_16KHZ
    //#define EXT_MOTOR_8KHZ

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Mon May 11, 2015 6:34 am
by beryl.wicaksono
That define doesn't available in MultiWii 2.3, right? I found it in Multiwii 2.4. Okay, I'll try. Do I need uncomment this too? #define USE_THROTTLESERVO.
As I said before, I've tried my ESC in arduino, and it works with the servo library. So, is it true that my ESC needs a servo signal?

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Mon May 11, 2015 6:44 am
by beryl.wicaksono
One thing I confused, in the code below, motor is connected to pin 8, but mine is connected to pin 9 (follow th PatrikE airplane tutorial). So, is this the problem? :roll:

Code: Select all

    /* HW PWM Servo outputs for Arduino Mega.. moves:
      Pitch   = pin 44
      Roll    = pin 45
      CamTrig = pin 46
      SERVO4  = pin 11 (aileron left for fixed wing or TRI YAW SERVO)
      SERVO5  = pin 12 (aileron right for fixed wing)
      SERVO6  = pin 6   (rudder for fixed wing)
      SERVO7  = pin 7   (elevator for fixed wing)
      SERVO8  = pin 8   (motor for fixed wing)       */

    #define MEGA_HW_PWM_SERVOS

Re: Multiwii Airplane #USE_THROTTLESERVO

Posted: Mon May 11, 2015 1:57 pm
by Cereal_Killer
beryl.wicaksono wrote:That define doesn't available in MultiWii 2.3, right? I found it in Multiwii 2.4. Okay, I'll try. Do I need uncomment this too? #define USE_THROTTLESERVO.
As I said before, I've tried my ESC in arduino, and it works with the servo library. So, is it true that my ESC needs a servo signal?


I'm sorry, you're right, it's new to 2.4 (but why not upgrade)? No you do not want to activate USE_THROTTLESERVO, that's for if you want a servo to be on the throttle channel for some reason.

beryl.wicaksono wrote:One thing I confused, in the code below, motor is connected to pin 8, but mine is connected to pin 9 (follow th PatrikE airplane tutorial). So, is this the problem? :roll:

Code: Select all

      SERVO8  = pin 8   (motor for fixed wing)       */ 

Always do what the code says, the guy's tutorial could be old or wrong.