Build Guide

**** DISCONTINUED ****

For some time now I have been watching the direct drive sim wheel projects with a desire to own one myself however the price has always been more than I was willing to pay.  I decided to investigate alternate solutions and early on came to the conclusion a stepper motor could be the answer.  Initially I tried to use off the shelf stepper controllers and modify them to work.  While I made progress they didn't give the results I was expecting.  The solution was to design a stepper controller specifically for use as a sim wheel.

I have not had the opportunity to try any other direct drive sim wheels so I can't provide any comparisons at this time.  My assumption is that the Stepper Sim Wheel would give results somewhere between the high level belt/gear driven consumer wheels and the direct drive servo wheels.  The Stepper Sim Wheel design detailed on this site currently produces a max torque of around 9 to 10Nm.

So is it really possible to build a direct drive ffb sim wheel for under AU$600.  The answer is yes, however note this is for a basic wheel only without any shifters or pedals, and of course assumes you can source the parts for the costs listed below.

Basic parts list (Australian $):

Step 1 - Attaching the Encoder to the Stepper Motor

Stepper motors are typically used open loop and don't usually come with encoders fitter to the shaft (although they are available).  So the first step is to attach the encoder.  This is an important step and needs to be done carefully and accurately as a poorly fitted encoder can cause major problems with the sim wheel.

Below is a picture of one way to mount the encoder to the back of the motor.  This method used a 3D printed adaptor (the .stl file can be found here).  You don't have to use a 3D printed part but it makes it neat.

  

To mount the encoder you need to drill a 6mm hole (or whatever the diameter of your encoder shaft is) into the back shaft of the motor.  First put tape over the end of the shaft so no filings can get into the motor when you drill the hole - some sort of stretchy plastic tape is ideal.  It is strongly advised to use a drill press or some other way to ensure the hole is dead center of the motor shaft and parallel with the shaft.  Below is a photo after drilling a hole but you can see how it was taped up first.  The second photo shows after the tape was removed.  The hole is drilled approx 15mm deep from the back face of the motor (about 10mm into the shaft in this example)  Just deep enough for the encoder shaft to fit in without bottoming out.

  

Mount the encoder into the printed part if using it (you could also use a flat disk of wood - the idea is just to get a large flat surface to glue to the motor) using three screws.  

Put a small amount of silicon glue (pure silicon - the stuff that is real thick and tacky) in the motor shaft hole.  Put some good quality doubled sided tape (carpet tape is ideal) on the base of the encoder mount and fit the two together and let it dry.  There should be no wobble or slop in the mounting or you will have problems with the wheel smoothness.

Note: I have seen others insert a 6mm steel shaft into the motor and then attach the encoder using a flexible coupler which worked well - the only difference is the encoder sticks out from the back of the motor more. 

Step 2 - Make (or Buy) a Steering Wheel Adaptor

Again there are many ways to mount the steering wheel including printing an adaptor on a 3D printer.  The method used here was fabricated from a 3mm metal plate and piece of galv pipe both from the local hardware store, from memory about $4 each.  (Be careful if welding galvanised or zinc plated metals, the fumes can be very poisonous.  Grind the plating off before welding, ensure good ventilation, and wear a filter mask)

First was to cut the desired shape from the metal plate (working around any holes that may already be in the plate).

  

This is just one low cost solution - there are also 3D printed options as well as high quality shaft mounts available to purchase from some of the OSW parts suppliers.

Step 3 - Programming the STM32 Discovery Board

The firmware for the STM32F4DISCOVERY board is that developed by MMos.  This firmware implements a standard PC HID FFB Wheel interface.  The firmware and ongoing discussion can be found and downloaded from the French virtualracing.org forum here:

[DIY] USB Force Feedback Wheel Controller

You will need to register on the forum to download the firmware which can be found at the bottom of the first post.  Download both:

 

Next download the ST-Link software required to download code to the STM32F4DISCOVERY board.  I used version STSW-LINK004 available here.   

Install the STSW-LINK004 on your windows computer (do this before plugging the board into the USB to ensure correct drivers are installed first).  Answer yes when prompted to install the device drivers.

