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

Question Simtuning G seat Sway no negative beyond center on a flap while one raise. Or axis neg clamp?

Discussion in 'SimTools DIY Version' started by Trigen, Feb 2, 2019.

  1. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Hello

    I got my G seat built and set so i dont have much negative axis to go on. Looking into for example dirt rally if i tune one axis that i do not wish to go negative i can do -50 or whichever number i need. Problem seems to be that this affects it when it needs to go down normally from top too, from what i can see anyhow. Is there a clever way for it not to go below center pot and still retain its speed? Ive had to mount one motor the opposite way from the other too, can this have an effect? I dont think so on the sway.

    The best would be if i could actually limit the negative throw for all axes not to go beyond center pot from the axis me
  2. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,282
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,199Coins
    Ratings:
    +5,093 / 18 / -0
    If your using a Arduino, simply edit the sketch you are using buddy to ignore the negative side of things.
    Take care,
    yobuddy
    • Informative Informative x 1
  3. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Cool, thanks! Not a clue how SMC3 so more questions and research :) Any chance you got a hint?
    Last edited: Feb 2, 2019
  4. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,030
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,878Coins
    Ratings:
    +10,880 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  5. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    After the code where the sketch inputs data from simtools test when the required axis drops below 511 and when it does make it stay at 511 until it goes above again.
  6. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Thanks for taking the time. But im not quite sure where that would be. Got a line number and a copy of some of the code?

    Cant i use this ( ive edited) clip code for it?

    Code:
    int InputClipMax1 = 600;    // The input position beyond which the target input is clipped
    int InputClipMax2 = 600;    // The input position beyond which the target input is clipped
    int InputClipMax3 = 600;    // The input position beyond which the target input is clipped
    int InputClipMin1 = 512;      // The input position beyond which the target input is clipped
    int InputClipMin2 = 512;      // The input position beyond which the target input is clipped
    int InputClipMin3 = 512;      // The input position beyond which the target input is clipped
    
  7. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Thanks guys looking into the faq and such now
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    Yes it appears the code that tests is already in there and you just need to change the values to what you want to use.
  9. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Thanks

    Does not look like it cares about any input i make to the clipping or max limit settings. Ive been testing it in the gameengine and LFS.


    If i set fks the int Target1 = 512; to 600 in the sketch it will move to 600 on upload so i know it will use that atleast.

    Test limits example, i generally set it at 480 min 550 max for testing

    Code:
    int InputClipMax1 = 518;    // The input position beyond which the target input is clipped
    int InputClipMax2 = 518;    // The input position beyond which the target input is clipped
    int InputClipMax3 = 518;    // The input position beyond which the target input is clipped
    int InputClipMin1 = 512;      // The input position beyond which the target input is clipped
    int InputClipMin2 = 512;      // The input position beyond which the target input is clipped
    int InputClipMin3 = 512;      // The input position beyond which the target input is clipped

    I can see that it first writes the limits to EEPROM then it reads it and set InputClipMax1 = 1023-InputClipMin1;

    Why does it take the Clipmax and set it to 1023 then subtract ClipMin? Wouldnt this remove any setting i set on top and replace it with 1023 - lets say 200 = 823. Now Clipmax is 823. I dont see it doing this with ClipMin anywhere but i dont have a full overview of the sketch. Main issue of course is that (Simtools) it does not seem to care what i set in either Clipmax or Min. im not a great programmer som im not sure how all this works.


    Code:
        EEPROM.write(5,DeadZone1);
        EEPROM.write(6,CutoffLimitMin2);
        EEPROM.write(7,InputClipMin2);
    Code:
        CutoffLimitMin1 = EEPROM.read(1);
        InputClipMin1 = EEPROM.read(2);
        CutoffLimitMax1 = 1023-CutoffLimitMin1;
        InputClipMax1 = 1023-InputClipMin1;



    Thank you
  10. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    Okay what you were trying to do won't work for several reasons so I modified the sketch so it clips targets when they drop below 512. :popcorn

    Attached Files:

    • Like Like x 1
    • Winner Winner x 1
  11. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Cheers. Have a beer on me!
    Last edited: Feb 3, 2019
  12. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,030
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,878Coins
    Ratings:
    +10,880 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  13. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,573
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 39 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Your clip code was not were I expected it to be..., but did you also apply a 'map' function to get back the full movement of the servo/motor?
  14. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    No nothing I read indicated that he needed that.
    Also this was intended to be a one-off and not a fix for everyone.
  15. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    I didnt say anything about it as i didnt know about it but a full range map from clip value would be the best of course. With that in mind i have a questions. If the game gives me a value of 450 will the axis go to 512 and stop there or will it ignore it completely? Same with values above but thats not much of an issue as i can set the axis limits in simtools. It would however save some slight time for new people.

    For the main testing part ive had to do some slight modifications to your code to make it work.

    This is being tested with the SMC packet serial for sabertooth

    If you use #define REVERSE_MOTOR1 setting the limits will not work as intended. It will be the opposite of what it should be and if you set the values in reverse it will just sit there and shake.

    Setting the value to 512 cen lead to the motor shaking due to dead zone being to small.

    In the code file above there is InputClipMax1 = 1023-InputClipMin1; It needs to set to a value say 650 or you will get 1% range on the axis and it is required for this to work. Just so there is no confusion here. You can set it to 1023 and use axis limit in simtools or if you know the value you can set that.

    Code starts at line 526

    Code:
    //****************************************************************************************************************
    //    Read all configurable parameters from the EEPROM.
    //       
    //****************************************************************************************************************
    
    
    void ReadEEProm()
    {
        int evalue = EEPROM.read(0);
        if(evalue != 114) //EEProm was not set before, set default values
        {
            WriteEEProm();
            return;
        }
        CutoffLimitMin1 = EEPROM.read(1);
        InputClipMin1 = 500;
        CutoffLimitMax1 = 1023-CutoffLimitMin1;
        InputClipMax1 = 650;
      
        DeadZone1=EEPROM.read(5);
        CutoffLimitMin2 = EEPROM.read(6);
        InputClipMin2 = 500;
        CutoffLimitMax2 = 1023-CutoffLimitMin2;
        InputClipMax2 = 650;
    Last edited: Feb 8, 2019
  16. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    An axis will go to the value set in inputclipmin and hold that value until it goes above it again.

    And since your range now appears to be around 150 (out of the 512 you currently have available) you don't require more motor range so no need for mapping. If anything it sounds like you could stand to use a lesser rotation pot (like 180 or 90 degree) to try to increase the resolution. But if your happy with the motion your getting probably no need for that either.

    Btw, when I edited the sketch I made it so that inputclipmax would still be changed when using SMC3 utilities. But hard coding a value like you did is fine too.
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Feb 5, 2019
  17. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Ive been working around this for a while now and it can make the flaps flap back and forth quite a bit when it hits the clip limit. Seems it would be best to give it a proper range.

    Im assuming i need to do something like this

    If (range > 0) range = 128; // or another number depending on how range is set up


    Im not quite sure where i would need to change it. Be specific
  18. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    If anything it appears you need a lesser rotation pot to increase the resolution.
  19. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    484
    Balance:
    2,872Coins
    Ratings:
    +178 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    I'm running a 2:1 gearing so it's not an issue. Those numbers are no longer valid. Just need to set the range and not use clipping as any slack in the system leads to flapping when hitting the clipping limits (especially on startup) unless you set the dz very large.
  20. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    It could be you have to much slack then. In any case you can't set a range when using absolute position sensors you can only remap it. However remapping doesn't change the actual resolution so I don't know what you would gain other than using a larger percentage of the graph when using smc3 utilities. To me it appears your problem is you are overshooting the target since the clip limit just freezes the target at that point. Are your tests always done loaded? Unloaded it would probably act as you state when using settings to make it move properly when loaded.