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

Chris Anderson liked Zara Mae Pickering's profile
May 21
Azjeg liked Azjeg's profile
Apr 27
DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
More…