iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.09k stars 1.46k forks source link

Matek F405-WING RSSI CHANNEL- UNABLE TO COMMUNICATE #3877

Closed PanayiotaCy closed 5 years ago

PanayiotaCy commented 6 years ago

For immediate help, just ask your question on one of the following platforms:

You can also read public documentations or watch video tutorials:

PanayiotaCy commented 6 years ago

Hello everybody!

I am struggling to make Matek F405-wing FC read a PWM signal that I feed in its RSSI pin, but I haven't had any luck yet. I have generated a PWM signal (of 490 Hz) with teensy, which can have 1.2 ms pulse width or 1.8 ms pulse width ( I confirmed it with an oscilloscope), however I cannot make Matek's RSSI pin to read it. The steps I have followed are: 1) I selected ch18 as RSSI in inav configuration and disabled the ADC analog RSSI 2) In CLI I entered the command: feature RX_PARALLEL_PWM, I got the enable response and then read the feature and confirmed that the RX_PARALLEL_PWM was included. However, after saving and rebooting, the RX_PARALLEL_PWM was not any more in the features.

I would really appreciate any help on how to read this PWM signal on RSSI pin with inav, or, alternatively, any guidelines on how to read a PWM input on any free port of Matek.

Thank you in advance!

rb1205 commented 6 years ago

RX_PARALLEL_PWM works only if you're not using a serial RX provider. That is, it works only if you have one separate wire for each channel going from your RX to your FC. This kind of setup is outdated and hard to come by nowadays and, considering that your FC keeps disabling it, it probably mean that it's not what you're using.

If that's the case, then a simple RC filter can turn your PWM signal to a voltage signal that you can feed to the ADC RSSI input.

PanayiotaCy commented 6 years ago

Thank you rb1205,

I managed to read an analog signal from the RSSI input, however it does not solve my problem. I am trying to trigger the RTH using an external pulse. Since the PWM input is not available on this FC i can use the analog RSSI but i would like to trigger the RTH using the RSSI input. In the modes menu of INAV at RTH i am only capable of selecting a Channel from Ch5 to Ch18. There is no RSSI or other ADC input option. Is there a way to do this?

If not, is there a way to map the Analog RSSI value to one of the available Channels? For example, to assign a spare channel to linearly map the analog voltage range to its PWM range (1-2ms) instead of using the default SBUS input. The rest of the channels should remain on SBUS.

rb1205 commented 6 years ago

If you're using SBUS or any other serial RX provider then no, there's no way to mix PWM channels in.

Besides, using RSSI as an actual AUX channel to trigger RTH would be far from ideal. You wouldn't have all the checks and safeties you usually get with a proper failsafe RTH, like a cooldown period and stick disable. Given the fluttering nature of RSSI, you'd probably have an hard time controlling your craft when you're approaching the set RSSI limit.

So, my advice is to stick with the normal failsafe and just use the RSSI signal for telemetry information like it is itended to. You can set an alarm on the radio/osd and manually trigger RTH if the need arises.

PanayiotaCy commented 6 years ago

Thanks for your answer. I think you did not fully understand my second question. I am not trying to use the actual RSSI signal to trigger RTH. I have a signal coming from an external circuitry which is robust and i designed it to output 2 separate values PWM values. I then followed your suggestion to convert the PWM signal to Analog using the RC filter. Now i can read this signal in INAV RSSI and it reads 2 discrete values (20% and 80%). Now i want to trigger RTH using these discrete values or a short range around them to be more secure. I believe that the problem now is software dependent. If INAV could take the RSSI value coming in from the relevant ADC channel then the RTH should be triggered as desired.

rb1205 commented 6 years ago

I see now. Well, since you already have external circuitry why don't use a BJT to short the SBUS signal to the ground, thus forcing the FC to failsafe and initiate a RTH?

stale[bot] commented 5 years ago

This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.

stale[bot] commented 5 years ago

Automatically closing as inactive.