Jump to content

FreeJoy. OpenSource joystick controller on STM32


Recommended Posts

Hi guys....first thanks to @Sokol1, for pointing me to this forum.

 

I am interested in creating a control unit comprised solely of a bank for 12-16 rotary encoders primarily for use in modern flight simulators like DCS, X-Plane 11, and MSFS 2020. For example, a G1000 glass cockpit unit will have over 12 rotary encoders to control things like heading bug, barometer, radio frequencies, altitude select up and down, inner and outer dial for the MFD, etc.  Despite the obvious need for a control panel that has large number of rotary encoders, I have not yet seen anybody do a project like this.  Also, some of the solutions out there for a  project like this work for only one just simulator like DCS and X-plane.  Consequently, I want a solution where my rotary encoders appear as a stand-alone joystick unit that will consequently work in any sim. I also want the encoders to function very similar to a scroll wheel like that found on a mouse or my X-56 throttle.

 

(1) The FreeJoy software along with the STM32 board should be able to accomplish this task, correct?  Are there any pitfalls that I need to be aware of before I start?

 

(2) Also, where is the best place to buy the STM32 board?  Does the board need to be an authentic "Blue Pill" board?  In other words, are there any  3rd party boards to avoid?  My concern is that the one I was looking at on Amazon has the following review: "The board that I received did not have an STM32 MCU on it. Instead it had a CH32F103 MCU. I am having trouble finding any information about this MCU to tell if it's even close to an STM32."

 

I'm open to any advice. Thanks!

 

 

 

Link to post
Share on other sites
2 часа назад, SCG_Limbo сказал:

I'm open to any advice

 

1) FreeJoy support up to 16 encoders, 15 of them can output as buttons/axis and one only in axis mode but more precise. 

2) I usually buy my bluepills on AliExpress and here is some information about fake chips.

I also have developed my own controller board for freejoy and it is also opensource. I gonna make a small batch for selling a bit later.

 

For more information about project please visit our wiki page and join #freejoy channel on HOTAS/HOSAS/SIMPIT discord server

 

  • Upvote 1
Link to post
Share on other sites
  • 3 weeks later...

Hi, I'm not sure if this is the best place for questions or not but I can't find another forum for Freejoy. Firstly, thanks for your work on this, it is an amazing thing, and I have found it much better and easier to configure than mmjoy which I have used previously.

 

I've got one question about setting up an ON-OFF-ON switch please. I already have some ON-OFF switches setup so that I have two logical buttons for the switch, A is on when the switch is on, and B is on when then switch is NOT on (inverted). This works great and only requires one connection to my shift register. Is there any way that I can achieve the same thing with the ON-OFF-ON so that A is on when switch is in top ON position, C is on when switch in bottom ON position, and B is on when NOT top ON AND NOT bottom ON. If that makes any sense.

 

So basically I want to get three logical buttons where one is always ON for an ON-OFF-ON switch with two physical connections to my register. If this is not possible at the moment, could it be added as a suggestion for a future build?

 

Link to post
Share on other sites
  • 1 month later...

Hi WG_Magners,

first of all: thanks for developing & maintaining FreeJoy!

 

