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

Tutorial SMC3 Arduino 3DOF Motor Driver and Windows Utilities

Discussion in 'SimTools compatible interfaces' started by RufusDufus, Dec 1, 2013.

  1. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,146Coins
    Ratings:
    +22 / 1 / -0
    My Motion Simulator:
    2DOF
    i have a question about max limits and Clip Input. a bigger number limits the range more right? so a value of 255 is the smallest range before hitting the limits right?

    what if that isn't enough? when i drag the blue dot, i hit maximum mechanical range at about +/- 1/3rd of the range from center to full

    i set max limit=235 and clip input=255 but the lines display at about 1/2 way between center and full. so i can drag the blue dot past the mechanical limit.

    is there a way to fix that?

    this problem is probably caused because the working range on my pot is about 40 degrees. it would be very difficult to change that mechanically. maybe there is a pot scaling setting someplace in the arduino code?

    ah, maybe uncomment ENABLE_POT_SCALING but not sure how to use that. i looks like another pot is supposed to be connected to analog input 5, and that sets the scale value. i'd prefer to set it in software but the code is confusing. can anyone help?

    thanks
    Last edited: Nov 19, 2016
  2. bruce stephen

    bruce stephen Hammer doesnt fix it, must be electrical

    Joined:
    Jun 7, 2015
    Messages:
    1,286
    Occupation:
    general contractor
    Location:
    michigan
    Balance:
    9,112Coins
    Ratings:
    +1,238 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform, 6DOF
    @steveh2112 You are correct about the motor off/on button. This is just a reset after it stops due to max limit setting. Lower the max limit. If it goes past this it will shut off motors, they will need to be reset at upper left. I run max limit at 10. Clip limits the peaks, it "clips" or cuts the frequency, it can be used to soften the big blows like wrecks. I run clip at about 80.

    Edit: turn off motors by unplugging them.;)
  3. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Max limit is useful in combination with PWMmax reverse.
    Pot range is physically limited. You cannot scale it over 255 by doing this in a sketch, only using pots with gears or multiturn pots work at least.
    This scaling is meant to reduce the output of the movement from 100%. The scaling isn't linear. More information in the manual
  4. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,146Coins
    Ratings:
    +22 / 1 / -0
    My Motion Simulator:
    2DOF
    there's a manual? do you have a link to it please?
  5. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Addendum: I was wrong about linear and not linear, sorry.
    *** NEW BETA VERSION SMC v0.7.zip AVAILABLE 12/12/14 FOR TESTING ***
    Updates Version 0.7

    • Added a POT scaling input that can be used to scale the motion output based on the POT position
    • POT scaling can be setup as one of two modes - Linear or non-linear
    • DO NOT ENABLE POT SCALING UNLESS POT ATTACHED TO ARDUINO
    • AN5 used for POT scaling input
    • The non linear scaling is designed to try and reduce the overall motion but maintain the "smaller" movements as best possible - ie road noise and stuff, but scale back on the huge side to side motion you get in higher power cars.
  6. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,146Coins
    Ratings:
    +22 / 1 / -0
    My Motion Simulator:
    2DOF
    i worked out how to scale the pots in software, not pretty but it seems to work

    find this line in the main loop() function
    Feedback1 = analogRead(FeedbackPin1);
    add the following after
    Feedback1 -= 512; // STEVE Feedback1 is 10bit, 512 is center
    Feedback1 *= 2; // STEVE scale range by 2
    Feedback1 += 512; // STEVE

    do the same for Feedback2 and Feedback3 if you need it
    now your pots will have twice the effect as before
    (remember to download it to the arduino)
    • Useful Useful x 3
    • Like Like x 2
  7. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Thanks for all of your inputs guys..;):)

    I am using cermet pots which worked like a charm before I converted to SMC3 with MM's.
    Considering upgrading to the ones you mentioned @bruce stephen though.

    I havent sorted it all out yet, BUT near.
    The problem was noise inteferences..
    Asuming the problem have been it is located in a steel cabinet where all the wires go underneath a steelplate..
    I have ground isolated the GND terminal on my arduino aswell as every extra GND terminal on my MM's.
    Now I run with a deadzone at 2 on the pots and I am able to run with some more power in the settings and still keep the MM's under 30 degrees.
    So....
    My question is. How hard can I run the MM's? :)
    How hot is your heatsink/resistors while running?????

    Thanks again for all of your previous inputs :cheers
  8. fzxj520

    fzxj520 Active Member

    Joined:
    May 14, 2015
    Messages:
    176
    Location:
    SimTools is a generic Motion Simulator
    Balance:
    1,341Coins
    Ratings:
    +90 / 1 / -0
    My Motion Simulator:
    2DOF
    Hello @RufusDufus, thank you very much!
    I use the model 2, ask how to amend the code flip a motor direction?
    • Winner Winner x 1
  9. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,146Coins
    Ratings:
    +22 / 1 / -0
    My Motion Simulator:
    2DOF
    i think you can uncomment
    REVERSE_MOTOR1 in the arduino .ino
    but i would just change the wiring so you don't have to mess with the software incase you ever upgrade
    • Agree Agree x 1
  10. fzxj520

    fzxj520 Active Member

    Joined:
    May 14, 2015
    Messages:
    176
    Location:
    SimTools is a generic Motion Simulator
    Balance:
    1,341Coins
    Ratings:
    +90 / 1 / -0
    My Motion Simulator:
    2DOF
    @steveh2112, thank you very much!
    Ok!
    Replace the Hall potentiometer, can not reverse the positive and negative polarity potentiometer.
  11. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,146Coins
    Ratings:
    +22 / 1 / -0
    My Motion Simulator:
    2DOF
    why not reverse the motor polarity?
  12. fzxj520

    fzxj520 Active Member

    Joined:
    May 14, 2015
    Messages:
    176
    Location:
    SimTools is a generic Motion Simulator
    Balance:
    1,341Coins
    Ratings:
    +90 / 1 / -0
    My Motion Simulator:
    2DOF
    Tried, but the rocker arm will go to the other side
  13. bruce stephen

    bruce stephen Hammer doesnt fix it, must be electrical

    Joined:
    Jun 7, 2015
    Messages:
    1,286
    Occupation:
    general contractor
    Location:
    michigan
    Balance:
    9,112Coins
    Ratings:
    +1,238 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform, 6DOF
    @fzxj520 swap positive and negative at the motor. This will reverse motor direction for your hall sensor. I am guessing it is running from target (blue line), not chasing it? If you need to reverse the direction for an effect this can be done in simtools. You don't need to alter the code to fix this.
    • Agree Agree x 1
    • Informative Informative x 1
  14. fzxj520

    fzxj520 Active Member

    Joined:
    May 14, 2015
    Messages:
    176
    Location:
    SimTools is a generic Motion Simulator
    Balance:
    1,341Coins
    Ratings:
    +90 / 1 / -0
    My Motion Simulator:
    2DOF
    Reverse through simtools can be completed. But I prefer the motor to reverse. I tried to reverse motor positive and negative, but not what I wanted.
    ‘REVERSE_MOTOR1 in the arduino .ino’is what I need! Great!
    • Like Like x 1
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    Swapping the two wires to the motor does the same thing and is better because you don't have to remember to change the software if there is an update.
    • Agree Agree x 1
    • Informative Informative x 1
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    @moaale, try setting Ks=3 and increase Kd and test. Also reduce PWMmax to somewhere around 220.
  17. bruce stephen

    bruce stephen Hammer doesnt fix it, must be electrical

    Joined:
    Jun 7, 2015
    Messages:
    1,286
    Occupation:
    general contractor
    Location:
    michigan
    Balance:
    9,112Coins
    Ratings:
    +1,238 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform, 6DOF
    Ok try updating to smc3 Arduino version 0.70 ( you are running 0.67) also try using smc3 Windows version 1.0.0.( you are running 1.0.1). I've had crash issues with1.0.1. Version 1.0.0 runs like a dream, it just has a terminal window open;)
  18. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    @moaale, there is too much noise on the feedback signal for some reason...

    The main causes are usually, electrical noise, or mechanical vibration, or incorrect wiring.

    1. Try disconnecting the wires to the motor and look at what the green line looks like in SMC3Utils, it should be smooth, no jumping around. Turn the motor or POT by hand and make sure it is still smooth. If this is not smooth maybe your POT is faulty or the POT wiring is incorrect.

    2. Connect Power back to the motors, disconnect the motor arms to seat, and remove the POTs from the motor shaft. Run SMC3Utils and turn the POTs by hand. The motors will just turn continuously. Again the green line should be smooth. If it isn't then you are most likely getting motor noise back in through the feedback somewhere. maybe try putting some capacitors from the POT feedback to GND.

    3. If the above two are OK it is most likely mechanical vibration or slop in the mechanical system somewhere causing the system to constantly hunt for the correct location.

    (Other members - if anyone can provide a better translation than google that would be helpful.)
    • Informative Informative x 2
  19. bruce stephen

    bruce stephen Hammer doesnt fix it, must be electrical

    Joined:
    Jun 7, 2015
    Messages:
    1,286
    Occupation:
    general contractor
    Location:
    michigan
    Balance:
    9,112Coins
    Ratings:
    +1,238 / 9 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform, 6DOF
    • Agree Agree x 1
  20. RV10

    RV10 New Member

    Joined:
    Nov 8, 2016
    Messages:
    9
    Location:
    GERMANY
    Balance:
    168Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hy guys, one of my Motors moves in spite of setting PWMmax to "zero" (SMC3utility) (Pots are not mounted to the motor and rotated manually)... Additionally the Motor stops when green line is moved to or above the target line. As long as im under the target line the motor turns - but always with the same speed, no matter how far or close i'm away from the target line. Wiring is like shown in post 1. Using one MM per Motor and 1 Arduino uno...

    I have no idea where to start to find out whats wrong :(