1. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  2. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  3. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

The RC-Rider Project (Let's 'Ride' Radio Controlled Models!)

Discussion in 'DIY Motion Simulator Projects' started by yobuddy, Jan 24, 2018.

  1. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    916
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    4,371Coins
    Ratings:
    +788 / 7 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    That's right. Nowadays i try to spare some time to evaluate a better 32bit solution (Maple mini) and less expensive 9DOF sensor. PCB layout is under design as well for it that will be shared via OSHpark for easy ordering...

    Soon...
    • Like Like x 1
  2. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    3,774
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    33,351Coins
    Ratings:
    +3,879 / 10 / -0
    Thanks @Thanos for the update buddy!
    • Like Like x 1
  3. Matthew Bangerter

    Matthew Bangerter New Member

    Joined:
    Jun 27, 2014
    Messages:
    27
    Occupation:
    Mechanical Engineer
    Location:
    Dallas, TX
    Balance:
    84Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Awesome work! So glad to see it working on a 6DOF. Like you said the current output for yaw goes from 0 to 360 rather than -180 to 180 or -90 to +90 like the other orientations (Not totally sure why). I added a line in there to correct for that

    if (Yaw > 179.9)
    {
    Yaw = Yaw-360;
    }

    It seems to work, though sometimes it seems to flip around 180 degrees permanently for some reason. Not sure why, but thats the general idea

    Code:
    #include <Wire.h>
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BNO055.h>
    #include <utility/imumaths.h>
     
    Adafruit_BNO055 bno = Adafruit_BNO055(55);
    imu::Vector<3> v;
    
    void setup(void)
    {
      Serial.begin(57600);
      Serial.println("Orientation Sensor Test"); Serial.println("");
     
      /* Initialise the sensor */
      if(!bno.begin())
      {
        /* There was a problem detecting the BNO055 ... check your connections */
        Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
        while(1);
      }
     
      delay(1000);
        
      bno.setExtCrystalUse(true);
    }
    
    void loop(void)
    {
      /* Get a new sensor event */
      sensors_event_t event;
      bno.getEvent(&event);
    
     // Possible vector values can be:
      // - VECTOR_ACCELEROMETER - m/s^2
      // - VECTOR_MAGNETOMETER  - uT
      // - VECTOR_GYROSCOPE     - rad/s
      // - VECTOR_EULER         - degrees
      // - VECTOR_LINEARACCEL   - m/s^2
      // - VECTOR_GRAVITY       - m/s^2
    
      v = bno.getVector(Adafruit_BNO055::VECTOR_LINEARACCEL);
    
    float Roll = -event.orientation.y;
    float Pitch = -event.orientation.z;
    float Yaw = event.orientation.x;
    float Surge = v.y();
    float Sway = -v.x();
    float Heave = -v.z();
    
    if (Yaw > 179.9)
      {
        Yaw = Yaw-360;
      }
      /* Display the floating point data if you want to see it in the serial monitor*/
    //  Serial.print(event.orientation.x, 2);
    //  Serial.print(",");
    //  Serial.print(event.orientation.y, 2);
    //  Serial.print(",");
    //  Serial.print(event.orientation.z, 2);
    //  Serial.print(",");
    //  Serial.print(v.x());  //x acceleration
    //  Serial.print(",");
    //  Serial.print(v.y()); //y accel
    //  Serial.print(",");
    //  Serial.println(v.z()); //z accel
    
    
    //  data broken down into bytes to send to computer via USB or telemetry module
    byte* RollPtr = (byte*) &Roll;
    Serial.write( RollPtr[0] );
    Serial.write( RollPtr[1] );
    Serial.write( RollPtr[2] );
    Serial.write( RollPtr[3] );
    
    byte* PitchPtr = (byte*) &Pitch;
    Serial.write( PitchPtr[0] );
    Serial.write( PitchPtr[1] );
    Serial.write( PitchPtr[2] );
    Serial.write( PitchPtr[3] );
    
    byte* HeavePtr = (byte*) &Heave;
    Serial.write( HeavePtr[0] );
    Serial.write( HeavePtr[1] );
    Serial.write( HeavePtr[2] );
    Serial.write( HeavePtr[3] );
    
    byte* YawPtr = (byte*) &Yaw;
    Serial.write( YawPtr[0] );
    Serial.write( YawPtr[1] );
    Serial.write( YawPtr[2] );
    Serial.write( YawPtr[3] );
    
    byte* SwayPtr = (byte*) &Sway;
    Serial.write( SwayPtr[0] );
    Serial.write( SwayPtr[1] );
    Serial.write( SwayPtr[2] );
    Serial.write( SwayPtr[3] );
    
    byte* SurgePtr = (byte*) &Surge;
    Serial.write( SurgePtr[0] );
    Serial.write( SurgePtr[1] );
    Serial.write( SurgePtr[2] );
    Serial.write( SurgePtr[3] );
    
      delay(25);
    }
  4. Matthew Bangerter

    Matthew Bangerter New Member

    Joined:
    Jun 27, 2014
    Messages:
    27
    Occupation:
    Mechanical Engineer
    Location:
    Dallas, TX
    Balance:
    84Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I guess depending on the sim you would want to do angular velocity rather than orientation for YAW. To do that use the VECTOR_GYROSCOPE function

    https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/arduino-code

    I've implemented that here. Also I've messed with the x y and z values and direction (negative) to accomodate the direction my sensor sits in the vehicle, so this needs to be adjusted. for your application

    Code:
    #include <Wire.h>
    #include <Adafruit_Sensor.h>
    #include <Adafruit_BNO055.h>
    #include <utility/imumaths.h>
     
    Adafruit_BNO055 bno = Adafruit_BNO055(55);
    imu::Vector<3> v;
    imu::Vector<3> g;
    
    void setup(void)
    {
      Serial.begin(57600);
      Serial.println("Orientation Sensor Test"); Serial.println("");
     
      /* Initialise the sensor */
      if(!bno.begin())
      {
        /* There was a problem detecting the BNO055 ... check your connections */
        Serial.print("Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
        while(1);
      }
     
      delay(1000);
        
      bno.setExtCrystalUse(true);
    }
    
    void loop(void)
    {
      /* Get a new sensor event */
      sensors_event_t event;
      bno.getEvent(&event);
    
     // Possible vector values can be:
      // - VECTOR_ACCELEROMETER - m/s^2
      // - VECTOR_MAGNETOMETER  - uT
      // - VECTOR_GYROSCOPE     - rad/s
      // - VECTOR_EULER         - degrees
      // - VECTOR_LINEARACCEL   - m/s^2
      // - VECTOR_GRAVITY       - m/s^2
    
      v = bno.getVector(Adafruit_BNO055::VECTOR_LINEARACCEL);
      g = bno.getVector(Adafruit_BNO055::VECTOR_GYROSCOPE);
    
    float Roll = -event.orientation.y;
    float Pitch = -event.orientation.z;
    //float Yaw = event.orientation.x; //orientation
    float Yaw = g.x();  //angular acceleration
    float Surge = v.y();
    float Sway = -v.x();
    float Heave = -v.z();
    
    //if (Yaw > 179.9)       //use if using orientation for yaw rather than angular acceleration
    //  {
    //    Yaw = Yaw-360;
    //  }
      /* Display the floating point data if you want to see it in the serial monitor*/
    //  Serial.print(event.orientation.x, 2);
    //  Serial.print(",");
    //  Serial.print(event.orientation.y, 2);
    //  Serial.print(",");
    //  Serial.print(event.orientation.z, 2);
    //  Serial.print(",");
    //  Serial.print(v.x());  //x acceleration
    //  Serial.print(",");
    //  Serial.print(v.y()); //y accel
    //  Serial.print(",");
    //  Serial.println(v.z()); //z accel
    
    
    //  data broken down into bytes to send to computer via USB or telemetry module
    byte* RollPtr = (byte*) &Roll;
    Serial.write( RollPtr[0] );
    Serial.write( RollPtr[1] );
    Serial.write( RollPtr[2] );
    Serial.write( RollPtr[3] );
    
    byte* PitchPtr = (byte*) &Pitch;
    Serial.write( PitchPtr[0] );
    Serial.write( PitchPtr[1] );
    Serial.write( PitchPtr[2] );
    Serial.write( PitchPtr[3] );
    
    byte* HeavePtr = (byte*) &Heave;
    Serial.write( HeavePtr[0] );
    Serial.write( HeavePtr[1] );
    Serial.write( HeavePtr[2] );
    Serial.write( HeavePtr[3] );
    
    byte* YawPtr = (byte*) &Yaw;
    Serial.write( YawPtr[0] );
    Serial.write( YawPtr[1] );
    Serial.write( YawPtr[2] );
    Serial.write( YawPtr[3] );
    
    byte* SwayPtr = (byte*) &Sway;
    Serial.write( SwayPtr[0] );
    Serial.write( SwayPtr[1] );
    Serial.write( SwayPtr[2] );
    Serial.write( SwayPtr[3] );
    
    byte* SurgePtr = (byte*) &Surge;
    Serial.write( SurgePtr[0] );
    Serial.write( SurgePtr[1] );
    Serial.write( SurgePtr[2] );
    Serial.write( SurgePtr[3] );
    
      delay(25);
    }
  5. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    3,774
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    33,351Coins
    Ratings:
    +3,879 / 10 / -0
    Hi Guy's
    Yaw should set it's output -180 to 180.
    Then If you turn on washout with yaw (in GameEngine), the skipping will be automatically fixed.
    • Informative Informative x 1
    Last edited: Aug 16, 2019
  6. Howard Yang

    Howard Yang New Member Gold Contributor

    Joined:
    May 5, 2016
    Messages:
    10
    Location:
    West Covina, CA
    Balance:
    - 147Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Is there any update to this project? I am also very interested in converting my 2DOF simulator to fly my FPV drone. is there a detail DIY or list of materials to purchase? I'm not a coder but more of a builder. Thanks!
    • Like Like x 1
  7. T R Para

    T R Para i make stuff up Gold Contributor

    Joined:
    Oct 18, 2018
    Messages:
    268
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    1,743Coins
    Ratings:
    +252 / 2 / -0
    My Motion Simulator:
    3DOF, AC motor
    hi Howard..
    I have been working on my system for months now and I am pretty sure it is a working system.
    To start you will need a Arduino nano board.
    Also the gyro/sensor is a GY- BNO055.
    A copy of RcRider.exe
    A laptop....
    And of course the simtools software.
    I can post the arduino code/sketch for you.
    A data radio modem is also needed to send the data from the quad to the laptop..
    What rc/fpv/quad are you going to use.
    • Like Like x 2
    • Informative Informative x 1
  8. Howard Yang

    Howard Yang New Member Gold Contributor

    Joined:
    May 5, 2016
    Messages:
    10
    Location:
    West Covina, CA
    Balance:
    - 147Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    I have the computer and the simtools. I can get the arduino nano board with the gyro sensor. But where do I download the RcRider.exe and what else do I need to do to get it to work? I am thinking about mounting this to my DJI racing Drone.
    • Like Like x 1
  9. T R Para

    T R Para i make stuff up Gold Contributor

    Joined:
    Oct 18, 2018
    Messages:
    268
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    1,743Coins
    Ratings:
    +252 / 2 / -0
    My Motion Simulator:
    3DOF, AC motor
    OK .. I was unable to upload one zip file here. I think because it is too big..
    So I split it up
    The gyro is about $14 on E-bay or $35 from adafruit on amazon.
    Although I have several Dji rigs I am not sure what frequencies are used on your setup.
    What goggles do you use.

    Attached Files:

    • Like Like x 1
    • Winner Winner x 1
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    15,332
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    112,763Coins
    Ratings:
    +9,081 / 46 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Thanks so much for sharing all that.

    @RaceRay can you please have a look at the size issue and also having this in the Download section, so it is easier to find.
  11. T R Para

    T R Para i make stuff up Gold Contributor

    Joined:
    Oct 18, 2018
    Messages:
    268
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    1,743Coins
    Ratings:
    +252 / 2 / -0
    My Motion Simulator:
    3DOF, AC motor
    Very fine...
    The file Rcrcode.zip is a set of arduino libraries needed for the sketch.
    The screen shots are just a sample of my set-up which drives two 10gram servos.
    Here is a picture of my test set-up lol
    Always happy to help my fellow Sim Brothers:)

    Attached Files:

    • Like Like x 3
  12. Matthew Bangerter

    Matthew Bangerter New Member

    Joined:
    Jun 27, 2014
    Messages:
    27
    Occupation:
    Mechanical Engineer
    Location:
    Dallas, TX
    Balance:
    84Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @Howard Yang sorry I'm slow to respond on this, @T R Para thanks for sharing everything and pulling it all together.

    As T R Para mentioned, He, Myself, @yobuddy @Thanos have been working on it somewhat in the background. Thanos and Yobuddy are still working on making a simplified integrated solution with a custom PCB that you can mount everything to, but T R Para and I have successfully field tested the system just wiring all the boards together. Here is my setup

    • Arduino Nano
    • BNO055 9 DOF Absolute Orientation IMU
    • Telemetry module
      • Think of these as a "wireless USB cable" between the arduino and your PC. There are many options here. Most are based off of the 3dr telemetry radios made to work with the pixhawk and ardupilot systems, but 3DR(American drone company) no longer makes them so there are several clones out there now. 915 Mhz should be used in USA, 433 Mhz should be used in some other countries
      • This $29 one is the one I am using with pretty good success at about 100 yards with the 100 MW version. I havent tried the 500 MW version. If you use this one, you need to make sure to update to the latest firmware for it to work using Mission Planner. At least I couldnt get it to work without updating it. Here is the firmware/settings I am running successfully but feel free to play with them to see if you get better results, make sure they are the same between the two radios
      • upload_2020-1-4_22-3-25.png
      • If you want better range you can drop $230 on this RFD900 version. I Believe this is what @T R Para is using? Havent tried it myself.
    Connections as follows:

    BNO055 IMU board -> Arduino
    • Vin -> 5V
    • GND -> GND
    • SCL -> A5
    • SDA -> A4
    Radio -> Arduino
    • 5V -> 5V
    • GND -> GND
    • TX -> TX
    • RX -> RX
    You will also need to supply 5V to the arduino. I am currently just running a cable to a servo port on my quad receiver, but there are many ways to accomplish this including a small dedicated battery to make the unit self contained.

    IMG_5029.JPEG IMG_5028.JPEG

    Connecting to SimTools
    • @yobuddy created the RCRider app that receives the data and basically looks like a "video game" to simtools.
    • Just install the RCRider plugin like with any other game, then run the RC rider program and choose the correct com port and baud rate(this will be the baud rate in the arduino code. if everything is working you should see values populating all of the DOF
    • Run simtools virtual axis testing to make sure data is coming into simtools

    Couple of important things to note:

    • The Baud rate that you choose in the Arduino code will correspond to the baud rate that you select in the RC Rider app
      • upload_2020-1-4_15-43-24.png
      • upload_2020-1-4_15-43-51.png
    • The telemetry radios must use the same baud rate as eachother, but dont need to use the same baud rate as above. This baud rate is used just for communication between the radios, whereas the other baud rate is used for communication between the arduino and the PC. The radios default to 57600
    • One of the variables we havent quite nailed down yet is the delay at the end of the arduino sketch as a longer delay gives you a more stable connection, but increases latency. The code that T R Para posted above has a 65 ms delay, but I was running pretty successfully at 25ms with only a few blips here and there. @yobuddy also thinks there might be some improvement we can make in the way the data is sent that will help here, but this works in the mean time.

    upload_2020-1-4_22-9-47.png
    • Be very careful changing settings on the radios, normally the ground USB module wirelessly updates the settings on the air module but if the settings between them get out of sync they wont talk to eachother and you need to connect the air unit to the computer via an FTDI cable (or you can use an arduino hack)
    • because the radio is using the serial connection of the arduino (which is also what the USB port on the arduino uses to talk to the computer) you have to disconnect the radio from the arduino before you can connect the arduino to the computer to update it.
    • You can also test everything without the radios by just connecting the arduino to the computer via USB as the RC rider app wont know the difference. This is helpful for testing and diagnostics and is where you should start before testing the radios.
    • I am obviously only using Pitch and Roll since I have a 2 DOF, but it is receiving all 6 DOF so you can tailor to your sim.


    I have tested it with a quad and a plane and it really is very cool! Here is a video of the tests (FYI the motion is a little choppy but that has more to do with my chair than with the data coming in, It uses pretty weak motors and doesnt have a super smooth response. The data comes in pretty smooth). Some Fine tuning to do but overall the system is working as hoped.

    Let me know if you have any questions and please post any progress you are making! The biggest reward of all the effort for me is seeing other people enjoy it.

    • Like Like x 5
    • Informative Informative x 1
    • Creative Creative x 1
    Last edited: Jan 5, 2020
  13. Matthew Bangerter

    Matthew Bangerter New Member

    Joined:
    Jun 27, 2014
    Messages:
    27
    Occupation:
    Mechanical Engineer
    Location:
    Dallas, TX
    Balance:
    84Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    FYI, added some additional content to the above post that should make it more helpful.
  14. lord_of_the_ping

    lord_of_the_ping New Member

    Joined:
    Aug 5, 2020
    Messages:
    7
    Balance:
    5Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    Motion platform
    Hi everyone,

    I am working on a similar project and need some help. I am fairly new to simtools and am working with a DOF reality P6 platform.

    I want to have motion in the platform using the data I receive from a remote vehicle. Now I have managed to receive the IMU signals as UDP packets on the computer to which the platform is connected to and simtools is installed on. However, I am struggling to understand how does this IMU information reach the platform via simtools.

    I have a .exe file which I run as my game (C# in background), this is where I get my UDP messages from the vehicle and send it to 127.0.0.1:4123. Next I have a game plugin which receives UDP messages at 127.0.0.1:4123. The game manager shows game running when I run my code and I noticed on WireShark that my UDP messages reach the correct IP:port but there is no motion in the platform.

    I feel that I am missing some part/understanding about how this data has to be sent. I am not using any arduino so I guess my problem is slightly different as compared to the project being discussed here.

    Any help would be great. I could also post some files/screenshots if someone needs that to understand the problem better.

    Regards