Hello,

I just purchased an ardupilot mega and soldered input and output pins, but I am having trouble reading receiver inputs. I uploaded the sample program from Sparkfun found here ( Example Firmware ). Currently only input0 is being read correctly. 

With nothing plugged in:
All inputs read 1500

After plugging a receiver output to input0:
input0 is read correctly and some of the other inputs change to 1000

When receiver outputs are plugged into inputs 0-7:
No change and nothing appears to be read.

Any ideas? Is this a soldering mistake or a bug on the board? Also, at one point, only input4 was working and all others stopped working. I'm not sure why that could have happened.

Any help would be greatly appreciated!

- rusty

Views: 801

Reply to This

Replies to This Discussion

Jehangir,

Need some additional information to help troubleshoot your problem.

What brand of receiver are you using and how are you powering the receiver while it is connected to the ArduPilot Mega.

Also, the demo code requires a three position switch on channel 5 to switch demo modes. Here is a code snippet from the demo code:

void loop()
{

//Switch low, forward the PPM
if(InputCh(5) <= 1250) //Reading channel 5 to change mode
{
OutputCh(0, InputCh(0));
OutputCh(1, InputCh(1));
OutputCh(2, InputCh(2));
OutputCh(3, InputCh(3));
OutputCh(4, InputCh(4));
OutputCh(5, InputCh(5));
OutputCh(6, InputCh(6));
OutputCh(7, InputCh(7));
}
else
{
//Switch High, Move servos
if(InputCh(5) >= 1750)
{
if((millis()- timer2) >= 20)
{
timer2=millis();
if(All_PWM >2100)
All_PWM=900;
else
All_PWM+=20;
}
}
//Switch in the midle, center all servos
else
{
All_PWM=1500;
}

OutputCh(0, All_PWM);
OutputCh(1, All_PWM);
OutputCh(2, All_PWM);
OutputCh(3, All_PWM);
OutputCh(4, All_PWM);
OutputCh(5, All_PWM);
OutputCh(6, All_PWM);
OutputCh(7, All_PWM);

To be able to see an output, channel 5 must have a PWM signal of <=1250 (See Switch low, forward the PPM).

Hope this helps.

Regards,
TCIII
Hi Thomas,

I am using a Hitec Optima 9 receiver that is being powered by the speed controller. Channel 5 has a signal less than 1250. I have played around with many variations of the code. Even the following produces no useful output on inputs 1-7:

void setup()
{
Init_PWM1(); //OUT2&3
Init_PWM3(); //OUT6&7
Init_PWM5(); //OUT0&1
Init_PPM_PWM4(); //OUT4&5
Serial.begin(57600);
}

void loop()
{
if((millis()- timer) >= 250)
{
timer=millis();
Serial.print("Ch0:");
Serial.print(InputCh(0));
Serial.print(" Ch1:");
Serial.print(InputCh(1));
Serial.print(" Ch2:");
Serial.print(InputCh(2));
Serial.print(" Ch3:");
Serial.print(InputCh(3));
Serial.print(" Ch4:");
Serial.print(InputCh(4));
Serial.print(" Ch5:");
Serial.print(InputCh(5));
Serial.print(" Ch6:");
Serial.print(InputCh(6));
Serial.print(" Ch7:");
Serial.println(InputCh(7));
}

}

I am only getting a response from input0. Like I said before, during one trial only input4 was working and the rest gave no values. I'm kind of guessing it has to be hardware at this point but any ideas would be great!

Thanks
Jehanqir,

There is the possibility that the Atmega168 on the ArduPilot Mega board did not get programmed at Sparkfun to do the PPM encoding. Also, the void setup() code looks a little strange. Is the PPM input from the Atmega168 to the Atmega1280 identified in this code?

Regards,
TCIII
Hey Thomas,

Still no luck. I assume the setup code is correct. I haven't touched it so it is still directly from the example code. I suppose the Atmega168 could be incorrectly programmed, but remember that one input is working correctly, so it must be programmed already.

I may have to buy another one and start over..

- Rusty
Rusty,

I have alerted Chris Anderson to this issue that you are having with the ArduPilot Mega demo code and he said that he will try to investigate it as soon as possible given his very busy schedule. Mikro over at the Aeroquad Forum has had a problem with two of the RC channels on one of his two ArduPilot Mega boards so you are not the only one with this issue.

Regards,
TCIII
Thank you Thomas, I appreciate the help.
Rusty,

Here is what uphiearl had to say about his ArduPilot Mega: "@TCIII
Yes, I have the same problem. Sometimes it decodes one or two channels. I am also watching on scope.
I think the demo program is fine. Agrees with what I see on the scope.
Must be programming in the 368 that we can't get to without a jtag programmer.
Had a problem with the mux board from Jordi. I sent it back, he reprogrammed and it works fine.
Maybe there is a problem with the 368 program.
Earl "

Regards,
TCIII
I can now get more than one ch to decode with the demo prog.
ch 1,2,3,4,7
ch 0 is my aileron ch that I cant get to decode.
I have tried switching ch around and still no luck on ch 0

ch 0 = ale
ch 1 = ele
ch 2 = throttle
ch 3 = rudder
ch 4 = servo tester
ch 7 = knob on my tx

Must be something wrong somewhere !
Earl
This sounds very similar to my problem. At least you are getting more than one channel to work. What changed between getting 1-2 channels working and then having ch 1,2,3,4,7 working?
I reloaded the demo code.
Earl
Still can't figure out why ch 0 (ale) doesn't read out.
Earl
Hi Earl,

What R/C transmitter/receiver combo are you using?

Regards,
TCIII

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service