Go Down

Topic: 3 axis auto stabilized platform (Read 80840 times) previous topic - next topic

GekoCH

hmm strange they are in the right place: Now i get this one:

ServoDecode.cpp: In function 'void processSync()':
ServoDecode.cpp:22: error: 'DEBUG_OUT' was not declared in this scope
o: In function `loop':
undefined reference to `ServoDecode'o: In function `setup':

Andy

mem

#181
Jul 26, 2008, 10:43 am Last Edit: Jul 26, 2008, 10:46 am by mem Reason: 1
Andy, remove the following line in the processSync method of the cpp file
 DEBUG_OUT('R');

You can remove any other occurrence of that line, I thought I had removed them all in the version I posted but it looks like one sneaked through. Its debug code thats not needed in the runtime version.

GekoCH

Thx a lot now it does work!

Hmm but i do get a NOT-SYNCHED output....

I have to check this out...

Andy

mem

Quote
Thx a lot now it does work!

Hmm but i do get a NOT-SYNCHED output....

I have to check this out...

Andy

What transmitter (or receiver) are you using and how is it connected to the input on pin 8?

jamiemcshan

#184
Jul 27, 2008, 05:54 am Last Edit: Jul 27, 2008, 06:04 am by jamiemcshan Reason: 1
Mem,

I am trying to integrate in the ServoTime2 code, but I get this message when I try to make a call to it.

I am a total newbie, so any direction on what to check would be great!

o: In function `__static_initialization_and_destruction_0':
undefined reference to `ServoTimer2::ServoTimer2()

And when I try the code from post 175, I get this.

o: In function `__static_initialization_and_destruction_0':
undefined reference to `ServoTimer2::ServoTimer2()'o: In function `runScript1(int, unsigned char)':
o: In function `setup':

Jamie

mem

#185
Jul 27, 2008, 07:22 am Last Edit: Jul 27, 2008, 07:48 am by mem Reason: 1
Jamie,  it looks like the ServoTimer2 library code is not being found. Can you check that the header file is named ServoTimer2.h and the source file is named ServoTimer2.cpp and that both are in a directory called ServoTimer2 in a subdirectory just below hardware/libraries.

GekoCH

Quote

What transmitter (or receiver) are you using and how is it connected to the input on pin 8?


I'm using a Graupner receiver and the Futaba FF10 as a transmitter..
I followed this tutorial to get the PPM signal from the Transmitter.
After that I could read out the different values for all the channels.
The wire from the inside of the transmitter where I found the PPM signal is directly connected to pin 8 and the ground to the ground on the Arduino.

Andy

mem

#187
Jul 27, 2008, 10:39 am Last Edit: Jul 27, 2008, 10:40 am by mem Reason: 1
> I followed this tutorial to get the PPM signal from the Transmitter.
> After that I could read out the  different values for all the channels.

Andy, are you saying that it works when connected to the transmitter but not when connected to the receiver?

If so, can you say how you are getting the ppm signal from the receiver

GekoCH

hmm yes I do get the PPM signal directly from the receiver (from the chip inside the receiver).
Sorry I forgot to post the link
With this code I can monitor every channel and if I push anything on the transmitter I get  different values for this channel. Just really great [ch61514]

Code: [Select]
#define channumber 8 //How many channels have your radio?
int value[channumber];

void setup()
{
Serial.begin(57600); //Serial Begin
pinMode(3, INPUT); //Pin 3 as input
}
void loop()
{
while(pulseIn(3, LOW) < 5000){} //Wait for the beginning of the frame
for(int x=0; x<=channumber-1; x++)//Loop to store all the channel position
{
value[x]=pulseIn(3, LOW);
}
for(int x=0; x<=channumber-1; x++)//Loop to print and clear all the channel readings
{
Serial.print(value[x]); //Print the value
Serial.print(" ");
value[x]=0; //Clear the value afeter is printed
}
Serial.println(""); //Start a new line
}


I got all the information from this site.
http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A38393

By the way. You don't get the PPM Signal directly from the reciever? How do you do that?

Andy

mem

#189
Jul 27, 2008, 11:01 am Last Edit: Jul 27, 2008, 11:02 am by mem Reason: 1
Andy, do you have ServoDecode working with your transmitter?

When you connect the receiver, are you using pin 8?

The receiver I use has a pic micro-controller to process the ppm signal and I take a feed off the appropriate pin. I posted details earlier in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1204020386/3#3

GekoCH

No ServoDecode does not work...
yes I'm using pin 8

Andy

mem

#191
Jul 27, 2008, 11:14 am Last Edit: Jul 27, 2008, 11:15 am by mem Reason: 1
ServoDecode uses a sync gap length of 3ms, your working test code uses 5ms. I doubt that is the cause of your problem but you could try to either change your test code and see if that stops it working:
 while(pulseIn(3, LOW) < 3000){} // <- was 5000

or change the following in ServoDecode.h
#define SYNC_GAP_LEN      (5000 * TICKS_PER_uS) // <- this was 3000
Don't forget to delete ServoDecode.o and see if that works

Another thing you could try is to change the following line in ServoDecode.cpp
volatile byte pulseEnd = PULSE_START_ON_RISING_EDGE ; // default value
to
volatile byte pulseEnd = PULSE_START_ON_FALLING_EDGE ; // try this

Again, don't forget to delete ServoDecode.o

GekoCH

yep the ServoDecode does now work. It does even work with
 while(pulseIn(3, LOW) < 3000){} // or 5000 doesn't matter.

So I plug now a servo to the Arduino....

mem

Good to hear you have it going, what made it start working?

GekoCH

I treid the ServoDecode just once and I think I pluged it to pin 7 or 9....
can I now remap the receiver signal to the servo signal with map()?

Or what do you suggest?

Andy

Go Up