PPM capture and PPM generation

More
10 Aug 2012 13:41 #1046 by wuselfuzz
PPM capture and PPM generation was created by wuselfuzz
Proposal on how to implement PPM capture for buddy functions:

- Use one stm32 timer to continuously run with microsecond ticks. There's more than enough timers left.

- Configure an external on the GPIO pin connecting to the tip of a 3.5" mono jack plugged into the DSC port. IRQ should fire on a rising edge.

Pseudo code for ISR:
#define MAX_PPM_VALUES 8
static u16 ppm_values[MAX_PPM_VALUES];

ppm_isr() {
   static s8  first_request=1;
   static u16 last_timer=0;
   static s8  index=-1;

   u16 timer=read_usec_timer();

   if(first_request) {
      first_request=0;
   } else {
      u16 duration=timer-last_timer; // unsigned underflow intended
      if(duration>2500) {
         index=0; // found the gap
      } else {
         if(index>=0 && index<MAX_PPM_VALUES) {
            ppm_values[index]=duration;
            index++;
         }
      }
   }
   last_timer=timer;     
}

Please Log in or Create an account to join the conversation.

More
10 Aug 2012 14:00 #1047 by PhracturedBlue
Replied by PhracturedBlue on topic PPM capture and PPM generation
Is there any spec at all for how PPM is implemented in each radio? I assume not. So basically you have no idea what the bounds of the PPM range are (nor how many channels will be sent). So I assume the 2 options are (a) a list of transmitter (brands(?) with predefined calibration, or (b) a calibration mode to figure out the bounds of the PPM (which is what you were discussing in the GUI thread)

I assume the PPM values are identical to what would go out the radio (all mixes applied). You mentioned in the other thread using them as inputs and running them through the mixer. Wouldn't that result in the Trainee having a completely different setup when he unplugs the cord? Is that desirable? Additoionally, the Trainee could need to turn off all mixing in his Tx else we couldn't make heads or tails of the signal., unless you want to try unmixing it in the Deviation firmware which sounds like a recipe for disaster.

Never having used a trainer, I assumed you setup your Tx for flight and the Trainer could basically take over as if the Trainee had handed his Tx to the Trainer, but what you are describing sounds like the reverse of that.

Please Log in or Create an account to join the conversation.

More
10 Aug 2012 14:26 #1048 by wuselfuzz
Replied by wuselfuzz on topic PPM capture and PPM generation

PhracturedBlue wrote: Wouldn't that result in the Trainee having a completely different setup when he unplugs the cord? Is that desirable? Additoionally, the Trainee could need to turn off all mixing in his Tx else we couldn't make heads or tails of the signal., unless you want to try unmixing it in the Deviation firmware which sounds like a recipe for disaster.

Never having used a trainer, I assumed you setup your Tx for flight and the Trainer could basically take over as if the Trainee had handed his Tx to the Trainer, but what you are describing sounds like the reverse of that.


It's actually the reverse. The teacher controls the plane until he pulls a switch that gives control to his trainee. Already did that with a couple of DX6i. On the DX6, the trainer switch is automatically pulled back by a spring as soon as you stop holding it.

I agree about the turning off all mixers part on the trainees Tx, this is neccessary.

The main intent of my suggestion is, that you can practically use any Tx for the trainee. The current situation is, that nothing is really compatible with anything else. I can't use the Tx2402 as a buddy box hooked to my 2801 Pro. I can't use my gf's DX6i as a buddy box for my 2801 Pro either. Those combinations simply don't work, and the UI of the 2801 doesn't tell you what's wrong. I can use the 2801 as a buddy box using the DX6i as the master transmitter, but that's dangerous - I have to set the 2801 to Mode 3 for the correct channel order. I don't really like to mess with the throttle channel.

Please Log in or Create an account to join the conversation.

More
10 Aug 2012 14:43 #1049 by FDR
Replied by FDR on topic PPM capture and PPM generation
In the er9x you can configure how to interpret the PPM input:
er9x PPM_In

Please Log in or Create an account to join the conversation.

Time to create page: 0.038 seconds
Powered by Kunena Forum