I have an issue with linking a TLE5011 (no movement in values on (Axes Config"-Tab). As this setup is working for others it must be an user error :)

So maybe you can give me some advice what to try next.

 

Status and what I have tried up to now:

* Running Freejoy 1.6.2b4 and latest QTConfigurator.

* TLE5011 itself is OK. It works if linked to an Arduino Pro Micro Board (MMJOY2).

* Tried with 3.3V and 5V for TLE-supply

* Tried 10K Ohm Pull-Ups on SPI_MISO and TLE5011_CS.

* Tried setup on second STM32: Same issue.

* MISO/MOSI: I would have expected to link the MISO-line from the TLE to the SPI-MISO (B4) pin at the STM32. But your schematic links it to SPI MOSI (B5)

https://github.com/FreeJoy-Team/FreeJoyWiki/blob/master/eng/TLE501x-connection.md

Tried both, does not work (besides with 5V TLE-supply and using MOSI-pin; not sure if STM likes this).

* Axes Config: Set to 14 bit and 16 bit. "Tried Channel 0" and "Channel 1". Tried offset of 180. Anything else to set?

 

==> Any idea how to proceed?

 

 

Link to post
Share on other sites
57 minutes ago, ShortCiruit said:

Hi WG_Magners,

first of all: thanks for developing & maintaining FreeJoy!

==================

Edit: Issue below is solved.

I made a reset of all settings in the Configurator (Reset all), wrote this config to the the device.

Then I added again the TLE settings and wrote this config to the device. ==> TLE Working correctly now :)

 

When writing the old config to the device again it does not work.

==> I must have messed up something in the settings.

 

==================

57 minutes ago, ShortCiruit said:

 

I have an issue with linking a TLE5011 (no movement in values on (Axes Config"-Tab). As this setup is working for others it must be an user error :)

So maybe you can give me some advice what to try next.

 

Status and what I have tried up to now:

* Running Freejoy 1.6.2b4 and latest QTConfigurator.

* TLE5011 itself is OK. It works if linked to an Arduino Pro Micro Board (MMJOY2).

* Tried with 3.3V and 5V for TLE-supply

* Tried 10K Ohm Pull-Ups on SPI_MISO and TLE5011_CS.

* Tried setup on second STM32: Same issue.

* MISO/MOSI: I would have expected to link the MISO-line from the TLE to the SPI-MISO (B4) pin at the STM32. But your schematic links it to SPI MOSI (B5)

Edit: correct as documented in the schematic (using MOSI Pin).

https://github.com/FreeJoy-Team/FreeJoyWiki/blob/master/eng/TLE501x-connection.md

Tried both, does not work (besides with 5V TLE-supply and using MOSI-pin; not sure if STM likes this).

* Axes Config: Set to 14 bit and 16 bit. "Tried Channel 0" and "Channel 1". Tried offset of 180. Anything else to set?

 

==> Any idea how to proceed?

 

 

 

  • Upvote 1
Link to post
Share on other sites

Issue not solved :(

As soon as I add "ShiftReg Data" and "ShiftReg Latch" to the config the TLE is not working any more.

 

* It does not matter if there is a ShiftReg physically linked to the STM or not.

* If there is a ShiftReg installed (4021 PullDown), it works correctly (but the TLE stops working).

* Tried C13/C14, B1/B0, A8/A9 for the Shift Register. Same result.

 

==> Any idea how to proceed?

Link to post
Share on other sites
18 hours ago, WG_Magners said:

Please pin your config file.

I hope I will be able to take a look tomorrow

This would be great! Please find attached the config file.

2020-12-26_TLE_ShiftReg.conf.txt

Additional question:
Which Configurator-Tool should be used?

This one is linked in the wiki:

https://github.com/FreeJoy-Team/FreeJoyConfigurator

But additionally this one is on GitHub:

https://github.com/FreeJoy-Team/FreeJoyConfiguratorQt

 

Link to post
Share on other sites
27.12.2020 в 01:53, ShortCiruit сказал:

This would be great! Please find attached the config file.

2020-12-26_TLE_ShiftReg.conf.txt 69 kB · 0 скачиваний

Additional question:
Which Configurator-Tool should be used?

This one is linked in the wiki:

https://github.com/FreeJoy-Team/FreeJoyConfigurator

But additionally this one is on GitHub:

https://github.com/FreeJoy-Team/FreeJoyConfiguratorQt

 

Both of tools can be used. QT version is a bit faster and flexible

Link to post
Share on other sites
On 12/28/2020 at 5:44 AM, WG_Magners said:

Both of tools can be used. QT version is a bit faster and flexible

So for me this means it should not matter which tool I use because the configuration written to the device should be the same.

Here I have the next issues:

1.) Writing a configuration to the device with the QT-Version and trying to read it with the "normal" version will crash the normal version (window just closes).

Maybe this is obvious not to mix tools, but I wanted to mention it.

2.) Potential issue with the QT-Version:
I still try to get a TLE5011 running. Issue: Setting an offset of "180", writing it to the device and reading it back gives me "120" as readout.

==> Writing and reading the offset in the normal version works, so I will stay with this one at the moment.

 

Revisions used:

FreeJoyQt-v1.6.2-1.1.1-Windows

FreeJoy.Configurator_1_6_2b3

 

Link to post
Share on other sites
1 час назад, ShortCiruit сказал:

1.) Writing a configuration to the device with the QT-Version and trying to read it with the "normal" version will crash the normal version (window just closes).

Maybe this is obvious not to mix tools, but I wanted to mention it.

Thanks for the report. Please pin your Qt-version config file

1 час назад, ShortCiruit сказал:

2.) Potential issue with the QT-Version:
I still try to get a TLE5011 running. Issue: Setting an offset of "180", writing it to the device and reading it back gives me "120" as readout.

