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. insanegr

    insanegr !N$@n€

    Joined:
    Jan 14, 2014
    Messages:
    504
    Location:
    Athens
    Balance:
    16,718Coins
    Ratings:
    +499 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    change UDP pass thru to monitor or something else and try again(out mode)
  2. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Thanks it better now:

    If I understand the whole thing right @ 83 I got the movement and afterward the amount was too much and it clipped it and went to offline?!
    Also motor 2 does not move at all.
    Might my pot/arm position be wrong?
    I have set the middle position of the pot to this arm position:
    IMAG0249.jpg
    Also if pot is not in the middle position there seems to be no power:
    pot at wrong place.jpg
  3. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    The post is VERY close to the middle position...BTW I do not understand how builder like you do not test all parts and components before putting together. The very first step should be: one motor, Ard, one driver, one pot, wiring and the PSU of course. Pot and motor are not connected to each other to avaoid any damage. I would go back first and foremost to understand all the steps to get the rig working. Regards, Pit
  4. cthiggin

    cthiggin Active Member

    Joined:
    Jul 1, 2012
    Messages:
    672
    Occupation:
    Self-Employed
    Location:
    Montgomery AL USA
    Balance:
    15,209Coins
    Ratings:
    +435 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    FWIW -Shouldn't the crank-arm be horizontal, and the pot itself being moved left/right to get get line in center????
    This is the way I've done mine and they work fine in reading...............in the picture, the crank-arm looks to be in almost full up position, but line in SMC3 Utility is almost centered.
  5. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,950Coins
    Ratings:
    +1,016 / 10 / -1
    This is correct. If the feedback position goes beyond the Max Limit setting (shown by he red line) the code shuts down the motor until reset or power cycle.

    In the video the feedback position (green line) is the same as the target position (blue line) therefore the motor is already in the correct position and doesn't need to move. Change the target position by moving it using the slider on the right while in manual mode, or select sine wave triangle for example for the target to continuously move and see if the motor tracks it.

    As above if the target and feedback lines are in the same position then the motor does not need to move so no power.

    In general the videos seem to suggest the system is working as expected... just needs tuning of the parameters.
    • Informative Informative x 1
  6. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Thank you guys (pit/cthiggin/RufusDufus), I will make adjustments and hopefully will be ahead with this :)
  7. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Gents,

    What do you think:



    To me it seems my PWM is not good enough, even though the motort both move at one stage!
    Any tips for me?

    Thanks in advance :)
  8. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    There must be something really wrong. If you raise the power, the potentiometer line (feedback) and motion line (target) should be the same.
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,950Coins
    Ratings:
    +1,016 / 10 / -1
    I would say PWMmax is way too low. I think I have it set about 200. The reason for recommending a low value when setting up is to minimise the risk of breaking anything.

    If your setup can handle it you can use a PWMmax of 255 (the max allowed) but most people find if you drive things this hard the H-Bridges overheat or the Power Supply switches off.

    The PWMmax sets the maximum duty cycle that the controller will drive power to the motors. This max duty cycle will be PWM max / 255 *100 % The actual duty cycle at any point in time will vary within this limit based on the other PID paarameters and target/feedback position.

    Once you have that changed the next most important value is the Kp value. Adjust the values in turn to see how they effect the response.
  10. Lighthill

    Lighthill New Member

    Joined:
    Aug 19, 2014
    Messages:
    4
    Balance:
    211Coins
    Ratings:
    +0 / 0 / -0
    Good morning everyone ...
    After hours of testing and trying. It was possible to drive in AC two rounds at Nordschleife and everything works perfect. It was the first time after 6 month of building and the Feeling was great :).
    Today i started everything like the day before and after seconds or minutes the System crashes ...

    my System is >

    Arduino UNO
    the cheap h bridges 43 A > running in mode2 <

    i changed the time/date/Group in ENG US

    thank you for any ideas ...

    Lighthill
  11. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    @Lighthill far too little information! Which system is crashing, Ard, SimTools? Please post more details.
    PS: go back, check out every bridge separately , check the Ard by SMC3, check the drivers voltage output (5V, GND, pot signal etc.)

    If the drivers hang, check the PWMmax - eventually too high values.
    • Agree Agree x 1
  12. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Gents,

    Can the setting of two motors be so diffrent?

    To me motor 2 is working okay, it is following the line good and a 420kp result in great response I think.
    But motor 1... He is nuts............. o_O
    Even with a minimal PW it overshoots and goes to the max position when obviously it turns itself off.
    What can be causing this?
  13. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Motor 1 was already OFF... I do not understand. Motor 2 has some issues - the feedback line is not equal to the moving line.
  14. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Yes Motor 1 is off, for the test I had to move the arm back to the default position as you can see in the video if it gets a little power then it start going to its max position and the code turns the motor off.
    But why I don't get?!
    Regarding Motor 2 what direction do you propouse? Why can this be?
  15. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Motor 2: switch the polarity of the motor or (!) of the pot and test CAREFULLY.
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,950Coins
    Ratings:
    +1,016 / 10 / -1
    You have different motor settings for Motor 2. All motors must be setup. As discussed before PWMmax of 20 is wayyy to low. Use the same parameter values for both.

    Also with the H-Bridges you are using.. they very easily overheat and shutdown if loaded too much. If this happens too often it can damage them.

    You can get much better performance from them if you unscrew the heatsink and add some heatsink grease between the heatsink and pcb. Also make sure they are cooled well. It looks like you motor 1 is temporarily shutting down at points due to overheating/overcurrent.

    [EDIT...]
    Actually looking at the video again, I wonder if the POT is connected the wrong way. Try doing the test in manual mode and just move the target in one direction. If the green line moves in the opposite direction then I would say you need to reverse the +5V and GND wires to that POT.
    Last edited: Mar 23, 2015
  17. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    @Pit : thanks the polarity change sorted the feedback line moving in the other direction!
    @RufusDufus : I have tested, Motor one moves as you said it should, but motor 2 does not move at all...

    • Like Like x 1
  18. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,283Coins
    Ratings:
    +1,120 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    check power wires/solderings.
    • Agree Agree x 2
  19. Edson Lourenço Bezerra

    Edson Lourenço Bezerra Edson Bezerra - Desenvolvedor Open Source

    Joined:
    May 14, 2014
    Messages:
    67
    Occupation:
    Analista de Sistema
    Location:
    Jundiaí
    Balance:
    147Coins
    Ratings:
    +24 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform, 4DOF
    Really responsiveness of members is something great!

    Muito grato a todos...
  20. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    pot of motor 2 is out of order.
    • Like Like x 1
    • Useful Useful x 1