Simchair MKIII I2C latest software on GitHub
Simchair MKIII uses the I2C bus for communication between the master controller and peripherals. That means that every controls piece contains a separate Arduino inside. Why is that necessary?
- we can use device-specific configuration: a lot of nice features are already there
- we can use external I2C ADCs that provide MUCH more precision
- we can have more than six analog axes and all the buttons we need
- we can use filtering when it is necessary without slowing the master controller down
- we can extend our controller’s ports more than we’ll ever need
- unified interface for everything, buttons or axes
- Leo board allows us to use a nice Joystick library by MHeironimus, which simplifies things like ten times; no more pain with USB descriptors
- easy flashing; need to change sensitivity setting for an aircraft? turn the AP on and flash the controller in flight!
Arduino Pro mini is used for all peripherals. It doesn’t have a USB port on it, so you will need a USB- UART converter to flash them. Why use a board with no USB? They are small and cheap, and the converter costs literally nothing. I use a PL2303 based converter:
You can opt for using another Arduino board, like nano, everywhere except the B8 stick grip at the moment. Basically, all you need to do is flash all the boards with their corresponding software and wire everything as written in manuals of the peripherals. Note that the master controller software is frequently updated, so remember to check GitHub for updates. Software for peripherals is only updated when there are some severe bugs in it, or some major upgrade is needed to adopt new functionality (I understand no one wants to disassemble stuff to upgrade it). With this in mind, you will only need to change something in peripherals’ software if you wired stuff differently.
At the moment, master controller sketch uses two libraries:
You will need to install them to your IDE to compile the software.
All adjustments are made in the master controller sketch in the <CONFIGURATION> section. Let us look at it.
#define B8_POT_MODE “HAT_SW” // HAT_SW or ANALOG
#define SENS_ADJ_METHOD “LINEAR”
#define ADS1115_RESOLUTION 15 //bits, min 12, max 15
// use a button on cyclic to switch sensitivity in flight.
// this kind of functionality is not available in a real aircraft, however
// it may somewhat resemble simulated force trim.
#define SENS_DEVICE “b8_stick”
#define SENS_SWITCH_ENABLED 1
#define SENS_SWITCH_BUTTON 0 //0 is the first button
// sens. switch behavior available options: “FORCE_TRIM” or “TOGGLE”
// FORCE_TRIM will reduce sensitivity to CYCLIC_SENS and RUDDER_SENS
// while SENSITIVITY_SWITCH_BUTTON is pressed, “TOGGLE” will act
// as a regular switch
#define SENS_SWITCH_MODE “TOGGLE”
// if SENS_SWITCH is disabled, these values will be used;
// set to 100 for full axis range
#define CUSTOM_CYCLIC_SENS 80
#define CUSTOM_RUDDER_SENS 80
#define XY_FILTERING_ENABLED 0
#define RUDDER_FILTERING_ENABLED 0
#define PTT_KEYBOARD_PRESS 0 // set to 1 to enable keyboard combination press instead of a joystick button
#define PTT_BUTTON 4 //1st button is 0, 4 should be PTT trigger position
// this should press CTRL + Q
#define PTT_KEYBOARD_KEY ‘q’
char PTT_KEYBOARD_KEY_MOD = KEY_LEFT_CTRL;
Now lets see what every option is for.
B8_POT_MODE – can be “HAT_SW” or “ANALOG” – hat switch (default) or 2 8-bit axes on the thumbstick.
SENS_ADJ_METHOD “LINEAR” – sensitivity adjustment method, linear is the only option for now.
ADS1115_RESOLUTION – choose to your liking from 12 to 15 bits. Larger values may introduce a bit of jitter; it wouldn’t affect the controls most likely though.
SENS_DEVICE – which device to use for sensitivity switching.
SENS_SWITCH_ENABLED – enable or disable sensitivity switching. If disabled, CUSTOM_SENS values will be used.
SENS_SWITCH_BUTTON – which button to use as a SENS_SWITCH, starting from 0.
SENS_SWITCH_MODE – “FORCE_TRIM” or “TOGGLE”. FORCE_TRIM mode will increase the resolution while holding the force trim button on the stick (it will be removed from the joystick). This allows emulating pilot actions when hovering with force trim on. TOGGLE mode will simply switch between sensitivity settings on button press.
CUSTOM_(CYCLIC/RUDDER)_SENS – map full ADC range to a reduced number of axis points. Will increase precision, but limit an axis travel with the given value. It depends on the stick length and how the sim handles sensitivity settings. 80 is a good place to start.
(XY/RUDDER)_FILTERING_ENABLED – enable or disable filtering. The default setting is off, turn it on if you feel jitter in your controls affects flying. Will introduce a slight input lag. Try reducing ADS1115_RESOLUTION at first.
PTT_KEYBOARD_PRESS – have the PTT button send a keyboard combination instead of a joystick button press. Useful if you need, e.g., Teamspeak for your comms.
PTT_BUTTON – which button is the PTT switch, a default for the B8 stick is 4
PTT_KEYBOARD_KEY – which key to send, the default is ‘q’.
PTT_KEYBOARD_KEY_MOD – which modifier key to use with PTT keyboard key, the default is ‘Ctrl’.
Simchair MKIII I2C latest software on GitHub