dlktdr / HeadTracker

This project is built to record the orientation a FPV headset to allow the camera on your RC to follow your head movements.
GNU General Public License v3.0
378 stars 90 forks source link

PPM input not working #99

Closed kesheshyan closed 1 year ago

kesheshyan commented 2 years ago

Hey, I was trying to read the PPM input as described in the documentation but it never worked.

I've tried different Arduinos, with and without voltage dividers - no success. As input I used 100% correct PPM signal from my servo tester device that I know for sure works.

I went ahead and flashed a board with Aduino code I wrote that just reads PPM signal without changing anything in terms of wiring and it worked immediately, so I assume the problem is related to PPM-decoder code.

dlktdr commented 2 years ago

What is generating the PPM stream? Edit.. nm.. There is an issue if the Frame Sync pulse is shorter than 4ms it won't pick it up. I have corrected the issue but a new firmware hasn't been posted yet. It's been dropped to 3ms

Fix was here, https://github.com/dlktdr/HeadTracker/commit/9a5ae4b8cdb369a1443a0da36344dd4af29438f7

Here is a pre-compiled one you can try. BLE v2.12.zip

kesheshyan commented 2 years ago

Thanks a lot! Will try!

dlktdr commented 2 years ago

Did this solve your problem?

ldalba commented 1 year ago

I have the same problem, no ppm input signal. I'm using the firmware 2.13v. Did you solve the problem?

dlktdr commented 1 year ago

You wouldn't happen to have an oscilloscope you can post a photo of the PPM stream your sending into it would you?

ldalba commented 1 year ago

You wouldn't happen to have an oscilloscope you can post a photo of the PPM stream your sending into it would you?

I don't have an oscilloscope. I can read the PPM signal with the function "measure signal - PPM" of the device ToolkitRC M9 For the wirings on the Arduino NANO 33 BLE, "PPM" is on D9 and "GND" on GND, as in the instructions. By the software side (HeadTracker), on the channel viewer: NO PPM INPUT channels detected IMG_1377-min

dlktdr commented 1 year ago

Did you choose the PPM pin in the GUI as well? Probably should have a * and note beside the images in the docs, as you can pick some of them at will, this one defaults to "Disabled"

image

ldalba commented 1 year ago

Did you choose the PPM pin in the GUI as well? Probably should have a * and note beside the images in the docs, as you can pick some of them at will, this one defaults to "Disabled"

image

Of course. It was the first thing I did

dlktdr commented 1 year ago

Just checking :) Without seeing what the PPM frame looks like I'm just guessing here but maybe the Frame Sync Pulse is really short on whatever is generating it.

I've reduced the minimum sync time to 2ms here and the min channel count to 2. https://github.com/dlktdr/HeadTracker/commit/14d0b3a855721b02cc3907ac4937d2f2481a3be1

Try this, it should be compiling some output you can test to see if it works. Maybe take a look in the serial monitor as well to see if you get the PPM signal detected at all when attached.

Github Actions should be compiling the test firmware here, https://github.com/dlktdr/HeadTracker/actions/runs/5040070851

Be sure to use a 2.2Gui as well. Can read how to get a development GUI about actions here if your unsure, https://headtracker.gitbook.io/head-tracker/support/development/git-workflow-and-actions

or can download the 2.2pre-release to get a 2.2gui too, https://drive.google.com/file/d/1DVPoDp4ZXhoI9SxvCinXkAfCYj1iWv1L/view?usp=share_link

ldalba commented 1 year ago

Just checking :) Without seeing what the PPM frame looks like I'm just guessing here but maybe the Frame Sync Pulse is really short on whatever is generating it.

I've reduced the minimum sync time to 2ms here and the min channel count to 2. 14d0b3a

Try this, it should be compiling some output you can test to see if it works. Maybe take a look in the serial monitor as well to see if you get the PPM signal detected at all when attached.

Github Actions should be compiling the test firmware here, https://github.com/dlktdr/HeadTracker/actions/runs/5040070851

Be sure to use a 2.2Gui as well. Can read how to get a development GUI about actions here if your unsure, https://headtracker.gitbook.io/head-tracker/support/development/git-workflow-and-actions

or can download the 2.2pre-release to get a 2.2gui too, https://drive.google.com/file/d/1DVPoDp4ZXhoI9SxvCinXkAfCYj1iWv1L/view?usp=share_link

It works fine just using the 2.2 pre-release! thank you. Now I can use my joystick logitech extreme 3d (ppm signal output with an arduino uno programmed) to drive the ariplane and also the headtracker for fpv.

dlktdr commented 1 year ago

Awesome. 🎉 That sounds like a cool project, do you have a link to the code for the joystick part somewhere. I know some users on discord were looking for the same thing. Should come join us and post some photos in #flightstick too. https://discord.com/channels/827622724565467196/856339077115543562 😄

Just to clarify, you used the firmware that came with 2.2-pre-release? That one works too? I don't need to worry about including this timing change? 14d0b3a

ldalba commented 1 year ago

Awesome. 🎉 That sounds like a cool project, do you have a link to the code for the joystick part somewhere. I know some users on discord were looking for the same thing. Should come join us and post some photos in #flightstick too. https://discord.com/channels/827622724565467196/856339077115543562 😄

Just to clarify, you used the firmware that came with 2.2-pre-release? That one works too? I don't need to worry about including this timing change? 14d0b3a

you can take a look on this projects, were you can download the code: https://github.com/acicuecalo/Arduino_Logitech_3D_Joystick_to_PPM https://robotsimpresion3d.wordpress.com/?s=ppm . Here you can also download the 3d file to build the case for the Arduino Uno board.

Take a look also at these projects: https://github.com/lexfp/le3dpToPPM https://github.com/makerprojects/USB2PPM_by_Arduino https://github.com/DroneMesh/USB_PPM

I just used the firmware that came in the release I downloaded by this link: https://drive.google.com/file/d/1DVPoDp4ZXhoI9SxvCinXkAfCYj1iWv1L/view?usp=share_link

Let me know if you need more specific informations

dlktdr commented 1 year ago

Awesome, Thanks.