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.
Tue Dec 31, 2024 3:52 am by tsenecal
» WW2 mini sub build
Sat Dec 21, 2024 11:49 am by SimonH
» Cheap Arduino Auto leveler
Sun Dec 15, 2024 7:44 am by geofrancis
» Microprocessor choices
Wed Dec 04, 2024 7:26 am by geofrancis
» Robbe Seawolf V2
Wed Dec 04, 2024 7:17 am by geofrancis
» Futaba -868/915mhz equipment
Tue Oct 29, 2024 4:46 pm by tsenecal
» RC Drift Gyro for pitch control
Sun Oct 20, 2024 2:04 pm by geofrancis
» sonar data link
Mon Oct 14, 2024 4:31 pm by geofrancis
» ExpressLRS - 868/915 Mhz equipment
Fri Oct 11, 2024 8:58 pm by Marylandradiosailor