element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 2 - the hardware
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dhal
  • Date Created: 15 Dec 2017 5:37 PM Date Created
  • Views 1090 views
  • Likes 8 likes
  • Comments 9 comments
  • python 3
  • raspberry-pi3
  • arduino due
  • arduino uno v3
  • raspberrypi3
  • python3
Related
Recommended

Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 2 - the hardware

dhal
dhal
15 Dec 2017

1/ the outputs (tractor lights - beacon, blinkers, lights)

 

I choose to use a Raspberry Pi for this task (Raspberry "Outputs" on the global sketch); I needed something independent of the PCs  to lighten their processes and a board that can receive orders from TCP/IP. Fortunately, I didn't need more than 24 outputs.

So I have designed an extended board, with a voltage shifter (Txs0108e) (from 3.3V to 5V) to switch relays on a 8 relays module:

imageimage

imageimage

 

I have preferred to let the lights independent (I could have joined the right and left lights for example) to be able to play with lights animation (like chase effects) ...

I attached a 5" HDMI screen (it's tactile, but I don't use this function) to check the process progress.

 

As presented in part 1, the exhibition environment is very noisy. In previous projects, I had to face many interferences issues. So I add some "interference traps" to digital and analog signals.

 

2/ The digital chain

 

In a previous version, I had chosen a Raspberry PI with 4 x I2C MCP23017 extensions to manage all the digital inputs.

But I finally found that using an Arduino DUE would be much simpler. Moreover, it has  ADCs too without any needed extensions.

And another advantage of the Arduino DUE (in addition to its execution speed)  is the possibility to exploit interrupts for the digital inputs.

But to use this last feature, we need to robustify the signals, to avoid fake interrupts due to interferences. So I designed an anti-bouncing interface based on Schmitt trigger (SN74HC14N) (from here). Actually, I prefer hardware solution than software one that slows down a program.

 

image

 

Then the Arduino DUE (and it's the final advantage of it) will translate an input to a key or sequence of keys simulating a keyboard for the "FS Hat" PC.

I have also 6 signals (among the 48) coming from the armrest powered in 3.3V I will use optocouplers.

 

image

 

imageimage

                                      imageimageimageimage

image

image

 

imageimage

imageimage

imageimage

(sorry, in French, but it's all the buttons, levers and controllers we can find in a tractor)

 

image

 

During the developping progress, I needed to add another anti-bouncing system, just one, te be read by an arduino UNO (see later); its the "up" position of the tire (position at the end of the day, for the night, to release the jacks).

I didn't want to use a 74HC14 just for 1 gate. So I designed this with a NE555 (from here):

image

 

 

 

3/ The analog signals (steering wheel, brakes and acceleration pedals, hand accelerator)

 

My first experience was to power the potentiometers with 0-3.3V to be able to read the values directly with an ADC (I had first used a raspberry pi with a MCP3208 - 8 channels, 12 bits resolution, SPI link). But the rotations of the pedals are very small and the resulting range was very poor (ie. about 200 points amoung 4096 available (12 bits resolution) once digitalized) and so very sensitive to interferences.

So, I decided to power them with a larger range of tension from +/- 15V. I use a LM324 that accepts this range of voltage to buffer a simple voltage divider to the potentiometer.

Then, I added protections and filters before Arduino DUE ADC. I had prefered using PWM instead of DAC as firstly I need 4 outputs (only 2 DACs on DUE), and secondly the embedded DAC range is not full 0-3.3V!

Thus, I added the same filter as the inputs (to filter the PWM signals) and a gain (from 3.3V to 5V) to feed the BU0836A (the joystick/analog entries USB-plugged on the PC "FS Hat").

image

The analog info are sent to PC "FS Hat" too for them to be transfered to Rasperry "Dashboard" (front wheels angles following the steering wheel angle, displayed speed vs the acceleration, brakes lights, back-up lights ...)

 

image

The range tuning (0-3.3V) is quite easy when you first observe the initial range; you feel how to turn the potentiometers +/-  to reach the requested values once you have an idea of the min, max and range.

But you really need SOMEONE to turn the steering wheel, push the pedals and turn the hand accelerator while you are measuring the ranges with a multimeter !!! image

imageimage

Note: in the middle of the board, I add a line for the arduino UNO (connected to PC "Master") to hard reset the Arduino DUE (so far, I never used it)

image

imageimage

imageimage

 

 

As the info come from the front of the cabin and the signal processing is at the rear, even if it's wired with shielded cables, I add a low-pass filter with a protection part (avoiding putting more than 3.3V on an arduino pin) .

Initially, I intended to choose 60Hz of bandwidth as it corresponds to the refresh rate of a screen and it's wide enough to take into account a signal change (have in mind that in real life, an ABS brakes reaction time is around 300ms ... so far from the chosen 16ms reaction time).

However, to reach that figure, it required not common values of resistors and capacitors. So, I look at this tool to compute Sallen-Key components for 60Hz, then I took the closest common values, and compute again with these common components and the results leaded to 79.6Hz (80Hz). Ok.

 

image

Note : I power the LM358  with 5.3V as the output is -2V lower vs the power and support up to 30V inputs (not a rail-to-rail opAmp). However, I use a rail-to-rail MAX492 for the final output.

 

imageimage

image

imageimage

image

image

 

4/ the supplies

 

image

 

5/ miscelleous

 

imageimage

image

 

image

image

 

Fully wired:

 

image

image

image

 

Back to intro

Tractor Simulator (interface with Farming Simulator 17) 

 

Global presentation

Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 1 - global presentation

 

Actual doc

 

Arduinos

Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 3 - the software, 1/ Arduinos

 

Raspberry Pis

Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 3 - the software, 2/ Raspberrys

 

PCs

Tractor simulator (cabin tractor interface with Farming Simulator 17): Part 3 - the software, 3/ PCs

  • Sign in to reply

Top Comments

  • DAB
    DAB over 5 years ago +3
    Excellent post. You did a good job of working through the signals, the data paths and signal conditioning issues. Your board work was very good and compact. The only thing I might have done differently…
  • jw0752
    jw0752 over 5 years ago +3
    Hi Damien, What an awesome build. It was all so nicely planned and laid out, very impressive. You mentioned your passion for doing it and this was evident in the final production. Thanks for taking the…
  • genebren
    genebren over 5 years ago +2
    Damen, What an inspiring amount of work. Your passion shows in the amount of detail and fine work you have performed. Well done! Gene
  • marty43
    marty43 over 1 year ago

    Valuable advice that helps me a lot in my project. Especially for filtering signals from parasites!

    Great article.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • priyash0008
    priyash0008 over 3 years ago

    Hey, I appreciate your quality stuff and I would love to read more informative posts like this! keep sharing.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • three-phase
    three-phase over 5 years ago

    Great to see a real world project from concept to completion. Totally agree with the other comments - a great inspiring blog

     

    Kind regards

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 5 years ago

    Damen,

     

    What an inspiring amount of work.  Your passion shows in the amount of detail and fine work you have performed.  Well done!

     

    Gene

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 5 years ago

    Hi Damien,

    What an awesome build. It was all so nicely planned and laid out, very impressive. You mentioned your passion for doing it and this was evident in the final production. Thanks for taking the time to share it with us. It is inspiring.

    John

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube