Monday, May 9, 2011

Finishing off


I have been using the pedals for a while now. Here are some general observations on the project:

Cost:

Making your own pedals is not a budget option – not by a long chalk. But, having said that, I do believe they offer much better value for money then options such as the vastly overpriced (imho) Thrustmaster T500 wheel.

I haven't 'costed-up' exactly but here are some approximate figures for the components:

Metal £60
Load-cell £28
Springs £50 (inc. two spares)
Fixtures & fittings £30+
Electronic components £30+

Other bits and bobs for the wheel and stand include:

Logitech DFGT £82
Wood £21
Screws/fittings £10+

This does not include the cost of any tools which are needed to make the thing.

Time:

Making the pedals took me about a month and a half working most nights. Like any project the first set always takes the longest to make and a lot of the time is spent working out how things should fit together. If I had to make another identical set I could probably knock them up in just a couple of weeks. I spent a lot of additional time researching the amplifier circuit, hall-effect sensors and potentiometers.

Sourcing the components;

About 90% of the parts/materials used for the pedals were sourced online. This was not out of choice as a lot of the components are sadly missing from so called diy shops. Everything was brought online with the exception of the M8 threaded rod, M8 & M6 washers and bolts along with a few electronics parts from Maplin. The hardest parts to source were the springs as I found a lot of searching for springs brought up engineering firms who aren't really set up to retail single items. The metal I brought from several retailers on ebay who offer a cutting service as well – it was very useful being able to get it supplied cut to length.

The wood for the wheel stand I did buy from a local timber merchant/hardware shop who also cut to length – this saved a huge amount of time when it came to making the stand.

Social Impact:

The project was not well appreciated by non-turismoers. If you have a girlfriend, or worse - a wife, then my advice would be to dump/divorce them before starting such a project: they will not understand or appreciate what you are trying to do and will go about doing that womens' thing of belittling your hobbies whilst claiming everything they do is incredibly important.

The wheel stand does take up a fair amount of space as it currently is. I think there are improvements/adaptations that could be made to make it more portable and storable without hampering its functionality. I haven't planned on making any such changes yet as I am still very much playing the game.

Note: It is amazing how far bits of aluminium swarf can get about.

Functionality:

I am very pleased with the functionality of my pedals and wheel stand (and the DFGT wheel for that matter). I have only had one instance of trouble when a tiny fraction of the brake stuck on during game play – this happened on a night were I was testing which spring to use in the brake and so therefore put it down to the newly fitted parts gelling together. After a month of so of gaming this has not re-occurred and neither pedal has missed a beat. The pedals are adjustable in many ways although quick adjustments are not really possible as they usually involve operations using at least several spanners.

The response of the hall-effect sensor is good although very slightly not quite linear at the top end of throttle response. The accelerator pedal response feels quite 'natural' to me (how linear is a real car's pedal?). I can usually hold the revs right were I want for standing starts (better than I can in my real car anyway), the signal is not 'jumpy' or 'spiky' in this game.

The brake is firm enough without being OTT. With it being a load-cell brake, the pedal can be set up in a number of different ways – if I set it so that there is barely any compression of the spring, the pedal has hardly any movement and is much more 'pressure sensitive'. The way I have it set up is so that there is just enough movement to get to full braking force before hitting the stop, this feels more natural to me – the pedal is still pressure sensitive of course, its just that the force is transmitted via the spring and there is more movement in the pedal.

A "quick" adjustment - this time altering the rest position of the accelerator pedal. Bolts are added to the holes in the front support to give the pedal more angle.
So far I have managed to achieve the following feats in GT5 using my custom pedals:

Lots of race wins (a few in A-spec too).
Gold on all 60 licence tests
Gold on the tricky Lotus Elise Top Gear Test Track Challenge
Gold on all the AMG/Mercedes-Benz nurburgring challenge thing
Gold on the Sebastian Loeb Rally Challenge

Durability:

It is early days yet of course, but I do not anticipate many durability problems with these pedals – much less than I might with any brought set anyway. I think the accelerator pedal will keep going forever. I am a little concerned that using an aluminium 'L' bracket with the load-cell could lead to a premature failure compared to using a steel one, but will see how it goes. One of the advantages of having built it all myself is that I know how everything works, how it all fits together which means I will know how to fix it if anything does go wrong.

Aesthetics

As you will see from the photos, I have painted the whole stand black. I used ordinary acrylic paint for this as it is quick, cheap and safe. Had the whole stand painted and put back together within a day. I am going to continue using it with the office chair: a proper car seat wouldn't add much to the functionality of the set up and would take up more space.

I added a foot-rest. This is made from a single piece of wood and a right angle bracket from a hardware store held together by screws. I bent the bracket to a slightly wider angle to get the foot-rest in position. It is not the sturdiest thing but it does the job.

I also added a small car mat. This is held in position by screws.

The finished set-up
Side view sans seat
Side view

Wednesday, April 20, 2011

Wheel Stand Over Here


So, one of the problems with my custom pedals is that they can't be used standalone. They need mounting to something. I sketch up a cockpit design to mount the pedals. Originally I wanted to have a cockpit that could be closed up to make it look like an ordinary table or cabinet. This is a bit ambitious for now, as I am more interested in getting the pedals working and to get in a bit of time playing the actual game.

I try to think of a really simple design. The concept I come up with, I call the 'Ski' design. Basically, each pedal is mounted at the end of a long 'ski' length plank of wood. Since there are only two pedals, this somewhat resembles a pair of skis. The other bits - footrests, wheel stand, seat - can then be built 'modularly' and fixed onto the skis. This uses the pedals in floor mount configuration. I sketch up a design and try to get the three most important bits (my ass, wheel and pedals) approximately the same distances apart as they are in my real car.

Another problem with my custom pedals is that in floor mount configuration the actual pedal is too high off the floor to be used as is. So a need a box to raise my feet higher (about 16 cm) off the ground.
"Some of these please"




With the ski design though, I am hoping it may be possible in the future to cut the skis and fix a hinge along that point, making them more easily foldable and easier to put into storage.






I don't know much about timber and don't really have time to do a lot of research into what types of wood etc. I browse the b&q website to get an idea of what sort of stuff is available. I discover that the wood I want is referred to as 'Plain Square Edged' (PSE) Timber. To keep the design simple I will use just three types of PSE in my design. These are (side x side in mm):

44 x 44
20 x 120
12 x 32

I sketch up on a piece of paper each piece and the lengths and number of pieces I need. I take this with me to the timber shop.

I go to a local timber merchant/hardware shop and get the wood. They also have a cutting service so take advantage of this and get all the pieces cut to size. This will save me a lot of time and effort. I'm afraid I don't know to this day what kind of wood it is (as in what tree it came from). Probably pine stuff builders use as its fairly cheap. Anyway it is good for what I want.

World's Neatest Bonfire
Making the Stand

Thanks to the having the pieces already cut to size, the wheel stand is starting to go together relatively easily. Using the skis as something to clamp to (my workbench isn't long enough) I drill holes for the main legs to fit onto the top shelf and bottom piece. Right now I don't have any decent wood screws, but these smaller ones about 45 mm in length will hold until the weekend when I can get some. Once I have them I'll just replace the current screws one at a time.

I attach the shelf pieces to the vertical legs (two 44x44 pieces of length 600). With one screw in at each end, the shelf still has a little bit of wobble in it. Adding an additional two screws at each end firms things up nicely without even having fixed the horizontal shelf support yet. The shelf is designed to be the same either way up (although later I fit some support feet to the bottom shelf). The shelf itself is made from a 21 x 210 piece of wood that is 550 in length (this is the width of the shelf). Whilst the wheel unit has a small amount of overhang at the rear I do not anticipate this being a problem. The piece I am calling the 'horizontal shelf support' is a piece of 12 x 32 of length 550 also. This fits to the underside of the shelf piece flush to the back edge. The main vertical legs are then screwed to this support piece.

The foot rest is 350mm long. The sides and top surface are all made from pieces of 21mm thick by 210 mm wide wood. Three lengths of 450mm go across the top, with two 350mm pieces as the sides. I wanted to clamp the pieces in position then drill and screw in the usual way. Unfortunately even my big G clamps aren't big enough to do this. The alternative method I used was to measure out and drill the holes on the top pieces only, add a screw through the hole so the tip was just poking out the other side. I then place the piece in the exact position on the side pieces and press down. I find I can easily screw into the side pieces without drilling, thanks to the wood being relatively soft.

The Footrest


The footrest and wheel shelf

Footrest slotted into bottom of wheel shelf

Once this is all screwed together, everything feels really solid and this unit is ready to be attached to the skis.

Ski Bindings

Ok so to fix the pedals to the planks of wood, I am using M5 bolts. I have brought some countersunk ones, 40mm long. These pass up through the bottom of the wood, through the pedal fixing brackets and are secured by a nut. The 'countersunkedness' means they will fit flush to the bottom of the wood.

I use 6 bolts for each pedal unit. There will be two brackets at the front of the pedal - one on each side. These will stop the pedal unit tipping back when the pedal is pressed. I also secure the pedal unit at the back, but this time instead of fixing brackets to the sides, I have drilled two holes in the rear support piece. There is just room for these fixings behind the pulley. 



Test Fitting the stand and pedal "skis"


Yes, but where are you going to sit.

My original intention was to buy either a proper bucket seat (one that could double for track day use in my real car) or get an old car seat and use this. But wanting to test the wheel stand first, I came up with an interim solution. I positioned the skis apart such that my “mastermind” style office chair could be wheeled up in between the skis (the chair has five wheels/castors in the usual pentagon formation – to fit, the first wheel goes in between the skis, the others are on the outside of the skis with the rear two just squeezing between the outside edges of the skis). If/when I do get a more racy seat, I can build some kind of stand and just bolt this onto the skis.

To fit myself in to use the stand, I have to drop the seat to the lowest setting. I have based my measurements of how the wheel stand should go together on measurements I made of my real car. I am used to driving in a position such that my thighs are angled slightly up from horizontal with the bottom rim of the steering wheel coming just below the height of the knees. I tried to replicate this with my wheel stand but it is not quite possible to do due to: (a) the dfgt wheel being smaller and (b) it being mounted quite high up on the wheel unit. The compromise means that my knees are quite close to being in contact with the underside of the shelf the wheel sits on.

Dimensions taken from my real car. Some of them may be approximate as they were pretty difficult to measure. The front lip of the seat is actually in front of the steering wheel. I hadn't noticed this before despite using the car nearly every day for the past 3 years.

Testing the wheel stand.

With the pedals now properly secured for the first time ever, I get an opportunity to see how they feel when operated by my feet (you know, like how people usually drive). First thing that strikes me is the way the brake feels softer than I imagined. I had put the 2nd firmest spring on the brake rather than the 40N/mm jobby as this had felt way too tough when pressing the pedal with hands. Now the current spring feels a bit too soft. Hey, maybe my calculations were right.

The second thing is the way the accelerator feels: with the greater range of movement, my foot tends to 'slide down' the surface of the pedal as I press it. Not sure if it needs adjustment or some kind of grip added to the pedal face. As it is, currently smooth aluminium there is little to no friction between foot and pedal. Other than that, the motion feels nice and smooth with just the right level of resistance.

Anyway, having the wheel stand will enable me to test how everything 'feels' and make adjustments if necessary.

Using the wheel, I find the stand is nice and solid with no wobbly bits. The position of the wheel feels good. I think the pedals need a little adjustment as I suspect they are a little too 'upright' and need a bit more angle to lean them back. This is purely a comfort issue though. 

The wheel stand with diagonal supports and a car mat.
The next stage of the project will be tweaking of the pedal positions/range etc and I also have plans to paint the wheel stand a fetching shade of black.

Friday, April 15, 2011

The Pedal Files

What the pedals look like. "Great for someone who likes driving in clown shoes"
I realised I hadn't done a post showing the actual finished pedals. As I am writing this blog somewhat retrospectively, (it takes a lot of time to make the things and blog about it) this post is a little out of date but is what-I-done-wrote at the time: 

As I detailed in my 'more holes than...' post. A lot of drilling work has been done to the pedal units. Since then I have been able to finish off the pedal units – although I'm sure they will need a lot of alteration and adjustment.

Firstly I cut a length of M8 studding to around 200mm length. This is passed through the hole in the main support piece. From the photo it can be seen (if you squint) that the threaded rod is free to be pushed further into the pedal box, the only thing stopping it is the spring which acts on the top large diameter washer which itself is secured by a nut. At the other end, the large M8 eye nut stops the rod being pulled out of the pedal box by the spring. A length of steel cable will be attached to the eye bolt, run over the pulley and then attach to the pedal arm. When the pedal is pressed the eye bolt is pulled further down into the pedal box. Somewhere along the length of rod inside the spring is a stop-nut. This will stop the rod being pulled further.

Rear view showing the 'Spring Assembly'. The upper washer is attached with an upper and lower bolt. The 'stop nut' is two M8 nuts locked together.

The next photo shows the finished pedal – this time it is the brake pedal. The wire rope is attached to the eye bolt and this runs over the pulley attached to the rear support piece. The pulleys fit a ¼” steel shaft, although this appears bigger here because I have used two pieces of aluminium tube to space the pulleys and keep them in the middle of the shaft. As this is the brake, the mechanism is a little more complex: the 'spring assembly' passes through the 'L' bracket for the load-cell. This 'L' bracket is pivoted through the main support piece – which is mounted vertically on the brake as opposed to horizontally on the accelerator. 

Rear View of the Brake 'Pedal Box'

 
Close up rear view of the Accelerator 'Pedal Box' - now attached to the wooden base (partly by vertical bolts seen nearest camera). The black thing around the wire rope is an ordinary cable tie (trimmed after fitting) - this helps keep the wire rope in position during fitting. The wire is not quite as flexible as I'd ideally like and tends to want to spring out from the pulleys. Once assembly is complete however and there is a bit of tension in the wire, this is no longer a problem.

I use some more of the 'plain bearings' to try to smooth the movement of the M8 threaded rod through the main support pieces.

I had a few problems here with the wire rope. Firstly it is not quite flexible enough for what I am trying to do here. This makes it difficult to get things threaded up neatly. Secondly the fastening to the pedal arm isn't quite as I originally intended; The M6 eye bolts which you can see attached to the pedal arm are difficult to fit as I do not possess any M6 nut tightening device that will fit inside the pedal arm to tighten the nut (M6 nuts need a 10mm spanner). Through a bit of improv I manage to get them fastened ok and they seem to have held so far. The other problem was the size of the 'wire rope grips' which fasten the two ends together. My original plan was take the wire rope coming from the pedal box, loop it through the M6 eye bolt, back over itself and fasten it inside the main pedal box with the wire rope grips. This wouldn't work very well because I hadn't left enough clearence between the wire rope and bottom of the pedal box. You can see the alternative solution that I came up with in the photograph.

"Improv" wire rope fitting to pedal arm. The two ends of the wire rope are secured with 'duplex wire rope grips' So far this fitting arrangement has been 100% secure.


At first when I was trying to tighten up the wire rope I thought the inflexibility of it may leave too much slack in the system. With a bit of trial and error though, I am reasonable pleased with how it has turned out. I found the best way to get a good bit of tension in the wire rope was to loop it through the eye nut on the spring assembly. Have the spring assembly in place held with a stop nut on the other side (no need to have the spring there yet). Then use trial and error to find the best position to apply the wire rope grip. To finally fit things I have the pedal arm nut into the wire rope, then lever it into position using the front support piece as the fulcrum, then I pass the pedal arm axle through to lock it position.

So, at the moment I think my pedals look like great for someone who likes to drive in clown shoes. Obviously they will need some kind of foot rest box if they are to be used as they are now. I had intended to build pedals in 'hanging down' configuration but changed my mind part way through. I think they will still be good but they definitely can't be used 'as is' without something to raise the height of the feet. After I took the main photos, I took the pedals apart again and made some adjustments. The pedals are now mounted a little lower down on the pedal arm and I have rejigged the spring assembly – the 'stop-nut' now consists of two nuts which I can lock together into position. I also filed some grooves in the bottom of the pedal arm. The wire rope passes through these and is kept nicely in position.

Groovy



+Additional

Since making further adjustments I have changed the rest position of the pedals by repositioning the front support/pedal stop pieces. I also drilled two holes in the lower face of the pedal stop  - these are so I can add bolts to help set the rest position of the pedal. Repositioning the front support piece by drilling new holes in the side pieces of the pedal box is massively time consuming, so these new holes make the process of adjusting the rest position of the pedal relatively quick'n'easy. I wanted to adjust the rest position because I felt the pedals were too 'upright' during test drives.

Front view of the accelerator 'pedal box' with 'pedal arm' removed. Note the two holes in the lower face of the 'pedal stop/front support piece' Bolts can be placed through these holes to 'angle' the rest position of the pedal more. Further angle adjustment is possible by adding/taking away washers from such bolts. Note also the front brackets which secure the 'pedal box' to the wooden base.
 As can be seen. I have now brought some wood with which to construct a wheel stand. This will be the subject of my next post.



 

Thursday, April 7, 2011

Amplifier Circuit


This is a long post, but it explains as much as can about how I made the load-cell amplifier circuit.

Ok, so I did quite a lot of research on amplifiers in order to make this LC amplifier circuit. I hadn't done anything with electronics for quite a while and what I had done I had mostly forgotten. So I will try and explain this for someone in the who was in the position I was. I still don't fully understand everything but have managed to cobble together enough information to make a circuit.

First off, thing to know is that there are different types of amplifier. The type of amplifier used here is called an 'instrumentation amplifier'. With the more standard type of amplifier (which you will find in audio equipment, maybe on the end of your guitar lead) the amplifier takes a single signal as input, multiplies this signal by some amount (known as the gain) and gives the result as the output. What the instrumentation amplifier 'in-amp' does, is takes two signals as inputs, finds the difference between them, and multiplies this by some amount (“the gain”).

The Loadcell (LC) used is four resistors in a 'Wheatstone bridge' configuration. When the loadcell experiences a force, the resistance changes and so more current flows down one side of the bridge causing an imbalance which can be measured across the device. The way I imagine voltage, current and resistance is with a water analogy. Voltage is the force which makes the current flow - like a slope which the water is falling down. Current is the actual water itself and resistance is something which inhibits the flow of the water, like a partial blockage along a pipe the water is flowing through. The analogy doesn't quite work if you go a little deeper into electrical theory but it kind of gives you the jist.

Anyway, with a voltage across the wheatstone bridge due to a force on the loadcell, we must take this voltage difference between the two sides and feed it to an 'in-amp' where we'd like it to be amplified up to the couple of volts range.

From my testing of the DFGT pedals, I can see that the brake is wired such that when the pedal is in the up position (what I call 'at rest'). The potentiometer output (green wire) is very close to the +5V input (red wire). When the pedal is pressed down, the output moves closer to Ground (i.e goes towards 0V). Ideally, I'd like my LC and amplifier circuit to do the same - have a voltage around 5V with no force on the LC and move towards 0V when the pedal is pressed.(See later on as to why this is crossed out)

Of course the amplifier is not 'magic' in that it can't multiply 0.1V up to 5V without having a power supply of its own. It also can't multiply up to voltages beyond what you supply it with. So we will use the power supply (red and black wires) from the DFGT to power both the amplifier and the LC. Since the power provided by the DFGT is just +5V (known as a single supply, there is no -5V) we will use a amplifier that accepts a single supply.

So at this stage, I am looking for a in-amp which can work on a 5V single supply. Fortunately I come across several links on the web where people mention LC amplifier circuits for exactly this purpose. It seems that the favoured chip is one called 'INA122'. I also come across a guy selling ready made LC amplifier circuits online. If you have brought a LC and need an amplifier circuit it will almost certainly be cheaper, quicker and easier to go with the ready made option. I wanted to make my own, just 'cause, y'know, I could say I'd done everything myself.

OK, so now I know which chip to get, but there are still another couple of components that go in the circuit.

The most important of these is the gain resistor. The gain of the amplifier is set by putting a resistor across the top two pins. Depending on what resistor you put here determines the gain of the in-amp. If you search online for 'INA122 datasheet' you will see that the formula for the INA122 gain is something like (off the top of my head):

5 + 200,000/R

If the maximum output from the LC unamp'ed is around 0.002V (2mV) (2 millivolts) then to get to 5V this would have to multiply by 5/0.002 = 2500. When I work this out the value of R comes out at 80ohms. Which is quite a small value of resistance. I think I will go for 100ohms but will buy a couple of different value resistors so I can have a play around with what gain I use when the circuit is built.

From all the reading up on in-amps I did, there are another couple of components that I will include in the circuit. The first is a 0.1uF (pronounced: nought-point-one-micro-farad) capacitor. The capacitor is connected between the +5V and ground. If you remember from physics and/or electronics classes, the impedance (bit like resistance) of the capacitor is frequency dependent. If the frequency of the current is 0 (which IS DC current which we have here) then the impedance is infinite and so no current passes. So in affect the capacitor does not do anything when using DC current. Why put it in the circuit then? Well, the capacitors job here is to handle any frequency response from the circuit. It will cut out any oscillating feedback as it allows that to pass to ground before it gets going.

I also read that there should be a 'path to ground' for the inputs to help protect the chip from current build up. I will therefore use two 10k resistors, one going from each input to ground.

Sourcing the Components:

OK, so buying an INA122 in an actual physical shop is probably impossible I would say? So the only place is online. I found quite a few online hobby electronics shops that sell amplifiers but could not find one that sells the INA122. I should mention also, that the INA122 (as with a lot of these things) comes in different 'packages' the package I wanted was the DIP (dual-inline-pin) package. These will fit a 8-pin DIP socket which I have encountered before. There are also a number of letters after the INA122 (i.e INA122UA etc), I still don't know what these mean but for the record I got the INA122PA - perhaps I need to read the datasheet more carefully.

Ok, so the only place to get hold of these chips is from one of the big online electronics components retailers. There are a number that I considered; Mouser, RS, Farnell, Rapid. I ended up buying from Farnell. I spent ages putting together an order through Mouser but then got to the check-out and found delivery was a hefty charge. Farnell had a £20 minimum order but postage costs were more reasonable (just). I added an extra INA122 to the order so I'd have one spare incase I messed up or something. The chips cost around £7 each.

If you haven't done any electronic circuit building before (like I hadn't) then deciding exactly what components to get can take an awful lot of time and research. If you go onto the Farnell website with the idea that you're going to buy 'a resistor' you'll be confronted with tens-of-thousands of different 'resistors' that you can buy. I'm going to put a list of all the components I brought, (that I brought and ended up actually using more like) below along with order numbers/codes.

One thing I also got was some 'PCB Terminal Blocks'. These little deelys you solder onto the circuit board and then they allow you to screw in wires (you could solder the wires to the circuit board somehow but this would be much more time consuming and make things difficult to disconnect when you need to). It took me literally hours to find out what these things were called. The ones I got for the in-amp circuit were 2.54mm pitch ones, which is the same pitch as the strip board which I already had. When they arrived, these turned out to be really quite small but still usable for this circuit.

Parts I brought are:

  1. 3 way PCB terminal (2.54mm Pitch) (Farnell: 3041360)
  2. 4-way PCB terminal (2.54 mm Pitch) (Farnell: 3041414)
  3. 100 ohm resistor – any sip (Farnell: 1099867)
  4. 10 kohm resistor (Rapid: 62-0897)
  5. 0.1 uF capacitor (Farnell: 1100383)
  6. 8-pin DIP socket (Farnell: 1101345)
  7. Strip/Matrix Board (2.54 mm pitch) See photo: The stuff I got was from Maplins. It has rows of three connected holes. I adapted the circuit to work with this type of board. If someone tried to make the same circuit using a different type of board you would need to adapt it to fit. I'm told its possible to make your own printed circuit board (PCB) to suit, but I didn't want to bother with this so went with strip board instead. I think it may actually be called 'tri-pad' board.
  8. Wires (individual wires taken from the excess 9-core cable I brought)
  9. INA-122 (DIP package) chip (Farnell: 1459460)
    Strip-board looks like this
Don't expect to be able to buy components like resistors and capacitors in ones and twos. For example: I got a reel of 100 100ohm resistors which was the minimum order. The whole reel cost something like 95p. Having spares of these may come in useful later as it is possible to combine resistors in various ways to get new values of resistance. If you want to get rid of spare resistors why not take a couple, bend one end into a hook, put them into a jewellery case and present them to an earth female as “space earrings”.

Tools needed are: Soldering iron, solder, something to hold the circuit board steady as you solder, wire strippers/sharp knife. The chips come in a special anti-static packaging. As I am not very good at soldering I had a look on youtube for some instruction. Best video I found was this one by 'CuriousInventor'. Although it annoys me immensely that Americans seem to have universally not noticed the 'l' in solder and continually pronounce it as 'sod-er' .

It is important to avoid static electricity when handling these chips, you can have a static charge on you without realising it. The precautions I took were:

Not bothering with an 'anti-static' bracelet
Not wearing any polyester
Touching the cold tap a lot before picking anything up ('tis an earth connection see)
Not rubbing a (inflated) balloon up and down my sleeve

Seemed to work ok so far.

Designing the circuit:

The circuit is pretty simple. It has several features mentioned above: - capacitor across the power supply, path to ground for the inputs. The rest is just a case of connecting up what goes where correctly with regard to the pin layout of the chip. You will find the pin layout in the datasheet. 

My little hand drawn diagram

My little hand drawn diagram shows what goes where. The load-cell itself needs to have a power supply, this is done by connecting it in parallel with the amplifier circuit – which is why you can trace direct connections between +5V and Ground on the supply side to E+ and E- on the load-cell. (I don't think it really matters if you connect the power supply to E+/E- or V+/V- as long as it is across opposite corners of the Wheatstone bridge). I think 'E' stands for excitation voltage.

The gain resistor goes across pins 1 and 8. Simple.

The power supply (+5V) goes into pin 7. The ground connection goes into pin 4. The output is pin 6. In terms of the dfgt pedal wires: power supply is red wire. Ground is black. Output is green.

Pin 5 – the reference voltage is also connected to ground. The capacitor across the power supply goes between +5V and ground. On the load-cell side, the two inputs also are connected to ground although via a large resistor (10k ohms).

The two inputs go to pins 2 and 3. 

What the thing looks like


Making the circuit (1st attempt):

The electronics brains will have already spotted in the photo of the finished circuit that my colour coding is a little messed up on the load-cell side. The white wire from the load-cell is actually ultimately connected to pin 2 of the chip via green wires on the circuit board (and vice versa with pin 3). This happened because of a cock-up on my part when making the circuit. I had got the idea in my head – despite all the electrical testing I had done and written about so far – that the brake pedal had a high voltage/low resistance when the pedal is at rest. In fact it is the other way round – pedal has a low voltage but high resistance when at rest.

I had gone and built a version of the circuit with the load-cell inputs swapped and +5V connected to pin 5 (Ref). When I came to test this with the game, I found that it worked perfectly 'backwards' I.e the brake would be on when the pedal was at rest, but as I pressed the pedal the brake would start to be released. This kind of gave me a big clue towards what I had done wrong and it didn't take me long to fix everything – except of course, I didn't want to go to the trouble of swapping my white and green wires just so the colours would match.

Here is a picture of the 'backwards' circuit to confuse any skim readers: (Incidently if you did want to rig up a load-cell brake with a set of pedals that were wired up in the way I had thought the dfgt's were, then this would work perfectly).

"Backwards"


Making the circuit (2nd attempt):

Ok, so here is the finished circuit. Part of the problem, as mentioned above, was adapting the circuit to work with the strip-board type that I had brought. I don't know how easy/difficult it is to make a PCB – I didn't really look into it. There are different types of strip/matrix-board available but whatever the connections are what is important. 

Adapted to the board


I drew out the three hole row configuration of my strip-board onto a scrap of paper and then overlayed the circuit components. It is important to note how many holes things cover when they are placed on the board – for example the 8 pin DIP socket takes out 16 holes altogether – 4 holes each side for the pins to fit in and then the rest covers 8 holes. Its also good to know how many components can fit into a single hole. I found it easy to fit at least a couple of wires and a resistor/capacitor leg into a single hole – only complication then is keeping them all in place when it comes to soldering.

Before I did start soldering I drilled some holes in the strip-board and fitted some rubber gromets with a 4mm internal diameter: These are used to mount the circuit to the plastic box in which it now lives.

Underside of the circuit


When it came to soldering I scored some lines on the plastic side to mark out the positions of the rows. Components are fitted this side then soldered on the copper side. Once it came to soldering I found things came together surprisingly quickly and having the drawing there in front of me made knowing what to solder where quick and easy. When soldering the resistors and capacitors, I pass the pin quite far through, the snip off the excess with a pair of clippers once it is soldered in place. I did not solder the chip in – instead I soldered in the 8-pin DIP socket and then carefully plugged the chip into the socket. I'm not sure how well the chip survives soldering so took the conservative option. All the wires used are just offcuts from the cable I brought to connect the pedals to the wheel unit.

Testing the load-cell circuit:

The finished circuit (experimenting with 200 ohm gain resistance).
Well you will notice from this later picture of the circuit that the gain resistor is now no longer soldered directly into the board. It is also now no longer a single resistor but actually two resistors in series. What I did here was to desolder the original gain resistor (with use of a desoldering pump), cut in half a spare 8-pin DIP socket and solder that above the chip. There are two small jumper wires (seen in blue) connecting the sides of the DIP socket to pins 1 and 8 of the chip. I did this so it would be easy to swap the gain resistor by just plugging/unplugging into the DIP socket.

During testing of the brake pedal, I began to realise a few things about how the amplifier circuit can be used to configure the 'feel' of the brake pedal. Basically... the larger the value of gain resistor used, the smaller the gain; if you increase the gain resistor by a factor of 2, you need to press the pedal twice as hard to get the same braking force in the game. But, at some point, the output of the amplifier circuit will saturate at 5V; at this point pressing any harder on the pedal has no effect as the braking force is already maximum. With a small gain resistor, this happens quite quickly so a relatively soft pedal press gives full braking force. With a really large gain resistor this might not happen. There is a balance to be found. Due to the way GT5's automatic in game configuration works, I found it is actually desirable to get the amplifier output to saturate at 5V: without this happening the game would continually recalibrate the brake pedal to whatever the hardest brake press had been during that gaming session. By setting a gain resistance so the output does saturate at 5V, this acts as a buffer meaning once a brake press causing 5V output is detected, the game knows 'this is the maximum' and so any harder presses of the brake later on won't trigger a recalibration.

With respect to the braking force maxing out, this is also more like a real car in some respects: if you are pressing the brake so hard that all four wheels are locked (or ABS is kicking in), then pressing the brake pedal any harder won't affect the deceleration of the car.

Anyway, after a little bit of testing I have settled on a value of 250 ohms for the gain resistance. Those of you who remember anything from electronics will know that it is possible to make a 250 ohm resistor by combining four 100 ohm resistors (those spares did come in useful). I have two resistors in parrallel and two more in series with those. I think the maximum output from the load-cell may have been a few more millivolts than I originally thought, which is why the 100ohm resistor was too sensitive. Knowing how changing the gain of the amplifier affects the feel of the pedal is useful because I can relatively easily change the force needed on the pedal to get maximum braking effect. 


Monday, April 4, 2011

What a bracket


Current Project Status:

Pedals are made but need electronics parts making up -
Hall-effect sensor has been tested and works. Now fixed to pedal unit.
Load-cell is in place but needs an amplifier to work.
Amplifier circuit has been designed and parts are ready to go.
A preliminary design for a wooden wheel stand is sketched out. Wood has been purchased.

This post deals with my issues mounting the magnets to work with the hall-effect sensor.

So, I have decided on a method to mount the magnets and hall effect sensor to the pedal. The magnets will be mounted to the pedal arm and will be the moving bits. Whilst the hall effect sensor (HES) will be mounted to the side of the pedal unit and will be the stationary bit. 

For the mounting of the HES and magnets I am using bits of left over aluminium. For the magnets I am using a piece of the 1.1/2 by 1" rectangle section - from the piece brought for part of the loadcell bracket. For the HES bracket a piece of 1" square tube - which was originally the 'spare pedal arm'.
I cut a piece of 1.1/2" x 1" 2 to 20mm 40mm in length. To make it into a channel section, I hacksaw the top side of the rectangle to make it into a U shape with the 1" sides forming the sides of the 'U'. I mount this on the back of the pedal arm, with a single 6mm bolt. The magnets will be positioned at either end of this piece - sticking out a bit to the side to be in line with the HES which will be mounted at the side of pedal unit sticking in. The height up the pedal arm at which this magnet bracket piece is mounted is quite important. Too high and the range of motion will mean that it will contact the HES and beyond when the pedal is pressed. Too low and the range of motion won't be sufficient to cause much change in the output of the HES. 


This piece wasn't long enough and I had to cut another. (Poor me)
I did some calculations to work out how high up the pedal arm I should mount the magnets – keeping in mind how far apart the magnets will be. I work out that it should be 97.8 mm (roughly) up from the centre of the axis.

To fit the magnets into the mounting bracket I just drill a 6mm hole and then bore this out until they fit. Go too far with one and have to hold it in with tape. One magnet is higher than the other because when the pedal arm swings there is some height offset due to the HES not being mounted on the same radius as the magnets. I did work out how much height offset there should be but won't detail that here (for any number of reasons). If you enjoy working that out then I think you would enjoy this project.

The incredibly simple hall-effect sensor circuit - can be wired in as a direct replacement for a potentiometer. I do this via the PCB terminal to make it a little easier to connect/disconnect things whilst testing. When using the pedals, magnets in bracket move towards camera as pedal is pressed. HES, of course, is stationary.


Close up view of the magnet bracket. The black thing with three legs is the hall-effect sensor. I had to mark the magnets so I'd know which one goes where and which way round.

Anyway, when it came to fitting the bracket I drilled a number of holes in the pedal arm so that it would be possible to mount the bracket at different heights later on if needed. 

The HES is much more simple: it just needs to be in a fixed position, close to the first magnet when the pedal is at rest. To mount it, my plan is to make up the circuit on a piece of strip board. Mount this strip board to a piece of aluminium angle - here I will use rubber grommets to isolate the circuit from any metal. The actual HES itself will be protruding from the strip board, enough so that it is inline between the magnets. I can tweak the position and angle of the HES by gently twisting the pins on which it is mounted. The aluminium angle will be bolted to the side of the pedal unit. When it comes to mounting the HES bracket/aluminium angle, I drill a whole series of holes in the side to allow tweaking of the height of the HES. I find the HES is secure enough when the bracket is fastened with just one bolt.

 
I decided to make the angle myself - from a piece of square tube. I take the 1" square tube and cut to length (105mm). Next I carefully hacksaw along the length just the thickness of the metal from the edge. Repeat on the “symmetrically opposite side” (I think) and bingo, two pieces of L. I have ended up using the second piece, and a few other offcuts, as brackets to fix the pedal units to wooden bases. To fix these brackets in place, it is a relatively simple job to drill holes in the side of the pedal units, holes in the brackets then bolt them together. To fix the rear of the pedal units, I have drilled two holes in the 'rear support' piece (which should fit flush to the bottom edge of the pedal unit) and bolted through these.

Pedal unit mounted to wood base. M4 Across, M5 Up