LibrePilot Forum

General Category => General Discussion => Topic started by: batata003 on October 06, 2016, 07:46:58 pm

Title: PPM with CC3D
Post by: batata003 on October 06, 2016, 07:46:58 pm
Hi,

I am using Arduino to send PPM of 4 channels to CC3D. I already got it working with PWM using 4 wires. It's really easy: I just need to send a pulse with the width that I want inside a periof of 20ms. It's fine and works great.

But when I use PPM I know I am gonna multiplex it, put the 4 channels inside the 20ms. Ok, I can easily do that with Arduino. But my question is this: if I have 4 channels and I want to fit those 4 channels inside 20ms, I know each channel will have to "last" 5ms and inside this 5ms I will have to send my actual data.

Ok, but how will CC3D know that every 5ms I will be sending data? I cant fine any specification of how long each channel can consume of the total pulse (20ms). I only need 2ms in each channel cause that is the largest value I will have, so can I make every channel consume only 2ms? How will FC know that? It must have a specification of this that I cant find so far.
Title: Re: PPM with CC3D
Post by: Brian on October 06, 2016, 08:40:00 pm
You need to send a full 8 channels, not just 4.  There is a 4+ ms start pulse, followed by the channel pulses, which are 2ms each.

This page describes it pretty well: http://www.fpv-hero.de/RC-Sender_2_en.html
Title: Re: PPM with CC3D
Post by: batata003 on October 06, 2016, 10:28:29 pm
@Brian thanks man, the link you pointed is great however it does not say the "starndard" or what works with CC3D. In the beginning it says you should use 8 channels (ok, 8 channels will be below 20ms) however reading it further the guys says the duration can be up to 22.4 but I am sure CC3D will not allow both cause it could not recognize if the user is using the 20ms pulse or 22.4 ms pulse. I would like really to find the documentation about the PPM that CC3D uses, do I really need the 4ms to syncronize it? With arduino I already used multiplexed and I didnt need the 4ms to syncronize it. Even if I have to use 4ms, maybe CC3D will use a different value.

Do you have any idea where can I get reliable information sepcifically to CC3D?
Title: Re: PPM with CC3D
Post by: Brian on October 07, 2016, 06:07:18 pm
Actually, it does look like it will work with just 4 channels:

https://github.com/librepilot/LibrePilot/blob/next/flight/pios/stm32f10x/pios_ppm.c
Title: Trying to use PPM
Post by: batata003 on October 11, 2016, 07:21:09 pm
Hi,

I am using CC3D with LIbrepilot and I am generating the input signal of the receiver of the CC3D with arduino. I am currently using channels 1-4 and generating the pulses in these channels with PWM. Now I heard of PPM and that I only need to use 1 channel to send data.

Ok, in the docs of librepilot it says: "The PPM stream should be sent to the first input through the white wire connected to CC ReceiverPort wire/pin 3"

Pin 3? Is it the channels 3? Or is it the signal pin of the channel one?
Title: Re: PPM with CC3D
Post by: f5soh on October 11, 2016, 07:30:54 pm
Post moved to similar theme started a few days ago

Look here how to wire PPM input. Best option is PPM on pin8 / input6 for Oneshot feature.
https://librepilot.atlassian.net/wiki/display/LPDOC/CC+Hardware+Configuration#CCHardwareConfiguration-ReceiverPort

FlexiPort can be used for PPM also.
https://librepilot.atlassian.net/wiki/display/LPDOC/CC+Hardware+Configuration#CCHardwareConfiguration-MainPortandFlexiPortserialcablepinout
Title: Re: PPM with CC3D
Post by: batata003 on October 12, 2016, 07:41:25 pm
It's really freaking hard to generate the PPM. I spent the last days making everyting possible but CC3D never recognizes my PPM.

I really cant believe it's so hard to find the PPM model that CC3D uses. How long should be the first sync pulse? Should it be high or low? After that, how long can each channel consume of the total pulse?

I even tried some german pages to find the correct structure of PPM but it's unbeliveable impossible. Some people provided me some pattern which CC3D didnt recognized, other people provided me other pattern very different but it does not work too. So where is the documentation of the protocol in which PPM is sent?

I really appreciate any help. I also would like to know, if you can help me, in LIBRE PILOT when I select PPM in the INPUT tab, I select PPM to throttle, pitch, roll and yaw and I select "channel 1" in all of those throttle, pitch, roll and yaw. Should I just change this in LIBREPILOT in order to it start recognizing PPM?
Title: Re: PPM with CC3D
Post by: f5soh on October 12, 2016, 08:08:35 pm
The PPM model used with the CC3D is pretty standard i think, it works with all know receivers with PPM output.
Every stick have his own channel inpout.

