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

Pot signal becomes erratic when power is supplied to drivers

Discussion in 'DIY Motion Simulator Projects' started by Josh Latka, Jan 31, 2025.

  1. Josh Latka

    Josh Latka New Member

    Joined:
    Jan 31, 2025
    Messages:
    21
    Balance:
    112Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
    I’ve been working on my 2 dof rig and trying to test the motors and drivers
    I’m using 2 ibt2 with adruino uno r3 and 2 1500wat 24v psu
    When I start smc everything is as it should be. Pot signals are solid lines.
    When I supply power to the motors the pot signals become slightly noisy and do not produce a solid line when left in position.
    When changing the settings to test motor movement (motors move correctly) the erratic signal makes the motors oscillate back and forth with very small movements when the pot is recentered as they are moving to the unstable signal of the pot.
    When I turn the power off to the motors the pot signal becomes stable and solid.
    I’ve tried adjusting all the settings in smc to reduce this affect with limited success.
    I can reduce the noise to a point but it only effects the motor movement and doesn’t completely eliminate the noise and effect and the pot signal stays noisy constantly until the psu are powered off
  2. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    126
    Balance:
    765Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    3DOF
    Sounds like noise. Did the pots cost more than 25 cents? Are the wires to the pots anywhere near the motor wires? Are they routed near the motors?
  3. Josh Latka

    Josh Latka New Member

    Joined:
    Jan 31, 2025
    Messages:
    21
    Balance:
    112Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
    They are cheap basic pots, 10 for like $10
    I have solved the problem by adding a 10nF ceramic capacitor to the pots ground and wiper poles. This stopped the erratic motor motion but the signal was still slightly noisy from a lack of shielding
    I shielded the pot and bit of wires extending out of the casing with electrical tape and noise cleared up
    I also noticed the pots where picking up signals when being touched is what led me to try it and it fixed the issue
  4. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    126
    Balance:
    765Coins
    Ratings:
    +26 / 0 / -0
    My Motion Simulator:
    3DOF
    Great! I actually have a low pass filter on my inputs mostly because I use a Hall Effect transducer which outputs a PWM signal but also because it lets me be lazy about the wiring.

    A low pass filter also has a resister in addition to the cap. The values are hardly relevant since you only care about a very low frequency.
  5. Josh Latka

    Josh Latka New Member

    Joined:
    Jan 31, 2025
    Messages:
    21
    Balance:
    112Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
  6. LVMAX

    LVMAX New Member Gold Contributor

    Joined:
    Jan 3, 2024
    Messages:
    3
    Balance:
    - 62Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    As I'm not proficient with coding, I would very much like to see the changes you made to your smc.ino code.
  7. Josh Latka

    Josh Latka New Member

    Joined:
    Jan 31, 2025
    Messages:
    21
    Balance:
    112Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
    I don’t have access to the pc with the code file atm
    What I did was this
    Fine the lines in the code that read like this
    const int PotInputPin = A5; // User adjustable POT used to scale the motion (if enabled)

    int DeadZone1 = 0; // feedback deadzone

    click in the empty space be these two commands and hit enter
    Then paste this between


    int PotData = 0;

    int filteredValue = 0; // Initialize filtered value
    float alpha = 0.1; // Filter coefficient (0 < alpha < 1)

    I left a blank space above this code and below

    I don’t know if it’s the ideal place to place it and if there is a better/proper place for it but I haven’t experienced any issues and can confirm that it cleared up the last bit of signal fluctuations
    I am an amateur at code and can edit and make changes but I am by no means proficient at creating code.

    perhaps someone more experienced can help and determine the best way to implement this filter code into the file for others to benefit as it does clearly clear up the pot signal and eliminate small fluctuations that cause the motors to try and constantly adjust to the small fluctuations of the signal resulting in audible noise of the motor rapidly adjusting position in very small increments resulting in a crackling noise that kind of sounds like bacon frying. Visual inspection of the exposed end of the motor shaft show the shaft rapidly changing directions back and forth as a result of the signal fluctuations

    these codes can be found here
    https://www.electroniclinic.com/arduino-analog-signal-filter-analog-sensor-value-fluctuates-a-lot/
    It is the more simple of the 2 codes and gives the better filtering of the 2 as well
    • Useful Useful x 1
  8. LVMAX

    LVMAX New Member Gold Contributor

    Joined:
    Jan 3, 2024
    Messages:
    3
    Balance:
    - 62Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Thank you for your help. I'll give that a try.
  9. Josh Latka

    Josh Latka New Member

    Joined:
    Jan 31, 2025
    Messages:
    21
    Balance:
    112Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
    here is my smc file with the code installed.
    it is set to mode 2

    Attached Files:

    • Informative Informative x 1
  10. LVMAX

    LVMAX New Member Gold Contributor

    Joined:
    Jan 3, 2024
    Messages:
    3
    Balance:
    - 62Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Awesome! Thank you for that.