PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDare

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDare

Post by BadBert »

As i already stated here (but i think that is the wrong location)
viewtopic.php?f=17&t=2152&start=0

i got problems using the ppm sum connection :(

i still got glitches!!! WAY less than before (changed the positive/negative in ppm sum trigger), really a lot better now.

i have added a youtube movie to show you guys.

During this movie, a am not touching the sticks of my transmitter!!!

http://youtu.be/mtwUxpKzKt4

I am using a graupner mx12 with ChainlinkDare UHF set.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

BadBert, I may have a solution for you.

The problem is probably that your Chainlink receiver sends 9 channels of RC data but the MW ppm sum receiver software only decodes 8!

Try this:

You must revert to positive ppm sum triggering.

Then, in Config.h, you will need to add a new definition for your Chainlink receiver.
I'm not sure which PPM SUM definition you are using, but you will need to add an extra channel to the definition.....
For example, if you are using the Multiplex definiton......
ie: #define SERIAL_SUM_PPM PITCH,YAW,THROTTLE,ROLL,AUX1,AUX2,AUX3,AUX4 //For Graupner/Spektrum

Change it to this:

Code: Select all

#define SERIAL_SUM_PPM         PITCH,YAW,THROTTLE,ROLL,AUX1,AUX2,AUX3,AUX4,AUX5 //For Chainlink????

Notice AXU5 added athe end of the definition..

At the beginning of the receiver code in RX.pde: change the number of channels to 9....

Code: Select all

//RAW RC values will be store here
#if defined(SBUS)
  volatile uint16_t rcValue[18] = {1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502}; // interval [1000;2000]
#else
  volatile uint16_t rcValue[9] = {1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502}; // interval [1000;2000]
#endif

Notice rcValue now has 9 elements.

and also modify rcChannel to have 9 elements:

Code: Select all

#if defined(SERIAL_SUM_PPM) //Channel order for PPM SUM RX Configs
  static uint8_t rcChannel[9] = {SERIAL_SUM_PPM};
#elif defined(SBUS) //Channel order for SBUS RX Configs
     .
     .
     .


Also change to 9 channels in the PPM sum receiver code (in RX.pde)

Code: Select all

// Read PPM SUM RX Data
#if defined(SERIAL_SUM_PPM)
  void rxInt() {
    uint16_t now,diff;
    static uint16_t last = 0;
    static uint8_t chan = 0;
 
    now = micros();
    diff = now - last;
    last = now;
    if(diff>3000) chan = 0;
    else {
      if(900<diff && diff<2200 && chan<9 ) {   //Only if the signal is between these values it is valid, otherwise the failsafe counter should move up
        rcValue[chan] = diff;
        #if defined(FAILSAFE)
          if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0;   // clear FailSafe counter
        #endif
      }
    chan++;
  }
}
#endif


I hope this works, I cannot test it without a 9 channel receiver.....

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

the chainlink indeed has 9 ch!!!

i'll try this as soon as i can, and report back here!

thanks so far!

EDIT: but a friend of mine has the v1.0 chainlink, that has 12 channels, and his ppm sum is working flawlessly :(
but i'll try!

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

I get the following error:

RX:12: error: 'AUX5' was not declared in this scope

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Sorry, forgot to define AUX5

At the beginning of mutltiwii_2_1.ino after #define AUX4 7

Add:
#define AUX5 8

H.

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

hmmm

for a while (couple of seconds) it was stable... after that... the same :(

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Try changing the value that defines the end of the frame......

Try:   if(diff>3500) chan = 0; or try: if(diff>2500) chan = 0;

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

Ok, i'll try!

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

ok, i tried both values, but no luck :(
(i did not repowered the board when i tried, is this a must?)

same "jitter" :( :( :( :( :( getting a bit sad now :(

Bev rc said it could be the to high/l ow voltage peak of the signal...

Quote from bev:
there is compatible problem of volt peak of MCUs, we use the STM8, I think the multiwii may
use the atmel or PIC, is that right, the high and low volt peak is a little different which cause some compatibe problem


can i do something about that??

anyone else got some ideas?

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

What voltage is supplying your your receiver?

You could add a 4.7v or 5v Zener diode across the ppm sum signal and ground (0v) to "clamp" the signal.
(Connect the cathode(-) to ppm sum signal and anode(+) to 0v)
I think you might need to get access to an oscilloscope to "see" the shape and magnitude of the ppm sum signal.
It should be a nice clean square wave, no more than 5volts.

I'm using a simple, one transistor ppm sum encoder with an orange spektrum clone with no problems.

H.

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

I dont have an oscilloscope .... so that is a problem.

can i ad that diode without any problems, just to try?
what would be the best one to try? 4.7 of 5v?

would this not influence the max and min of a channel?

my receiver is getting 5.03v from the multiwii board i think? so i find it weird that the ppm pulse can be more than 5v...

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

and is a zener diode enough? or do i need to add more hardware?

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

I found a forum (discussing problems with Chainlink) that mentions "lock-out" issues when your Tx is too close to the Rx.
After reading some more info about Chainlink, I don't think adding a Zener diode will solve anything...

http://fpvlab.com/forums/showthread.php ... Dare/page4
Hi, I am Wee from BEVRC, there is a problem for the ChainLinkdare is that the Tx's antenna and Rx's antenna shouldn't be too close, such as half a meter, which will cause the Rx enter a saturate mode, which we have mentioned in the manual. Ali encountered the same situation and he thought it's faulty and sent it back for check, indeed, it's a hardware bug, hope to get it sorted when the v1.1 hardware for the Rx released soon.
So, it's easy to get it worked well for most of the situation, don't get the Tx's antenna and Rx's antenna too close.

I also see that the firmware can be updated. Have you done this? Is it necessary?

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

I-ve already tried standing a couple of meters away... did not help!

and the firmware is updatable of the RX, but there is no newer firmware available :(

i already knew about lockout with the transmitter to close to the receiver so i already tried that.
Lock out is completely no signal on rx, and the rx goes to failsafe

I'll give it a new try this evening, just to be sure,

but the message from bev clearly states that the peak of the signal is to high:
there is compatible problem of volt peak of MCUs, we use the STM8, I think the multiwii may
use the atmel or PIC, is that right, the high and low volt peak is a little different which cause some compatibe problem


so if that is true, the diode should work?
and just only the diode? and the 4.7v one should be ok? (or do i need to add more hardware?)

EDIT: i have asked bevRC to make a scan with a scope of 1 pulstrain for me.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Zener.png
(3.95 KiB) Not downloaded yet

4.7V Zener diode would be fine.
Always good practice to add a current limiting resistor, but probably not necessary here.

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

howardhb wrote:
Zener.png

4.7V Zener diode would be fine.
Always good practice to add a current limiting resistor, but probably not necessary here.

Ok thanks!

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

I'm, getting some diodes tomorrow, so i am going to try.

i will put a resistor in between, just to be safe ;)

i'll let you guys know as soon as i can.

If this does not work, i'll hook everything up to a ppm encoder that is known to work with multiwii....

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by timecop »

I really doubt STM8 output levels (which are either 3.3V or 5V depending on how its powered) have anything to do with this.
I'm waiting to see what the bev dudes will show for scope output.
I don't think diode is going to solve anything.

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

bev themselve say that it has to do with peaks on the signal (voltage peaks) so if that is correct, this SHOULD help...

did not get any scope image yet :(

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

i'm gonna try the diode tonight.

Even BevRC said in theory, this should work.... ;)

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

Diode did not work :( also tried it with the resistor.

I hooked up a ppm encoder, and that works perfect

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Badbert, one last thing to try is a re-written rx routine specifically for negative ppm sum.

In a previous post you mentioned that setting falling edge interrupt helped, but not entirely.

For that to work correctly the rx routine needs to be modified slightly.
I am using a modified routine with a simple ppm sum encoder, made from diodes and a single transistor.
(the transistor effectively inverts the ppm sum from the receiver, thus requiring modified rx code)


In Def.h. ....attachInterrupt(0, rxInt, FALLING); //set interrupt to falling edge to catch the first channel

then, replace the rx function with the code below:

Code: Select all

// When using negative PPM, high to low going pulses need to be found......
// The Rx interrupt must be set to trigger on FALLING edge to find the first pulse.
// During the last channel pulse measuring, we must set the interrupt to RISING edge in order to find the end of that last pulse.
// Then, set the interrupt back to FALLING edge.....to wait for channel 0 again
#if defined(SERIAL_SUM_PPM)
#if !defined(PROMICRO)
    void rxInt() {
  #else
    ISR(INT6_vect){
  #endif
  uint16_t now,diff;
  static uint16_t last = 0;
  static uint8_t chan = 0;

  now = micros();
  diff = now - last;
  last = now;
  if(diff>3000) chan = 0;
  else {
         if(900<diff && diff<2200 && chan<9) {   //Only if the signal is between these values it is valid, otherwise the failsafe counter should move up
           rcValue[chan] = diff; 
           #if defined(FAILSAFE)
             if(failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0;   // clear FailSafe counter - added by MIS  //incompatible to quadroppm
           #endif
         }
     chan++;
    if(chan==8) attachInterrupt(0, rxInt, RISING); // Chainlink Dare has 9 channels... so set interrupt to catch the rising edge to find end of last channel
    if(chan==9) attachInterrupt(0, rxInt, FALLING);  //set interrupt back to falling edge to catch the first channel in the next loop after 3000 delay
  }
}
#endif


H.

BadBert
Posts: 32
Joined: Thu Feb 23, 2012 12:01 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by BadBert »

Thanx! I'll try!

NigelUno
Posts: 2
Joined: Thu Jan 20, 2011 11:10 am

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by NigelUno »

I've the same issue with ez-UHF rx 4 ch + T8FG + MultiWii 2.1

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

howardhb wrote:Badbert, one last thing to try is a re-written rx routine specifically for negative ppm sum.

In a previous post you mentioned that setting falling edge interrupt helped, but not entirely.

For that to work correctly the rx routine needs to be modified slightly.
I am using a modified routine with a simple ppm sum encoder, made from diodes and a single transistor.
(the transistor effectively inverts the ppm sum from the receiver, thus requiring modified rx code)


In Def.h. ....attachInterrupt(0, rxInt, FALLING); //set interrupt to falling edge to catch the first channel

then, replace the rx function with the code below:

Code: Select all


     chan++;
    if(chan==8) attachInterrupt(0, rxInt, RISING); // Chainlink Dare has 9 channels... so set interrupt to catch the rising edge to find end of last channel
    if(chan==9) attachInterrupt(0, rxInt, FALLING);  //set interrupt back to falling edge to catch the first channel in the next loop after 3000 delay
  }
}
#endif


H.



Is there away to remove the transistor or invert the PPM signal so the code does not have to change from RISING to FALLING?

Thank you.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

The purpose of the transistor is to "square" each channels pulse shape after they are added together.
This is necessary for accurate measuring of the width (time) of each pulse.
If you want to run standard ppm sum code, you could simply add another transistor to invert the signal a second time
, or, instead of the transistor, use a non-inverting buffer 74LVC217 or similar.

H.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Awe Awesome!! What about a Hex Inverter 7404?

Thank you...

Or what about this: http://hyperphysics.phy-astr.gsu.edu/hb ... er.html#c2

Image

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Yes! Using a hex buffer will work.
Use two (of the six available ) inverters, in series, in a 7404 hex inverter.

Better still, use a 7414 (schmitt trigger) hex inverter.
This type has better wave "squaring" capability as a result of high input impeadance and noise immunity.
H.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Thank you Howard, I ordered some 7414s. Just for clarity, using a 7414, the transistor is no longer required right?

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Correct.
Remember to add a 100nf capacitor across the power pins of the 7414.
H.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Howard, I pulled my old Oscilloscope out of the Garage today and took this image. It does not look like other PPM pulses I have see but it works. Any suggestion what I maybe doing wrong or it could be this scope.

Image

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

That scope image shows a signal that looks to be "damped" by a capacitor, or, the probe you are using has a high capacitance.
What were the voltage and time-base settings on your scope?
Where in the circuit were you measuring? I would expect to see at least square wave with some rounded transitions.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Thanks Howard, I opened the case of the scope and cleaned all of the contact just this morning. Going to redo this test and update you. As for the PPM, it is working great, just want to get this scope working so I can have something to work with when I start experimenting around.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

P.S., just took a good look around on eBay, not even going to mess with this old scope. I see where I can get a pocket scope for less then 70 bucks and many others that connect via a PC.

Thanks Howard for your time.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

@Howard,

I received the SCHMITT INVERTER however, I did not take into consideration the package size and will have to build a new board to accommodate it. A thought occurred to me that if we were to replace the NPN Transistor with a PNP like a 2N3906, maybe that will do the trick. What is your opinion?

SequentialPPMconnectiondiagram2.jpg

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

copterrichie wrote:@Howard,

A thought occurred to me that if we were to replace the NPN Transistor with a PNP like a 2N3906, maybe that will do the trick. What is your opinion?

SequentialPPMconnectiondiagram2.jpg


Just confirmed by replacing the NPN transistor with a PNP, (no other changes required) requires no modification to the MWC' Sum-PPM. Just be mindful that the Emitter goes to the positive voltage and the Collector to ground, just the opposite of the NPN transistor.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Good!
Consider moving the 1k bias resistor to the +5V vcc line so that the transistor is biased "off" . Might save a few mA.

H.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

howardhb wrote:Good!
Consider moving the 1k bias resistor to the +5V vcc line so that the transistor is biased "off" . Might save a few mA.

H.


Sounds Great!!! Still have a problem with Channel Six however. On my scope, channel six is active but the MWC is not detecting it. We need away to add the final pulse at the end of the stream, any suggestions?

Maybe moving the resistor to the +5V may do the trick, will try that and report back.

User avatar
howardhb
Posts: 189
Joined: Tue Oct 11, 2011 7:10 pm
Location: Port Elizabeth, South Africa

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by howardhb »

Have you searched for the definition of RC_CHANS? It should be defined as 6.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Duh, it would help if I was using the latest Dev. :)

But there is still no channel Six detected by the MWC. :( I believe we need that final pulse because when I used a known good PPM source, there is an extra pulse at the end of the stream.

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by Mis »

But there is still no channel Six detected by the MWC.

If your receiver have more than 6 channels, connect one additional diode to channel 7 and you get 6 working channels.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: PPM sum bug firmware v2.1 + Graupner MX12 + ChainlinkDar

Post by copterrichie »

Mis wrote:
But there is still no channel Six detected by the MWC.

If your receiver have more than 6 channels, connect one additional diode to channel 7 and you get 6 working channels.


+Point however, these RXs are 6 channels so for now, I will have to live with 5 channels. :cry:


BUT, I have not given up hope. :)

Post Reply