Archive for the ‘Racing Sim’ Category

LFS Gear indicator and shift light

Sunday, September 23rd, 2012

I always wanted to do some sort of Outguage project but never really got around to it and I guess it was more of a luxury than a requirement.  With recently getting back into the racing and now with a sequential shifter, I wanted a big gear indicator that could be glanced at and see the gear.  Sure, the built in LFS one works but bigger is better right? I also wanted a shift light so i can concentrate on driving line rather than shift points.

I looked at some ways of achieving this goal and ended up mashing some projects from some other people together and came up with my version.

The display is based on an ethernet enabled arduino – In my case the Freetronics Etherten.  You could just as easily use a Uno with ethernet shield however. This means there is no serial connection to the arduino and there is no noticeable delay in the display compared to LFS.

The code is based on the Outguage library from https://github.com/jlinnosa/arduino-lfs-outgauge-monitor by Jaakko Linnosaari and another individual by the name of Pete Willard with my own customization.

The gear indicator code is fairly simple as such, the harder part of it was for the shift light.  Since only a handful of cars in LFS actually have a shift light, we have to look at the theoretical shift point for each car and set the light to come on at that RPM.  The light is currently set to come on at the ‘Max power RPM’ as stated in LFS which is generally a few hundred to a thousand RPM before it hits the limiter.  Once it hits the limiter, the shift light will flicker.  This is achieved by using a ‘tone’ output from the Arduino instead of just turning it on. The shift light/LEDs are powered via a BD681 darlington transistor so you can use almost any light you want.  I just chose leds.

**The tone library used needs to be modified to compile under Arduino 1.0.1, see the comments in the code.

The common annode display is driven via a ULN2003 darlington transistor array.  All 7 pins from the arduino go straight to the input pins of the ULN2003 and the segments of the display are grounded via a 500 ohm resistor for current limiting.  It’s a bit of a hack job – Not normally how i like to have my projects but this one was so quick and easy to implement, there was not really much need for a shield to run it.

Arduino sketch: http://www.hux.net.au/wp-content/uploads/2012/09/outguage_udp_7seg.ino

Racing sim update

Sunday, September 23rd, 2012
Some time ago I somewhat shelved the sim, mostly because I didn’t really have the room to keep it set up but also because I decided to re-work the wheel setup but it never really took off.  The idea was to make my own electric feeback wheel with an optical encoder, arduino and a big DC motor but I could not get it right.  The movement side of it was fine – I had the arduino reading the pulses and converting this into a joystick axis but it was the electric force where I could not get it right. Big DC motor, H-Bridge and PWM but I could not get enough force out if it that I was happy with.  I decided the best option was to buy a commercial wheel and use my pedals/shifter.
I ended up buying a Logitech G27.  I am very happy with the mechanics of the wheel and it’s force abilities but the pedals and shifter really let it down. I tried them but going back to a position type brake (over force like my pedals) just felt all wrong and while the shifter is ok, it just did not have that realism of my DIY aluminium H shifter.
I also removed the stock wheel from the G27 and replaced it with the one from my other setup and placed some button switches on the wheel to hook up in place of the stock ones.  This is a much better size and feel.  The only downside is the flappy paddles are now too short but I hardly ever use them. Maybe one day i will make up some longer ones.
I have re-worked my H shifter now too.  As well as replacing the H plate with a friendlier soft plastic (cutting board) instead of the aluminium I had before I have modded it to be able to swap to sequencial mode. This is great for RBR and other rally games but I also prefer it to paddles where it is harder to change gear while turning.
There is now an extra 2 switches mounted to the bottom of the H plate and a removable washer is screwed to the bottom of the shifter shaft.  This gives a little extra throw on the shaft to push the switches.  I also too advantage of the holes in the upper part of the shifter to insert some tube to restrict the movement forwards and backwards.  This restriction allows the shifter to return to center.  Another screw in one of the brackets supporting the shifter prevents sideways movement too.
Swapping from H to sequencial takes about 30 seconds and is very easy.

