QGC radio channel monitor

Ground Stations and utilities for Windows, Linux, Android, & others

QGC radio channel monitor

Postby aBUGSworstnightmare » Tue Nov 17, 2015 11:36 am

Hey guys,

is there any way to display 18 channels in the QGC radio channel monitor? I'm currently working on implementing Spektrum X-Plus channels (channel 10 to 18) but only 16 channels were displayed.
radio monitor.jpg
radio monitor.jpg (58.66 KiB) Viewed 3243 times


Maximum no of radio channels on the AQ platform is (per my understanding as well as per radio.h) 18 (RADIO_MAX_CHANNELS)!
Code: Select all
#ifndef _radio_h
#define _radio_h

#include "serial.h"
#include "digital.h"
#include "util.h"

#define RADIO_STACK_SIZE        120
#define RADIO_PRIORITY          25

#define RADIO_NUM               3       // max number of RC radios
#define RADIO_MAX_CHANNELS      18
...
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: QGC radio channel monitor

Postby Max » Tue Nov 17, 2015 12:48 pm

Hi Joerg,

The issue is that the mavlink radio status message can only send 8 channels at a time. Right now AQ only sends 2 messages, so only ch 1-16. So for channels 17 and 18 you need a 3rd message with just those two channels. You can look in aq_mavlink.c ~ line 182 where it sends the radio channels and probably figure out how to add the other 2 channels... or let me know which fw version you're working with and I can paste some code here. The QGC widget should display however many channels are being sent by the FC.

-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: QGC radio channel monitor

Postby aBUGSworstnightmare » Tue Nov 17, 2015 1:45 pm

Max wrote:Hi Joerg,

The issue is that the mavlink radio status message can only send 8 channels at a time. Right now AQ only sends 2 messages, so only ch 1-16. So for channels 17 and 18 you need a 3rd message with just those two channels. You can look in aq_mavlink.c ~ line 182 where it sends the radio channels and probably figure out how to add the other 2 channels... or let me know which fw version you're working with and I can paste some code here. The QGC widget should display however many channels are being sent by the FC.

-Max


Hi Max,

... well ... never worked with mavlink so would need some time to figure it out how to do it.

My first guess is changing it to:
Code: Select all
// rc channels and pwm outputs (would be nice to separate these)
    if (streamAll || (mavlinkData.streams[MAV_DATA_STREAM_RC_CHANNELS].enable && mavlinkData.streams[MAV_DATA_STREAM_RC_CHANNELS].next < micros)) {
   if (!mavlinkData.indexPort++) {
       mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_0, micros, 0, RADIO_THROT+1024, RADIO_ROLL+1024, RADIO_PITCH+1024, RADIO_RUDD+1024,
          RADIO_GEAR+1024, RADIO_FLAPS+1024, RADIO_AUX2+1024, RADIO_AUX3+1024, RADIO_QUALITY);
       mavlink_msg_servo_output_raw_send(MAVLINK_COMM_0, micros, 0, motorsData.value[0], motorsData.value[1], motorsData.value[2], motorsData.value[3],
          motorsData.value[4], motorsData.value[5], motorsData.value[6], motorsData.value[7]);
   } else {
       mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_0, micros, 1, RADIO_AUX4+1024, RADIO_AUX5+1024, RADIO_AUX6+1024, RADIO_AUX7+1024,
          radioData.channels[12]+1024, radioData.channels[13]+1024, radioData.channels[14]+1024, radioData.channels[15]+1024, RADIO_QUALITY);
       mavlink_msg_servo_output_raw_send(MAVLINK_COMM_0, micros, 1, motorsData.value[8], motorsData.value[9], motorsData.value[10], motorsData.value[11],
          motorsData.value[12], motorsData.value[13], motorsData.value[14], motorsData.value[15]);

            // added for displaying channels 16 and 17
            mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_0, micros, 2, radioData.channels[16]+1024, radioData.channels[17]+1024);
       mavlink_msg_servo_output_raw_send(MAVLINK_COMM_0, micros, 2, motorsData.value[16], motorsData.value[17]);
       mavlinkData.indexPort = 0;
   }
   mavlinkData.streams[MAV_DATA_STREAM_RC_CHANNELS].next = micros + mavlinkData.streams[MAV_DATA_STREAM_RC_CHANNELS].interval / 2;
    }

but don't know if my assumption is right.
The aq_mavlink.c that I'm using is attached.

By the way: X-Plus decoding is working already for DSMX (verified on AR9020, AR10000 and AR7700); need to add Cypress support and test if DSM2 makes any sense.

