Finished 2DOF 12V DC wiper arduino playseat

Finished projects, you can't start topics here and have to request a topic in the "administrator" section first.
Please use the image gallery for your pictures, a short tutorial can be found here.
The first image in the first post will be shown in the project gallery.

Finished 2DOF 12V DC wiper arduino playseat

Postby RacingMat » Fri 7. Jun 2013, 09:33

Thanks to Xsim software ;-) I have now the joy to drive my own dynamic 2DOF simulator !!
X-sim / Arduino / motomonster / 12V DC truck wiper motors

Years ago, it was really impossible to start such a project... without a software like Xsim !
But when I came back on the Internet in 2013 with this simulator project still in mind : I discovered Xsim and fully functional projets 8-)

So, I started a simulator and ... I finished it !!!

I'd like to share in return what I did, to help others as I've been helped by reading your posts

It's running in rFactor IA mode in order to show the maximum effects ! and prouve that wiper motors can be strong enough !
It can be smoother.



Among many designs, I finally choose to follow the building instructions of Lipide512, thanks to him for his great tutorial and his help !

The concept:
A dynamic simulator which integrates the driver, the seat, pedals and steering wheel (but not the screens !)
The two axes (2DOF: Two Degrees of Freedom) are : roll and pitch (roulis and tangage).


The principle is inspired by the commercial model from Frex
but with gearmotors (wiper motor + rod) replacing the electric linear actuators.

[*]This simulator uses the essential software Xsim to extract games telemetry data and send the data to the motors.

[*]Two computers :
Pc #1 (graphic card "7970 lightning", Windows 7) :

- The car games (Dirt3, rFactorLite and Richard Burns Rally)
- Xsim Sender

PC #2 (Recycling) connected via a crossover cable RJ45 to PC #1

- Xsim Profiler

[*]Electronic cards : Arduino + Motomonster

An Arduino card linked to computer #2 with a USB cable.
The Arduino controls the MotoMonster shield "motor driver board".

The power board Sparkfun "MotoMonster" drives the two motors (12V 47A = 575W) according to the instructions of the Arduino (5V 5mA = 25 mW).

For simplicity, the motor driver board is equivalent to 4 relays:

driving the right motor forward <-> this means mounting the right side,
driving the right motor in the other direction <-> this means lowering the right side,
driving the left motor forward <-> this means mounting the left side,
driving the left motor in the other direction <-> this means lowering the left side,

An arduino program (C language)

This program interprets the data sent by serial port xsim (instructions) and sends it to the motor control board.
It performs a feedback control by reading the values of the potentiometer coupled to the motors :
-> The actual position is compared to the setpoint, and this will create a new updated order sent to the MotoMonster card.

This feedback loop is performed every 80 ms.

A punchy 12V Power Supply Unit about 30A.

Electric Motors :

2 Truck Wiper Motors for actuating the movable platform, with their positioning potentiometer (for feedback).

Structure in rectangular steel tube:

- the frame
the frame rests on the ground and supports the movable platform via a motor drive shaft (U joint).

- the moving part: the "cockpit"

- A true racing bucket seat (tubular). The fiber seats are lighter but more expensive.
- A harness! important to feel the seat movements and for realism of immersion
- Force Feedback steering wheel and pedals

The dimensions
Here are the quotations to give you an idea :



The step-by-step pictures:


It was very convenient to have the bucket seat's mounting plate: I drilled the structure easily! (Uh, now it's for sale!)

Power Drill and a conical tool to adjust the hole to good diameter
Take care to ensure the shaft 's squareness : it has to be vertical !

Then I crossed the bars at 45 ° to triangulate my frame :

Here's the frame:

The gimbal (U joint) is blocked in rotation along the yaw axis.


the gimbal assembly:

which gives this :-)
and this

Theignition key, of course = :))
a plate on the side of the wheel holder:
and here is a "starter / emergency stop" key §

The pedal support


the right bracket must be folded down!

folding legs with a hammer

The D5mm hole for a screw that will lock the support and prevent it from slipping

After welding, the result in perspective:

Dirlling of the pedals and support plate at the same time
Two-components glue bonding and 4 screws M5x16
take the opportunity to remove the unnecessary ballast which adds to the inertia of the system :)


after painting (and shorter legs):

and perspective view

The 4-point harness

In fact, it is a 6 points but it's too much ! and not comfortable : 4 is fine.

welding a small bolt

the clip can be mounted and removed

side view:


conclusion: the harness is great!

- For the look 8-)
- For immersion: it feels like being in a rally car!
- For sensations: I think we fight less against movements playseat, it is more inclusive

