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

DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Monday
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Saturday
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9
DIY Robocars via Twitter
RT @JoeSpeeds: Sat Nov 6 Virtual DonkeyCar (and other cars, too) Race. So bring any car? @diyrobocars @IndyAChallenge https://t.co/nZQTff5…
Oct 31
DIY Robocars via Twitter
RT @JoeSpeeds: @chr1sa awesomely scary to see in person as our $1M robot almost clipped the walls as it spun at 140mph. But it was also awe…
Oct 29
DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
Oct 25
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Oct 23
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Oct 23
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Oct 23
DIY Robocars via Twitter
RT @DAVGtech: Another incident: https://t.co/G1pTxQug6B
Oct 23
More…