Sokol1_br Posted January 22, 2020 Posted January 22, 2020 (edited) FreeJoy joystick controller firmware, by WG_Magners - similar to MMjoy2 and EasyJoy32One. Hardware required: ARM STM32, example ~$2 STM32F103C876. FreeJoy firmware supports following features: Up to 8 analog axes (12 bit resolution - 4096 points) Up to 128 buttons (Wired though Matrix or Shift Register) Incremental encoders TLE5010/5011 sensors (digital bus instead analog like potentiometer and conventioal Hall sensor) Shift Registers 74HC165 and CD4021 Axes to buttons (12 buttons per axis) 4 POV hats Push buttons, toggle switches, inverted buttons, etc. All this options can be configured by user-friendly configurator tool - FreeJoy Configurator: Note: FreeJoy Configurator require MS NET Framework 4.5.1 installed. Instructions on how use FreeJoy Configurator: https://github.com/vostrenkov/FreeJoyConfigurator/wiki For flashing firmware to ARF STM32 device an ST-LINK v2 programmer is required (or USB-UART converter). Example. Instructions how to flash firmware to the device can be found on Github wiki page. https://github.com/vostrenkov/FreeJo...ickstart-guide Source code can be found on Github: https://github.com/vostrenkov/FreeJoy/wiki FreeJoy firmware: https://github.com/vostrenkov/FreeJoy FreeJoy Configurator tool: https://github.com/vostrenkov/FreeJoyConfigurator Links to the latest releases: https://github.com/vostrenkov/FreeJoy/releases https://github.com/vostrenkov/FreeJoyConfigurator/releases FreeJoy is free use under GPL3.0 license, can use it in your commercial projects for free, keeping the code open. Autor: WG_Magners =================================================================================================================== Topics in il2sturmovik forums: English: https://forum.il2sturmovik.com/topic/57900-freejoy-opensource-joystick-controller-on-stm32/ Russian: https://forum.il2sturmovik.ru/topic/12818-freejoy-opensource-joystick-controller-on-stm32/ Edited January 24, 2020 by Sokol1_br 1
rel4y Posted January 24, 2020 Posted January 24, 2020 I have played around with this piece of Software since October (https://forums.eagle.ru/showpost.php?p=4065934&postcount=6) and it has come a long way since. Such great work by vostrenkov! What it really needs is an external ADC like the MCP320x (because the internal ADCs are sadly not very good) and adjustable VIP/ PID. I hope the developer can add these features in the future! :) Cougar, CH and Saitek PnP hall sensor kits + shift registers: https://forums.eagle.ru/showthread.php?t=220916 Shapeways store for DIY flight simming equipment and repair: https://www.shapeways.com/shops/rel4y-diy-joystick-flight-simming
Sokol1_br Posted January 24, 2020 Author Posted January 24, 2020 (edited) But, since ARM32 STMF103xxx ADC is 12 bits what advantage in use external MCP32x ADC, too 12 bits? The only downsize is the 3.3v what limit the contacless sensor options a bit. In Reddit an guy inform that some Chinese STM32Fxxx has issues for work in USB, is the model in what the reset button is round and have a metallic octogonal base. The model with retangular plastic reset button is OK. Edited January 24, 2020 by Sokol1_br
rel4y Posted January 25, 2020 Posted January 25, 2020 (edited) No no, I know of the too high USB data pullup resistor on the blue pill boards. I have soldered a 1,8k resistor in parallel over the usb input R10 and it works no problem. Not all USB sockets will cause problems with the bad pullup anyway. The nominal resolution of an ADC is not the only metric you need to look at. There is also sample rate & SNR of the ADCs. Said bluntly, the two internal ADCs are really cheap. There is so much noise, that your effective resolution will be more like 8-9 Bit. If you have your axis in idle at an ideally steady voltage output, the digital read out of the ADC will still fluctuate quite a lot. Let's be optimistic and say you can't differentiate +-1 digits of your nominal value because of ADC noise. That means of your nominal 12 Bit resolution (4096 points), you can effectively only differentiate ~1365 absolute points. This means you have an effective resolution of only about 10,4 Bit. One solution is digitally averaging the input while sacrificing output sample rate. Edited January 25, 2020 by rel4y Cougar, CH and Saitek PnP hall sensor kits + shift registers: https://forums.eagle.ru/showthread.php?t=220916 Shapeways store for DIY flight simming equipment and repair: https://www.shapeways.com/shops/rel4y-diy-joystick-flight-simming
slowmover Posted February 5, 2020 Posted February 5, 2020 How many rotary encoders can i connect? [sIGPIC][/sIGPIC]
Sokol1_br Posted February 5, 2020 Author Posted February 5, 2020 I don't know, but author post (in English) in this forum: https://forum.il2sturmovik.com/topic/57900-freejoy-opensource-joystick-controller-on-stm32/?do=reportComment&comment=890862 New firmware with new functions was released.
WG_Magners Posted February 24, 2020 Posted February 24, 2020 (edited) Didnt know about this thread =) Now FreeJoy project is moved to orgranisation page: https://github.com/FreeJoy-Team I released new version v1.3.4 yesterday, main features are dynamic HID config and PID changing option. Please check for more information at release page. Edited February 24, 2020 by WG_Magners
rel4y Posted February 24, 2020 Posted February 24, 2020 Amazing work! Thank you very much and please keep development active. :) Cougar, CH and Saitek PnP hall sensor kits + shift registers: https://forums.eagle.ru/showthread.php?t=220916 Shapeways store for DIY flight simming equipment and repair: https://www.shapeways.com/shops/rel4y-diy-joystick-flight-simming
Sokol1_br Posted February 24, 2020 Author Posted February 24, 2020 The nominal resolution of an ADC is not the only metric you need to look at. There is also sample rate & SNR of the ADCs. Said bluntly, the two internal ADCs are really cheap. There is so much noise, that your effective resolution will be more like 8-9 Bit. Rel4y, About your ADC question: https://forum.il2sturmovik.com/topic/57900-freejoy-opensource-joystick-controller-on-stm32/?do=findComment&comment=898408
rel4y Posted February 24, 2020 Posted February 24, 2020 (edited) Rel4y, About your ADC question: https://forum.il2sturmovik.com/topic/57900-freejoy-opensource-joystick-controller-on-stm32/?do=findComment&comment=898408 First of all, I am by no means an expert on ADCs. Magners has a point in saying that mostly the bad board layout is to blame. I just checked the STM32F103 ADC specs and they look decent. The STM32f103 just like the ATmega32u4 has +-2 LSB max error and a bit higher nonlinearity error. The main problem is the horrible blue pill voltage supply, the 3.3V reg is absolute crap. I will try to circumvent/ replace it. Another problem is that analog and digital supply/ ground are not seperated properly. In terms of digital filtering, thats what I referred to earlier. That certainly helps, but you are sacrificing sample rate. Looking at the transients posted in the IL-2 forums, you may get away with "medium" filtering at 80 ms, but "high" at 200 ms is already too much for my taste. It results in noticable input lag. Edited February 24, 2020 by rel4y Cougar, CH and Saitek PnP hall sensor kits + shift registers: https://forums.eagle.ru/showthread.php?t=220916 Shapeways store for DIY flight simming equipment and repair: https://www.shapeways.com/shops/rel4y-diy-joystick-flight-simming
WG_Magners Posted February 24, 2020 Posted February 24, 2020 First of all, I am by no means an expert on ADCs. Magners has a point in saying that mostly the bad board layout is to blame. I just checked the STM32F103 ADC specs and they look decent. The STM32f103 just like the ATmega32u4 has +-2 LSB max error and a bit higher nonlinearity error. The main problem is the horrible blue pill voltage supply, the 3.3V reg is absolute crap. I will try to circumvent/ replace it. Another problem is that analog and digital supply/ ground are not seperated properly. In terms of digital filtering, thats what I referred to earlier. That certainly helps, but you are sacrificing sample rate. Looking at the transients posted in the IL-2 forums, you may get away with "medium" filtering at 80 ms, but "high" at 200 ms is already too much for my taste. It results in noticable input lag. In case of good PCB layout there is a very small chance you will need filtering level more than LOW. My observations is that HIGH level completely remove bouncing of cheap chinese potentiometers connected to bluepill board, but yes - you can feel the input lag a little. Input lag at MEDIUM level is nearly unnoticable. Keep in mind that transient response test show you 0.2s lag for immediate fullscale change at input - in real cases it is much softer. Best advice I can give you - just try it :) Now I am working at v1.3.5, it will contain 7 levels of filtration and dynamic deadband. I already implemented test version of it and it works pretty well. I also ordered MCP320x parts from China to make comparison with internal ADCs and maybe add their support to the firmware. But shipping may take a long time for some reasons...
WG_Magners Posted March 6, 2020 Posted March 6, 2020 Release v1.4.1 Configurator Firmware Changes: Added dynamic deadband Added sequential buttons (several logic buttons mapped to same physical and pressed sequentially) Influence of microcontroller periphery to ADC conversion reduced (especially if TLE sensors are used) Improved timings for shift registers More flexible filters (7 levels of filtration) Angle setting for axis offset (step 15 degrees) 3 PWM pins for LED lightning Up to 24 LEDs mappable to logical buttons states Optimization for small wide displays Device name is set to config name while saving by default Indication of pins/buttons config errors This version should improve ADC results (especially if TLE sensors are used in configuration). Dynamic deadband detects movements of axis and holds axis output if no movement is detected. Hold threshold is configurable. 3 PWM channels allow you to make configurable RGB lightning. Connection LEDs through transistors is recommended for lightning.
rel4y Posted April 20, 2020 Posted April 20, 2020 Amazing work on your latest release! Thank you for supporting several external ADCs and all these other great features! FreeJoy is now basically the new DIY community standard. You rock! :thumbup: Cougar, CH and Saitek PnP hall sensor kits + shift registers: https://forums.eagle.ru/showthread.php?t=220916 Shapeways store for DIY flight simming equipment and repair: https://www.shapeways.com/shops/rel4y-diy-joystick-flight-simming
Sokol1_br Posted April 21, 2020 Author Posted April 21, 2020 Some highlights of latest Release v1.5.1b3. Support for external ADC, for AS5600 (programmable working angle) and MLX90333 (SPI mode) contactless sensor Full list of features: 8 analog inputs (12 bit output resolution) axis configuration options: calibration (manual or auto), filtering, offset, deadband (center or dynamic), curve shapes axis to buttons function (up to 12 buttons per axis) buttons/encoders to axis functions 128 digital inputs (buttons, toggle switches, hat povs, encoders) digital inputs configuration options: normal/inverted button, 3 types of toggle switches, radiobutton sequential button 5 shift modificators 4 hat povs 16 incremental encoders shift registers 74HC165 and CD4021 digital sensors TLE5010/5011, AS5600, MLX90393 (SPI interface only) external ADCs ADS1115 and MCP3201/02/04/08 3 PWM channels for lighting 24 LEDs (single or matrix) bindable to button's states device name and other USB settings user-friendly configuration utility updating firmware on USB saving and loading configuration from file Instructions are available on wiki of github page of the project: https://github.com/FreeJoy-Team/FreeJoyConfigurator/wiki https://github.com/vostrenkov/FreeJoy/wiki
Sokol1_br Posted June 11, 2020 Author Posted June 11, 2020 New firmware: Release v1.6.0 Changes: HID bootloader (improved software updating algorithm) Buttons logic completely reworked Timer functionality for buttons (delay before pressing and press duration) Sequential non-latching buttons Logic buttons inversion option Button output disabling option Axis trimming by buttons Axis centering by buttons (helicopter-style trimming) Axis prescaler Combined axes activation by button Prescaler activation by button "Equal" function for combined axes Encoders as axes sources Encoders reading resolution settings High-resolution (fast) encoder support Improved ADC performance Improved shift registers stability Configurator GUI improvements USB-communication improvement Migrating from v1.5.x without a programmer device Run old configurator v1.5.x and connect your device Using Firmware Flasher upload Bootloader.bin file from the archive to the device. It should reboot and connect as FreeJoy Flasher Delete old configurator and install the new one (v1.6.0) Upload new firmware FreeJoy_v1_6_0bx.bin via FreeJoy Configurator v1.6.0 as described in wiki If you have a programmer device you can flash .hex file as usual (bootloader is already included in .hex file) Firmware - https://github.com/FreeJoy-Team/FreeJoy/releases Configurator - https://github.com/FreeJoy-Team/FreeJoyConfigurator/releases
Recommended Posts