Having spent some more time looking at the Spektrum SPM9246 satellite receiver and it’s output I’ve made some progress. When trying to use this with Paparazzi I’ve had very variable results and it fails to work.
Direct Binding Doesn’t Work 🙁
I’ve been unable to get the binding via the KroozSD board to work with the satellite and watching the output using pigpiod (as detailed Quad Update #4) the reason became clear as the simple series of pulses was never visible. I’m still a little unclear why, but after hooking up the RaspberryPi I managed to replicate the required pulse pattern and the satellite receiver went straight into bind mode. Binding to my Spektrum DX8 failed however – probably because the required responses weren’t sent as these would normally be provided by the AR8000. After the failed attempt the receiver was not receiving any information so I restarted the bind process using the AR8000 and all was well again.
As this makes sense and appears logical, I think it’s worth ignoring the possibility of binding my satellite receiver directly from a Paparazzi board.
DSMX
Every time I bind the receiver the transmitter reports it’s connection as DSMX and 22ms. Given the individual frames are sent every 11ms this means that there are 32 bytes sent per frame, which after removing the 2 byte headers leaves 28 bytes of channel data, or 14 channels available. Watching the data I often see the “split channels” where movements would be reflected across 2 channels for one control. As an example, when the channel data is split idle throttle appears as (output from spektrum_serial.py)
0 1 ---- ---- 354 0
Increasing the throttle position results in
0 1 ---- ---- 900 0
Increasing it further, results in
0 1 ---- ---- 0 500
Every time I see this behaviour the number of bits per channel is 10, whereas when the number of bits per channel is 11 I see a single value. From this I am assuming that DSMX always uses 2048 values and hence requires 11 bit data per channel. If the transmitter/receiver decide to transmit 10 bit data then 2 channels are required to transmit the required accuracy (2 10 bit numbers == 11 bit number) and hence the channels are split. While the throttle data is simple to understand, the other “stick” controls are a little more interesting. The figures below are for the pitch control, but similar results are seen for yaw and roll.
4 5 ---- ---- 1004 0
With the pitch fully forward
4 5 ---- ---- 320 0
And fully back
4 5 ---- ---- 0 657
AUX 1 is a simple toggle switch, but even that is shown across 2 channels.
8 9 8 9 ---- ---- switched from 0 to 1 ---- ---- 342 0 0 682
AUX 2 is a 3 way position switch, and the values are similarly recorded across 2 channels.
12 13 12 13 12 13 ---- ---- switched from 0 to 1 ---- ---- switched from 1 to 2 ---- ---- 0 682 0 0 342 0
AUX 3 is a rotary switch, so starting with it at the 7 o’clock position,
14 15 14 15 ---- ---- turning fully clockwise ---- ---- 0 682 342 26
These are just some values I grabbed today, but they do show the range of values that I have been seeing. Switching off the transmitter and then switching on again (while still observing data) sometimes results in the data being sent changing from 10 bit to 11 bit which then results in single values being reported (AUX 2 was at position 2 and AUX3 at fully clockwise position)
0 1 2 3 4 5 6 7 ---- ---- ---- ---- ---- ---- ---- ---- 354 998 1006 1006 342 1706 342 342
Changing to full throttle position, AUX 1 moving from 0 to 1 and AUX 2 moving to position 0 resulted in
0 1 2 3 4 5 6 7 ---- ---- ---- ---- ---- ---- ---- ---- 1698 998 1006 1006 1706 1706 1706 342
With AUX 2 in position 1 and AUX 3 at the 7 o’clock position,
0 1 2 3 4 5 6 7 ---- ---- ---- ---- ---- ---- ---- ---- 1698 998 1006 1006 1706 1706 1024 1706
The pitch value (channel 2) changes from 322 at fully forward to 1681 fully aft.
Going Forward
Every time I switch on my transmitter it starts off sending 10 bit data and so I have to deal with the split channels. Until I can reliably detect and convert that data into the single values that are needed I suspect it will never work reliably with paparazzi. The challenge is to convert this 10 bit data
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 354 0 998 0 1006 0 1006 0 342 0 0 682 0 682 939
into these 11 bit values
0 1 2 3 4 5 6 7 ---- ---- ---- ---- ---- ---- ---- ---- 354 1003 1004 1011 342 1706 1706 936
Transmitter Settings
The other option I have is to change the transmitter setting for the frame rate to force 11ms updates. Hopefully this will cause the data to be always sent as 11 bit and hence the problem will no longer be an issue. I’ll try this soon and see what happens.
UPDATE – I tried using the 11ms and DSM2 option under the Frame Rate settings menu and from what I observed neither makes much difference and the behaviour doesn’t change, so I have reverted back to the default settings.
spektrum_serial.py
The small python script I have written to allow me to watch the output from the satellite receiver is now available on github. As usual, any comments, suggestions welcome to improve it.