Arduino as a Auto-Pilot for SP Racing F3 Flight Controller

Hi dear all,

i am currently working on a project at university. I targed to generate 5 output-signals with 50 Hz frequency by Arduino UNO which can control my 5 channels (arm, trottle, yaw, pitch and roll). First i tried to make it with PWM.h library, but i could get only 3 outputs (pin 3, 9 and 10 ), Nevertheless i couldnt controll any channel with my 50 Hz. 5% (min.) and 10% (max.) PWM.

I need 5 Outputs with 5% (min.) and 10% (max.) duty cycle which are working on 50 Hz. frequency. I think there is also an integration problem between my first solution and SP Racing F3.

Please can anyone tell me, how to overcome this challenge!???

Please tell some arduino libraries, their useful functions, or some integration solutions :))

Thank you soooo much my engineer-friends!!!

cakirerahmet:
Hi dear all,

i am currently working on a project at university. I targed to generate 5 output-signals with 50 Hz frequency by Arduino UNO which can control my 5 channels (arm, trottle, yaw, pitch and roll). First i tried to make it with PWM.h library, but i could get only 3 outputs (pin 3, 9 and 10 ), Nevertheless i couldnt controll any channel with my 50 Hz. 5% (min.) and 10% (max.) PWM.

I need 5 Outputs with 5% (min.) and 10% (max.) duty cycle which are working on 50 Hz. frequency. I think there is also an integration problem between my first solution and SP Racing F3.

Please can anyone tell me, how to overcome this challenge!???

Please tell some arduino libraries, their useful functions, or some integration solutions :))

Thank you soooo much my engineer-friends!!!

I don't have any experience with what you are trying, but I see a logic error. You cannot maintain 50 Hz signal integrity while changing the duty cycle. If you change the duty cycle, you change the frequency at that point. Perhaps that is causing the problem.

Paul

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

If you are controlling servos, then are you using the servo library that will provide the PWM signal?

google arduino servo library

What is your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile:

Nevertheless i couldnt controll any channel with my 50 Hz. 5% (min.) and 10% (max.) PWM.

{cough} Servo library {cough}

The execution of the following codes sustains 50 Hz signal at DPin-2 of Arduino UNO. The ON-period of the signal can be varied by varying the value of the 8-bit argument of this command: myServo1.write(arg);. We can generate 50 Hz signals at other DPins by creating objects like Servo myServo2, Servo myServo3, … ,.

#include<Servo.h>
Servo myServo1;
Servo myServo2;

void setup() 
{
  Serial.begin(9600);
  myServo1.attach(2);  //50 Hz signal at DPin-2
  myServo2.attach(3);  //50 Hz signal at DPin-3

  myServo1.write(0x45);
  myServo2.write(0xA0);
}

void loop() 
{
 
}