In the end I decided to go with the PCA9685 16 channel PWM module in the Rx as simpler than having to convert to S-bus. The main issue as already noted by others is the frequency accuracy. However since there are spare outputs (even when using the outputs as ON/OFF) I set a calibrate output to 50% sqaurewave, fed that back to the Arduino and measured the actual frequency. This was then use to correct that nominal 50Hz set via the I2C bus. Seems to work, and has a trap if the measured frequency is too far away from 50Hz.
I still had to caibrate each servo, the two G9 used as test seem to go from 0.58mSec to 2.5mSec @ 50Hz, but these values are added as data definitions, and used to map the message values 0 to 255 to these time values.
I am finding that 3x AA bateries are not enough to power even these 2 servos when lots of test waggling is tried the voltage drops and resets the Arduino.
I've also added a small rotary DIP switch to define the RF channel; with a hex switch (0 to F) I map to channels 3, 5, 7, ... 33 so I keep away from the band edges as I think it uses about 3 RF channels due to still using LoRa. Interstingly when set to 'adjacent' numbers (e.g. RF channels 3 & 5) there is nothing received at the Rx unit, but it would be more interesting to have 2 pairs and the same test.
Using the ADC module and the resitive joysticks and a message format of 8 bits per servo seems to result in a stable servo postion, though only 256 positions spread over the 180deg travel. There is the occasional 'ZZZ' from the servos and a barely perceptible mechanical twitch but I'm not sure if thats noise pick up at the analogue joystick inputs (no filtering at the moment, but I am going from 12-bit to 8-bit so that shouldn't be a problem) or just the servo dreamingi in its sleep or a function of the PWM module. Don't think its message corruption or the CRC would flag an error.
I havent done any range checks, too cold out, and I'm building a module based in the MCP23017 16 bit I/O expander to provide the digital channel inputs. It will also I hope provide a digital trim function as another advantage of using the commercial Tx is the mechanical trim available on the joystick controls. I intend to use a digital input to increment/decrement from the joystick value as a digital trim.
I've also got a small I2C OLED display for displaying the RSSI signal strength, SNR and other lovely data from the RF module as well as the returned Rx status but thats a bit further away, but would be useful for range tests.
When I get round to it I'll put my code on github for interest.
Yesterday at 9:21 pm by geofrancis
» 868/915 Mhz as a viable frequency for submarines.
Sun Sep 08, 2024 10:55 pm by geofrancis
» WW2 mini sub build
Thu Sep 05, 2024 8:15 am by david f
» Trumpeter 1/144 PLAN Type 092 Xia Class SSBN
Tue Aug 06, 2024 5:42 am by redboat219
» UHF radio control for submarines (openLRS, LoRa, FSK etc. on 458Mhz and 433Mhz )
Sat Jul 27, 2024 9:05 am by david f
» David Forrest's R class
Fri Jul 19, 2024 1:00 pm by david f
» Futaba -868/915mhz equipment
Sun Jun 09, 2024 10:47 pm by tsenecal
» Darnell type 21 submarine, need some help
Sun Jun 09, 2024 9:35 am by Deep Diver (Fred)
» bladder bags
Tue May 28, 2024 8:30 am by Deep Diver (Fred)