Sim Update – Shifter paddles and a better seat

Tuesday, June 29th, 2010

With the basics now sorted I’ve moved on to some more asthetic and convinience items for the sim.  I managed to pick up a seat from a local DIY car wrecker from a Suzuki Swift Gti for $28!  It’s got a couple of very minor rips but over all it’s in great condition and super comfy.

I’ve also recently added some F1 style shifter paddles to the wheel.  This enables easy use of cars that are only sequencial shifing in LFS.  It’s odd – a ‘H pattern’  gearbox based car can be driven as a sequencial but not the other way around.  I guess it’s because most commercial wheels do not have H shifting (or a clutch for that matter) so it keeps compatibility. I’m still considering what i can do to make an add-on for the H shifter to convert it easily to sequencial and back again but it’s less important now and it would only be for realism.

The paddles are constructed very simply. The orangy brown stuff is a silicone rubber.  The bolts support the flaps on the main bolts and give it a spring effect.  The gap between the microswitch and the paddle is only a couple of mm and it works really well.  The original design for the paddles were a little short and were not easy enough to reach so i extended them with another bit of aluninium rather than make new ones – hence the addition of the second set of bolts.

Sim pretty much finished now

Monday, June 7th, 2010

I completed the shifter not long after the last post and also made some slight mods to it.  The main change being that the shaft is now much shorter than the original one.

This is the shifter in it’s current state:

Also, since completing the shifter, I broke one of my design rules – the ‘Small/Storable/Dissasemblable” rule.  There were various reasons for this but the main one was that i just could not get the ergonomics right when sitting at a desk/table.  It mean that regardless of how i laid it out, it just didn’t feel right.  Not only that, I decided to utlise an old 32″ HD CRT TV that i had and it weighs about 50kg.  It’s not something i wanted to put on a rickety desk.

I proceeded to make a metal frame placing the pedals, shifter and wheel at comparable distances to my real car.  The seat came later….

With the basic frame complete, I was in the hunt for a seat.  Ideally i wanted to use a real car seat.  Not necessarily a real racing seat but perhaps just a slightly bucketed seat from a sports car (something still nice and comfy).  That is still the intention but for now, i’ve mounted an old school style plastic chair to it.  It’s not overly comfy and still doesn’t feel quite right but does the trick for the time being. I also added some adjustable feet to the frame.

This is pretty much how it is today:

The only change i have made since this image was taken is the addition of a handbrake.  This helps immensely for drifting and offroad driving.  It uses an extra axis on the mjoy.  It’s noting spectacular and ideally needs more sprung force on it but is very functional.

Shifter update

Sunday, March 28th, 2010

My shifter is almost complete now.  All the mechanics of it have been done, just the electrics left.

The pictures are pretty self explainatory but i’ll explain how it works.

The first collet on the shifter shaft is staic and held by a grub screw.  The spring then exerts force against the delrin block supporting the skate bearings.  The block is free to move over the shaft.  This part gives the ‘clunk into gear’ feel.  Underneath the the rod end is a slightly cupped out thick ‘washer’ and then that’s followed by another static collet.  The spring force is also excerted on the washer and then the body of the rod end.  This means that when the shaft is moved off center, the washer falcrums on the body of the rod end and pulls the shaft down against the spring, this keeps it centered.  This combined with the gates on the bottom of the shifter gives it a very real feel.  I still have to put a slight concave in the neutral position although it is not stirctly needed as the spring is just about enough to give some more resistance, just before falling over the edge onto the ‘in gear’ ramp.

The plan for the electrics is to have a dual personality 6th gear.  There will be a toggle switch to make it either reverse or 6th.  Therefore in normal 5 speed boxes it will be reverse but in 6 speeds i can use it as 6th but flick a switch and it will be reverse.

p3280032_sml p3280034_sml p3280033_sml

Racing sim update

Friday, March 26th, 2010

