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
Mat






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.

1665

1634

Among many designs, I finally choose to follow the building instructions of Lipide512, thanks to him for his great tutorialhttp://www.gamoover.net/Forums/index.php?topic=25907.0 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).

1557

The principle is inspired by the commercial model from Frexhttp://www.frex.com/gp/motion/motionpage1.html
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 :

1502

1610


The step-by-step pictures:

Structure

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


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 !
1550

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

Here's the frame:
1552

Look for a car or truck gimbal at scrap yard or
an ebay search "rear drive shaft" (don't buy a RC model shaft ;-)

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

1576

the gimbal assembly:
1560
1561

which gives this :-)
1562
1563
and this
1503



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


The pedal support

1588

1589
1590
the right bracket must be folded down!
1594

folding legs with a hammer
1593

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

After welding, the result in perspective:
1596

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 :)

1597


after painting (and shorter legs):
1608

and perspective view
1609


The 4-point harness

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

welding a small bolt
1613

the clip can be mounted and removed
1615

side view:
1616

Overview:
1617

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
1587

Drilling diameter 4, threading M5 and screw
1607

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
1599

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
1600
1601

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 !)
1555

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 (https://miraiintertech.com/e-store/products/SCN5.html))

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.
1573


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


Mounting with 3 screws M6 x 16 and washers
1572

A steering rod (15 €):
1614

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

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

Overview
1575

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

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

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

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 :-)
1584

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

Fixing rods on the platform:

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

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.
1592

1598

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

1578

assembled with loctite:
1585

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

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

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!
1581

overview !
1506

Engine and rods mounting :

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

For the electronic part:
The 12V power supply 47A
1558
eBay, the DPS-600bp model (http://www.ebay.fr/sch/i.html?_from=R40 ... pb&_sop=15) is 30 € with shipping: 575W
The mod is very light! https://sites.google.com/site/tjinguytech/my-projects/HP47A ad here http://www.worldwidedx.com/general-ham-radio-discussion/121243-server-power-supply-conversion-cheap.html
There is not need to open the block and therefore no risk of electric shock.


Cards: Arduino and MotoMonster:

here is the wiring diagram I followed from Lipide512


1505

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)

If you bought the Motomonster board, the simpliest is to stack it onto Arduino !



If you don't, you have to follow the following pinout :
Arduino and Motomonster have same pin's number !
connect together

Arduino .../...Motomonster
......GND <-> GND pin
........5V <-> 5V
.....pin 4 <-> pin 4
.....pin 5 <-> pin 5
.....pin 6 <-> pin 6
.....pin 7 <-> pin 7
.....pin 8 <-> pin 8
.....pin 9 <-> pin 9

pin 13 is not needed
on the pictures, I've soldered more wires (but they are unused wire...).

Alternative: the olimex VNH3SP30 works like Motomonster VNH2SP30: 1 pin for PWM speed, 2 pins needed for direction
and can handle 24V
and so the code is compatible!

specs https://www.olimex.com/Products/RobotPa ... h3sp30.pdf

The Olimex board (integrating VNH chip) pinout is:
Olimex pin 5 = inA motor1
Olimex pin 4 = inB motor1
Olimex pin 6 = pwm1

Arduino /.. VNH3SP30 motor1
Ard GND <-> Olimex GND pin
Ard 5V <-> Olimex 5V
Ard pin 4 <-> Olimex pin 5 inA motor1
Ard pin 9 <-> Olimex pin 4 inB motor1
Ard pin 6 <-> Olimex pin 6 pwm1

Arduino /.. VNH3SP30 motor2
Ard GND <-> Olimex GND pin
Ard 5V <-> Olimex 5V
Ard pin 7 <-> Olimex pin 5 inA motor2
Ard pin 8 <-> Olimex pin 4 inB motor2
Ard pin 5 <-> Olimex pin 6 pwm2


Arduino / Potentiometers
Ard pinA0 <-> center pin of pot 1
Ard pinA1 <-> center pin of pot 2
Ard pinGND <-> 0 ohm's pin potentiometer 1 & 2
Ard pin 5V <-> 10k ohm's pin potentiometer 1 & 2

First movement tests
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)
1566

go for the thermal paste
1564

spreading the paste:
1565

1567

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

-> And insert in the hole!
1569

the cover of the electronic cards with his fan

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

overview:
1606

a glogal overview of the electrical stuff:
1618

For your information, here the wiring for 2 motomonsters and 1 arduino if you intend to build a 3DOF or 4DOF
3387

If you're using more powerfull motors, you can use one Motomonster per motor. Follow the specification of VNH
3479

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