Fixed it. I will update after fixing 1) issue

  • Upvote 1
Link to post
Share on other sites
2 hours ago, Reksotiv said:

Wow! Thank you!

 

For QT-Version:

- Read back of TLE Offset-settings works now.😀

- Maybe another minor issue with the QT-Version (sorry...)::(

1.) Settings written with the normal config tool.

2.) Reading back from device via QT-Tool seems to change the "Buttons from Axes" data.

Even though only set for 3 Axes (3 buttons per Axes), in the QT-Tool for all other axes there seems to be a default resulting in "2 Buttons from Axes" ==> Additional 10 Buttons in the tab "Button Config".

I have attached the config file for the normal tool.

 

 

2020-12-30_v04_complete - Kopie.conf.txt

On 12/23/2020 at 3:40 PM, ShortCiruit said:

Issue not solved :(

As soon as I add "ShiftReg Data" and "ShiftReg Latch" to the config the TLE is not working any more.

 

* It does not matter if there is a ShiftReg physically linked to the STM or not.

* If there is a ShiftReg installed (4021 PullDown), it works correctly (but the TLE stops working).

* Tried C13/C14, B1/B0, A8/A9 for the Shift Register. Same result.

 

==> Any idea how to proceed?

Positive item:

  •  Complete Setup (TLE5011 & Shift registers) now seems to work.

Negative item:

  • I have no idea what caused the initial issue. I have changed the HW- and SW-Config (incl. re-flashing the basic FreeJoy SW, switching between config tools) so many times the last days I cannot state what made the difference.

Maybe helpful for others:

As stated here

https://github.com/FreeJoy-Team/FreeJoyWiki/blob/master/eng/TLE501x-connection.md

my TLE-setup required a 1kOhm pull-up resistor on the data line.

It seemed to work without pull-up, but looking in detail there are issues leading to spikes in the data.

  • Thanks 1
Link to post
Share on other sites
21 минуту назад, ShortCiruit сказал:

2.) Reading back from device via QT-Tool seems to change the "Buttons from Axes" data.

Even though only set for 3 Axes (3 buttons per Axes), in the QT-Tool for all other axes there seems to be a default resulting in "2 Buttons from Axes" ==> Additional 10 Buttons in the tab "Button Config".

In Qt-version you need set buttons from axes to 0 to disable. In your config file is set to 2.

Link to post
Share on other sites
7 minutes ago, Reksotiv said:

In Qt-version you need set buttons from axes to 0 to disable. In your config file is set to 2.

Yes, it is set to "2" also in the normal config-tool (seems to be the default setting). But in this tool an additional check box needs to be ticked to activate this setting for the corresponding axis.

 

In the QT tool there is no check box any more. So it is activated per default by the setting of "2".

 

