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

Motors going back and forth really fast

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by Sam Neall, Aug 13, 2020.

  1. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I have been having no problems for months with the tuning settings I have been using. I recently had a USB hub blow out which messed up my arduino. When I replaced it and uploaded the SMC script, the motors acted normally until they got to the center point. When they reached center they started rumbling really bad. I’m pretty sure it’s the way I wired it because the tuning settings didn’t change. It is grounded via its DC barrel jack by the way. I was wondering if you guys could see any wiring flaws in my setup. I attached a video of the abnormal motor movement and showing the wiring. I have encountered this motor behavior many times when trying to troubleshoot this system in the first place. What ultimately ended up fixing it was trying a tuning profile from somebody else. I’m using the same tuning profile now and for some reason the problem is back.

  2. Ads Master

    Ads Master

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

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    15,575
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    114,159Coins
    Ratings:
    +9,137 / 46 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Can I just clarify, does everything work as expected in the SMC3 utility?

    If so then please post pictures of all of your SimTools settings.

    If not then please post pictures of your SMC3 settings.
  4. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    The yellow line in SMC3 follows the motor movements. Meaning, since the motor is going back forth really fast, the yellow line is too. When I put it in manual mode it positions like normal but still rumbles. Other than the motor twitching, everything seems to be working completely fine in SMC3. I haven’t tried using the simulator with SimTools yet because of this problem. As you have said before, I should get SMC3 working before using SimTools. Here are @SeatTime’s settings that I used. 3025985D-1AE9-468D-86AE-9B4C8F50A9A6.jpeg
  5. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,065
    Location:
    London
    Balance:
    7,684Coins
    Ratings:
    +241 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    set
    kp to 1
    ki to zero
    kd to zero

    put the sim into a sine wave

    slowly increase kp until the sim starts moving

    is it stable now ?
  6. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Yes, the motor that I put the sine wave on is completely stable. However if I don’t cut power to the other motor, it has the twitching problem while the motor being controlled by the sine wave works fine. What could be the issue here?
  7. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,065
    Location:
    London
    Balance:
    7,684Coins
    Ratings:
    +241 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    Do you have a clean signal for the potentiometer

    Are the wires shielded ?
  8. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    The potentiometer signal is clean but the wires aren’t shielded. I’ve been operating it with unshielded wires for a few months now. I can’t see how wiring could cause this problem, simply because I have tested each motor and they were both work like normal independently. Is there anything in the software or Arduino that would only let one motor go at a time? I am using the same 5V and ground for both potentiometers by the way.
  9. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    @noorbeast Any ideas why one motor is working and the other isn’t only when an automated wave is sent through it? Sorry I didn’t post this on my project page it’s just that it is very outdated and wouldn’t really help the situation.
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    15,575
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    114,159Coins
    Ratings:
    +9,137 / 46 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    My initial thought would be a grounding issue, if both work OK independently.
  11. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I just rewired both grounds and there is still an issue.
  12. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I am using an Elegoo clone arduino. Could this be causing issues? I know SMC3 outputs at 500000 baud and that people have said that clones can’t handle that. I had to use 115200 for SimTools with my last arduino but it worked fine with SMC3 as well when I uploaded the script with the 500000 baud. I’m not sure why it would work at 500000 with SMC3 and not SimTools. Should I just buy a name brand arduino? Also, my sabertooth driver maxes out at 115200 baud. If I have my Arduino set at 500000 to be compatible with SMC3, wouldn’t this cause a problem with my motor driver?
    Last edited: Aug 16, 2020
  13. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,065
    Location:
    London
    Balance:
    7,684Coins
    Ratings:
    +241 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    Edit the smc3 sketch so it uses a slower baud rate

    See what happens
  14. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    SMC3 utils does not work with anything other than 500000 baud. I have gone through a lot of troubleshooting steps regarding baud rate because it was causing one of my other problems so I have actually already tried editing SMC3 utils to work at 115200. If I set the sketch to 115200 and ground pin 8, SMC3 utils refuses to start.
    Last edited: Aug 17, 2020
  15. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    If I configure the settings on utils first then upload the 112500 sketch, the result is the same as the 500000 baud sketch.
  16. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,065
    Location:
    London
    Balance:
    7,684Coins
    Ratings:
    +241 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    reduce the pwm frequency till you can hear the motors

    set pwmmin to zero
    set pwmmax to 255
    set pwmrev to zero
  17. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    There is twitching no matter what PWM frequency I put the motors on. It just gets more intense as you increase PWM. The only time it stops twitching is when it is not at the target position. When the simulator starts up, the motors go very smoothly until it reaches the target then it starts twitching. The only reason the sine wave was working is because the motors were too slow to go exactly on target since I had a low PWM. Since they never got to the target position because of low power, there was no twitching. When I increase the PWM, the motors will hit the target a lot more often and twitch when they do. So, scratch everything I said about only one motor working at a time and only the sine wave working. This is simply a problem with the motors twitching when they reach the target position.
    Last edited: Aug 17, 2020
  18. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Also, here is a picture of the feedback being fine while the PWM is all over the place. A35496C6-944F-4337-8D0B-C172764B1313.jpeg
  19. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    @noorbeast do you have any thoughts regarding this new information? I feel like it would be the potentiometers, however as shown with the picture I posted, they look pretty clean. The only variation is likely because of the motor twitching because when I cut power to the motors, The Feedback line completely smooth.
  20. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,065
    Location:
    London
    Balance:
    7,684Coins
    Ratings:
    +241 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    try adjusting your deadzone
  21. Sam Neall

    Sam Neall Member

    Joined:
    May 14, 2019
    Messages:
    129
    Balance:
    230Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I have tried that already. It doesn’t seem to help at all. If anything it makes the movements more erratic. It just seems like the motors are reacting way too harshly to potentiometer signals.