PC2 : Profiler
windows seven
IP fixe : 192.168.0.4 (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.

1667

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

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

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


Adjust here as well the same default speed :
1671
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 https://www.sparkfun.com/products/10182 "Example Code"
 Created 24 Apr 2012 by Jean David SEDRUE Version betatest26 - 24042012 http://www.gamoover.net/Forums/index.php?topic=25907
 Updated 20 May 2013 by RacingMat in english http://www.x-sim.de/forum/posting.php?mode=edit&f=37&t=943&p=8481  in french : http://www.gamoover.net/Forums/index.php?topic=27617
 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 A0
#define potR A1

////////////////////////////////////////////////////////////////////////////////
//  DECLARATIONS
////////////////////////////////////////////////////////////////////////////////
/*  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

////////////////////////////////////////////////////////////////////////////////
// INITIALIZATION
////////////////////////////////////////////////////////////////////////////////
void setup()
{
  // serial initialization
  Serial.begin(115200);

  // 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

  motorMotion(motRight,sensorR,DataValueR);
  motorMotion(motLeft,sensorL,DataValueL);
}
////////////////////////////////////////////////////////////////////////////////
// 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"
    Data[0]=Serial.read();
    if (Data[0]=='L'){
      Data[1]=Serial.read();
      Data[2]=Serial.read();
      //  call the function that converts the hexa in decimal and that maps the range
      DataValueR=NormalizeData(Data);
    }
    if (Data[0]=='R'){
      Data[1]=Serial.read();
      Data[2]=Serial.read();
      //  call the function that converts the hexa in decimal and maps the range
      DataValueL=NormalizeData(Data);

    }
  }
  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
  targetPos=constrain(targetPos,potMini+brakingDistance,potMaxi-brakingDistance);

  gap=abs(targetPos-actualPos);

  if (gap<= Tol) {
    motorOff(numMot); //too near to move     
  }
  else {
    // PID : calculates speed according to distance
    pwm=195;
    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);
      else
        digitalWrite(inApin[motor], LOW);

      // Set inB[motor]
      if ((direct==0)||(direct==2))
        digitalWrite(inBpin[motor], HIGH);
      else
        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);
      break;
    case 3: //Brake Ground (free wheel)
      digitalWrite(inApin[motor], LOW);
      digitalWrite(inBpin[motor], LOW);
      break;
    case 1: // forward : beware it's depending on your hardware wiring
      digitalWrite(inApin[motor], HIGH);
      digitalWrite(inBpin[motor], LOW);
      break;
    case 2: // Reverse : beware it's depending on your hardware wiring
      digitalWrite(inApin[motor], LOW);
      digitalWrite(inBpin[motor], HIGH);
      break;
    }
    analogWrite(pwmpin[motor], pwm);
  }
}
////////////////////////////////////////////////////////////////////////////////
// testPot
////////////////////////////////////////////////////////////////////////////////
void testPot(){

  Serial.print(analogRead(potL));
  Serial.print(";");
  Serial.println(analogRead(potR));
  delay(250);

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

    motorGo(motLeft, FW, pw);
    delay(250);       
    motorOff(motLeft);
    delay(250);       
    motorGo(motLeft, RV, pw);
    delay(250);       
    motorOff(motLeft);     

    delay(500);       

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

  }
}
////////////////////////////////////////////////////////////////////////////////
// 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 x0 to x9
      x[i]=x[i]-48;
    }                       
      if (x[i]>64 && x[i]<71 ){//for xA to xF
      x[i]=(x[i]-65)+10;       
    }
  }
  // map the range from Xsim (0 <-> 255) to the mechanically authorized range (potMini <-> potMaxi)
  result=map((x[1]*16+x[2]),0,255,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
http://www.youtube.com/watch?v=oFnLDR2xGgg
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 :
1579

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 !

L for Left
R for Right

8 bits resolution and hexadecimal output
-> value in hex varies from 01 to FF
01 full speed reverse
7F stop
FF full speed forward

-> value in decimal (more explanatory) varies between 0 to 255
0 full speed reverse
64 mid speed reverse
128 stop
192 mid speed forward
255 full speed forward

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

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

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

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

RC1L3F
RFFL01 (Max !!)
-> roll right

Xsim setup
you can upload the file (rename it to .rn2) from Kalarius ;) here

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
1672


Plug-Ins
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)

1672
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) :

Datapacket...
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 :
R~a0~L~a1~
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


ranges

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 ;-)

1682

Items to buy
- motors 12N.m 24V : 2x35€ + 16€ shipping
SWF VALEO NIDEC ITT 404.458 motoréducteur 24V DC http://www.smolka-berlin.de/onlineshop/fr/artikel/SWF_VALEO_NIDEC_ITT_404.458_motor%E9ducteur_24V_DC__Offre_sp%E9ciale%21%21%21_/4398

- Arduino board : 25€ + shipping http://store.arduino.cc/eu/index.php

- MotoMonster board (16V max) :
70€ @ Sparkfun https://www.sparkfun.com/products/10182
27$ @ DX http://dx.com/p/monster-moto-shield-for-arduino-red-161274

- you can use 2.5mm² wires or bigger
@ 20A continuous
and 30 cm length between driver and motor
-> the wire will heat 37°, which is below the 60° max heat.
http://www.plaisance-pratique.com/spip. ... article=88

Have shortest possible wires between driver and motors!

RacingMat wrote:You can find some Motomonster on Aliexpress @ 14$ :)
http://www.aliexpress.com/item/-/1992625367.html

or you can use OLIMEX with 24V
9$ per motor
https://www.olimex.com/Products/RobotPa ... -VNH3SP30/


- 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 http://www.gotronic.fr/art-potentiometr ... -11293.htm
you can find here many other electronic distributors : http://codelab.fr/177

Weight
+ 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
Last edited by RacingMat on Wed 3. Feb 2016, 23:21, edited 32 times in total.
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
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: 120 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby Racerr87 » Fri 7. Jun 2013, 18:36

Very nice!
Racerr87
 
Posts: 40
Images: 7
Joined: Mon 7. May 2012, 17:01
Has thanked: 3 times
Been thanked: 5 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby prodigy » Fri 7. Jun 2013, 22:45

Very good and detailed project, maybe just add some X-Sim setup screens too and it will be complete.
It's nice to see Arduinos in action.
And looks like those rubber feet absorbed vibrations pretty good, it looks much better than without them like in your second video.
User avatar
prodigy
X-Sim Supporter
 
Posts: 274
Images: 42
Joined: Tue 16. Oct 2012, 12:32
Location: Pula, Croatia
Has thanked: 20 times
Been thanked: 21 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby RacingMat » Sat 8. Jun 2013, 15:55

@ Racerr87 : thanks ! it represents one month of intensive reading and 2 months of work

@ Prodigy : thank for your opinion !! In reply to your message, I've uploaded images on Arduino's and Xsim's configuration
and wrote some instructions in the first post.

Between the 2 videos, there is a difference : I enlarge the base as it was too instable (and the soft rubber feet amplified a lot the problem...)
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
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: 120 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby vicpopo » Sat 8. Jun 2013, 19:23

Salut,

Super boulot , super bien détaillé pour aider ceux qui sont tentés par l'aventure.J'ai lu sur le forum gameover le super 2dof de lipid512 , super boulot aussi.Pour le problème de chauffe pas grand chose à faire ou changer pour des moteurs plus puissants.

Very nice job .Nice to see the french guys here on the xsim forum for sharing them job.

Good thread with many details from the building. ;)
User avatar
vicpopo
 
Posts: 643
Joined: Fri 20. Apr 2012, 18:04
Location: Strasbourg France
Has thanked: 37 times
Been thanked: 79 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby RacingMat » Sun 9. Jun 2013, 10:10

Thanks !

I've added some explanations in the first post for configuring Xsim for my 2DOF.

For the temperature, my motors are just fine, not hot (even after an hour !!)
(it's written somewhere in the Lipide512 post ?)
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
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: 120 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby sirnoname » Sun 9. Jun 2013, 12:53

Hi Mat,

great docu.
Some question: Is this firmware written by yourself?
Do not see a dl :(

regards,
SirNoName
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1700
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 117 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby RacingMat » Sun 9. Jun 2013, 18:24

@ SirNoName : thanks for your positive opinion !
This gives me the opportunity to tell you that I'm grateful for your Xsim programming ;)

The Arduino's program has been written by a french guy (mentioned at the top of the code).
It is based on the example given by Sparkfun who sells the motor driver card "MotoMonster".
So I've mainly re-read it, streamlined few things and added comments (in english) for a better understanding.

I've inserted the code at the end of the first post.

Next steps, I'd like to give a try to improve the speed of execution (Analog to Digital Conversion's overclocking for example).

yours
RacingMat
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
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: 120 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby futuresims » Wed 12. Jun 2013, 01:47

Congratulations!
*****/*****

I give you 5 stars out of 5 stars.

You did a really fine job of documenting your work.

You are a very inspirational person!

This is what X-Sim is all about.

X-Sim is about inspiring other people to build their own motion simulator.

When people document their work with complete measurements, pictures, videos, and wiring diagrams, it helps to inspire others who follow you.

When others see your work and work well documented like you have done, others will see that they too can do this.

Thank you very much for your Great work.
User avatar
futuresims
 
Posts: 33
Joined: Mon 25. Mar 2013, 15:06
Has thanked: 0 time
Been thanked: 6 times

Re: Finished 2DOF 12V DC wiper arduino playseat

Postby RacingMat » Thu 13. Jun 2013, 22:02

Thanks Futuresims ! I appreciate that even more because you're posting some very detailed and interesting posts !
(so you know well how often it requires to disassemble everything only for taking a good picture to share...)

I wish you to succeed in your playseat construction project ! Driving it, is such a reward and such a pleasure !!
Mat
2 DOF playseat : arduino, motomonster, 12V truck wiper motors
http://www.x-sim.de/forum/viewtopic.php?f=37&t=943
User avatar
RacingMat
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: 120 times

Next

Return to Motion simulator Finished Project Gallery

Who is online

Users browsing this forum: No registered users and 2 guests