It cannot be set to "0" in the normal tool, minimum is 2. the "0"-setting is controlled via the checkbox.

As said, really a minor issue and only relevant when switching between tools.

Link to post
Share on other sites
  • 3 weeks later...

I'm back :)
 

I have some issues with reading in encoders and it could be a user/configuration issue. Maybe you can give some advice.

 

Firmware: FreeJoy_v1_6_2b4.bin

 

Issue

In principle the encoders work as expected, but a lot of pulses are lost/not transferred to the PC.

The encoders should trigger 16 pulses per revolution. But even when turning slowly only a few of the expected pulses are recognized on software side.

I have tried with the FreeJoy configurators and the VKB_buttontester.

I have tried several settings of the Encoder press time (between 1 ms and 100 ms) but I did not find a suitable setting.

 

Expected behavior

With each mechanical detent there should be a pulse. This works fine for an Arduino in MMjoy-setup with the following configuration

https://simhq.com/forum/ubbthreads.php/topics/4333127/re-mmjoy-mmjoy2-build-your-own-usb-controller#Post4333127

 

1. Encoder Hardware

I use the first one (ELMA E37) but also tried the second type (CTS288V)

http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=98_75&products_id=196

http://www.leobodnar.com/shop/index.php?main_page=product_info&cPath=98_75&products_id=242

2. Link to SM32 & Config Files

According FreeJoy wiki  https://github.com/FreeJoy-Team/FreeJoyWiki/blob/master/eng/Encoders-connection.md encoders can be linked to the STM directly but also via shift registers.

My setup uses encoders linked via shift registers2021-01-07_1100_Throttle_Cougar.conf.txt, but I also tried linking them directly to the STM 2021-01-16_encoder_Test.cfg.txt. No difference visible for me.

 

Any hint what to try next? I see there are modifications on github regarding encoders, but I am not sure if this addresses this topic.
Best regards

Link to post
Share on other sites
16.01.2021 в 20:43, ShortCiruit сказал:

Any hint what to try next? I see there are modifications on github regarding encoders, but I am not sure if this addresses this topic.
Best regards

 

Hi! Thanks for such detailed issue description.

I have tried several encoders processing algorithms and looks like it is still not optimal now.
I will take this into account and try to improve encoders performance in the next versions of the software. 
 

Link to post
Share on other sites

Hi again Magners and others

 

I have now managed to connect my TM grip to the STM32 board and it works perfectly, all 22 buttons can be read through the three CD4021 shift registers and out to the board.

 

Grip.jpg.f7b596ef9651d1417ace9ce5825a5130.jpg

 

What I would like to do next is connect the TLE5010 axis sensors on my Virpil WarBRD base to the STM32 board

 

WarBRD_base.jpg.7bbde99d5af46b522741022b62f99314.jpg

 

The TLE5010 sensors are mounted on a small board with another 8 legged IC, which I do not recognise, and then four wires out connect it to the Virpil controller board

 

TLE5010_board.jpg.2a2669c624d7608781b539b3b610a472.jpg

 

Assuming that two of the four wires are Vcc and ground, I would be grateful if anyone could please let me know exactly which of the two wires are Vcc and ground and also where the other two wires need to connect to on my STM32 board for it to read the TLE5010 sensor

 

All suggestions gratefully received, thank you.

Link to post
Share on other sites
8 часов назад, Vortice сказал:

Hi again Magners and others

 

I have now managed to connect my TM grip to the STM32 board and it works perfectly, all 22 buttons can be read through the three CD4021 shift registers and out to the board.

 

Grip.jpg.f7b596ef9651d1417ace9ce5825a5130.jpg

 

What I would like to do next is connect the TLE5010 axis sensors on my Virpil WarBRD base to the STM32 board

 

WarBRD_base.jpg.7bbde99d5af46b522741022b62f99314.jpg

 

