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
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.
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).
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 :
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!)
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:
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.
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:
Overview:
conclusion: the harness is great!
- For the look
- 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 (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.
-> 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 !
Overview
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.
Overview!
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 (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
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)
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.
overview:
a glogal overview of the electrical stuff:
For your information, here the wiring for 2 motomonsters and 1 arduino if you intend to build a 3DOF or 4DOF
If you're using more powerfull motors, you can use one Motomonster per motor. Follow the specification of VNH
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.
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 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 :
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 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
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)
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
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 :
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