(https://forum.librepilot.org/index.php?action=dlattach;topic=2420.0;attach=4376)

Title: Re: PPM with CC3D
Post by: Brian on October 12, 2016, 09:11:21 pm
You really need some sort of logic analyzer to look at the signals.  If we could see the signals, we could probably tell you what's wrong.

I have this one, which is pretty cheap, and works very well for relatively low bandwidth signals: http://dangerousprototypes.com/blog/open-logic-sniffer/
Title: Re: PPM with CC3D
Post by: f5soh on October 12, 2016, 11:25:14 pm
I found your post in Arduino forum: http://forum.arduino.cc/index.php?topic=428945.0

Tested the code you posted and works fine

(https://forum.librepilot.org/index.php?action=dlattach;topic=2420.0;attach=4378)

(https://forum.librepilot.org/index.php?action=dlattach;topic=2420.0;attach=4382)
Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 03:43:04 am
@f5soh man, I am so glad you are here to help me! I checked the print of your LIBREPILOT and mine was configured different! In this weeked I will test your setup and check if it works. It's gonna save me!! I spent so much time into this and I almost gave up, you gave me the last breath I needed. I will come back here to tell you if it worked!
Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 03:48:35 am
@f5soh could you please answer me this: I was using pin 3 of CC3D to connect to my arduino and could never make it work. I see you used the FLEXIPORT. Unfortunatelly I cant use FLEXIPORT, could you please check that code in PIN 3 of your CC3D?
Title: Re: PPM with CC3D
Post by: Brian on October 13, 2016, 04:21:12 am
Can you show a picture of your hardware configuration tab?  The configuration options for the receiver port are shown here:

https://librepilot.atlassian.net/wiki/display/LPDOC/CC+Hardware+Configuration
Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 04:42:51 pm
Hi Brian, this is my screenshot :)

I tried right now and couldnt make it work on pin 3 of the receiver. Unfortunatelly I cant use flexiport, could anyone else confirm if can send PPM to pin 3 using arduino?
Title: Re: PPM with CC3D
Post by: f5soh on October 13, 2016, 04:59:50 pm
Your receiver port is set to PWM...
Look at link posted above and learn what it means, there is also some connection diagrams.
Whatever the input you use, if configured right the PPM works.

In hardware tab:
PPM-NoOneShot : PPM input, pin3.
PPM_pin8. PPM-OneShot compatible.

The config you set should match the pin you use.
Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 07:13:04 pm
@f5soh first I appreciate your kindness and patience with me.

I know the difference of PPM and PWM, very well :) The print I gave you had an error cause LIBREPILOT probably has some bug: when I change PWM from PPM in every channel (inside INPUT tab), in the HARDWARE tab the RECEIVER does not change to PPM. So I have to do that manually as you said. So you were completely right about what you said!

I did a video showing my setup for you and how my LIBREPILOT is configured. Could you please watch it? Sorry for my english, it's terrible I know, really sorry. I tried my best and recorded the video 3 times till I could understand what I was saying!

Link: https://goo.gl/photos/VJFg3xQGJWXn3msh9


I REPEAT: despite using Arduino UNO as FTDI to Arduino Mini, when I use PWM everything works fine, completely fine. Exactly the same setup, no wires changed. But when I move to PPM (as shown in the video I also changed HARDWARE TAB) keeping everything the same LIBREPILOT wont recognize the pulses anymore.
Title: Re: PPM with CC3D
Post by: f5soh on October 13, 2016, 07:25:27 pm
Double check your settings, i tested all PPM inputs (pin3, pin8 and PPM on FlexiPort) using the same code and a Nano board as you so i can say there is no bug in LibrePilot.

You first select the input you want to use in Hardware tab.
Connect the hardware like the wiki pages show, according to the PPM input you choose.
https://librepilot.atlassian.net/wiki/display/LPDOC/CC+Hardware+Configuration#CCHardwareConfiguration-ReceiverPort

Some posts before i recommend use the Pin8, please use this option.

When you do changes in Hardware you need to reboot the board, this means remove all power from it and reconnect again.

Next you should start the wizard and move controls when asked, at end you will get a Input tab fully configured.
When you change input type in RCInput you do not have changes in Hardware tab, that normal.
Simply because you can use mixed inputs, like one Sbus receiver connected to the board for vehicle control and additional PPM receiver for Gimbal control for example.

Edit: In your video you have ALL channels values set to 0: min/neutral/max...
If you don't use TxWizard you should set all values manually.
Manual calibration works only if activity and changes in values for min/max setup.


Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 08:26:20 pm
MAN YOU ARE A BOSS!!!!!!!!!! I SHOULD HAVE REBOOTED THE BOARD!!!!!

IT WORKED, THANK YOU , REALLY THAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANK YOU!!!!!!!

You were the only person who could help me, THANK YOU A TON!!!!!!!!!!!
Title: Re: PPM with CC3D
Post by: f5soh on October 13, 2016, 09:07:51 pm
Quote
You were the only person who could help me

:D

(https://forum.librepilot.org/index.php?action=dlattach;topic=2420.0;attach=4386)

SystemHealth tell you a reboot is needed after every HW change.
If you used the Vehicle wizard your board should be also working just fine with the automatic reboot.
Title: Re: PPM with CC3D
Post by: batata003 on October 13, 2016, 09:50:01 pm
The message you said does not appear to me @f5soh I am using version 15.09 of librepilot even after changing the PWM to PPM.

Anyway, after almost 4 days, at least 2 of full time googling and researching about PPM it finally worked. If you never had said to reboot I would keep trying this for weeks till get a solution.

You are very kind, I repeat this. You were the only person who didnt kick my ass and kept helping me even when I did stupid mistakes. Thank you, God bless you  :-*
Title: Re: PPM with CC3D
Post by: f5soh on October 13, 2016, 10:12:40 pm
SystemHealth behavior with the red [ ? ] alarm after HW changes and messages in Hardware tab are the same using 15.09

If you used the Vehicle Wizard your issue will be solved in a few minutes, that the preferred method when you want to setup a board quickly.

Title: Re: PPM with CC3D
Post by: batata003 on October 14, 2016, 04:08:03 am
Indeed Vehicle Wizard would have solved my problem in a blink of an eye, I wouldnt even see this problem I had!

Big thanks anyway, I learned a lot today.  ;)