Giter Club home page Giter Club logo

g29-lc-brake's Introduction

Logitech G29 pedals mod

What it does

  • Adds load cell as the brake pressure sensor.
    • replaces lower part of the spring housing with a 3D-printed one.
  • Adds Adafruit ItsyBitsy M4 express to process load cell data and potentiomenter readings as an independent (from the wheel) HID joystick with 16-bit values. Un-invert the values reported by pedals while we're at that.

Why

Humans easily adapt to control car braking by applying pressure. Logitech pedals use potentiomenters that read pedal displacement. Relationship between the applied pressure and the displacemmment is controlled by the brake's spring with a rubber block intended to make the relationship non-linear. Unfortunately, it squeezes whe wide range of high pressure values at the end of the pedal travel into a rather narrow range of the pedal movement which Logitech software then attempts to normalize into something more sensible.

It mostly works, but in practice I've found it rather hard to modulate the brake pressure precisely. One moment the car does not brake enough, then all of a sudden ABS goes nuts (or the car spins out). It just does not behave like a real car brake.

So, after eyeballing various higher-end pedals I've decided that I'm not that interested in spending my toy budget on the ready-made gear. Instead, I've figured that I can just mod the pedals using mostly off-the shelf components and whatever I had at hand.

TL; DR; It worked surprisingly well. Eventually.

Required hardware

  • Logitech G29/G920 pedals. The mod may work with G27 or other similar Logitech models, but you may need to tweak the spring housing model to fit.

  • $15 Adafruit ItsyBitsy M4 Express

    It's amazing how much stuff you can cram into $15 worth of hardware:

    • ATSAMD51 32-bit Cortex M4 core running at 120 MHz

      You get a real 32-bit ARM processor, with tons of peripherals and you can program it in Python, if you want to. Why anyone is still using AVR-based overpriced and underpowered Arduino boards these days is beyond me.

    • Floating point support with Cortex M4 DSP instructions. -- M4 can do a lot of signal processing, if needed.

    • 512 KB flash, 192 KB RAM -- should be enough for everyone, right?

    • 2 MB SPI FLASH chip for storing files and CircuitPython code storage.

    Another option is Feather M4 ($23) which uses the same processor as the ItsyBitsy M4 and comes with some breadboard space which would be handy.

    You could also save few bucks and go for QT Py ($6), Trinket M0 ($9), or ItsyBitsy M0 ($12). These boards use Cortex-M0 and are slower than the Cortex-M4 on the ItsyBitsy M4, but should still be more than sufficient to do the job.

    Other thoughts:

    About any chip with an USB interface, couple of GPIO pins for I2C and three ADC-capable inputs could do the job. ItsyBitsy M4 is way overpowered for that and was largely chosen for convenience of writing software in Python.

    Surprisingly, not that many low-cost Cortex-M based boards have USB support. My usual go-to Discovery and Nucleo boards from STM use USB for built-in STLink debugger and only pass through UART to the host.

    Trivia bit: $13 STM's Nucleo-32 which is based on stm32f431kb uses stm32f723 for the built-in ST-Link debugger. F732 alone costs as much as the board and is much more capable than the stm32f4 chip it debugs. How can one buy the whole board for less than the sum of the parts is a mystery to me. Can't complain though.

    ESP32 may be an interesting option for interfacing with the computer via Bluetooth, but that was considered to go beyond the keep it simple approach I was going for.

  • $30 FX29K0 100lbf/50kg load cell with I2C interface.

    • Part number: FX29K0-100A-0100-L
    • Datasheet for FX29 load cells.
    • Datasheet for zsc31014 which is the measurement controller inside the FX29 load cell.

    There are quite a few variants of the load cell. You need the one starting with FX29K or FX29J, and ending with 0100-L pr 0500-N. If you use FX29K/FX29J followed by a digit other than 0, you will need to adjust the I2C address in the code.py.

    The cell costs about $30 and is available from the usual sources.

  • Female DB-9 connector.

    Used to read the stock potentiomenter values via the reguler DB-9 connector from the pedals that normally plugs into the wheel base.

    I've repurposed an old serial cable I had in my junk that may be useful one day bin.

Software

  • CircuitPython

    That turned out to be the easiest way to get things working. I've considered multiple alternatives, but this method ended up winning based on the results delivered/annoyance caused ratio.

    • My repo with the modified CirquitPython

      The only changes are to ass PEDALS USB HID device for ItsyBitsy M4 Express board. If you want to use a different board, you'll need to make similar changes for that board.

    • Pedals software (this repo)

      It's a simple python script that reads the values from FX29 and the values of the stock potentiometers and reports them via USB. It also continually prints all the values over the serial port. It could be used to measure the relatinship between pedal displacement and the reported load. E.g. here is what my brake pedal reports depending on the spring setup: brake pedal load/displacement chart

      The result is roughly comparable to the much more expensive Heusinkveld Sim Pedals Ultimate:

Hardware -- the real hardware this time.

  • Coins. I've used Euro 10c, Danish 2 kroner (yay for a center hole!) and an US 25c coins. You could probably use other coins, possibly filed down to size, or find appropriately sized washers.
  • M4-0.7x20 screw + nut, but the size is not particularly critical, we just need a bump that will push on the load cell.

First mod version was prototyped using a bunch of schedule 40 PVC pipes and couplers. It didn't quite work out. I had to build both upper and lower parts of the spring housing. Making the parts telescoping into each other was hard to do within the limited size choices and the constraints imposed by the pedal frame. Without parts snugly fitting into each other, the spring buckles under the load and the whole contraption flies apart. It turns out g29 pedal design uses a number of subtle tricks to constrain spring housing motion to prevent spring buckling.

Build instructions

See Build.md for the gory details.

g29-lc-brake's People

Contributors

artem-b avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.