but it requires a keyboard support!

The bottom
To finish the structure, a wooden bottom on which I can put my electric stuff

Drilling diameter 4, threading M5 and screw

The rubber feet

Essential accessory: small rubber feet to absorb vibrations and provide stability on the ground.
Here are some hard plastic and adjustable feet

Width of the frame, I aimed a compact size to begin with
Edit: The first tests have shown that ... it was not wide enough!
then I added + 11 cm on each side (it must go through the door ^ -) for a total of 68 cm

The Center of Gravity cdg
I determined it with "precision" with an assistant:
on a tubular steel rod, roll frame until you find the balance
with the driver in it!
(the rod has to be perpendicular to the plateform !)

Mechanical part:

In Frex system, the seat is operated by electric actuators.
Xsim users recommand the use of SCN5 actuators. The Xsim application has a dedicated setting window.
But the cost was too expansive for me: € 320 each (the only retailer here (

So, the actuators are advantageously replaced by wiper motors and a system of rods (just 10 times less expensive).

Wiper motors

Edit : finally, this bracket is too short : I couldn't mount the 2 motors symmetrically .
If you can, make a DIY bracket with custom height.

-> And check that the rod can rotate 360 °.

Mounting with 3 screws M6 x 16 and washers

A steering rod (15 €):

A connecting rod:
- Center distance 65 mm (finally)
- 5 mm thick

With a file, try to file a 18° cone down : it has to go well on the motor shaft.
Tighten hard !


motors and rods final mounting
sanding the edges to remove the zinc coating of the bracket for a good welding

I checked the alignment of the motors with the platform (= I conterbalanced a small angular error during the welding of the platform)

Edit: the engine brackets are not stiff enough! they move under the constraints.
solution :

and I checked the rod could rotate freely at 360°
do not hesitate to do the same (one full turn may arrive more quickly than you think :-)

here the assembly of the connecting rod with the movable platform :

Fixing rods on the platform:

we notice the hexagonal hollow: handy to tighten nylstop nut for example :-)
it works well for top seat side.

On the other end, I shortened the length of the threaded rod so that it can rotate 360 ° without stumbling. There is a problem : the spindle mounted on ball, turns on itself when i tighten the nylstop nut : '(
So I made a hacksaw deep enough to insert a screwdriver while I clamped the nut.


Mounting potentiometers
wiper motor's preparation = fixing the pot at the back of the engine

1 / tapping of the smooth hole of the engine
2 / a M4 threaded rod
3/ a 6mm diameter (like pot) spacer and M4 tapped


assembled with loctite:

then the parts for making a rotational connection adjustable to adjust the potentiometer
(The brass piece is ... a 380V connecting block course!)

This solution is rather excellent!
it is tight enough to but if it goes too far: the pot is not damaged, it slips.

Making a light and flexible bracket for the pot: it should mainly prevent its rotation and absorb a bit of eccentricity.

thickness: 0.8 mm for soft and flexible
Overall un-folded dimensions: 50mm x 129 mm

the first bracket and the second waiting!

overview !

Engine and rods mounting :

- Make sure the platform is horizontal (spirit level)
- the 2 rods has to be perpendicular (red square on picture)

For the electronic part:
The 12V power supply 47A
eBay, the DPS-600bp model ( ... pb&_sop=15) is 30 € with shipping: 575W
The mod is very light! ad here
There is not need to open the block and therefore no risk of electric shock.

Cards: Arduino and MotoMonster:

I chose not to stack the two cards although it is expected to:
- I wanted to keep me a chance to reallocate the outputs of the Arduino
- I wanted better cooling system (so I raised the motomonster)

a video to show the amplitudes of movement of the cockpit and the moving speed.
The position commands are typed by hand in the arduino serial monitor (RF7LF7 then RAELFF etc ...)

Heat sinker had to be cut in half in order to have a good contact with the 2 chips (uneven)

go for the thermal paste

spreading the paste:


Protection for cables :
-> electrical conduit
-> A notch

-> And insert in the hole!

the cover of the electronic cards with his fan

+ a grid that prevents the wires to be worn against the fan's blades.


a glogal overview of the electrical stuff:

Arduino configuration :
PC1 : Games & Sender
windows seven
IP fixe : (TCP/IP v4 protocol)
this PC runs the games
and Xsim Sender

PC2 : Profiler
windows seven
IP fixe : (TCP/IP v4 protocol)
this PC runs Xsim Profiler
and communicates with Arduino via USB serial cable.

*/ Arduino : install manually the drivers (see the Arduino's documentation for Windows Seven installation).
After complete installation, find in the Windows system on which COM Port it has been installed : you will need to put this information in Xsim Profiler.


Double clic on Arduino's line and adjust the default speed :

In the Arduino plateform, put the right COM Port : if not, you won't be able to upload your program into the Arduino...

If you need to lead some communication tests, use the Serial Monitor ("magnifying lens" on top right ).

Adjust here as well the same default speed :
and you will have to copy this very same information in Xsim Profiler !

Arduino's code

Code: Select all
 Arduino code for dynamic playseat 2DOF
 Created 24 May 2011 by Jim Lindblom   SparkFun Electronics "Example Code"
 Created 24 Apr 2012 by Jean David SEDRUE Version betatest26 - 24042012
 Updated 20 May 2013 by RacingMat in english in french :
 Updated 30 April 2014 by RacingMat (bug for value below 16 corrected)

#define BRAKEVCC 0
#define RV  2 //beware it's depending on your hardware wiring
#define FW  1 //beware it's depending on your hardware wiring
#define STOP 0
#define BRAKEGND 3

#define pwmMax 255 // or less, if you want to lower the maximum motor's speed

// defining the range of potentiometer's rotation
const int potMini=208;
const int potMaxi=815;

#define motLeft 0
#define motRight 1
#define potL A5
#define potR A4

/*  VNH2SP30 pin definitions*/
int inApin[2] = {
  7, 4};  // INA: Clockwise input
int inBpin[2] = {
  8, 9}; // INB: Counter-clockwise input
int pwmpin[2] = {
  5, 6}; // PWM input
int cspin[2] = {
  2, 3}; // CS: Current sense ANALOG input
int enpin[2] = {
  0, 1}; // EN: Status of switches output (Analog pin)
int statpin = 13;  //not explained by Sparkfun
/* init position value*/
int DataValueL=512; //middle position 0-1024
int DataValueR=512; //middle position 0-1024

void setup()
  // serial initialization

  // initialization of Arduino's pins
  pinMode(statpin, OUTPUT); //not explained by Sparkfun
  digitalWrite(statpin, LOW);

  for (int i=0; i<2; i++)
    pinMode(inApin[i], OUTPUT);
    pinMode(inBpin[i], OUTPUT);
    pinMode(pwmpin[i], OUTPUT);
  // Initialize braked for motor
  for (int i=0; i<2; i++)
    digitalWrite(inApin[i], LOW);
    digitalWrite(inBpin[i], LOW);
///////////////////////////////// Main Loop ////////////////////////////////////
void loop()
  int sensorL,sensorR;

  readSerialData();   // DataValueR & L contain the last order received (if there is no newer received, the last is kept)
  // the previous order will still be used by the PID regulation MotorMotion Function

  sensorR = analogRead(potR);  // range 0-1024
  sensorL = analogRead(potL);  // range 0-1024

// Procedure: wait for complete trame
void readSerialData()
  byte Data[3]={
    '0','0','0'          };
  // keep this function short, because the loop has to be short to keep the control over the motors

  if (Serial.available()>2){
    //parse the buffer : test if the byte is the first of the order "R"
    if (Data[0]=='L'){
      //  call the function that converts the hexa in decimal and that maps the range
    if (Data[0]=='R'){
      //  call the function that converts the hexa in decimal and maps the range

  if (Serial.available()>16) Serial.flush();
void motorMotion(int numMot,int actualPos,int targetPos)
  int Tol=20; // no order to move will be sent to the motor if the target is close to the actual position
  // this prevents short jittering moves
  //could be a parameter read from a pot on an analogic pin
  // the highest value, the calmest the simulator would be (less moves)

  int gap;
  int pwm;
  int brakingDistance=30;

  // security concern : targetPos has to be within the mechanically authorized range


  if (gap<= Tol) {
    motorOff(numMot); //too near to move     
  else {
    // PID : calculates speed according to distance
    if (gap>50)   pwm=215;
    if (gap>75)   pwm=235;   
    if (gap>100)  pwm=255;
    pwm=map(pwm, 0, 255, 0, pwmMax);  //adjust the value according to pwmMax for mechanical debugging purpose !

    // if motor is outside from the range, send motor back to the limit !
    // go forward (up)
    if ((actualPos<potMini) || (actualPos<targetPos)) motorGo(numMot, FW, pwm);
    // go reverse (down)   
    if ((actualPos>potMaxi) || (actualPos>targetPos)) motorGo(numMot, RV, pwm);


void motorOff(int motor){ //Brake Ground : free wheel actually
  digitalWrite(inApin[motor], LOW);
  digitalWrite(inBpin[motor], LOW);
  analogWrite(pwmpin[motor], 0);
void motorOffBraked(int motor){ // "brake VCC" : short-circuit inducing electromagnetic brake
  digitalWrite(inApin[motor], HIGH);
  digitalWrite(inBpin[motor], HIGH);
  analogWrite(pwmpin[motor], 0);

void motorGo(uint8_t motor, uint8_t direct, uint8_t pwm)
  if (motor <= 1)
    if (direct <=4)
      // Set inA[motor]
      if (direct <=1)
        digitalWrite(inApin[motor], HIGH);
        digitalWrite(inApin[motor], LOW);

      // Set inB[motor]
      if ((direct==0)||(direct==2))
        digitalWrite(inBpin[motor], HIGH);
        digitalWrite(inBpin[motor], LOW);

      analogWrite(pwmpin[motor], pwm);


void motorDrive(uint8_t motor, uint8_t direct, uint8_t pwm)
  // more readable function than Jim's (for educational purpose)
  // but 50 octets heavier ->  unused
  if (motor <= 1 && direct <=4)
    switch (direct) {
    case 0: //electromagnetic brake : brake VCC
      digitalWrite(inApin[motor], HIGH);
      digitalWrite(inBpin[motor], HIGH);
    case 3: //Brake Ground (free wheel)
      digitalWrite(inApin[motor], LOW);
      digitalWrite(inBpin[motor], LOW);
    case 1: // forward : beware it's depending on your hardware wiring
      digitalWrite(inApin[motor], HIGH);
      digitalWrite(inBpin[motor], LOW);
    case 2: // Reverse : beware it's depending on your hardware wiring
      digitalWrite(inApin[motor], LOW);
      digitalWrite(inBpin[motor], HIGH);
    analogWrite(pwmpin[motor], pwm);
// testPot
void testPot(){


void testpulse(){
  int pw=120;
  while (true){

    motorGo(motLeft, FW, pw);
    motorGo(motLeft, RV, pw);


    motorGo(motRight, FW, pw);
    motorGo(motRight, RV, pw);
    Serial.println("testpulse pwm:80");     

// Function: convert Hex to Dec
int NormalizeData(byte x[3])
  int result;

  if ((x[2]==13) || (x[2]=='R') || (x[2]=='L'))  //only a LSB and Carrier Return or 'L' or 'R' in case of value below 16 (ie one CHAR and not 2)
    x[2]=x[1];  //move MSB to LSB
    x[1]='0';     //clear MSB
  for (int i=1; i<3; i++)
    if (x[i]>47 && x[i]<58 ){//for xA to xF
    if (  x[i]>64 && x[i]<71 ){//for x0 to x9
  // map the range from Xsim (0 <-> 255) to the mechanically authorized range (potMini <-> potMaxi)
  return result;

copy/paste the code in a "sketch" (.ino file) and upload it into the Arduino

first hardware tests and trials

First : your pot are not mounted onto the motor
you can see the expected behaviour in this video
and please find the explanation of the code here :

The code is written to put the simulator on middle position at start :
/* init position value*/
int DataValueL=512; //middle position

- if your pot is fully turned to max, as Arduino "reads" potentiometer value as motor position, Arduino believes that motor is in max position.
- but the order is to be in middle position
- so the Arduino will ask the motor to go reverse in order to go to middle position
- your motor is turning
- but while your pot keeps still, the motor will turn non stop !

- when you manually turn the pot backward to min, Arduino reads that motor is in min position
- but the order is still middle position, so Arduino will tell the motor to go forward
- motor runs non stop until the pot is in middle position

In the code, you have a "tolerance" parameter : when the pot is around middle position (<middle+tolerance and >middle-tolerance), the motor stops.
You can broader Tolerance value to stop your motor more easily manually.

Second : now checked the wiring
Once you have played in this manner, now checked the wiring
simulate the pot mounted onto the motor (back to back or alongside with gears...)
reduce the speed (pwmMax) to see the direction of motor rotation
and check if Arduino will behave as expected when you turn the pot

if your pot is mounted this way :

when you turn in a direction, motor has to go the opposite way.
If not, invert motor wiring or pot wiring.

Warning ! if you have gears between pot and motor, you'll have to twist your mind :eek: to check the correct behaviour.

Third : mount the pot onto the motor, the behaviour will be the following :
- motor goes to middle position and stop
- if you send order to Arduino via Serial Monitor (say R7FLAE) the left motor will move and stop at his new position ! right motor didn't move.
- etc...

First serial tests without Xsim
For beginning, start by sending yourself instructions to the Arduino and to your motors...
No need at this stage to use Xsim and Game's data !

In the "Serial Monitor" send the following strings in Hexa and Enter:
-> it should move the playseat in horizontal position

R01L01 (max !!)
-> it should tilt the playseat backward and a bit further

RFFLFF (Max !!)
-> it should tilt the playseat forward and a bit further

You can mix for rolling movment :
R01LFF (Max !!)
-> roll left

RFFL01 (Max !!)
-> roll right

Xsim setup
Then in Xsim Profiler / Output / port com

serial Port configuration :
select the right arduino's COM Port

if you don't find it in the drop box, write it directly (as explained below the drop box on the screen) like this \\.\com4

For rFactor game (and many other games) :
- find its plugin (if it exists or a compatible one) in the Xsim's plugin's directory : copy it
- paste it in the plugin's directory of the game

Xsim sender (running on the Game PC#1) defines the following parameters :

IP address of the 2nd PC
the path of the game executable file
the plug in being used
informations for the joystick ...

Easy !
These parameters are saved in a text file with .fsd extension (XSim 2)

Xsim profiler (pc #2) transforms and combines the telemetry data in order to get an order for each motors.
Muy difficil !!!

- serial link choice (for me and my Arduino, its USO not synaptrix)
- Axe 0 : combination of (lateral, longitudinal, pitch ...) game telemetry effects to calculate the right motor's position
- Axe 1 : combination of (lateral, longitudinal, pitch ...) game telemetry effects to calculate the left motor's position
- some general parameters of the software
- serial link's configuration : port number, data's format (for me, its R~a02~L~a01~)

These parameters are saved in a text file with rn2 extension (XSim 2)

select your "Right DOF" and type the format awaited by arduino "~a0~"
8 bits resolution and hexadecimal output
watch out, the ~ characters are mandatory !

the same with "Left DOF"

"Output Protocol Parser" (the values that will be sent every cycle) :

packet send on start : R7FL7F
this is a middle position (ie the simulator is parallel to the ground) (7F = 127 : mi-course de l'amplitude des potards = niveau 0)

data's format :
it means that the values of a0 are sent to the "Right motor/DOF" and the same for a1 and Left Motor

packet send on simstop : R7FL7F
when Xsim stops sending game telemetry's data, it puts the simulator back to the midlle position


On the next picture, I show the different ranges and conversions through all the stages from the game / Sxim / Arduino / pot / motor
it useful if you need to understand the code ;-)


Items to buy
- motors 12N.m 24V : 2x35€ + 16€ shipping
SWF VALEO NIDEC ITT 404.458 motoréducteur 24V DC

- Arduino board : 25€ + shipping

- MotoMonster board (16V max) :
70€ @ Sparkfun
27$ @ DX

- server PSU 12V 47A (575W) DSP600 : 35€ on eBay

- 2x potentiometers : 2x7€ + shipping
you can buy any cermet potentiometer : "cermet" means Ceramic Metal.
It guarantees you that it's the strongest design compared to plastic-carbon low cost pot.

- cermet
- linear (not logarithmic)
- 10 kOhm

I bought mine at ... -11293.htm
you can find here many other electronic distributors :

+ my plateform structure weight 8,6 kg
tube 30x20x1,5 (1,1 kg/m) 5,4m : 5,9 kg
tube 16x16x1,5 (0,7 kg/m) 4,1m : 2,7 kg
+ rally tube seat : 9 kg
+ rally harness : 1 kg
+ logitech MOMO wheel and pedals : 4,5 kg
+ buttkicker 1 kg
subtotal : 25 kg

+ driver !
grand total : 100 kg which is heavy and has great inertia in mouvements !
-> so keep in mind to build light

Electrical power consumption

I measured the power with this wattmeter : 1961

PC#1 Games : 80 to 100W
PC#2 notebook : 30 to 45W
Dolby 5.1 : 15W
Power supply PSU : in IA mode rfactor which sakes a lot ! between 170W and 220W (depending on the parameters in Arduino code : max speed and amplitude)
the PSU efficientcy is 81%, hence it gives 180W to the motors.

-> 90W per motor -> 7,5 A in 12V DC

If you wish to leave comments, :-)
go to this post in the "in progress forum"
because this post is locked.
Last edited by RacingMat on Sun 9. Jun 2013, 18:02, edited 6 times in total.
User avatar
X-Sim Stage 2 edition
Posts: 451
Images: 147
Joined: Wed 20. Feb 2013, 21:30
Location: Marseille - FRANCE
Has thanked: 4 times
Been thanked: 118 times

Return to Motion simulator Finished Project Gallery

Who is online

Users browsing this forum: No registered users and 1 guest