Unfortunately, when I started driving with my new OSW direct drive wheel, I noticed that my braking was a bit random and unpredictable.  I checked the raw output with DXTweak, and I could see the signal from the brake pedal load cell was spiking and jumping around with noise.  I figured it must be interference from the big servo motor on my direct drive steering wheel, and I embarked on a multi-day mission to figure out how to fix it. Direct drive motors are pushing a lot of current at a high PWM switching frequency (3.4 kHz), that they are bound to put out some EMI.

I’m using an STM32F4 Discovery board for the pedal controller, with G27 pedals which have a beam style load cell on the brake pedal (Update: I’m now using these custom hydraulic + load cell pedals that I recently built).  It is recommended to have a ground cable from the pedals to the pedal USB controller board.  I have also heard people have soldered a ground cable from their pedals/rig onto the metal usb plug housing on their controller.  If you’re going to try ferrite chokes, the most useful place to put one is around the three motor power cables, where they enter the servo drive (leaving the ground cable outside the choke).

I’m using a simple DIY load cell amplifier circuit based on the INA122, which doesn’t have a nice ground plane like a commercial load cell amp.  This DIY board is likely to pick up more noise than a commercial load cell amp would, although it seems people with DSD/Bodnar load cell amps are also having an issue with EMI.  I didn’t want to wait for a commercial LC amp to arrive in the mail, so I did some more testing.

Simple INA1220load cel amplifier on proto board

My motor housing was connected to ground with a single big ground wire to the ioni, and the motor power cable was shielded (grounded at one end).  The encoder cable was also shielded, and grounded at one end. I’m using G27 pedals with the standard cable and a d-sub9 extension cable.  I tested it without the extension cable, no difference.  I tried a custom shielded cable from the brake to the Discovery board, and surprisingly it made no difference, so I’m still using the original g27 cabling. I looked at the load cell amp, and figured I could add some filtering to the circuit.

I added a low pass RC filter on each of the two inputs (Vin+ & Vin- from the load cell), and also on the Vo output of the amplifier.  The values of the RC filters can be calculated to suit your requirements.  I found that a 1kOhm resistor and a 10nF capacitor does a good job at filtering out EMI.  According to a handy Low Pass Filter Calculator, a 10 nF and 1K ohm RC low pass filter allows frequencies up to 16 KHz through.  Sounds good to me, for a smooth and noise free brake input.  I also added two decoupling capacitors on the 5V line which supplies power to the pedal (a 100uF 16V electrolytic and a 100nF ceramic in parallel).

Here’s a pic of a DIY ina122 load cell amp with RC filters that I built.  I am using a fixed value 390 ohm gain resistor, rather than a trimpot.  I don’t think it makes much difference being able to adjust the gain, even if you only use 1/4 of the full range of a good quality usb controller (4096 steps of resolution), you still have 1000 steps which is plenty enough.  I am using dupont connectors for the connection to the load cell on the left (4 wires), and the USB pedal controller on the right (3 wires – +ve, Gnd and Voutput).

Load cell amp with RC filters frontside

Note that the circle on top of the INA122 is the location of pin 1.  Excitation + on the load cell is connected to Vcc +5v.  Excitation – is connected to GND.   Vg is the gain resistor, a 390 ohm resistor from pin 1 to pin 8.

The electrolytic capacitor (100uF 16V) and the large ceramic capacitor (100nF) are connected between Vcc +5v and GND, forming a decoupling filter that smooths the supply voltage.

The three small ceramic capacitors (10nF) are the capacitor half of the RC filters – connecting Pin 2 to GND, Pin 3 to GND, and Vout to GND.  Vout is the signal connection to the pedal controller.

This is the underside of the circuit.  The three resistors (1k ohm) visible on the bottom are the resistor half of the RC filters, connecting Pin 2 to Signal – , Pin 3 to Signal +, and Pin 6 to Vout.

Load cell amp with rc filters backside

The circuit is built on proto board which I bought from a local electronics store.  I scored it with a sharp knife on both sides and snap it to get the desired size.  It’s a bit rough looking compared to a custom PCB, but it’s quick, cheap and easy to build.  Does the job fine.

Here’s the circuit diagram:

DIY INA122 Load Cell Amplifier circuit with low pass filters 1.1

If you find that you aren’t getting any output from the load cell amplifier, and you’re wiring looks correct, I would suggest trying reversing the signal + and signal – wires from your load cell.  With the circuit above, the ina122 amplifier will only output a signal when pressure is applied to the load cell in one direction (and you might have the direction reversed).

I tested resistance across the logitech pedals, and discovered that the pedal arms are electrically isolated from the bases (only the bases are connected to ground).  This means that the pedal arms can pick up EMI and sit at a different voltage to the load cell amplifier ground.  Grounding the pedal arms to the bases is a bit fiddly, but seems to help reduce noise.

In summary, check you have a single solid ground connection to your motor housing, shielded encoder and motor cables (grounded at only one end), and grounded pedals.  If that doesn’t solve it for you, and you have a DIY load cell amp, you could then try adding RC filters and decoupling capacitors your LC amp circuit.  Even better, you could build some really good pedals from timber like these ones I built, which don’t have any metal to pick up EMI.

On a related note, if your G27 gas (throttle) and clutch pedals are giving a spiky signal, it could be due to dirty potentiometers.  The cheap plastic pots on the g27 are not sealed, and they are prone to fouling up.  An easy solution is to spray some Isopropyl Alcohol into the opening of the pot, and turning the pot back and forth a few times.  This cleans the gunk off the wiper inside the pot, and usually fixes the scratchy output.  Spray into the big gap in the pic below:

G27 spiky potentiometer spray with isopropyl alcohol

Now I’m going driving.  Enjoy your direct drive wheel 🙂

Advertisements

2 thoughts on “Solving a Noisy Load Cell Brake when used with Direct Drive wheel

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s