1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. 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!
  3. 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
  4. 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

Prototype Pitch & Roll Full Rotation

Discussion in 'DIY Motion Simulator Projects' started by dontcarefilmer, Sep 13, 2014.

  1. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    http://web.cs.wpi.edu/~claypool/papers/precision-deadline/tr-06-13.pdf

    For those that are into reading technical articles..here is a good one about latency. It states that above 50 ms total, research data indicates slower lap times. Given ping times often at or above that figure..every reduction in other areas theoretically make better lap times possible. Given that many iracers practice 10-20 hours per week to improve 0.5 seconds per lap, you can see how important it can be to the really serious players
  2. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Iracing guys like to benchmark each other as to whos has more PFS per second
  3. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    For a given GPU, decreasing video quality/output incerases FPS. For a given video quality/output spending more money on a GPU generally gives more FPS. Without disclosing the video quality/output, benchmarking FPS seems silly. If someone tells me they have three monitors with high resolution and 100 FPS..then I would be impressed by how much much money they probably spent..sort of like being impressed by a Ferrari. Are they faster on the track??.perhaps not. The only benchmarking I care about would be lap times.
  4. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    ISRTV is the place to look up iracing FPS comparisons
  5. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    I can’t tell you what fps I get with iRacing because I don’t use it. So far, I have refused to pay their asking price when I have so many other titles to choose from that I can purchase outright! I use Nascar Racing 2003 season instead. Its code is what iRacing was built on in the first place.
    I’m not saying iRacing is not worth it though because Papyrus was the best imo when they were in operation.

    But I’m not really concerned about what my frame rate is to be honest. If it were to slow, I would know it, and then I would concern myself about it! I usually just vsync at 60hz and I do know I get 60 fps. However, I don’t know if the gtx 770 in use (PNY XLR8 Enthusiast Edition) would be able to keep up with 5760 x 1080 in 3D because that would be the equivalent of 11520 x 1080 in reality if my understanding is correct.

    Btw, after some research, I am convinced that the human eye can see many more fps than 24 because it doesn’t see in frames, but is continuous. However, I am also now under the impression that the human brain is only capable of processing between 12 to 20 fps. But, while it many not be able to process every frame over 20 fps, what you are able to process will be using the most updated information possible when using the fasted frame rate possible.

    I equate that to our simulators. We want to have the latest telemetry update possible when it comes time to actually process it!

    ps I also run just about everything maxed out in the games settings but I keep anti-aliasing to x8.
    • Like Like x 1
  6. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    BlazinH...Thanks..as usual..a thoughtful and informative response.

    I like triple monitors but so far have stayed with one big one to keep my FPS up. I do not Vsync and have not noticed any tearing. Your set up is very nice and got me to reevaluating the triple monitor option using a GTX Titan. Still ruminating over lag time on monitors or projectors. The low lag 120hz monitors seem to be in the 27 inch area and would need to be pretty close to my face compared to 60 in monitors or projectors.

    Thanks again..I think I'm off topic so over and out...Happy Thanksgiving!!
  7. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    its difficult to actually see FPS difference when you are in a motion seat
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
  9. dontcarefilmer

    dontcarefilmer Member

    Joined:
    Apr 30, 2014
    Messages:
    36
    Occupation:
    Industrial Electrician
    Location:
    West Sydney, Australia
    Balance:
    363Coins
    Ratings:
    +41 / 0 / -0
    Using the oculus rift with my laptop I peak at 45 FPS and generally run at 30 FPS. Motion sickness kicks in pretty fast at these sort of frame rates. I may not be able to tell the difference on a standard monitor but the immersion is truly broken on the rift. I can only imagine this would get even worse during motion simulation (just guessing here, no hard data yet). This is why I needed to buy a high quality GPU. The minimum recommended FPS is 75, and the commercial release is expected to aim for 90 FPS!
    • Agree Agree x 1
  10. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 38 / -0
    My Motion Simulator:
    AC motor, Motion platform
    I initially found that synchronised motion helped in reducing motion sickness with the rift. Although I don't suffer at all now.
  11. stroutmail

    stroutmail Member SimAxe Beta Tester Gold Contributor

    Joined:
    Oct 22, 2014
    Messages:
    99
    Occupation:
    Investment Manager/Economist/Engineer
    Location:
    Pennsylvania
    Balance:
    1,065Coins
    Ratings:
    +47 / 1 / -0
    My Motion Simulator:
    2DOF
    PLS explain what you mean by "synchronized motion". Thks.
  12. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 38 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Motion in sync with what you are seeing. If the motion is out of sync or 'wrong' in any way, then it could make things worse.
  13. dontcarefilmer

    dontcarefilmer Member

    Joined:
    Apr 30, 2014
    Messages:
    36
    Occupation:
    Industrial Electrician
    Location:
    West Sydney, Australia
    Balance:
    363Coins
    Ratings:
    +41 / 0 / -0
    Another update.

    I have managed to rewrite the arduino code so that it is modular and it now includes a comms module that works well with simtools (borrowed from here: http://www.xsimulator.net/community/marketplace/communicating-with-an-arduino-and-sim-tools.97/, written by @eaorobbie cheers). I still need to add in the code for the encoder as the tracking drifts quite a bit when being used with the game. But at least an encoder is mounted and attached, so that's half the battle. Ideally I would have attached the encoder to the shaft of the motor directly, but I don't have the option in this case, I expect the full scale to be different.
    20141116_145300.jpg 20141118_183541.jpg 20141118_183617.jpg 20141118_183727.jpg
    I also need another encoder inside the inner rig (for the roll motor), but for now this is a proof of concept (to myself mostly) and a way to test code without a massive cost upfront.

    I did a quick test run with it connected to LFS to see if it was working.
    Here is a video of the action:



    Next I will try running it with MS Flight Simulator X and try to get full rotation happening.
    • Like Like x 3
    • Winner Winner x 1
  14. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,602Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  15. dontcarefilmer

    dontcarefilmer Member

    Joined:
    Apr 30, 2014
    Messages:
    36
    Occupation:
    Industrial Electrician
    Location:
    West Sydney, Australia
    Balance:
    363Coins
    Ratings:
    +41 / 0 / -0
    Please keep in mind that this is a work in progress, and sorry about the length :blush.

    Explanation of the arduino code:

    Everything has been split up into functions so that I can add or remove functionality as I go without having to recode too much, and without having to search the whole page. More will be added later but for now, this is the core program with basic functions.

    To keep track of the position I have used a lowest common multiple unit which is common to each value:

    Input from Simtools: 0-65535 (16 bit)
    Input from rotary encoder: 0-599 (600 pulse per rev)
    Output to stepper drivers: 0-3199 (200 steps per rev, but with 1/16th microstepping)

    The lowest common multiple was calculated to be 4915200 (32 bit)

    To keep track of everything internally, all values are converted into this global resolution which keeps them as integers. Unfortunately it also encodes everything as 'long'.

    I have made provisions for other code changes, which are yet to be implemented. At the top of the code is type selection which will eventually run different versions of code as chosen by the user. There is only one for now.

    The loop flows like this:

    * Enable Steppers

    * Check for new input
    Convert input to LCM

    * Decide on shortest path to setpoint (CW or CCW)

    * Create an acceleration/deceleration profile for the trip (unimplemented, currently just using a fixed interval)

    * Drive steppers based on profile
    Update internal position
    Constrain to 360 degrees (conditions for negative or greater than 360)


    I will add an interrupt routine for the encoder to force update it's position, and override the existing internal values. This will only happen as the rig passes a pulse (600 ppr) and so shouldn't bog down the processor too much. But time will tell.

    Explanation of each module:

    * Enable steppers:

    The stepper drivers need an enable signal from the arduino to pass current to the motors. I have reserved this space for when I add start up functionality (a start button or input from Simtools to begin, etc.). At the moment it is always enabled.

    * Check for new input:

    Read in the serial data from Simtools (16 bit) and convert it to the global LCM resolution.
    The expected data is:
    P*****~R*****~

    * Decide on shortest path:

    This part was tricky. I needed a way for the arduino to decide which way was the shortest path around a circle given a setpoint and current position. On a line, this is straightforward, but including the 0 point crossover was hard. I found 4 conditions which would give the answer in a simple way. I split the circle into quadrants (0-90, 90-180, 180-270, 270-0) and tested a move under each condition by hand until I found a pattern. I could go into more detail if anyone is interested, but diagrams would be needed.

    * Create profile:

    This was done in my last code (but it is rather messy) and would ramp up and ramp down when given a set of coordinates far from the set point. It was made to avoid losing steps due to acceleration, but I wanted the rig to be fast. This only works well when given a setpoint no where near the current position. The data from Simtools negates than by updating routinely, so there will rarely be a condition that is too far. And using encoders to keep the position on track will improve this. However the code is written to allow a variable step time if I add it back in later (something PID will probably go here).

    * Drive stepper:

    The speed of the steppers are decided by how much time to leave between each step. If time has passed greater than that of the step time (given by the above profile) then take half a step.
    If last time was half a step then update the position as well.
    The position must be within 0-360 degrees (but using the LCM global resolution). If it creeps above or below it is corrected here.

    Repeat.

    If anyone wants a more detail I am happy to share, but this is quite a lot for one post I think. Also if anyone has suggestions for a more optimised code, I'm all ears. I am not an expert by any means, and would like to learn more.

    Attached Files:

    • Like Like x 3
    • Winner Winner x 3
  16. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Looks good man
    • Agree Agree x 1
  17. Roy

    Roy Member

    Joined:
    Mar 17, 2015
    Messages:
    63
    Occupation:
    Marine Engineer
    Location:
    Saint John, New Brunswick, Canada
    Balance:
    1,142Coins
    Ratings:
    +16 / 1 / -0
    Have you seen these on YouTube
    • Like Like x 2
  18. dontcarefilmer

    dontcarefilmer Member

    Joined:
    Apr 30, 2014
    Messages:
    36
    Occupation:
    Industrial Electrician
    Location:
    West Sydney, Australia
    Balance:
    363Coins
    Ratings:
    +41 / 0 / -0
    Yeah I've seen one just like that a few years back, painted red. I'm pretty sure it was called the Flymotion. I'm not going to lie, some of my inspiration came from their design :blush. When I finally get up to it my full scale will be a bit different I hope.
    • Like Like x 2
  19. moptop

    moptop New Member

    Joined:
    May 16, 2015
    Messages:
    3
    Balance:
    40Coins
    Ratings:
    +0 / 0 / -0
    I just signed up for this site but I know something like this is what I want to build. Time to plan!!
  20. francky foor

    francky foor Member

    Joined:
    May 10, 2015
    Messages:
    110
    Location:
    france (nord)
    Balance:
    347Coins
    Ratings:
    +19 / 1 / -0
    My Motion Simulator:
    2DOF, SCN6
    I am sick:confused:
    • Funny Funny x 1