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. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    48
    Balance:
    313Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    3DOF
    SMC emulates limit switches with Max Limits. You would need to set max limits beyond the gravity state. You might want to use a mechanical bumper for when the rig settles at power off.

    Clip input will avoid commanding a position outside of your range.
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,878 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    By the sound of it your actuators can be back driven, that is they are are unable to support load when unpowered,

    If that is the case a software solution is not able to prevent exceeding set limits.

    If so a mechanic stop, at the limit of the bottom range, may be needed.
  3. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Will this parameter prevent abrupt reversals of the motors?

    I thought that the emulation of the limit switches were the Clip Inputs, which reversed the movement when the value was exceeded.
    The problem is that with the system off, the 4 linear actuators all go down due to the payload and then go to the 0mm position.
    In this case it is necessary for me that when switching on the system and starting Simtools, the motors do not get stuck due to the "Max Limits" which reads the 0mm position.
    Is there any way to trick the system or disable the "Max Limits" parameter?
    If I set the value of "Max limits" to 0 (zero) in SMC3utils, do I fix the problem?
    Or let's imagine for example the operation of the 10K potentiometer: 5 volts (1023) corresponds to the maximum excursion ie 100 mm, to 0 volts (0) corresponds the minimum excursion ie 0 mm. If I calibrate the potentiometers so that at the minimum excursion (0 mm) I don't have 0 Volts in VOUT (A0 of Arduino), but about 0.5 volts, I can fool the system by letting it read that the motors have not exceeded the "Max Limits "and therefore do not go to block?

    Exactly, the ball screws used are the 1605, so the screw pitch is 5mm.

    Is it not possible to disable the "Max Limits"?

    Unfortunately the engines are not equipped with an engine block or predisposition.
  4. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    48
    Balance:
    313Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    3DOF
    The SMC3 code will not drive the rig outside of the clip limits. If the rig is outside the clip limit the SMC3 code will drive the motor back to the center position. The motors are not disabled in this case. You can potentially set the max limit to 0 which would in theory never disable the motors.

    This effectively disables the max limit. This could lead to the motor being damaged in certain theoretical situations. You need to avoid the case where that drop position is between 2 and -2 (or 1022). In the case of crossing over the zero point it could driver the motor the wrong direction and damage it. So you may want to make the max limit 2 and the drop point 10 (for example) to avoid any possibility of going the wrong direction.

    Once you exceed the max limits you cannot move. You have to backdrive the motors back inside the limit and then reset the Arduino or Enable to motors from SMC3Utils.
  5. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    What is the technique for correctly setting the Clip Input values? I've read what the values are for, but I don't know how to set them up. Is it done in realtime with Simtools or with the game running? How do I configure the correct values?
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,878 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Do not run SMC3 and SimTools at the same time, it will create a port conflict.

    From a mechanical efficiency point of view around 38-40 degrees of lever movement up and down is about the limit of effective torque utilisation, over that puts unnecessary strain on the motors.
  7. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    48
    Balance:
    313Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    3DOF
    Those parameters are set from SMC3Utils one time. You can move the motor manually to a point you consider the limit of where you want it to go and set the clip limit there.

    You said you have a lead screw, to me that implies multiple revolutions on the pot. If that is the case then it’s not going to work without a software change.
  8. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi guys, thanks for the help.
    I tried again to change the parameters in SMC3utils but I don't know if I entered the correct values. That is, now I will better explain the steps I did in SMC3utils. Introduction, today I did the tests with my prototype with 12V micromotors and Arduino and BTS7960. I have selected the following parameters shown in the figure, obtaining the graph you see.
    So I maximized the Clip Input value, but the graph hasn't changed, so the rotational motion of the motor arm has the same angular rotation.

    The effects of the PID values are seen in real time instantly as the motor moves.
    Are the effects of changing Clip Input values also displayed in real time in SMC3utils?

    [​IMG]

    [​IMG]

    Attached Files:

    Last edited by a moderator: Jul 18, 2022
  9. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    I hope to receive an answer soon because my ideas are very confused and I don't know what steps to take

    :sos:(
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,878 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  11. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    48
    Balance:
    313Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    3DOF
    That's correct changing the clip values does not change the amplitude of the waveform sent by the test programs. There is no way to set the amplitude in SMC3Utils.

    Use manual mode to move all the way to the clip limits. So where you clicked on "Triangle Wave" to get this plot click on "Manual". Now the graphic to the left of the plot can be used to move the target position anywhere within the non-clipped area. Drag the dot with the mouse or click I don't remember which.

    Attached Files:

  12. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi guys and thanks for your help.
    Message to Joe: The PNG file is all black with a pixel in the center.

    So I took a step forward with SMC3utils, namely:

    on the left of the window I selected "Manual", I set the value of 255 in Clip Input, I moved the blue cursor manually within the range and the motor rotated perfectly until it reached a maximum angle of about 60 °. Then I exceeded the Clip limit and the engine did not rotate beyond the limit, I went back inside the limit and it started working again, perfect.
    Then I set the value of 200 in Clip, I moved the blue cursor manually within the range and the motor rotated until it reached a maximum angle of about 80 °. Then I exceeded the Clip limit and the motor did not rotate beyond the limit , I went back inside the limit and it started working again, perfect.

    So I guess I'll leave the value of 200 in Clip Input, this is already a big step for me, having set a value chosen wisely.

    I know that SMC3utils is absolutely necessary to set the values of PID, PWM and safety limits. Also I noticed that the value of 200 that I set in Clip Input is strictly related to the value of "Amount of Axis to Use" (Output Testing) of Simtools, that is, if I set a Clip Input value of 255, the angular rotation goes from 60 ° to -60 ° when I move the slider of "Amount of Axis to Use", if I set a Clip Input value of 200, the angular rotation goes from 80 ° to -80 ° when I move the slider of "Amount of Axis to Use ".

    But I have a question: suppose that due to a software configuration error or a hardware problem, the motor exceeds the range of the Max Limits set in SMC3utils and blocks for safety reasons. How do i unlock the engine? Do I have to act mechanically or simply as a computer?
  13. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    48
    Balance:
    313Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    3DOF
    First of all I didn’t post a PNG so far as I know.

    Yeah once you are outside the limit SMC3 software will not move the motor ever. So you either have to manually move it or move the pot. The logic in the Arduino is if target exceeds limit disable motor. That means drop the motor enable I/O bit.

    It is possible to write a different program for the Arduino that would move the motor. However, mechanically moving it is likely easier.
  14. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi Joe and thanks for the replies, I will run further tests and let you know.

    NOTE
    I have attached the screenshot of your attached file, I don't know how that is possible.

    Attached Files:

  15. Manes

    Manes Member Gold Contributor

    Joined:
    Jun 12, 2020
    Messages:
    106
    Balance:
    179Coins
    Ratings:
    +12 / 0 / -0
    Hello guys. I hace a problem with SCM3. I format my pc, and when reinstalate the SCm3, the PWMmax is always in 1. I put more power, he put 255 , and when I save and close, the motors dont have power. I open the SCM3 again, and the PWMmax is in 1. Anybody knows? thanks guys!
  16. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Make sure you have selected the correct COM.
    Go to "Device Manager" and look at which COM port your board is associated (for example Arduino) ...
    You have to open the "SMC3Utils" file and enter the same COM port
  17. Manes

    Manes Member Gold Contributor

    Joined:
    Jun 12, 2020
    Messages:
    106
    Balance:
    179Coins
    Ratings:
    +12 / 0 / -0
    Yes. The Scm3 and Arduino are conected. I select the com Port and Scm3 and Arduino works. The problem is pwmax is in 1, i Up to 255, save, close, open again, and pwmax is in 1. I try to delete and reinstalate but the problem is the same....
  18. Elvis A. Ramírez

    Elvis A. Ramírez Flight simulator

    Joined:
    Aug 1, 2022
    Messages:
    11
    Occupation:
    Engineer
    Location:
    Dominican Repúblic
    Balance:
    79Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform


    Hi guys! I want to know if MODE 1 works for L298n motor driver?
  19. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,878 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  20. DerKlausi

    DerKlausi New Member

    Joined:
    Aug 7, 2022
    Messages:
    22
    Balance:
    117Coins
    Ratings:
    +10 / 0 / -0
    Hi all,

    is there any way to read the raw data (=sensor output and other values) from SMC3-Utils instead of just watching the graph output? Or even better: where may I find the source code of the SMC3-Utils?


    Thanks,
    DK