The TLE5010 sensors are mounted on a small board with another 8 legged IC, which I do not recognise, and then four wires out connect it to the Virpil controller board

 

TLE5010_board.jpg.2a2669c624d7608781b539b3b610a472.jpg

 

Assuming that two of the four wires are Vcc and ground, I would be grateful if anyone could please let me know exactly which of the two wires are Vcc and ground and also where the other two wires need to connect to on my STM32 board for it to read the TLE5010 sensor

 

All suggestions gratefully received, thank you.

Hi!

Maybe this thread will be helpful for you: https://forum.il2sturmovik.ru/topic/11603-diyсамодельщина-электроника-usb-контроллер-сенсор-платы-расширения/?tab=comments#comment-701131

Link to post
Share on other sites

Vortice,

 

 

Just curiosity: what the reason for wire Thrustmaster grip in STM32 card, since VirPil original controller support CD4021 shift register?

 

 

 

Link to post
Share on other sites
50 minutes ago, Sokol1 said:

Vortice,

 

 

Just curiosity: what the reason for wire Thrustmaster grip in STM32 card, since VirPil original controller support CD4021 shift register?

 

 

 

 

Because the Virpil original controller board has suddenly stopped receiving inputs from the buttons on the stick and Virpil are taking a very long time to help me with this problem.

 

The axes inputs still work, but I would like to replace the Virpil board with an STM32 board to run the joystick while I am waiting for Virpil to sort out this mess.

Link to post
Share on other sites
On 1/22/2021 at 7:42 AM, Vortice said:

 

... Virpil are taking a very long time to help me with this problem. ... I am waiting for Virpil to sort out this mess.

 

That's worrying. This is why I'm hesitant to buy from VKB again, or Virpil. Had an issue with my VKB when converting it to use my TM Warthog grip with the VKB base, seems one of the button inputs wasn't working and knocked out a matrix of buttons. Anyway VKB wasn't much help and insisted I send it back. Living in Australia I'd hoped to fix issues myself with their support because sending items back means a very lengthy process. I just ended up selling the VKB and went back to my Warthog.

Now I'm looking to build my own HOTAS and Rudder Pedals - I have nice CNC milling machine close to being operational.

Link to post
Share on other sites

Update: Virpil finally got in touch with me on Friday and will be sending out a replacement 5 pin mini din female to 5 pin JST male connector cable for the grip to mainboard connection. I have buzzed out the existing cable and found that there is no longer continuity on the ground connection.

 

Heaven knows when the replacement cable will get here, and it looks like the Virpil TLE5010 sensor boards are using secret protocols, so I have ordered the TLE5010 kit from Aliexpress anyway.

 

Even if all the Virpil stuff does end up working eventually I might still convert the WarBRD base to STM32 just for the heck of it.

Link to post
Share on other sites
55 минут назад, Vortice сказал:

looks like the Virpil TLE5010 sensor boards are using secret protocols

TLE5010 cannot use any secret protocols except of one described in datasheet

Link to post
Share on other sites

The TLE5010 can only operate by the datasheet, but it talks to the controller board through the IC on the sensor board and I don't know what they may have programmed into that chip.

 

However, there doesn't seem to be any information, anywhere, on what the pinout description of that sensor board is so I will probably use the Aliexpress boards instead.

Link to post
Share on other sites

Hi, Sorry If I disturbe this topic, but I would like to ask some help for my MMJOY2  problem. If it is not the right plaece please send me PM or give me a link . (I asked this the another forums, simHQ and il2sturmovik.ru)

https://ibb.co/N7CCKFj

I have a Chinese version of the MMJOY  with shield.

https://ibb.co/85Xsxdz

And this is in life:

https://ibb.co/vL3Pv7c