Rads
Joerg
Attachments
aq_mavlink.c
(39.2 KiB) Downloaded 155 times
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: QGC radio channel monitor

Postby Max » Tue Nov 17, 2015 2:14 pm

Here you go, your aq_mavlink version modified to send the two extra channels.

-Max
Attachments
aq_mavlink.c
(39.44 KiB) Downloaded 315 times
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: QGC radio channel monitor

Postby aBUGSworstnightmare » Tue Nov 17, 2015 6:32 pm

Max wrote:Here you go, your aq_mavlink version modified to send the two extra channels.

-Max


Hi Max,

tested this change but this seems to be wrong!
Still only 16 barographs for the channels but now the numbering is wrong too.
channel monitor.jpg
channel monitor.jpg (56.45 KiB) Viewed 3211 times


Any idea?

EDIT: After changing back to the old file the numbering was correct again.
By the way: This screenshot shows AQ M4r6 with X-Plus channels enabled 8-)
cypress with xplus.jpg
X-Plus with Cypress from M4r6

SPM_0030.jpg
Channels 1 to 10 on DX10t - bound to M4r6 onboard RX
SPM_0030.jpg (14.86 KiB) Viewed 3199 times

SPM_0031.jpg
X-Plus channels - refer to screenshot (channel monitor) to verify values; channels 17 and 18 still missing from QGC.
SPM_0031.jpg (13.84 KiB) Viewed 3199 times

Don't get fooled by the values displayed in QGC for the X-Plus channels! X-Plus channel data is 9 bits resolution (512 step) only; mid at 256. On my DX10t the value range at +/-150% (max trim added) is 0 to 511; with no trim value range is 85 (low) - 256 (mid) - 426 (high). I've interpolated the range (means multiplied by two) in my current code revision for larger swing.
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: QGC radio channel monitor

Postby Max » Tue Nov 17, 2015 9:07 pm

Well it shows channels 17 and 18, what's the problem? :)

Sorry, try this one. The first version skipped sending channels 8-16.

-Max
Attachments
aq_mavlink.c
(39.5 KiB) Downloaded 146 times
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: QGC radio channel monitor

Postby aBUGSworstnightmare » Wed Nov 18, 2015 7:27 am

Max wrote:Well it shows channels 17 and 18, what's the problem? :)

Sorry, try this one. The first version skipped sending channels 8-16.

-Max


AFFIRMITIV!
channel monitor.jpg
Autoquad M4r6 with full 18 channel support
channel monitor.jpg (70.86 KiB) Viewed 3173 times


I will make some final testing later one, write up some details and publish the sources (and some precompiled firmware versions).
Somebody with a DX18/DX18t and others with DX10t should test this.

It is confirmed working on my end with Spektrum sat bound to AR9020/AR10000, AR7700 (FC connected to Remote RX output; also works if using the sat/AR7700 only after binding) and with the Cypress on the M4r6.

@Max: Did you make any further changes to your 1858 build (http://autoquad.org/wiki/wiki/whats-new ... e-changes/)? Can you send me a link where to find the sources? Would like to add Angels/my latest additions to that rev for testing (i.e. if Spektrum code works with new control scheme).

Joerg
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: QGC radio channel monitor

Postby brat002 » Wed Nov 18, 2015 9:21 am

How about merge this in master branch? :)
brat002
 
Posts: 191
Joined: Tue Apr 21, 2015 10:35 pm

Re: QGC radio channel monitor

Postby aBUGSworstnightmare » Wed Nov 18, 2015 2:28 pm

brat002 wrote:How about merge this in master branch? :)


Well, first this needs to be tested!

Sources/more details are here viewtopic.php?f=31&t=4690&p=35387#p35387
aBUGSworstnightmare
 
Posts: 1460
Joined: Fri Jun 22, 2012 5:24 pm

Re: QGC radio channel monitor

Postby Max » Thu Nov 19, 2015 12:29 am

aBUGSworstnightmare wrote:@Max: Did you make any further changes to your 1858 build (http://autoquad.org/wiki/wiki/whats-new ... e-changes/)? Can you send me a link where to find the sources?

https://github.com/mpaperno/aq_flight_c ... its/master

Also I'm uploading an updated (ALPHA test) version of QGC which supports setup of the new controls scheme, among other things (changelist).

qgroundcontrol_aq-Win32-1.7.A1.zip

-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA


Return to AQ Software

Who is online

Users browsing this forum: No registered users and 3 guests

cron