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

    Silyn New Member

    Joined:
    Sep 14, 2023
    Messages:
    20
    Balance:
    - 36Coins
    Ratings:
    +14 / 0 / -0
    My Motion Simulator:
    3DOF
    I'm using a string potentiometer, but the output is pretty fuzzy, any ideas how to clean it up? upload_2024-4-4_15-58-18.png
  2. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    108
    Location:
    Catalunya
    Balance:
    492Coins
    Ratings:
    +31 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform

    Hey, Did you solve your problem?

    I'm building a 3DOF rig too (paused now due the work) and I also have that noisy problem but with all three motors. I tried everything, connecting ferrite cores, using shielded cables, connecting a capacitor between the two motor cables as close to the motor as possible (in fact I opened a motor and installed it inside), connecting two more capacitors between each cable and the motor chasis, connecting a electrolytic capacitor across the hall sensor supply, I tuned all the parameters in SMC to see if the problem gone....it never being solved, the noise is always there and the motors run with a lot of jitter, it is totally unplayable.

    I think the problem are the sensors. The arduino (and also the Sabertooth) amplify the noisy sensors coz I noticed that the yellow line reacts to the little green (feedback) pulses/movements/noise.

    Now I'm waiting for others hall effect sensors apparently better (at least bigge, with cable incorporated and twice the price) than the "cheap" ones I'm using now (around 30€ green sensors).

    We will see, If it does not work probably I'll abandon the project and I'll sell all the components separately.
  3. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF

    I can't say that I 'Solved' the problem, but it's not a problem anymore.
    For me it was that with the same PID settings each motor would act different if they were attached to channel 3 than if they were attached to channels 1 or 2. The 'noise' I was seeing on the was really it just doing the calculations different for the integral and derivative values.

    For position sensors, I'm just using some cheap AS5600 based magnetic encoder boards from Amazon (5 for $17) with a 3d printed housing. All I'm using to hook them up is some cheap three conductor RC servo wiring I had laying around. I've looked at getting some shielded wire, but the feedback that the Arduino is reading has been very clean so far.

    Does your feedback from the sensors look as bad as the picture that Silyn posted before you?
  4. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    108
    Location:
    Catalunya
    Balance:
    492Coins
    Ratings:
    +31 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    No, my sensor's feedback aren't as bad as the Silyn sensors but I still think mi problem comes from the feedback. If I reduce the Kp value the noise effect reduces too and the yellow line is less noisy BUT some of little movements aren't noticeable coz the signal is not strong enough to move me upwards and that also makes the motors very hot (because the lack of movements while the motor is receiving energy, it acts as short). If I want plenty "fidelity" in the movements I need to increase the Kp but then the effect of noise is an horror. Aprox in one week I'll receive the new sensors and I'll see if there is an improvement. Other tests I want to do is try to configure Simtools/FlyPT to filter that noise and make the movements smother if it is possible.
  5. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    My system is in no way tuned out (I'm still building and adjusting the mechanical parts) but all I have is a Kp value. I set Ki and Kd to zero for the moment because that makes all three channels behave the same.

    Have you tried with Ki and Kd set to zero?
    • Like Like x 1
  6. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    108
    Location:
    Catalunya
    Balance:
    492Coins
    Ratings:
    +31 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    I tried everything but Kd does not make any effect and Ki more than 1 makes the motor/controller run crazy so that values are set to zero.
  7. ashboss

    ashboss New Member

    Joined:
    Apr 18, 2024
    Messages:
    5
    Balance:
    15Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    i feel like a fool i got the wrong board got the leo and it looks like there is no work around :(:(
  8. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    You can rewrite the code to work on the Leonardo boards. I ported it to an Adafruit ATMega32U4 breakout board (same processor as the Leonardo) just to see how it preformed. It ran about the same, but all three timers are 16 bit instead of one of them being 8bit like on the Uno R3. It does seem that the speed varies more, probably because of the overhead of servicing the USB.

    But if you're looking for something already released for the Leo, then I don't know where you'd find that.
    Also, if you go out to get an Uno, make sure it's the R3 since the R4 uses a different and more capable chip but is not compatible with this SMC3 code.
  9. ashboss

    ashboss New Member

    Joined:
    Apr 18, 2024
    Messages:
    5
    Balance:
    15Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    it R3 btw not sure what to change
  10. ashboss

    ashboss New Member

    Joined:
    Apr 18, 2024
    Messages:
    5
    Balance:
    15Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    hey got it to work but motor 1 not changing directions motor two works fine any idea why
  11. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    I can take a look at your code if you want. I am no expert, but maybe I can spot something.
    • Friendly Friendly x 1
  12. Attyla.pl

    Attyla.pl Member

    Joined:
    Oct 1, 2023
    Messages:
    75
    Location:
    Polska
    Balance:
    330Coins
    Ratings:
    +20 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Ashboss
    write exactly what you mean, it's hard to guess what you are writing about so briefly, answer the questions to begin with:
    1. you have an Arduino UNO R3 board yes/no ?
    2. in SMC3Utils after selecting Out mode "Sine" the arm moves up and down yes/no ?
  13. Silyn

    Silyn New Member

    Joined:
    Sep 14, 2023
    Messages:
    20
    Balance:
    - 36Coins
    Ratings:
    +14 / 0 / -0
    My Motion Simulator:
    3DOF
    Does anyone have SMC3 code that works off A/B encoder data?
  14. ashboss

    ashboss New Member

    Joined:
    Apr 18, 2024
    Messages:
    5
    Balance:
    15Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    1 no i got a leo
    2 yes they finally do after some miner agistments
  15. Attyla.pl

    Attyla.pl Member

    Joined:
    Oct 1, 2023
    Messages:
    75
    Location:
    Polska
    Balance:
    330Coins
    Ratings:
    +20 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Ok, my advice buy a cheap arduino R3 clone and move on with your project, it's a waste of time figuring out the leo board whatever it is :)
  16. Denis Mowberry

    Denis Mowberry Member

    Joined:
    Jun 6, 2023
    Messages:
    91
    Occupation:
    Retired
    Location:
    New Zealand
    Balance:
    328Coins
    Ratings:
    +14 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform
    Amps X volts =watts. 4 amp X 24 volts=96 watts per motor. I run 2 x 250 watt 24 volt motors off 1 600 watt power supply with no problems.
  17. ashboss

    ashboss New Member

    Joined:
    Apr 18, 2024
    Messages:
    5
    Balance:
    15Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    i finally stated work on my 2 dof rig. look at my control box:thumbs

    Attached Files:

    • Like Like x 1
  18. Nick Clements

    Nick Clements Member

    Joined:
    Jan 7, 2019
    Messages:
    39
    Balance:
    74Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, SCN5, Arduino, Motion platform
    I have just added another motor (24v wheelchair motor) to my rig for traction loss . I have loaded up SMC and my front two motors work as they did no issues. However my rear motor only works one way .I can move the blue cursor up and the rig responds and moves to the side . If I move back down it does not follow but just sits there!!! I’m sure this is an obvious solution. I have even replaced the IBT2 for a new one in case it was the cause . Any help much appreciated, it must be something simple …..

    could this be the behaviour of having an electric brake function on the motor.?

    I will try and put 24v across the small black wires as others have on this forum.

    update::: No electric brake on motor. Next I measured with DMM on the motor out of the ibt2 , when I move rig to the right -24v is read on DMM. Now if I move the other way past centre I do not get +24v.??? Yet in SMC I have the green line following the rig perfectly ??

    can it really be another duff IBT2???
    Last edited: May 25, 2024
  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,666
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,864Coins
    Ratings:
    +10,804 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Some have reported quality related issues when trying to run ibt2s at 24v, apparently around 20v is more robust.

    That said, are you using 2 Arduino's and can you please post pictures of your settings?
  20. Nick Clements

    Nick Clements Member

    Joined:
    Jan 7, 2019
    Messages:
    39
    Balance:
    74Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, SCN5, Arduino, Motion platform
    I will post pictures of settings , but would it be better to get another arduino uni ?