1. Thread posting restricted: Only the BeamNG team members can post new threads in this sub-forum in order to prevent spam. Posting is available on unlocked threads.

Making a "simple" button box...

Discussion in 'Microblogs' started by Diamondback, Jan 13, 2024.

  1. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    Here's a bit of talk about my 2023 christmas holiday project, which is nearing completion now.

    During the final days before the .31 release I noticed a distinct lack of input hardware on my side, testing all the new things of the T-Series was extremely tedious due to the lack of matching hardware. Buying something is not my style (and nothing like what I want really existed), so of course I had to design and build my own thing.

    Thanks to some experience with USB HID stuff from my earlier CAN-Bus related work, I was pretty confident that the software side of things would go well and I could build a custom button box. The bigger issue is the actual inputs themselves, I wanted a large variety of different styles of input, buttons, switches, joysticks, encoders, etc etc. So after searching around, I acquired a bunch of different things.

    The next challenge is building an enclosure for all of this, something that is not super tricky for me because I'm quite used to designing and 3D-printing housings like this. However, the focus this time around was on modularity since I didn't quite know yet which specific input hardware was going to fit the best and what sort of layout I wanted. I opted for a design where the bulk of the material is a sturdy frame that accepts modular panels, each panel can then house a few different input thingies and if I want to change it, i just need to reprint that panel rather than the entire box.

    Overall, this approach worked wonderfully and allowed me to have my final box with minimal waste from testprints. The most tedious part is yet to come though, wiring.... I haven't counted, but just going by what I had to order in addition to the stuff I already had, I probably crimped about 500 crimps, and wired 50m or so of cable... :D Again everything is modular so it's a bit more than if you were to build one fixed thing that can't be changed.

    The software side of things did indeed go pretty straight forward, easily taking the least amount of time. I'm using Adafruit boards for both the USB controller and the IO stuff and for usability went with their own flavor of micropython (called "circuit python"). This makes it very easy to use and again, very modular. It's perfectly possible use cheaper hardware, but for me personally this was the path of least resistance.

    Here's some notable data points:
    • About 60 individual buttons and switches in various styles, some momentary, some latching
    • 2 analog joysticks, one with 2 axes, one with 3 axes
    • One real ignition switch with 4 positions
    • A 10-position rotary selector
    • 3 small rotary encoders
    • One big rotary encoder from a CNC handwheel
    • Another CNC handwheel encoder that is exposed as an axis for high precision inputs
    • One 4-way digital joystick that can multiplex between 9 different sets of inputs for a total of 36 individually usable buttons on one single stick
    Some buttons are still missing, had to order more since I liked them so much, but they just need wiring and are plug-and-play otherwise :)

    IMG_20240112_110636jpg_compressed.jpeg IMG_20240112_154330jpg_compressed.jpeg IMG_20240112_154334jpg_compressed.jpeg IMG_20240112_154338jpg_compressed.jpeg IMG_20240112_154341jpg_compressed.jpeg IMG_20240112_104615jpg_compressed.jpeg IMG_20240112_104521jpg_compressed.jpeg IMG_20240112_010459jpg_compressed.jpeg IMG_20240112_010323jpg_compressed.jpeg
     
    • Like Like x 62
  2. EUDM fanboy

    EUDM fanboy
    Expand Collapse

    Joined:
    Nov 30, 2023
    Messages:
    1,180
    Absolutely awesome!
     
    • Agree Agree x 2
  3. JowoHD

    JowoHD
    Expand Collapse

    Joined:
    Oct 27, 2016
    Messages:
    1,165
    this is awesome. im liking the beamng mug
     
    • Agree Agree x 4
  4. NeoLikesThinkpads

    NeoLikesThinkpads
    Expand Collapse

    Joined:
    Aug 28, 2023
    Messages:
    584
    probably a "hey you helped us with the game heres a free mug" which i rlly want bc that would be nice for my hot chocolate
     
    • Agree Agree x 2
  5. EUDM fanboy

    EUDM fanboy
    Expand Collapse

    Joined:
    Nov 30, 2023
    Messages:
    1,180
    beamng merch confirmed?
     
    • Agree Agree x 4
  6. Obnoxious

    Obnoxious
    Expand Collapse

    Joined:
    Sep 14, 2022
    Messages:
    665
    god i hope...
    --- Post updated ---
    still off topic, but a lazer-engraved beamng thing i did almost a year ago
    upload_2024-1-13_15-29-57.jpeg
     
    • Like Like x 8
  7. bussin.buses

    bussin.buses
    Expand Collapse

    Joined:
    Aug 1, 2022
    Messages:
    5,004
    Damn! That's sick.
     
    • Like Like x 2
  8. Jackets64

    Jackets64
    Expand Collapse

    Joined:
    Nov 26, 2017
    Messages:
    1,908
    Any chance you'd share schematics (if you did it that professionally lol) and price to build?
     
    • Agree Agree x 2
  9. zachariah.74

    zachariah.74
    Expand Collapse

    Joined:
    Apr 10, 2022
    Messages:
    784
    If those mugs were sold online somehow even in limited numbers I absolutely guarentee they would sell out very quickly. Very cool button box anyway
     
    • Agree Agree x 3
  10. TalksWithNoise

    TalksWithNoise
    Expand Collapse

    Joined:
    Jul 10, 2023
    Messages:
    260
    This is super impressive! Clean and thought it was an official product being fixed at first glance. If only all of the inputs were uniform for PCB mounting to make assembly easy! How'd you get the clean text next to the toggles and buttons?
    Also 74HC595s or other shift registers can be used to create more inputs/outputs for a single microcontroller if adding more controllers becomes problematic.
     
  11. Ax50

    Ax50
    Expand Collapse

    Joined:
    Aug 12, 2019
    Messages:
    477
    Will you do some video showcase on it working? That would be really cool! But it also proves we're all starting to run out of buttons to bind for BeamNG lol

    Also I dig that mug!
     
    • Agree Agree x 1
  12. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    There's really nothing here worth making schematics for, it's just a whole bunch of buttons, switches and encoders wired to GPIO pins and some power...
    The different boards are all connected with I²C using Qwiic cables, so nothing special there either. I only wrote down what connects where so that I knew which pins to use in the firmware.

    It's just printed in a different color, in my case using a toolchanger, but this is perfectly possible with manual filament swapping as well. :)
     
    • Like Like x 1
  13. KèrozéN

    KèrozéN
    Expand Collapse

    Joined:
    Feb 14, 2014
    Messages:
    426
    i'm really interested how you make the key work as a controller input. That a thing that I really want to craft, especially since BeamNG have ignition feature.
    I've looked for real neiman car too, but no way to convert them in input switches.
     
  14. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,966
    The Ignition switch is just 3 different normally open switches in one, so I just hook them up and with some logic it exposes itself as 4 momentary buttons (one for each state).
     
    • Like Like x 1
  15. Métronome

    Métronome
    Expand Collapse

    Joined:
    Jul 6, 2023
    Messages:
    392
    A controller i'm dreaming about is a automatic shifter with PRND21, with a switcher in the 2, wich can become M with + an - beside it.
    Like this, it could permitte to switch between D, 2/M and 1 and vice versa, removing the obligation to put on neutral for each selection.

    Of course PRND2/M1 will be momentary buttons, while + and - will be push buttons.
    And the automatic gearbox could also get some buttons to modifie the ESC State, maybe a simple button or a wheel selection like some Citroëns (C5 Aircross or C4 Cactus), another one to activate Sport mode and maybe later a button for Snow mode.
     
    #15 Métronome, Jan 17, 2024
    Last edited: Jan 17, 2024
    • Agree Agree x 4
    • Like Like x 1
  16. KèrozéN

    KèrozéN
    Expand Collapse

    Joined:
    Feb 14, 2014
    Messages:
    426
    Okay, thank's for your precisions, i hoped that could be a "ready-to-use" key input (like a dimmer or a switch), instead off a full crafted homemade one.
    Very beautiful work by the way! If you have crafted any others unique input or controller, please share them with us, they give some inspiration and a lot of motivation to try ourselves
     
  17. Jsap20

    Jsap20
    Expand Collapse

    Joined:
    Jun 26, 2016
    Messages:
    631
    Very Nice! where might some devoted fans be able to purchase BeamNG mugs like that?
     
    • Agree Agree x 1
  18. Métronome

    Métronome
    Expand Collapse

    Joined:
    Jul 6, 2023
    Messages:
    392
    I am thinking, do you think it could be possible to have a USB gearbox with force feedback ? Or it's more complicated than we thought ? Or it's another area of manufacturing than simple buttons ?

    Like this, we could have better feeling of floating gear and a better experience of non-synchronized gearbox for the truck and old vehicles, because I've ask why the Gavril T-series doesn't come with the double declutch system, and someone of the team tell the fact they tried to do that, but it was complicated because of the USB gearbox in the market, which doesn't come with force feedback system.
    And without this, it's difficult to simulate correctly the gearbox of a truck without feeling the knob trying to refuse being engaged, recquiering action of the double declutch for each gear change.
     
  19. Jackets64

    Jackets64
    Expand Collapse

    Joined:
    Nov 26, 2017
    Messages:
    1,908
    Shifters like this kinda exist but only work in very select games and are very expensive. It would take a lot of work to make it function properly in BeamNG.
     
    • Agree Agree x 1
  20. Métronome

    Métronome
    Expand Collapse

    Joined:
    Jul 6, 2023
    Messages:
    392
    I do some researches about a Force Feedback Shifter, and I found two things :
    - First, a software named FFShifter wich convert any forcefeedback joystick to react as a shifter, but it's not perfect.
    - Second, an active shifter named BASH Pro active h-shifter, wich uses a gate locking feature powered by real-time in-game telemetry data.
    The active gearbox can simulate floating gears, adapt the force feedback depending of the car and the gearbox informations in-game, and have a truck simulation.
    It has three types of gear changing, as H-dogbox, sequential mode and H-sync. I don't know, but maybe it could simulate non-synchronized gearbox, if it has a truck simulation.
    Price : 1.170 €.
     
    • Agree Agree x 3
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice