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

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hello, I have spent all afternoon finishing installing the potentiometers with the new printed supports, I have had a long fight with Arduino IDE, I had to delete an avr folder, uninstall, delete all traces and with a previous version, I finally won the fight to the ide...damn hehehe.
    I have loaded the smc.ino, edited it to mode 2, edited the port in smc.ini and run the smc.utils utility.

    If I move the potentiometers by hand, I see the wave in both motors. I set everything to 0 and clip input to 255 and then max limit to 255.
    I set kp at 400 and start raising pwmax and get up to 255 and there is no movement.
    I did not have the multimeter, so I have not been able to check if 24 was reaching the input of the ibt-2, the potentiometers are working well by hand if there is movement of the green line.
    Now reviewing the tutorial I see that apart from modifying the mode to mode 2, below you have to modify the part that indicates the wiring of the ibt-2 with the arduino
    Screenshot_20240102-221050_Chrome.jpg
    This also has to be edited, at least that's what I understand with Google translator.....
    If it's just that I stay calm, if not I will change all the cables between the Arduino Uno and the IBT-2. If that was my mistake, can someone tell me in which row the change begins for connections between the IBT and the Arduino in the code? .
    20240102_195627.jpg
    20240102_195613.jpg
    You can't see it there, but I raise pwmax to 255 on both engines. Is it just setting mode 2 or do I also have to modify the connections shown in the first photo?

    Thank you for your help and attention.
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Just to be clear, this is the wiring for the IBTs:
    MODE2:

    Edit the SMC3 code for Mode 2 like this.

    Arduino to H-Bridge (Chinese 43A)

    ENA ----> IN1/RPWM
    ENB --+-> EN1/R_EN
    +-> EN2/L_EN (ie connect ENB to both R_EN and L_EN)
    PWM ----> IN2/L_PWM
    n.c. ----> IS1/R_IS
    n.c. ----> IS2/L_IS
    +5V ----> VCC
    GND ----> GND

    The image below shows wiring for two motors... Thanks to @eaorobbie for getting me started with the image :thumbs
    [​IMG]
  3. Luis Pinho

    Luis Pinho Member

    Joined:
    Sep 11, 2015
    Messages:
    61
    Location:
    Portugal
    Balance:
    637Coins
    Ratings:
    +27 / 0 / -0
    Hi,
    The motor 1 and 2 are off, that means that before taking this screenshot, the movement (or the reading of the sensor) was higher than the upper limit or lower than the lower limit.

    If you press the OFF button of motor 1 or 2, does it stays on? If it does, can you retry the process of moving the potenciometer and check if the motor responds?
    Last edited: Jan 3, 2024
  4. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    ok, then you just have to edit mode 1 and put it in mode 2.
    Google translator is not perfect and at home I read everything again and the translation makes me understand that I had to modify the wiring part in the smc.ino.
    It is now clear to me that it is only an indication of how to connect it correctly.

    thanks noorbeast, I will check the wiring and check that there is 24v in the ibt-2
    • Like Like x 1
  5. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    If I press the motor button 1 or 2 it still says Off as in the screenshot, maybe I'm a little confused, but after 4 hours trying to modify the new supports for the DIY sensors, I'm fighting with the Arduino IDE..... When I started smc.utils my head was no longer working...haha, sometimes it's better to stop and continue at another time with a fresh head.
    I will do the process again moving the potentiometers out of the limits, I think I made that mistake, but I was no longer thinking clearly.

    Thanks again to both of you for responding, I will keep you informed.
  6. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Well, it turns out that I put the potentiometers outside the limits and yesterday my brain couldn't take it.

    This morning before going I was already imagining what that error was, since this sim already worked before and the adaptation of the potentiometers was fine, since the wave was moved manually hehehe, I was simply very confused.

    Today I centered the potentiometer waveform with the blue line and there is already movement. Only engine 1, 2 will be there at another time, they claim me at home.

    Sorry for the orientation of the video, when recording it vertically it only allows me to create a short and does not let me insert that type of video, so I have rotated it and uploaded it as a normal video, the next one will be taken into account when recording it horizontally

    • Like Like x 1
    Last edited: Jan 3, 2024
  7. evgenymcp

    evgenymcp New Member

    Joined:
    Nov 27, 2023
    Messages:
    12
    Balance:
    43Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    How many degrees does your engine turn? Is it about 90 degrees in the video? What shaft position sensor do you have? I am using an AS5600 magnetic encoder. 0-360 degrees which gives an output of 0-5V. After turning on, the motor moves to a position corresponding to 2.5V - 90 degrees and rotates within 1.25V - 3.75V from 0 to 180 degrees.
  8. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    I am using the SS495A1 and a neodymium magnet.
    For the moving parts an old potentiometer.
    I bought this coml 10 years ago......I don't remember the specifications, but I think they were in the range of 0 to 5v....my potentiometers are DIY, they can rotate 360° infinitely and will not break.
    Sorry for the delay in answering, bad dates with the holidays.
    Greetings, Petar2
  9. Thunder84661

    Thunder84661 New Member

    Joined:
    Jan 6, 2024
    Messages:
    3
    Balance:
    28Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    Hello everyone,
    A few weeks ago I worked on a 2 dof as described and got everything working, now I have a problem that keeps causing failures after an indefinite period of time. From the right electric motor, it fails completely after I reset the aduino and it works again for a while. Maybe someone has a tip.
    Best regards
    Manu
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    When you say it fails is it because of a USB disconnect, moving out of limits, or thermal shutdown?

    In what circumstances does it occur, such as an in game racing car crash, or something else?
  11. Thunder84661

    Thunder84661 New Member

    Joined:
    Jan 6, 2024
    Messages:
    3
    Balance:
    28Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    It doesn't matter when driving straight, in curves. Could it be that the shutdown comes from the motor driver H-bridge. At the beginning I had a thermal problem with the bridge and installed a fan.
  12. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Yes undue load could create a shutdown. That could be hardware related, design related, or a combination of both.

    It would help troubleshooting if you create your own thread and detail your rig, so the design and all hardware specs are known.
    • Like Like x 1
  13. Thunder84661

    Thunder84661 New Member

    Joined:
    Jan 6, 2024
    Messages:
    3
    Balance:
    28Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF

    I found the problem, I put thermal paste between the circuit board and the cooling fins of the H-bridge. Now it works without any problems
    • Like Like x 1
  14. tselehub

    tselehub New Member

    Joined:
    Dec 6, 2023
    Messages:
    24
    Balance:
    98Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    because i cant found U JOINT, if i add one more motor and make it 3dof, will be work with this code? need to modify?
  15. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Please see the very first SMC3 thread post: "The PID algorithm has been optimised for this application and achieves 4096 PID updates per second for all three motors giving smooth precise motor control with well tuned parameters." https://www.xsimulator.net/communit...3dof-motor-driver-and-windows-utilities.4957/
  16. tselehub

    tselehub New Member

    Joined:
    Dec 6, 2023
    Messages:
    24
    Balance:
    98Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    I can use as the 2dof or the 3rd need to be for traction? i dont want traction. just 3dof like 2dof.
  17. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    How an axis is consigned is done in SimTools, not SMC3.

    A 3DOF with heave requires the motors to be powerful enough to drive the rig.
    • Like Like x 1
  18. miaziol

    miaziol Member

    Joined:
    Dec 20, 2020
    Messages:
    33
    Location:
    Poland
    Balance:
    - 62Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hello
    I have a little problem, im use hall sensor potentiometer , it has 180 degree. in the middle I have 2,5V on one end 4,8 oon second 0 its normal voltage for the usb. Now my question. I must set my limits like this: Max limits on 255 and clip on 220. How to fix it? Make gearbox or so? Or it's not a problem? tempImageRucKmV.png
  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,736
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    152,189Coins
    Ratings:
    +11,064 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    The pot should be rotated to the center position on the graph and then connected to the motor where the lever is in its centered rest position.
  20. miaziol

    miaziol Member

    Joined:
    Dec 20, 2020
    Messages:
    33
    Location:
    Poland
    Balance:
    - 62Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    its not a problem with centering or so. My problem and question is not how to set the potentiometers and how to centre the feedback. My question is about a small range. It is not about the range in which the rig itself moves, it is about the limits in the smc. I now have to have the limits set to 250 Max and 220 Clip. The movement of the platform is large even very large, but the range of the potentiometers is no longer. I'm wondering if I need a gear for the potentiometers, and if so, I'll have to look for it somewhere.