Ardupilot: 4 channels in

Hi Jordi,Thanks for all your help getting me to the point where I can drive 4 servo outputs from the ardupilot.My next task is trying to read the value of another channel in from the receiver.Earlier you said there is only one pin free. Were you referring to D11. I used that for my outgoing channel 4 as you probably know.I really don't need the "remove before fly" functionality for my application, so if I remove the code for that, would I free up D6 and D7? As a general approach, could I flip the board over and solder a wire between the Ch3-IN pin and D6, and also between the Ch4-IN pin and D7?Then in the code could I do something similar to how you handle channels 1 & 2 ...pinMode(2,INPUT); // Servo inputpinMode(3,INPUT); // Servo InputThen I would add:pinMode(6,INPUT); // Ch3 Servo inputpinMode(7,INPUT); // Ch4 Servo InputThen could I just call:ch3_pos = pulseIn( 6, HIGH, 2000 );ch4_pos = pulseIn( 7, HIGH, 2000 );Is it as simple as this, or are there additional things I need to consider?Thanks,Curt.

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

Join diydrones

Email me when people reply –

Replies

  • I just wanted to post a follow up to my own message here. I did exactly what I proposed and it seems to work. I disabled the portion of the code that refers to pins 6 & 7 as a "remove to fly" shunt, and defined both as INPUT pins. Then I connected the signal line for Ch 3 IN to D6, and Ch 4 IN to D7. Finally I called pulseIn() for pins 6 & 7 and these seem to track the stick positions.

    So now I have 4 channels in, 4 channels out, plus the manual pass through / mux.

    What I'm working on now is a "binary" check sum'd protocol so the ardupilot can ship the receiver inputs upstream over the serial port and then receive servo commands back. My intermediate goal here is to use the ardupilot as a simple servo/receiver + auto/manual subsystem connected to a more powerful flight computer (probably gumstix).

    The gumstix will be able to log stick inputs, autopilot servo outputs, along with all the IMU sensor data, and attitude solution.

    Along the way it may be interesting to try to connect up the airspeed sensor from the shield as well as the voltage sensor and maybe a second pressure sensor to use for pressure altitude.

    I have a sparkfun 6DOF v4 IMU that I plan to hook up to the flight computer (gumstix) and a couple IMU algorithms to play with.

    Just to put all of this in perspective, I'm coming from a working IMU based autopilot that used the Xbow MNAV. But the MNAV is discontinued, so I'm hoping to be able to leverage a combination of currently available parts to rebuild our system newer and stronger and better and more capable than ever ...

    Prototyping and fiddling with firmware is incredibly tedious, but I'm close to being able to do what I want. :-)

    Thanks,

    Curt.
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…