Ok, as promised here is the details of the electronics.  Most of you would be interested in the load cell interface so i’ll start with that.  The interface is truly simple, the main chip, an INA122PA is only about $7 from RS and a little more from Farnell.  There are other equivalents but this is the one i used and is also one of the cheapest.  The pinout is very basic for our purposes.  You have a power supply (coming from the Mjoy) to power the chip and the load cell.  The load cell applies it’s voltage to 2 pins and the chip simply amplifies the voltage from the load cell.  The gain (how much it amplifies the voltage) is set by the resistor accross pins 1 and 8.  The capacitor is a simple 0.1uf filtering type. The cell puts out 2mv/v so at 5v excitation we get 10mv at full scale.  To get 0-5v we need to multiply that by 500.  For this chip that means a resistor of about 400 ohms.  Less resistance will give more gain.  Since my load cell is a 100kg item i have increased the gain on mine to about 600.

That’s about it!  Hook it up inline instead of a pot and you’re done.  Just make sure you get the wires around the right way…

lc_interface Load Cell interface

As for the main Mjoy board, I modified a layout i found around the net.  I have not removed any ‘branding’ so if one wanted to seek out the original designer i’m sure they could.  The only real change i made was to add pads to be able to vertical mount standard diodes for the buttons rather than use SMD types.  Most other changes were to add some distance between tracks etc.  Print, transfer, etch, drill and solder etc.  I made up my own paralell port programmer interface to program the chip in place with the provided header.

One thing i would like to add here is that originally i tried to use an AtMega88 as i was told they were basically the same.  Unfortunately they are not.  There are too many dfferences to allow the standard hex file (for the AtMega8) to work.  Someone has ported the code to the ’88 but i have not been able to get this to work.  I presume it has something to do with fuse settings on the chip but even though i have set them right, it still does not work for me. I ended up having to stick with an AtMega8 at about 5 times the price of the ’88.

mjoy_pcb p3210025_sml1

PCB Layout files (Sprint 5.0 format, free reader available to be able to print them http://www.abacom-online.de/uk/html/dateien/demos/viewlayout50.exe)

NB – The Mjoy PCB has incorrect axis lables, they are backwards so it should read X,Y,R,T,Z,Rx.  Not really important other than the fact that the XYRT axes are 10bit and the other 2 are only 8bit. Earlier versions of Mjoy only have 2 10bit axes (X and Y)

pcb-mjoy-v14
load_cell_board

Please let me know if you download these files, it’s nice to know someone else is finding these useful.

I’ve also started work on my H Shifter for the sim.  I’m trying to keep the design simple but at the same time i want something robust and somewhat realistic.  Combining the ideas of some others, i have come up with my own design which should allow for this.

Shown below is the basis of the shifter (not complete obviously).  Between the 2 horizontal bars (the ones with holes in them) will go a block of delrin which supports 2 standard skate bearings.  I have not yet finished the profile on the horizontal bars, there will be another dip in the middle. The delrin will freely slide over the 1/2″ shaft and will be followed by a spring and then a retaining clip.  This will force the block/bearings down on the ‘ramps’.  This should give a ‘clunk’ into gear and also allow for a little freeplay between gears in the ‘y axis’ when viewed from above.  The centering mechanism will be another single spring around the shaft that sits on the rod end and is secured again by a retainer.  The compression of the spring will try to keep it centered.  From there it is only a matter of making a gate plate and hooking up the switches for the gears.  I intend to mount the switches in the base of the unit to keep them safe.

p3250031_sml p3250030_sml

Time for a new project

Sunday, March 21st, 2010

While i’ve been tinkering with many things over the time since my last post.  Most of it has not really been very noteworthy or at least nothing that would probably be of interest or use to anyone else.

However, inspired by now owning a 2L turbo sports car and some recent participation in some motorsport events i’ve decided to build a racing simulator.  It’s nothing new, i don’t claim it to be but i’ve decided to collaborate some of the things i have done in hope that it might help someone else going down the same path.

The aim of this project is to produce a somewhat life-like simulator without using a standard shop bought wheel/pedal set.  I’ts not going to be real, i know, but here’s my ‘requirements’:

  • Realistic steering wheel with as much rotation as possible
  • Analogue Clutch
  • ‘H’ pattern gear shifting
  • Analogue Hand/E brake
  • Force measured brake (not movement like normal pedal sets)
  • Small/Storable/Disassembleable  (I don’t have a spare room for a sim cockpit)
  • Strong/Durable
  • Cheap!

The intended target platform is a PC running ‘Live for speed’

I started this project a couple of months back, starting with the wheel and now i have just completed the pedals.   The steering mechanism was construced utilising a 2:1 ratio cam belt driven gearbox giving a theoretical ‘lock to lock’ of 540 Deg.  A little less than i wanted but it works ok.  There’s nothing too technical about it other than the gear reduction.  It uses a real sports steering wheel too.  A keen eye might also be able to tell what the bearing/shaft supports are recycled from :)

