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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

Question Soft starting motion platforms?

Discussion in 'SimTools Pro & Entertainment Version' started by Zed, Oct 20, 2017.

  1. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Edit: I built a program to do this with JRKs. The file is posted down a bit. WIP. Be sure to see @Brett Horton's video to see what this is all about.

    Gravity pulls my platform to a nose down position when not in use and powered off. When I power it up and then start whatever sim, if someone isn’t in the seat to load the sim, SimTools snaps it to the center positions pretty violently. Even if someone is in the seat, it’s still violent.

    I don’t find any soft start options in SimTools but I’m also a newb at the fine points. I would guess it would be tough to implement since it would need to be able to talk directly to a wide array of controllers, but is there a way to call an "awaken" program that we supply that homes the system?

    I am using JRKs and can write a routine that can read current positions, command those positions, energize motors, and walk the motors to center slowly, but is there a way in SimTools to call that routine and wait for its completion before SimTools takes over?


    Edit - there is an important caveat to using this program. See this post for details: https://www.xsimulator.net/community/threads/soft-starting-motion-platforms.11051/page-2#post-150544
    Last edited: Feb 9, 2018
  2. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    12,754
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    97,447Coins
    Ratings:
    +8,170 / 40 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  3. Brett Horton

    Brett Horton Active Member

    Joined:
    Aug 18, 2016
    Messages:
    289
    Occupation:
    UAS Manager / Pilot / Integration Specialist
    Location:
    Tampa FL
    Balance:
    18Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    He means on initial boot up. The first time you start your sim each day, after the seat and JRK's have had no power. When you initialize SimTools (or the game for that matter) the seat violently snaps to the initial (typically centered) position.
    I have been asking / requesting this feature for over a year if possible.
    • Like Like x 1
  4. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    12,754
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    97,447Coins
    Ratings:
    +8,170 / 40 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Yes I am aware of that and noted it was not exactly what @Zed was asking.

    Soft start is possible and available, depending on what hardware you use, though that won't help with JRKs: https://www.xsimulator.net/community/threads/smc3-arduino-3dof-motor-driver-with-softstart.9479/
  5. Brett Horton

    Brett Horton Active Member

    Joined:
    Aug 18, 2016
    Messages:
    289
    Occupation:
    UAS Manager / Pilot / Integration Specialist
    Location:
    Tampa FL
    Balance:
    18Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    I think that is exactly the same thing he is asking...
    Sorry to hear JRK's / SimTools do not allow this
  6. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    @noorbeast - Thanks for that and I’ll give that a try. A small bump would be preferable to the big one I get now. But it sounds like @Brett Horton and I are on the same page.

    Brett, I’ve asked over at the JRK/Pololu website if there was any kind of soft start routine but don’t think there is. Are you running JRKs? If so, what I’m planning to do is write my own that would read the position of the motors, command that position, energize the motors, and then slowly (over a few seconds) walk them to their middle positions.

    As you know, once they are up and energized, they stick to center and no bouncing around unless in a sim.

    It can be a routine that just stands alone and giving it a desktop icon to make it easy to access should be fine I think. Having SimTools call a user-supplied routine to home a sim would be nice but not really necessary since we need it only at the startup.

    I’ll post results here if I get it to work. The program itself is trivial. It’s just sorting the comms to the JRKs, plus reading a config file for setup. If it was Linux I’d have it in just a few minutes. :cheers
    • Like Like x 2
  7. Brett Horton

    Brett Horton Active Member

    Joined:
    Aug 18, 2016
    Messages:
    289
    Occupation:
    UAS Manager / Pilot / Integration Specialist
    Location:
    Tampa FL
    Balance:
    18Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    Thanks for your reply,
    Yes I run JRK's as well...
    Have wanted this feature for quite a while now.
    But alas, I am not a programmer...
    If I can help in any way please let me know!
    A stand alone program would not be an issue at all as I use Sim Commander to launch all my sims ( Using Sim Vibe) so I can just add a launch task before sim startup.
  8. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    12,754
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    97,447Coins
    Ratings:
    +8,170 / 40 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    The low tech approach is a mechanical chock/lock, which is what @Nick Moxley does, I don't have the problem as I use 60:1s that can't be back driven, but what you are suggesting @Zed would be appreciated by many JRK users.
    • Agree Agree x 1
  9. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    @Brett Horton - I’ll work on this today. The JRK manual even has an example C program that should be easy to adapt and the routine itself is trivial. I just need to sort out windows programming again. Been a while. :)
    • Like Like x 1
  10. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    That’s actually what I’ve been using too but I’d like it to be more simple, plus I still get a bump since my chocks aren’t quite to center. I’ve been sliding some spare extrusion between my top and frame but I already set up rest stops for the sim to settle to and I was thinking it would just be kind of cool to have it move slowly and smoothly to the home position ready to hop in - kind of like the door in the haunted house that slowly opens and beckons... :grin
    • Like Like x 1
  11. Nick Moxley

    Nick Moxley Well-Known Member

    Joined:
    Dec 13, 2013
    Messages:
    2,755
    Occupation:
    Owner/Operator- Moxleys Rantals
    Location:
    Winnipeg Manitoba Canada
    Balance:
    19,427Coins
    Ratings:
    +2,460 / 29 / -2
    My Motion Simulator:
    2DOF, 3DOF, DC motor, JRK

    My locks are 100% DEAD center and i often Still get a jump when i power up, also sometimes ill have one side drop as i UnLock it before powering up, ill manually re position it closeish to center and then it doesn't Jump but rather a small "tick" and there live.

    Im honestly baffled as to why they sometimes kick and other's not. I can only assume its the amount of current the JRK feeds to the motor to get that Initial spin up of the rotor to check the position, IF the poles are out by a Hair, you get a Big ol jump and jolt of power, If the poles are perfectly lined up, the motor's do Nothing but are Now On with that small click of the rotor only having to move a fraction of a movement.

    I look forward to seeing what you come up with for this Zed, :thumbs:thumbs
    • Like Like x 1
  12. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    As with all things, the devil is in the details. I got MinGW installed and working, and can talk with the JRKs but there are some hurdles. I’m trying to figure out how to use the Pololu identifiers like those in the JRK utility instead of the JRK command comm ports but no luck yet. I want to be able to uniquely identify the JRKs because I now realize I have to read the configs off the JRK to know if the feedback or motor sense is reversed. I could just blindly issue a movement command and see which way the feedback changes but that risks causing damage if I go the wrong way. So more to learn/find. It’s in their dev kit.

    I can code up the specific solution for my rig but I was hoping for the more general one where others could put the JRK identifier on the command line and have it go from there.

    I could also just set the PWM value to some user chosen small value and let them gently move the platforms into position, then set it back, but the frequent writing of setup values will wear the EEPROM. I don’t know the specs on the part but have worn out EEPROMs before with too many reprogram cycles so don’t want to do that.

    In sum, learning a lot but it eats time.

    I can’t just send the existing position and then send the 2048 position because that’s effectively what causes the abrupt move - just minus setting the initial position. So anything else takes knowing how to interpret the feedback and turn that into a scaled motor command and knowing which way to move the motor to seek to midpoint/home.

    Ultimately I’m sure it’s still simple but being careful takes time. Still working on it though but it’s going to be longer to do than I thought and I really want to go driving now... :think
    • Like Like x 2
  13. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Ah, but it gets easier. I can run my program while running the JRK utility (didn't know I could do that) and scaled feedback takes care of everything. All I need to do is read that and increase or decrease the target to take it to 2048. Sorting if the jrkGetScaledFeedback(fd) value is above or below 2048 and incrementing and decrementing the target as appropriate until it hits 2048 is dead simple.

    I was looking at Game Engine and it uses the JRK device number when you select JRK as the interface so the only question there is if MinGW will support what's required. I just need to know how to address USB devices using that. The interface is listed in the Windows device manager. I just need to sort how to parse that and use it in the program. And the only other annoying thing is the simple timing functions I'm used to have been deprecated but they still work. So I get some warnings at compile time... ;)

    So actually getting close.
    • Like Like x 1
  14. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,133
    Location:
    Newcastle Australia
    Balance:
    26,049Coins
    Ratings:
    +2,433 / 23 / -0
    My Motion Simulator:
    DC motor, Motion platform, 6DOF
    Fi - BFF software does this slightly differently - It has a start/finish position which in your case could be the rig at its lowest point - Ie where it would have ended up by itself when the power was turned off. If you set it up like this - when you next turn it on, as the new start position is at the lower setting - there will be no big jump. The software then slowly walks the rig to the center position ready for operation. When you jump out of a game the rig slowly lowers itself to the lower position ready for turn off. Hope this helps. This is actually designed for big rigs so that you can enter/exit the rig.
  15. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    And, it works!

    Just need to sort device numbers into USB addresses!
    • Like Like x 2
  16. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    I don't think the JRK remembers the last position from when power is turned off if I understand what you are saying. I could do that in some kind of config file or similar but I'm trying to just make this as simple as I can. Hopefully it's useful for others but my goal is more selfish than altruistic. :blush

    At any rate, what I'm doing is just reading the actual current position (scaled feedback) instead of relying on a memorized position and then setting a target to that value and just looping while incrementing or decrementing that value as appropriate until it reaches midpoint/center. I could easily expand it with another variable for target position for each axis instead of just having it go to center, but when SimTools fires up, I think it is just outputting a center value anyway so ultimately that's probably where it needs to end up.

    My rig just settles when the motors are commanded off and that works fine for me. I have hardware stops to keep it from going too far so bringing it back to center is all I'm wanting to do on this at least for now.
    • Like Like x 1
  17. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    I've got this working on 2 axes now. I figure that's the default case but can add a third and some smarts for the traction loss folks if there is interest.

    The way it runs is to use the command "home.exe COM1 COM2" (assuming those are the command ports for your JRKs).

    It reads the scaled feedback position on the JRKs and uses those as the initial targets to send back to the JRKs. That turns on the motors and the program then increments/decrements as necessary to get to 2048. When it gets there on both axes, it's done. Soft start! :thumbs

    I'm waiting for two things before I upload the executable - word from @Brett Horton that it works for him too, and I'd like to know how to use Pololu device identifiers instead of com port numbers to talk to the JRKs.

    @yobuddy - you used the JRK device identifier in SimTools. Any hints on how to use those to open the com ports? I'm not sure if COM port designators will occasionally change which will raise havoc with this. Do you look somewhere to get the association/translation from device identifier to com port or can that be used somehow as the device name when you open the com ports?
    • Like Like x 1
  18. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Got more progress if anyone wants to play along. Please remember this is at your own risk. Might also want to turn down your JRK PWM values to minimize/prevent damage just in case until you know it works properly on your system. It works fine on my system and Brett's but please be careful until you know on yours. This is beta and I'm looking for any feedback you care to offer. For now it's just the two axes that get centered up instead of moving with a big bang when the motion software starts.

    The program is called home.exe and the way you use it is to call the program with what is basically a speed value and then the JRK "Command" com port values. (I plan to update to JRK device identifiers as the com port numbers may change if stuff is plugged in or unplugged - I just don't know.)

    Usage is home.exe <step size> <com1> <com2> or, for example, home.exe 2 COM1 COM2

    Note that there is a space between each argument and the COM letters are all caps. The program will just exit out if you don't specify all of the variables - step size and each of the two com port values. You can get the com port numbers from the Windows device manager. Find your JRKs and then look at the properties then the hardware tab. You want the Command port - not the TTL port.

    The <step size> is just a number from 1 to 10 inclusive and is basically speed. The JRKs accept position values of 0 to 4095. The step size is just how big the increment is that is used to slew the motors from wherever they are to the center position of 2048. Note that right now it doesn't necessarily hit 2048 exactly. It will be within step size of 2048 though.

    When it runs, it reads the scaled feedback position, spews some diagnostic information, and uses that as a starting point to then slew to the center position by incrementing the position "step size" at a time.

    You don't have to run it in a command prompt window. You can make a desktop shortcut to it and then modify the shortcut to include the step size and com ports. Might want to test in a command prompt window first though. Also, running it on a system already centered up may possibly move it slightly but it could only be a move of "step size". Basically no effect.

    Here is sample output when running it incorrectly first, then on a cold and dark platform that just had power applied, and then the output after turning the motors back off using the JRK utility and letting it settle back down. The difference is just the current settings to the commanded motor position:

    C:\Users\Zed\Home\Portable>home.exe
    Home vers. 0.1b
    Inputs = 1.
    Usage is home.exe <step size> <com1> <com2> eg: home.exe 2 COM4 COM7

    C:\Users\Zed\Home\Portable>home.exe 8 COM4 COM7
    Home vers. 0.1b
    Inputs = 4.
    home.exe 8 COM4 COM7
    Using step size of 8.
    Current Scaled Feedback1 is 546.
    Current Scaled Feedback2 is 212.
    Current Setting1 is 0.
    Current Setting2 is 0.
    Done!.

    C:\Users\Zed\Home\Portable>home.exe 8 COM4 COM7
    Home vers. 0.1b
    Inputs = 4.
    home.exe 8 COM4 COM7
    Using step size of 8.
    Current Scaled Feedback1 is 610.
    Current Scaled Feedback2 is 168.
    Current Setting1 is 2050.
    Current Setting2 is 2052.
    Done!.

    C:\Users\Zed\Home\Portable>

    Attached Files:

    • Winner Winner x 4
  19. Brett Horton

    Brett Horton Active Member

    Joined:
    Aug 18, 2016
    Messages:
    289
    Occupation:
    UAS Manager / Pilot / Integration Specialist
    Location:
    Tampa FL
    Balance:
    18Coins
    Ratings:
    +191 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    Here is a quick video of my setup running Zed's routine.
    I am running with the following options:
    .....home.exe 3 COMx COMx
    X being your com port for your JRK's
    3 being the "speed" I like for the soft startup. 1 being slower 10 being faster...FYI
    • Winner Winner x 3
    • Like Like x 1
    Last edited: Oct 21, 2017
  20. Zed

    Zed VR Simming w/Vive

    Joined:
    Apr 4, 2017
    Messages:
    730
    Location:
    USA
    Balance:
    4,227Coins
    Ratings:
    +749 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Great video, Brett! Thanks for posting that. Shows really well what this is about.

    For now I limit the step size to between 1 and 10 inclusive. I can allow bigger step sizes but that could come at the expense of creating vibration and cogging between each step commanded.

    Also, something else Brett found is his computer asked him about running unknown software. No big deal and he just said yes first time and it didn’t ask again. But when he put it in his startup folder to run automatically when he boots, it was hanging and was hanging even when he would run manually in a command prompt window. Somehow he found there was an additional approval dialog we think was from having it run in the startup folder. Once he allowed that too, it ran every time after that just fine and without further dialogs.
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Oct 22, 2017