Here's my setup:
I have a lone APM (red) board without IMU shield. I connect the three (ground, power, signal) IN0 pins to my RC receiver's channel 1 output. I connect a PPM generator to the three IN7 pins on the far edge of the APM board. I connect a 5V FTDI cable to the APM board and upload the following Arduino sketch (compiled using the latest APM_Libraries.zip downloaded a few hours ago):
#include <APM_RC.h> // ArduPilot Mega RC Library
void setup() {
APM_RC.Init(); // APM Radio initialization
Serial.begin(57600);
Serial.println("ArduPilot Mega RC lock test");
delay(1000);
}
void loop() {
for(int i=0;i<8;i++)
APM_RC.OutputCh(i,1500);
}
I then verify that the serial monitor prints "ArduPilot Mega RC lock test" upon APM bootup.
First measurement:
I connect my two oscilloscope channels to IN0 and OUT0. The result is a correctly-shaped RC pulse on both channels which responds to movement on the transmitter's stick. The two pulses are perfectly overlapped (or very close to it). Regardless of what pulse length my PPM generator generates on IN7, this behavior remains the same.
Second measurement:
I connect one of my oscilloscope channels to OUT0 and the other one to IN7. I confirm that my PPM generator on IN7 generates pulses of measured lengths {1167us, 1294us, 1425us, 1552us, 1683us, 1814us}, and that OUT0 still responds to the transmitter's stick for every pulse length on IN7.
I have two APM boards that I have tried these steps on and the result is the behavior. One of the boards is unmodified from SparkFun and I updated the firmware of the 328 on the other using PPM_Encoder.zip downloaded a few hours ago (also verified that the signature matched an ATmega328P).
I would have expected to observe a 1500us pulse on OUT0 for all IN7 pulse lengths except one, but instead I never observe 1500us pulses on OUT0. The output pulse lengths for channels that have valid input pulses match the input pulses exactly under all circumstances and the output pulses for channels without valid input pulses appear to have fairly random pulse lengths.
I would debug the issue further, but I have been unable to find the source code for the PPM_Encoder firmware for the 328. Chris or others, could you post the source code for the PPM encoder along with the compiled hex file? Is the behavior I'm observing the intended behavior?
Thanks,
Ben
You need to be a member of diydrones to add comments!
Replies
I would still like to get the source code for the PPM encoder however, because now my above program successfully forces an output of 1500us regardless of mode switch setting. That is, now I have the opposite problem -- the 328 will not switch *into* manual mode. The amber mux LED will not extinguish regardless of the pulse length on IN7. And yes, this time I have tried closing the PicoScope program (the thing that caused the problem last time). When I load the standard APM_radio example, the outputs function correctly.
Finally, where can I find the code mentioned here?:
http://code.google.com/p/ardupilot-mega/wiki/ModeSwitch
At first I thought it was just bad solder, but could this be a wider problem?