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

Resolved Different axis limiting for each way of a G-seat flap?

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by Qlittles, Apr 8, 2020.

  1. Qlittles

    Qlittles Active Member

    Joined:
    Sep 27, 2017
    Messages:
    117
    Location:
    Union City, California, USA
    Balance:
    446Coins
    Ratings:
    +61 / 4 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hello all, I'm re-working my G-seat, and I had a question about having different axis limiting for each way of a flap. For example:
    axis limit.png
    Flap movement "A" is larger than flap movement "B". I want to do this because I realize that although it is possible to just not use the negative value in the Tuning Center, there is some detail I will be losing on the "B" side. I do understand that I can increase the negative Tuning Center value so that "B" is half of "A" for example. However, this doesn't guarantee that the flap won't travel past "B", in which case, things will break mechanically.

    Is there a way to set the axis limiting for the motor for just one direction? Maybe a modified SM3?
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    365
    Balance:
    2,346Coins
    Ratings:
    +110 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    The easy way is to go to line 545 (bit below) in the SMC ardunio file and change the minimum axis limit and cropping it. That way you have a hard limit

    Here's mine.

    Code:
    void ReadEEProm()
    {
        int evalue = EEPROM.read(0);
        if(evalue != 114) //EEProm was not set before, set default values
        {
            WriteEEProm();
            return;
        }
        CutoffLimitMin1 = 300;
        InputClipMin1 = 500;
        CutoffLimitMax1 = 750;
        InputClipMax1 = 700;
      
        DeadZone1=EEPROM.read(5);
        CutoffLimitMin2 =300;
        InputClipMin2 = 500;
        CutoffLimitMax2 = 750;
        InputClipMax2 = 700;
    
    
    Another option is to use PT Mover where you can just crop negative wherever you want without any hassle and you can limit each force where you want it. Might not be exactly what you want but give it a look anyways. Its much much faster to check what value your pot is at and is great for testing. There's a remap feature that could maybe be used but i dont quite understand it yet. You also have logistic which is the same as the use % of axis in Simtools

    Here's the link and ive added my config file in the latest mover release so you can just tweak the com ports you need. Be aware you need to change your value range to -100 100 in the upper axis 1 and 2 as i have mine set so that center is at 323 for more range on my hall sensors. Also DO NOT power on or off before turning Mover on/off . PS Roll speed is amazing for Gseats

    https://www.xsimulator.net/community/threads/flypt-mover.13464/

    Im sure some of the great support on here will chip in with some insight too

    Attached Files:

    • Informative Informative x 2
    • Like Like x 1
    Last edited: Apr 9, 2020
  4. Qlittles

    Qlittles Active Member

    Joined:
    Sep 27, 2017
    Messages:
    117
    Location:
    Union City, California, USA
    Balance:
    446Coins
    Ratings:
    +61 / 4 / -0
    My Motion Simulator:
    2DOF, Arduino
    Awesome! Thanks a bunch for the detailed response. I'll first try the easy way you mentioned and see if that suffices ( I'm a bit intimidated by the second option).
  5. Qlittles

    Qlittles Active Member

    Joined:
    Sep 27, 2017
    Messages:
    117
    Location:
    Union City, California, USA
    Balance:
    446Coins
    Ratings:
    +61 / 4 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi! I'm trying to change the values in your first method, but I don't see the code in SMC3 at line 545. Did you put in this code at that place? I'm looknig at the latest SMC3 version if that makes any difference. Also, I see at the beginning of the code CutoffLimitMax1, etc. Is this the right section? Thank you for your help!
  6. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    365
    Balance:
    2,346Coins
    Ratings:
    +110 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    My bad, it starts at 483, ive just put 545 in as it brings me to the code.

    Here's the default. replace InputclipMin = to fks 512 to have it stop in the middle.

    Code:
     CutoffLimitMin1 = EEPROM.read(1);
        InputClipMin1 = EEPROM.read(2);
        CutoffLimitMax1 = 1023-CutoffLimitMin1;
        InputClipMax1 = 1023-InputClipMin1;
      
        DeadZone1=EEPROM.read(5);
        CutoffLimitMin2 = EEPROM.read(6);
        InputClipMin2 = EEPROM.read(7);
        CutoffLimitMax2 = 1023-CutoffLimitMin2;
        InputClipMax2 = 1023-InputClipMin2;
    
        DeadZone2=EEPROM.read(10);
        Kp1_x100=ReadEEPRomWord(11);
        Ki1_x100=ReadEEPRomWord(13);
        Kd1_x100=ReadEEPRomWord(15);
        Kp2_x100=ReadEEPRomWord(17);
        Ki2_x100=ReadEEPRomWord(19);
        Kd2_x100=ReadEEPRomWord(21);
        PWMoffset1=EEPROM.read(23);
        PWMoffset2=EEPROM.read(24);
        PWMmax1=EEPROM.read(25);
        PWMmax2=EEPROM.read(26);
        PWMrev1=EEPROM.read(27);
        PWMrev2=EEPROM.read(28);
        PWMrev3=EEPROM.read(29);
    
    
        CutoffLimitMin3 = EEPROM.read(31);
        InputClipMin3 = EEPROM.read(32);
        CutoffLimitMax3 = 1023-CutoffLimitMin3;
        InputClipMax3 = 1023-InputClipMin3;
    
        DeadZone3=EEPROM.read(35);
        Kp3_x100=ReadEEPRomWord(36);
        Ki3_x100=ReadEEPRomWord(38);
    
        Kd3_x100=ReadEEPRomWord(40);
        PWMoffset3=EEPROM.read(42);
        PWMmax3=EEPROM.read(43);
        Ks1=ReadEEPRomWord(44);
        Ks2=ReadEEPRomWord(46);
        Ks3=ReadEEPRomWord(48);
    
  7. Qlittles

    Qlittles Active Member

    Joined:
    Sep 27, 2017
    Messages:
    117
    Location:
    Union City, California, USA
    Balance:
    446Coins
    Ratings:
    +61 / 4 / -0
    My Motion Simulator:
    2DOF, Arduino
    YEEEEEEEEEESSSSSSS!!!!! I finally got it to work using your instructions!!! Finally, I'm able to secure the arms without worrying about things breaking :) Thanks a bunch!!!!
    • Like Like x 1
    • Winner Winner x 1
  8. FredBasset

    FredBasset New Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    28
    Balance:
    441Coins
    Ratings:
    +12 / 0 / -0
    I'm fairly new to this but have now got my motors moving nicely with SMC3Utils. I'm using BlazinH's modified SMC code with a Sabertooth 2x32.

    I only want "positive" motion on my axis and for any "negative" motion to be cropped. I've tried the modifications mentioned above using 512 as the mid point but if I use SMC3Utils it just continually turns off the motor. I then tried 400 to see if I could at least limit the negative motion but its still not working.

    Any thoughts as to what I might be missing? Also I haven't tried it with SimTools yet, is the cropping only effective there.

    Thanks for any help
    Fred
  9. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,131
    Location:
    Oklahoma City, USA
    Balance:
    15,743Coins
    Ratings:
    +1,803 / 32 / -1
    To crop all negative motion just use the tuning center in Simtools and set the negative values for the dofs you want cropped to zero.
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    15,085
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    111,171Coins
    Ratings:
    +8,995 / 43 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Try allocating '0' for the min value in the Tuning Center for any axis where you want "negative" motion to be cropped.
  11. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    15,085
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    111,171Coins
    Ratings:
    +8,995 / 43 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Beat me to it :grin
  12. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,131
    Location:
    Oklahoma City, USA
    Balance:
    15,743Coins
    Ratings:
    +1,803 / 32 / -1
    That's not an easy thing to do :D.

    Also I will be offering new motor controller software soon named Awesom-O that will let you crop positive and negative values individually to whatever you wish by moving sliders which will then show their positions on a graph (similar to SMC3 utilities). It will also feature a whole slew of other improvements over what SMC3 offers like 12bit resolution for starters. More to come.
    • Informative Informative x 1
  13. FredBasset

    FredBasset New Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    28
    Balance:
    441Coins
    Ratings:
    +12 / 0 / -0
    Thanks guys, I've looked at this site on and off for years. Really glad I've started to build something and appreciate the help