I coloured the pins where I put the wires ,same colour  same wire.  So my problem is that I use one of the shift register in my FLCS joystick handle grip. I connected those buttons  like the pic show. red wire is the common GND and the others are the individual buttons.  When I connected to the PC and set up in the MMJOY program (see above) the shift register is 74hc165 (i'm not sure about that because I can't see on the chip) and 3 chip the CS and DATA pins are D0 and D1. But the 4021B set up is no working .  And when I want to test the buttons they only work in the top of the 2 sockets on the shift register ( on the pics are circled). If I put  other buttons there, they also work, but just in  those sockets.  I don't know what could be the problem if  all of the buttons are working and the program is also recognise it, except the rest of the 4 sockets . I have only one strange  thing, If I connected the shield to the PC  without the shift register just alone then there are some buttons (from 17 to 24)which are flickering in the program .  These buttons are recognised and work from the shift register also. So from 17 to 24 buttons are in the top of the shift register  2 sockets.

 

If we can solve this problem I would like to convert my FLCS/TQS. And I want to use this set up:

https://ibb.co/p2kjmNV

https://ibb.co/HDc5bTp

https://ibb.co/3NwzgQX

https://ibb.co/kJq0Bp1

 

But I don't know how should connect to the arduino pro micro  these device. Which wires can I put together  like the VCC and the GND.  could The TLE5010's  6 pins of 5 be the common with the others? And can I use 4 TLE5010 and 6 other  normal potmeter in the same time on only one pro micro?

As you can see  on the schematic, I would like to put the pro micro inside the TQS base, and the all others wires could be collected from others to there. 

Can somebody to check it and give me some advice to it? Or any other info about that how can I reach my goal that there be a workable  HOTAS. other  board or other program .

Thank you. 

Link to post
Share on other sites
  • 3 weeks later...

Hey Everyone,

 

I flashed my STM32 with freejoy, but i can't seem to get a ground or 3.3v out of the boards pins to get an encoder to work.  I tried the gnd on both sides of the board, nothing. I also tried using the 3.3v and switching the button inputs to button gnd - still nothing.

 

Anything I should try? 

 

Thanks!

Link to post
Share on other sites
8 часов назад, Tezzlax сказал:

Anything I should try? 

Hey,

first of all, are you sure that you have configured everything right? Sharing your config file could help

Link to post
Share on other sites
11 hours ago, WG_Magners said:

Hey,

first of all, are you sure that you have configured everything right? Sharing your config file could help

 

Looks like I am just stupid, just need switch the button to gnd and be connected to gnd - all good now! 

 

Now just trying to figure out the shift registers, that's complex to say the least (going to use 10 of them)

Link to post
Share on other sites

hello guys, i need some tips, i have been able to flash the stm board succesfully, but when i disconnect the st link programmer and connect the board to the pc with the micro usb cable, the pc does not recognize the board, any advice will be very appreciated.

Link to post
Share on other sites

I only signed up to say thanks. This software is great. I tried so many times with OSH Studio and eventually gave up. This one just worked. STM flashed and Freejoy Configurator 1.7 all working within 5 minutes. Buttons and encoders connected as well. Brilliant.

 

Is there any easy possibility of adding macros to the button inputs? I've tried AHK and AutoIT with Arduino but it wasn't really too successful.

 

Can I add a volume control to an encoder or an audio changer to a button? Similar to Soundswitch (https://soundswitch.aaflalo.me/). It's so annoying getting into VR and finding I have the headphones as master and not VR.

 

Is there a possibility of adding volume control to different software? Similar to MaxMix (https://maxmixproject.com/). It would be great to alter volumes for discord and master volume in game.

 

Again thanks for the software.

  • Upvote 1
Link to post
Share on other sites
On 2/25/2021 at 1:33 AM, zeze1982 said:

hello guys, i need some tips, i have been able to flash the stm board succesfully, but when i disconnect the st link programmer and connect the board to the pc with the micro usb cable, the pc does not recognize the board, any advice will be very appreciated.

I had the same issue. Changed my USB cable for another one that was data as well and it worked instantly. Some USB cables are for charging only.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...