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.

Showroom No-Weld 2DOF Seat Mover On Homebrew Ricmotech RS1 Clone

Discussion in 'DIY Motion Simulator Projects' started by armpit, Jun 7, 2017.

  1. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Ebay seller alice1101983 is who I and other forum members have had good luck with.

    I read that these motors are 17 amps, so they should not draw more than ~200w each... But they must have higher peak ratings to be blowing 20a fuses while I was stress testing them and I'm not sure if the power supply will be able to handle spikes like that for two motors. I'm going to see how the one psu will work for me before considering a second or an in-line battery.
  2. llluis

    llluis Active Member Gold Contributor

    Joined:
    Mar 30, 2017
    Messages:
    126
    Location:
    Quebec
    Balance:
    1,518Coins
    Ratings:
    +95 / 1 / -0
    My Motion Simulator:
    6DOF
    Where did you get them? What's the size?
    What threaded rod diameter are you using?
  3. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    1/2-20 with a 1/2" opening
    https://www.ebay.com/itm/QA1-NFR8-N...n-Steel-1-Piece-Female-1-2-20-RH/262945956783
    also available from speedway motors directly: https://www.speedwaymotors.com/QA1-...on-Steel-1-Piece-Female-1-2-20-RH,263325.html
    There are other sellers with them that might be more local to you, but that was the cheapest I could find for inside the US.

    I am using 1/2-20 threaded rod. As users wiser than me have pointed out, it's not the ideal way to do it as the threaded rod isn't as strong as if you are able to weld, but I haven't noticed any significant bending/flexing.
    I think the recommended is male heim joints and welded nuts on the ends of thicker steel tubing... but to me the threaded rod + female heim joints was the most straightforward way to get my push arms done.
    Last edited: Oct 31, 2017
  4. llluis

    llluis Active Member Gold Contributor

    Joined:
    Mar 30, 2017
    Messages:
    126
    Location:
    Quebec
    Balance:
    1,518Coins
    Ratings:
    +95 / 1 / -0
    My Motion Simulator:
    6DOF
    Thanks much for all your information and sharing with us your progress.

    Yeah, I saw the notes regarding the threaded rods... But I don't know any way to have the steel soldered. And can look for it right now. The threaded rods, on the other hand, is easily accessible and easy to work with. I'll do like this right now and upgrade it in the future, if necessary.

    The only thing left in your build I didn't ask yet is the race harness, LOL
  5. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Just the cheapest decently rated one I could find on Amazon.
    Tanaka 4-point Buckle Sports Harness
    amazon.com/gp/product/B019EQ49JS
  6. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Small update...
    While I'm waiting for the new monster motos to come in, I decided to go ahead and adjust the mounting points at the top so that the angle is less dramatic.
    I also bought some PVC pipe to cover the threaded rods just to clean up the look a little bit, swapped out some of the nuts on the motor axle with locknuts, and am working on redoing some of the wiring

    IMG_20171101_185648.jpg

    ( overlay compared to before: )
    IMG_20171101_185648.jpg
    • Like Like x 2
    Last edited: Nov 2, 2017
  7. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    The old wiring graveyard. These walmart connectors and my cheap-o crimping tool were junk, plus I didn't have much experience crimping so I'm sure I didn't do it right; I even had one (the main 12v+ coming off the fuse box) that was loose and was showing signs of overheating.... I'll keep a closer eye on this new batch, but I used much higher quality connectors and got better crimps
    Unrelated, one of my pots over-rotated with a runaway motor a couple weeks ago when I hooked up the new motors for testing, I've replaced this but it wasn't hooked up for the pictures.

    IMG_20171101_235018.jpg

    I have much more confidence in the new connectors, if I notice anything funky going on with these after use, I'll make direct solders where possible after I do some shakedowns with the new motors.

    IMG_20171101_235352.jpg

    IMG_20171101_235515.jpg

    I've now done everything I can think of while waiting for the motor controllers... time to twiddle my thumbs
    • Like Like x 1
  8. fuad

    fuad New Member

    Joined:
    Sep 9, 2017
    Messages:
    25
    Location:
    kuwait
    Balance:
    2Coins
    Ratings:
    +8 / 0 / -0
    Hi M8,
    good work and im happy you solved the stall isue.
    i have the same problem with 1 motor. can you post the code you used to solve the problem.
    regards.
  9. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I'll outline what I did, I think this is a case where some understanding of what was done to workaround the issue I was having is better than just blindly grabbing my modified code file. This solved my issue but I don't guarantee it will work for you, and I also don't know enough about the motor controller to say anything about if this is harmful to it or not, so do this modification at your own risk.

    Here's the steps you need to take:
    First we want to add a function that actually handles resetting the motors, we'll do this by making some variables for this and a new function called 'resetMotor' and put it in the main body of the code.
    To do this, find the function
    Code:
    void setPwmFrequency(int pin, int divisor)
    and add this above it
    Code:
    //Initializing motor reset vars
    bool resetMotor1 = false;
    bool resetMotor2 = false;
    int motorReset = 0;
    int motorResetInterval = 100;  //Increase or decrease this interval to suit your needs
    int motorResetLength = 1; //Amount of pwm cycles to force the reset to be sent
     
    void resetMotor(int motorNumber)
    {
      if(motorNumber == 1)
      {
       //Toggle pins for motor 1 outputs
          if(digitalRead(ENApin1) == LOW)
            digitalWrite(ENApin1, HIGH);
          else if(digitalRead(ENApin1) == HIGH)
            digitalWrite(ENApin1, LOW);
       
          if(digitalRead(ENBpin1) == LOW)
            digitalWrite(ENBpin1, HIGH);
          else if(digitalRead(ENBpin1) == HIGH)
            digitalWrite(ENBpin1, LOW);
    
       //Set pwm pin to off for reset of motor 1
          analogWrite(PWMpin1, LOW);
      }
      else if(motorNumber == 2)
      {
       //Toggle pins for motor 2 outputs
          if(digitalRead(ENApin2) == LOW)
            digitalWrite(ENApin2, HIGH);
          else if(digitalRead(ENApin2) == HIGH)
            digitalWrite(ENApin2, LOW);
       
          if(digitalRead(ENBpin2) == LOW)
            digitalWrite(ENBpin2, HIGH);
          else if(digitalRead(ENBpin2) == HIGH)
            digitalWrite(ENBpin2, LOW);
    
       //Set pwm pin to off for reset of motor 2
          analogWrite(PWMpin2, LOW);
      }
      else if(motorNumber == 3)
      {
        //unimplemented
      }
    }
    
    Now, we want to implement something that keeps track of when it is time to send a motor reset signal. We'll do this by modifying the main process that calculates what values to send to the motors.
    Inside of the main program loop, find this section
    Code:
        if (PIDProcessCounter >= PIDProcessDivider)
            {
                PIDProcessCounter=0;
             
                // Check and Update Motor 1 drive
     
                Feedback1 = analogRead(FeedbackPin1);
                if ((Feedback1 > CutoffLimitMax1) || (Feedback1 < CutoffLimitMin1)) { DisableMotor1(); }
                PWMout1=CalcMotor1PID(Target1,Feedback1);
                if (Disable1==0)
                {
                    SetOutputsMotor1();
                }
                else
                {
                    PWMout1=0;
                }
    
                // Check and Update Motor 2 drive
    
                Feedback2 = analogRead(FeedbackPin2);
                if ((Feedback2 > CutoffLimitMax2) || (Feedback2 < CutoffLimitMin2)) { DisableMotor2(); }
                PWMout2=CalcMotor2PID(Target2,Feedback2);
                if (Disable2==0)
                {
                    SetOutputsMotor2();
                }
                else
                {
                    PWMout2=0;
                }
    
                // Check and Update Motor 3 drive
    
                Feedback3 = analogRead(FeedbackPin3);
                if ((Feedback3 > CutoffLimitMax3) || (Feedback3 < CutoffLimitMin3)) { DisableMotor3(); }
                PWMout3=CalcMotor3PID(Target3,Feedback3);
                if (Disable3==0)
                {
                    SetOutputsMotor3();
                }
                else
                {
                    PWMout3=0;
                }
    
                LoopCount++;
            }
    
    And replace it with this
    Code:
        if (PIDProcessCounter >= PIDProcessDivider)
            {
               //BEGIN armpitMod: Keep track of motor reset count
               //and mark motor for reset if we are past the interval
                motorReset++;
                if(motorReset > motorResetInterval)
                {
                  resetMotor1 = true;
                  resetMotor2 = true;
                  if(motorReset > motorResetInterval + motorResetLength)
                  {
                    resetMotor1 = false;
                    resetMotor2 = false;
                    motorReset = 0;
                  } 
                }
               //END armpitMod
             
                PIDProcessCounter=0;
             
                // Check and Update Motor 1 drive
     
                Feedback1 = analogRead(FeedbackPin1);
                if ((Feedback1 > CutoffLimitMax1) || (Feedback1 < CutoffLimitMin1)) { DisableMotor1(); }
    
                PWMout1=CalcMotor1PID(Target1,Feedback1);
             
             
                if (Disable1==0)
                {
                    SetOutputsMotor1();
                }
                else
                {
                    PWMout1=0;
                }
    
                // Check and Update Motor 2 drive
    
                Feedback2 = analogRead(FeedbackPin2);
                if ((Feedback2 > CutoffLimitMax2) || (Feedback2 < CutoffLimitMin2)) { DisableMotor2(); }
                PWMout2=CalcMotor2PID(Target2,Feedback2);
                if (Disable2==0)
                {
                    SetOutputsMotor2();
                }
                else
                {
                    PWMout2=0;
                }
    
                // Check and Update Motor 3 drive
    
                Feedback3 = analogRead(FeedbackPin3);
                if ((Feedback3 > CutoffLimitMax3) || (Feedback3 < CutoffLimitMin3)) { DisableMotor3(); }
                PWMout3=CalcMotor3PID(Target3,Feedback3);
                if (Disable3==0)
                {
                    SetOutputsMotor3();
                }
                else
                {
                    PWMout3=0;
                }
    
                LoopCount++;
            }
    

    Now we need to force the motor output code to ignore sending normal values if the motor is marked for a reset.
    Do this by finding this function and replace this
    Code:
    void SetOutputsMotor1()
    {
        if((Feedback1 > InputClipMax1) && (PWMrev1 != 0))
        {
    
    with this
    Code:
    void SetOutputsMotor1()
    {
        //If motor 1 is marked for reset, let's enter the reset function instead of doing normal motor output
        if(resetMotor1)
        {
            resetMotor(1);
        }
        else if((Feedback1 > InputClipMax1) && (PWMrev1 != 0))
        {
    
    We need to do the same for motor2, so find this function and replace this
    Code:
    void SetOutputsMotor2()
    {
        if((Feedback2 > InputClipMax2) && (PWMrev2 != 0))
        {
    
    with this
    Code:
    void SetOutputsMotor2()
    {
        if(resetMotor2)
        {         
            resetMotor(2);
        }
        else if((Feedback2 > InputClipMax2) && (PWMrev2 != 0))
        {
    
    After that, your motor controller will receive a reset signal every every 1/4 second or so.
    • Informative Informative x 1
    Last edited: Nov 2, 2017
  10. pinthi

    pinthi Member Gold Contributor

    Joined:
    Nov 1, 2017
    Messages:
    32
    Location:
    France
    Balance:
    - 45Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    c'est génial ton travail
    je prend model sur toit pour construire mon simulateur
    par contre je m'est les pédale solidaire avec le feuille
    merci pour les idées
  11. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    12,871
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    98,260Coins
    Ratings:
    +8,217 / 40 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    You can dual language post if you also include and English Translation, like this:

    it's awesome your work I take model on roof to build my simulator par contre I'm the pedal solidarity with leaf thank you for the ideas
  12. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Well guys, the 3 new motor controllers FINALLY came in after 2 months.... and they are all 3 bad. One board has one underpowered chip, one had no working reverse for either chip, and one sent my power supply into protect mode regardless of PWM setting.
    From ebay seller alice1101983, and they were also not helpful with the shipping issues and I had to twist their arm (and get ebay involved) to get them to do anything. I'm marking that seller off of the list of 'good sellers'.

    One of the new ones and the original old one I was using both have one chip each that are good, so my next step is to wire up one chip from each one of the boards to each motor; hoping to make progress on that early next week.
    I've ordered more from another seller, so once those come in since I'll already have the "one dual chip monster moto per motor" setup in place I'll go ahead and wire the (hopefully 100% working) new boards up as 2-into-1 to get 60 amps per motor.
  13. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I ended up waking up early this morning and getting right into the dual-controller setup before having to leave town for the weekend... IT WORKS!

    My wife thinks it's going to catch on fire, can't say I blame her haha! I'll work on tidying it up when I get back, I'm also going to wire it up for one power supply per board. Right now the second one is just sitting there unplugged and I made a split for the power from the other one.

    IMG_20171216_123830.jpg

    • Like Like x 1
    • Winner Winner x 1
  14. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I just got done with a shakedown run with a single power supply for each monster moto, everything worked great for about 2.5 hours then I started noticing motor fade. I was in the middle of a 'ring lap so I waited until the end to check on things and the motor housings were too hot to touch for more than just a couple seconds. I measured them at 145F.... the motor controllers were just barely warm to the touch so the new heatsinks+fans are working great there.

    Is this kind of temperature common? Should I consider lowering the pwmMax to keep the temps down, or just look into adding some fans to aid in cooling? I have some room to play with the pwmMax, I was running at 255 and some car/track combinations were actually hurting me from how aggressive the motors were during shifts or running off the track.
  15. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    12,871
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    98,260Coins
    Ratings:
    +8,217 / 40 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    No that sort of tempeature is not common and either the design, settings, or both, are overstressing the motors.
    • Informative Informative x 1
  16. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thanks, the settings are the easiest to take a look at so that's where I started.

    I had a sneaking suspicion that the constant electric buzzing from the motors wasn't normal (you can hear it if you crank the volume up in the last video I posted), I assumed it was from having a pwmMin set of 30 that was causing them to never be able to rest fully, but it ended up being more than just that.

    I poked around in the SMC3 code and added some debug serial output and noticed that the motors were constantly fighting back and forth on themselves even when they were where they should be. Turns out my potentiometers don't have the cleanest signal (they are perfectly stable when I have the power to the motors turned off, so there's unsurprisingly some interference probably from the motor windings), so I added in a 'running average' style read for the last 10 pot values. I saw that a hardware fix for this may be ferrite clips around the signal wire or bridging the signal and ground for each pot with a '104' ceramic 0.1uF capacitor; I don't notice any delay or loss in fidelity from the 10 value running average, but if I do then I'll give the capacitor a shot.

    I also ran through the guide for the SMC3 first time setup to get new numbers all figured out.

    My idle holding noise is completely gone, along with all the buzzing and whining that used to happen during any movement at all.

    The motors are cold to the touch even after 30 minutes of running the SMC3 'motion' test, where previously they would be warm after just that.
    It's way too late to do another shakedown test, but that will be the next thing I do. I did a test using the joystick control plugin while sitting in it and the movement is noticeably smoother and more precise now too. I'm feeling really good about this fix.

    Just while typing this I had the Sine Wave test running and forgot about it, it's that quiet now!

    Here are the values I've settled on and what the motion response looks like. I'm still experimenting with the Kd and Ks for helping with the overshoot on large sudden changes, I noticed best results at Kd=400 ks=100, but those values are WAAAY higher than I've seen anyone else use...

    upload_2017-12-21_3-0-45.png
  17. nnamssorxela

    nnamssorxela New Member

    Joined:
    Jun 14, 2017
    Messages:
    4
    Location:
    Colorado, USA
    Balance:
    101Coins
    Ratings:
    +0 / 0 / -0
    In your last post you mentioned you are averaging the last 10 potentiometer readings to reduce the PWM or motor directions fighting themselves. Forgive my lack of understanding about all things electrical, but wouldn't this just "slow" the PWM adjustment down? I would think that the averaging would be 10x less frequent reducing motor heat, but 10x more "jarring" assuming that the motors are actually falling off zero and have 10 seconds longer to move off of the target location. Or does that not matter when the motors are in motion, and only when they are at rest? Does that make sense?

    Are you still planning on running the capacitor or are you happier with the code running the averaging?
  18. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    For the averaging of the potentiometer reading, they are polled once every few microseconds and the value they return (0-1023) is used to know where the motor is so the pwm can be calculated. I am still polling the potentiometers at the same rate, but using a rolling 10 value average, so if there's one or two numbers in that range of 10 values that are a little higher or lower, the overall average that is returned won't fluctuate as much so the pwm will be 'smoothed' over the next dozen or so microseconds. Not talking about a lot of time passing here, so the delay is negligible.

    I actually did change to using a 0.1uf ceramic capacitor '104' bridged between ground and signal on the potentiometer for each motor and made a before and after video I meant to post up here. You can hear the sound pretty clearly in the 'before', this video was taken with the 10 value smoothing workaround NOT in place. The capacitor method is the better choice because the real value from the potentiometer is being immediately used rather than a running average, though either way is about the same.

    • Informative Informative x 1
  19. nnamssorxela

    nnamssorxela New Member

    Joined:
    Jun 14, 2017
    Messages:
    4
    Location:
    Colorado, USA
    Balance:
    101Coins
    Ratings:
    +0 / 0 / -0
    Great work! If I understand you correctly, you say that the video was filmed with the averaging not in place. Are the motors still staying cool to the touch after similar stress testing?

    Does using the capacitor to clean up the potentiometer signal still leave you with the noticeably smoother action mentioned in your quote above?
  20. armpit

    armpit Active Member

    Joined:
    Jan 7, 2016
    Messages:
    127
    Occupation:
    Software Engineer
    Location:
    SC, USA
    Balance:
    195Coins
    Ratings:
    +131 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Yes the motors are still staying cool, this is part because of the capacitors keeping the potentiometer signal clean and part because of fine tuning the pwm minimum, maximum, and ramp-up curve values in the smc3 application.
    The smooth action was also from going through and fine tuning the pwm values, specifically the pwmMin being set to zero instead of 30 so that small adjustments can happen without being jerky and overshooting slightly.


    Might have also helped that I cleaned up the wiring.... :)

    3776257219655735408.jpg