Arduino Uno in the control loop

I am trying out a project that I found on this site

http://www.flitetest.com/articles/quadcopter-obstacle-avoidance-system-using-arduino

and according to the comments some people have been able to get this to work on an apm board. I am trying to interface an arduino uno to an apm 2.5. I have tried many things to trouble shoot my set up and so what I am trying to do right now is just manually control the arducopter with the arduino in the control loop for the elevator and aileron channels. Essentially I have those two channels going directly from the receiver to the uno, then to the input on the apm. 

I power the system with the props off and connect it to the mission planner. I then go to the radio calibration screen so I can have a nice visual of what the apm is seeing from its input ports. The apm is seeing the stick values fine on the screen they move smoothly with my stick movements on the controller. The problem is I don't see or hear any reaction from the motors on the two channels being sent through the uno board to the apm. 

I've tried powering the uno board from my computer to see if the current draw was too much and no change. I undid the wiring and took the uno out of the loop to make sure nothing on the output side was wired up wrong and on the test run my motors responded fine. 

Here is the stripped down code I am using on the uno just so I can rule out any interference by the rest of program I took it down to just translating input and spitting it back out. 

#include <Servo.h>
Servo aleo,eleo,thro;

int x,y;
void setup()
{

aleo.attach(10);
eleo.attach(11);

Serial.begin(115200);
Serial.println("initializing......");
}
void loop()
{
x=pulseIn(3,HIGH,20000);
y=pulseIn(5,HIGH,20000);


aleo.writeMicroseconds(x);
eleo.writeMicroseconds(y);


}

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • never mind I got help from another forum it's working now

This reply was deleted.

Activity