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. Patrick Gottberg

    Patrick Gottberg New Member

    Joined:
    Dec 16, 2024
    Messages:
    1
    Balance:
    - 24Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Hello i also need help,
    i have HBS86H drivers with the folowing Control inputs:

    ENA-, ENA+, DIR-, DIR+, PUL-, PUL+

    But now i didn't now, how to connect to my
    Arduino mega.

    Thanks in advance!
  2. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF
    I have been trying to find the post about the 'Scaler' feature using one more potentiometer but have had no luck yet. Could anyone share the link, if any?

    I want to learn what it does, why we want it, and how to set it up (in the Arduino code). Appreciate it!
  3. Sebastian2

    Sebastian2 Member Gold Contributor

    Joined:
    Dec 17, 2023
    Messages:
    83
    Balance:
    302Coins
    Ratings:
    +52 / 1 / -0
    Pot scaling makes it possible to reduce the travel of your motors via direct physical user input (i.e. turning a knob or pushing a button).

    You could do all this via Simtools, but hardly while you are in game. Sometimes interacting with a potentiometer might be prefarable to interacting with menus.
    Some use it to vary the intensity without having to mess with profiles. I made a "Soft Off" emergency shut off switch that I hit when I see I'm about to crash (it centers the seat and makes it ignore the simtools commands)

    You can use a 10k ohm potentiometer (or 10k resistor + switch if you want to use "soft off"). Put it between Output Analg 5 of the Arduino and Ground.

    You will also have to make a change to the SMC3 code. Check the first few lines of the Arduino IDE. Uncomment #define ENABLE_POT_SCALING and upload the code to your arduino.
    • Like Like x 2
    • Winner Winner x 1
    • Informative Informative x 1
  4. JaniK

    JaniK New Member

    Joined:
    Jan 11, 2023
    Messages:
    11
    Location:
    Finland
    Balance:
    45Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    This is pretty nice feature, I am just redoing my wiring from the fast jumper cables /temp test (allmost 1year temporary :rolleyes:) to actual wiring harness now that I have finally added a traction loss system.

    I think I will add the pot or maybe a 2-position toggle switch with a smaller, like a 4,7k resistor to have reduced motion mode.
    • Like Like x 1
  5. Ronan Design

    Ronan Design Roman Design - Custom MSFS Scenery

    Joined:
    Jun 4, 2021
    Messages:
    252
    Occupation:
    Web Designer, MSFS Scenery Designer
    Location:
    Toronto, Canada
    Balance:
    1,621Coins
    Ratings:
    +121 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    My motors are overheating, and I can feel them "buzzing" constantly even when the rig is sitting idle. They are quiet though, but still "buzzing".
    Any advice on how to calm the motors down when they are sitting at the proper position? Is my Kp too large? Or should I lower the PWMmax? I'm trying to use all the power I can get from the motors. I could also increase the deadzone, but it's already at 3, so maybe that's not a good idea...
    All advice welcome!
    My settings are like this:
    upload_2025-1-28_0-10-51.png
    The motors are Yalu wheelchair motors 24V 250W 75RPM, 6 of them are running from 2 x 750W PSUs, 3 Arduinos, 6 x Cytron 13A DC Motor Drivers.
    Last edited: Jan 28, 2025
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,310
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    149,531Coins
    Ratings:
    +10,947 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    First, I would suggest design Vs physics as the initial area of review. So, reduce the CTC on levers and please report the outcome.

    Your posted SMC3 setting would be more informative running the Sine test, particularly loaded.
    • Like Like x 1
  7. Ronan Design

    Ronan Design Roman Design - Custom MSFS Scenery

    Joined:
    Jun 4, 2021
    Messages:
    252
    Occupation:
    Web Designer, MSFS Scenery Designer
    Location:
    Toronto, Canada
    Balance:
    1,621Coins
    Ratings:
    +121 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Reducing CTC will reduce the load on the motors, but the load is not a problem. The motors are heating up from the micro-"buzzing", even when the rig is empty and not moving. It's the constant tiny movements that are not even visible or audible that heat them up. Logically, when the motor should not be moving but just maintaining the position, a steady voltage should be applied (in the form of PWM obviously), instead of the constant micro-movements. So this is the source of the problem. Of course increasing the load exacerbates the problem and the motors heat up more, but if the "static" heat-up is reduced, the load won't be a problem. First thing I'm thinking of doing is reducing Fpwm from 25kHz to 20kHz, which is more common. I just say 25kHz on a similar rig, but most use 20, so maybe that would mean less pulses I guess (still more than enough for precision). Maybe that will help together with some other adjustments that I'm trying to figure out. There has to be a way - maybe reduce PWMmax and increase Kp instead, or something. I'm sure people did that already and know the relationship between the settings and the "buzzing". I wish I wouldn't have to guess.
    I should get the basic settings right, then if it's not enough, I could reduce the CTC distance too.
  8. Wagnard

    Wagnard Well-Known Member Gold Contributor

    Joined:
    Jan 30, 2017
    Messages:
    502
    Location:
    Canada, Quebec, Mirabel
    Balance:
    4,906Coins
    Ratings:
    +662 / 2 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    From what I read online about your Cytron 13A DC Motor Drivers, 20KHz is the max that you should use for the PWM frequency.
    • Like Like x 1
    Last edited: Jan 28, 2025
  9. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF
    Fellow builders... question how you get this 'chattering' gone or at least reduce as much. I assume this isn't good.
    The motion feels very solid already. It's just this chattering; I assume this is the positioning hunting.

    I am using this 100A High Power H-bridge dual channel DC Motor Drive.
    I am using this sensor AS5600 Magnetic Encoder 12bit for position feedback.

    Here is the video with sounds, hear the 'rrrr....rrrr....rrr...' and see the LED direction indicator keep jumping between Left and Right.
    https://www.youtube.com/shorts/WNmPN5LT3xU

    This is my SMC3Utils setting:
    [​IMG]
    [​IMG]
    Just FYI, I have 50% scaller (set the scale pot to 120'clk position) if you see the plot 'Target' line (green color).
  10. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,944
    Location:
    London
    Balance:
    11,892Coins
    Ratings:
    +476 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    Swap the encoder for a hall effect potentiometer, see if the problem improves
  11. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,944
    Location:
    London
    Balance:
    11,892Coins
    Ratings:
    +476 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    Reduce p and also see what happens
  12. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF
    I suppose you mean Kp? I tried reduce down to 400, start to see a slightly less responsive. But the chatter remain the same. The only setting value that really effect is a combination of Kp = 500 and Deadzone = 10.
    But I heard Deadzone more than 2 is bad, is this true?

    Btw, the AS5600 I use is a half effect.
  13. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,944
    Location:
    London
    Balance:
    11,892Coins
    Ratings:
    +476 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    I would set the deadzone to zero whilst you are trying to sort this

    the AS5600 may not have a clean outout
  14. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF

    I set the deadzone to 0 now, also tried using "Rotatable Hall Sensor, 0.088°0-360 Degrees Rotatable Hall Angle Sensor 0-5V Output Full Circle 12Bit DC 5V Supply Voltage DC 0-5V Output Voltage"
    https://amzn.to/4jGBeBY

    And giving me exactly the same 'rrr..r..r.....rr...' hunting issue. I wonder if this is caused by the Harmonic gear I am using, which does not have backlash or slack between the motor and the output shaft of the gear head where "potentiometer" attaches.

    What sensor are you using? and do you have no 'rrr.r..r..r...' issue?
  15. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,944
    Location:
    London
    Balance:
    11,892Coins
    Ratings:
    +476 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    is there movement at all when you hear the rrrr rrr rrrr
  16. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF
    I can definitely feel vibration on the motor rear-shaft. I assume the position feedback system is hunting, the PWM and direction is working on a very small angular distance.
  17. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,944
    Location:
    London
    Balance:
    11,892Coins
    Ratings:
    +476 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    can you attach the encoder to the motor shaft - not the output shaft
  18. prophet.id

    prophet.id Member Gold Contributor

    Joined:
    Mar 11, 2024
    Messages:
    30
    Balance:
    60Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF
    I can but it should not work as the motor moves too fast.
  19. Attyla.pl

    Attyla.pl Active Member

    Joined:
    Oct 1, 2023
    Messages:
    247
    Location:
    Polska
    Balance:
    1,112Coins
    Ratings:
    +70 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Me thinks you should start a thread in Q&A, and show specifically in pictures or drawings what you want to assemble, at the moment you are cluttering up the thread through which it is hard to dig anyway.
    To be clear with a typical arduino smc3 batch, such as is available on the forum you will not use a rotary potentiometer.
    Arduino only measures voltage in the range of 0-5V and that's it, there is nothing in the code to count RPM and you don't really need it with a Hall sensor it is super accurate.
    • Agree Agree x 1
    Last edited: Feb 6, 2025 at 22:43