The pedals were heavily based on the design of the commercial product from http://www.cannonsimulationtechnologies.com. Todd of CST also sells a ‘DIY’ guide for making a pedal set that is somewhat comparable to his commercial product for only US$12.  I probably could have constructed my pedals without the need for the guide but i went and bought it anyway.  I saw it like paying royalties for his design and i think it’s only fair he gets some reward for his efforts.

The main difference with my pedals are basically the fact that i have constructed them almost entirely of things i had at home already or i could acquire for free.  The problem for someone attempting to replicate what i have done is, not everyone would have the stuff lying around like i do but parts can easily be substituted.

So far, the build has only cost me about $80.  The bulk of that cost is for the rod ends that go to the tops of the pedals at ~$16ea.  The springs were about $7 each.  The steering mechanism has been totally free so far.

All these mechanics are no good without some way to interface them with a PC.  I tinkered with the idea of using an optical mouse to track an encoder mounted to the steering wheel at first but this was not far from epic fail.  It worked but was too unreliable, lost it’s center and basically sucked.  One advantage it did have was an almost unlimited number of rotations.  Pity it sucked everywhere else.  Abandoning the optical mouse idea, i moved to the old pot style joystick.  I happened to have an old E-Sky USB trainer in the cupboard that i never use anymore so i gutted that –  The result is the ability to have 4 axis analogue joystick control.  Only problem was that ideally i needed 5 analogue inputs but it was enough for ‘proof of concept’ for now.

Not long after destroying the USB trainer I came across Leo Bodnar’s site.  He sells a generic USB interface that provides 6+ Analogue inputs as well as 32 odd buttons.  While his product is good, it did not really follow the rule of cheap.  At about $80 to get one to my door, it would have doubled the current cost of the build.  Some more googling turned up a ‘product’ called Mjoy by Mindaugas Milasauskas.  It’s a DIY USB joystick interface based on an Atmega8 AVR. It seems that his legacy goes on but for some reason his website is gone.  I am making  Mindaugas’ and version of the joystick interface (for a fraction of the cost of Leo’s).  All of my designs and ideas will be published here.

The interesting thing with the CST pedals is the use of a load sensor for the brake sensing.  This is a superb idea (Although Todd admits it was not his).  This will give a much more real feel to the brake pedal.  I managed to salvage a load sensor from some industrial scales some time back – I knew it would be good for something! The problem is the interface between the load sensor and the joystick controller.  The load sensor only puts out ~2mv at full load, we need 0-5v scale for the joystick interface.  Some more googling dug up an ‘off the shelf’ chip designed for this exact task.  It’s an INA122 by Burr-Brown (owned by Texas instruments i believe).  As it turns out,  this appears to be the chip Leo uses in his controller with load cell interface.  The difference with me is, i’m going to give you all the info you need to get it running with Mindaugas’ design for free.

Details to come….