Once the STSW-LINK004 software is installed plug in the STM32F4DISCOVERY to the computer using the "mini USB" connector (this is the st-link connector).

Run the  "STM32 ST-Link Utility" that was installed above.

Select "Connect" and the utility should successfully connect to the STM32F4DISCOVERY board.  A LED on the board will flash green/red.

Select "File -> Open" and navigate to the unzipped "MMosFFB_FW_0.99.2\FFB2014-0.99.2.hex" file and open it.

Select "Target -> Program & Verify" then click the "Start" button in the window that pops up.

If all goes well you will get a message that the board was successfully programmed.

Step 3a - IMPORTANT, Ensure the DISCO Board has the Latest Link Software

I have found that the newer version of the DISCOVERY boards, the STM32F407G-DISC1, sometimes comes with an early version of the Link software.  This early version causes the DISCO board to remain in reset when powered by the 5V rail as is required in this project.  The fix is to simply upgrade the Link software on the DISCO board to the latest version using the STSW-LINK004 utility software used above.   

Select menu item "ST-LINK -> Firmware update" the click the "Device Connect" button then

Select "Yes" to upgrade ST-Link firmware 

This step will erase the MMOs software as detailed in Step 3 so if it is required you will need to reprogram the MMOs software after doing this.  (You may not notice if this step is required until you get further down the procedure at Step 8 and power the DISCO1 via the Stepper Control Board +5V and it doesn't power up or get recognised by the computer.)

UPDATE: After doing this step to fix another board with the problem I actually noticed it appears to be downgrading the firmware to an earlier version... either way the step seems to fix the problem with the newer DISCO1 boards not powering up while using an external +5V supply - which is required by this project.  

Step 3c - Check the STM32 board and MMos firmware are detected by Windows

Once you have ensured the STM32 has the latest Link software and programmed the MMos firmware on it you can go ahead and check if it is successfully recognised by Windows as an MMos force feedback controller. 

Connect a "micro USB" cable between the STM32F4DISCOVERY and the computer, ie the USB plug at the other end of the discovery board.  NOTE: you will now have two USB cables between your computer and the STM32 board, there should be no other connections to the STM32 board at this time.

Windows should now do its stuff and detect the device and install any required drivers.  The MMos firmware is detected as a standard HID device so the drivers required are default windows drivers, nothing special.

Once installed the MMos device should show up under Windows Devices & Printers.  The board is now ready for use with the stepper sim wheel.

Step 3d - Configuring the Interface

Now that the STM32 and MMos are successfully recognised by Windows it is an ideal time to configure the interface.  To do this unzip the MMosFFB_Tool_0.91.zip file and run the file MMosForceFeedback2014.exe

You should see a GREEN usb plug icon in the bottom left of the window as shown below... If it is RED then the MMos/STM32 is not installed and detected by Windows properly.

Setup all parameters as shown in the above image and then click on the "Setup" button and set those parameters as shown below... (You can leave the Analog Axes, Buttons 1-16, Buttons 17-32, and Shifter set to "None" at this stage - these settings are dependant on what additional devices you connect to the controller.

 

Then click "Save".  Once back to the main window select "EEPROM" from the FFB Configuration dropdown and then click "Save" again.  The board will now be ready for use with the Stepper Torque Controller.

Step 4 - Wiring Up the Electronics

A block diagram overview of how the electronics connects together is shown below for reference.  Note only one power supply is required as there is a 5V output from the Stepper Torque Controller suitable for powering the STM32F4DISCOVERY.

Connection of pedals, shifters and buttons is quite straight forward with the MMos / DISCO board but won't be explained on this page as it isn't required for the wheel to work. 

Step 5 - Connecting the Motor and Encoder

First connect just the motor and the encoder without the STM32F4DISCOVERY.   Note at this point the encoder should be physically mounted to the wheel as described in the initial steps.

WARNING - Never disconnect/connect motor wires with the power on - It will likely blow the output drivers on the control board

 

It will be necessary to extend the motor wires in length, ensure to use similar gauge wire  (or better) to that coming from the motor.  It is also recommended that you use a suitable type of connector between the board and motor rather than connecting the motor wires direct to the board to enable them to be easily unplugged and plugged when mounted in a case.  The same goes for the encoder wires.  See the Sourcing Parts page for ideas of suitable connectors.

Step 5a - Connecting the Encoder

The encoder is connected to the Stepper Torque Controller via the 5 Pin header labelled P5.  Connect the encoder wires in the order as labelled on the board.  The encoder count signals are usually labelled A and B - these connect to the Stepper Torque Controller ENA and ENB pins.  The encoder index signal may be labelled as Index or Y or Z - this connects to the Stepper Torque Controller ENY pin.  Don't forget the +5V and GND wires.  Note the encoder you use must be 5V compatible and have 2000ppr. 

Note: In the case of E6B2-CWZ6C encoder, it has the shield labelled as GND and the Blue wire labelled 0V(COMMON).  It is the OV(COMMON) that must be connected to the Stepper Torque Control board GND however it is a good idea to also connect the Shield GND.

Step 5b - Connecting the Motor

The motor connects with one winding pair going to each connector on the Stepper Torque Controller.  To find the motor winding pairs you can use a multi-meter.  Find two wires that measure low resistance between them (with the motor disconnected)  - this is a pair.

Another easy way to find the winding pairs is (with the motor disconnected) turn the motor shaft with your hand to get an idea how easy it turns.  Now short any two wires together, if the motor shaft is now harder to turn you have found a winding pair.  The other two wires should have the same effect if shorted together.  Note down the pair colours.  If the motor wasn't harder to turn then select a different pair of wires and try again.  It should be obvious when you have the correct pair.

Now connect each pair to one of the screw terminal connectors on the Stepper Torque Controller.  At this stage it doesn't matter which way round they are wired as long as one pair goes to one screw terminal connector and the other pair goes to the second screw terminal connector. 

Step 5c - Connecting the Power Supply

The Stepper Sim Wheel uses a 24V DC power supply.  Connect the PSU +24V to the RED wire and PSU 0V/GND to the Black wire of the Stepper Torque Control board.  If the power supply does not have a mains power cable attached arrange for a licensed electrician to connect one.

While it is not mandatory it is highly recommended to place a 7A fast blow fuse in series with the PSU +24V wire to the Stepper Torque Control board. 

Step 6 - Initial Turn On and Adjustment - Motor and Encoder Only

Before powering up the wheel first make sure everything is secure, there is no chance of boards moving and touching anything metal or conductive and no chance of shorting wires.  Also make sure your motor is securely mounted - if not it will likely spin from inertia and the wires will wrap around it and potentially rip out from the board.  If you aren't immediately putting everything in a case then at least bolt the boards down and make sure all wires are secure - it's easy to damage things if something moves and shorts out.

WARNING - Ensure the motor is securely bolted to the desk before turning on

Step 6a - Checking Motor Direction

The first check is to make sure the stepper is wired to run in the correct direction.

This is done by placing the jumper (on the Stepper Torque Controller) on the two pins marked TEST.  Turn the power (+24V supply) on.  If the motor is slowly turning clockwise (ie when a wheel is mounted the wheel would be turning the car to the right) then the motor is wired correctly.  If the motor is slowly turning in the opposite direction then you need to turn off the power and reverse the wires for one phase only by swapping them at the screw terminals.  For clarification you are only swapping two wires both on the same terminal block.   Reconnect the power and your motor should be running in the correct direction.  The motion may not be smooth at this stage and will stop for about 5seconds every 360degs.  Do not try to stop the wheel while in test mode.

Step 6b - Checking Encoder Direction

The next check is to make sure the encoder signals are wired to count in the correct direction (only do this step after you have the motor turning in the correct direction above).

Again with the jumper in the TEST position turn on the power (+24V supply) on so the motor begins to turn.  If the encoder is counting in the correct direction there will be two red LEDs glowing on the controller.  If the encoder is counting in the reverse direction only one of the LEDs will be glowing.

In the case you have only one LED glowing, turn off the power and swap the two wires connected to the ENA and ENB pins.  This should make reverse the encoder count.  Turn the wheel power back on and the wheel should begin to turn again and both LEDs should be glowing.   

WARNING - Never disconnect/connect motor wires with the power on - It will likely blow the output drivers on the control board 

Step 7 - Locating the Encoder Index for Centering the Wheel Mount

While it is not mandatory, it helps to mount the wheel in line with the index signal of the encoder. To find the index signal simply run the wheel in the TEST mode described above. The motor turns in a clockwise direction but if you wait you will notice it stops for about 5 seconds once every complete rotation. The position the motor stops is when the encoder index is located. Mark the shaft at this time with a felt pen so you know where it is and use it to align the wheel when mounting it.

Step 8 - Connecting the MMos / STM32F4DISCOVERY Board

The easiest way to make connections between the Stepper Torque Controller board and the STM32F4DISCOVERY is to use female-female 2pin wire jumpers commonly available on ebay as shown below.  Just peal off as many wires as you need and make the connections.  Its a bit extra work but labelling the wires can save time later down the track if one falls off - you don't have to backtrack through all the design notes to find where it goes.  Of course this shouldn't be an issue if you put everything in a case which is also highly recommended.

NOTE - It is better to connect to the pins on the underside of the STM32 board as there are longer pins and more secure when using jumper wires 

Connections between STM32F4DISCOVERY and Stepper Torque Controller.  (Note: the Motor and Encoder remain connected to the Stepper Control Board) 

Step 9 - Connecting to the Computer and Testing the Wheel

When connecting the completed wheel to the computer it is important to note there is only one USB connection - the Micro USB port on the STM32F4DISCOVERY.  The second Mini USB port should be left unconnected.  The STM32 board gets it's power from the Stepper Torque Controller via connector P4.  Note: the STM32 / MMos board should already be setup by now as per steps earlier "Configuring the Interface".

Make sure your wheel motor is securely mounted to the desk - if not it will likely spin from inertia and the wires will wrap around it and potentially rip out from the board.

WARNING - Ensure the wheel motor is securely bolted to the desk before turning on

Place the jumper on the Stepper Torque Control board to the RUN position.  Double (triple) check all wires are correct.  Turn on the 24V power to the wheel.  If anything gets hot or doesn't seem right switch off immediately.  

Step 9a - The Wheel Buzz

Shortly after power on the wheel motor will make some buzzing noises... two short buzzes followed by a brief delay and then another slightly longer buzz.  This indicates the wheel is performing its calibration alignment steps and should not be touched.  There should be no external force applied to the wheel between these buzzes - if there is then it may be necessary to switch off and do it again.  Once complete the wheel is ready to locate the encoder index.

Step 9b - Locating the Index

Each time the wheel powers up the MMos interface software needs to locate the encoder "Index" signal so it knows the position of the wheel.  Until it finds the index there will be no FFB and a BLUE LED will be flashing on the STM32F4DISCOVERY board.  Simply rotate the steering wheel until the "Index" is found and the BLUE LED will stop flashing.  If you mounted the wheel in alignment with the index signal as explained earlier then it is simply a matter of turning the wheel to the center position if it isn't already there.  

Once the BLUE LED stops flashing the wheel is ready for use.

Step 9c - The Force LEDs

There are two LEDs on the STM32 board either side of the BLUE LED, one RED and one GREEN.  These glow proportionally to the force feedback applied to the wheel - one for each direction.

Also note if the force feedback from the game gets to the maximum the BLUE LED will come on indicating that the MMos Interface is now clipping the signal.

Step 9d - Tweaking the MMos Settings

You can run the MMosForceFeedback2014.exe file at any time to change the settings to your liking.  Don't change the PWM and Encoder settings though.  To have the new settings active each time you start the wheel it is necessary to save them to "EEPROM".  Once this is done the MMosForceFeedback2014.exe is no longer needed to use the wheel.