1. 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!
  2. 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
  3. 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. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    OK thanks guys for your answers.
    As for the PID values, I have no problem, I have already set the following values (correct for the type of engine I use)
    P = 350
    I = 0
    D = 0

    PWMmin = 100
    PWMmax = 200

    I have correctly set the center of the potentiometers to 512, green line in the center of the visual spectrum, the motors move very well.
    My only doubt is this, I hope to explain myself well: let's suppose that in SMC3utils I set the limit CLIP = 100 and close SMC3utils. Then I open Simtools Game Engine, Axis assignments, Axis Limiting.
    The 100% value of Amount of Axis to Use will correspond to the range of values of the CLIP limit, therefore the motor arms will have a rotation range based on the parameter of SMC3utils and will not exceed the limit of
    CLIP100?
    Are the two parameters (CLIP of SMC3utils) and (Amount of Axis to Use of Simtools) independent or do they interact together?
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Think of the SMC3 settings as a hardware configuration/optimisation and safety limit, so if exceeded everything shuts down.

    In SimTools Axis Limiting is not really needed except as a cushion for some vulnerable hardware, such SCN actuators, which can be very fragile at their limits. For things like DC motors Axis Limiting is not needed.

    Axis Assignments, Tuning Center and Game Manager setting are all about how a possible range of motion (defined in SMC3) is allocate to various axis for a particular game (Axis Assignments), how those responds to game inputs (Tuning Center) and how a base motion profile can subsequently be tailored/varied to say dial in different types of cars for a particular track, or one type of car for different tracks (Game Manager profiles).

    What SimTools does is very different from SMC3, but each needs to be calibrated properly to do its independent but related job.
  3. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Thanks noorbeast, you are very kind and very thorough in your explanations.
    I ask you for information and a configuration advice: for the operation of the platform with gear motors (motor shafts in rotation), there are no problems if the mechanical handle exceeds 90 ° or -90 °.
    Instead, I have to configure my 4 linear actuators in the 4 corners (like the D-Box system) with a stroke of 100 mm and I have to be careful not to knock the mechanical parts in the maximum range (over 0 mm and over 100 mm).
    My actuators have no mechanical limit switches and no motor lock, so when the system is not powered the 4 actuators will go down due to the force of gravity. When I turn on Simtools the motors must not be blocked due to the "Max Limits" set in SMC3utils.
    I know that SMC3utils is able to emulate the limit switches through the values of "Clip Input"
    So I need to know what parameters I need to set to prevent the actuators from going beyond 0mm and 100mm and how I can prevent the motors from locking when the actuators are all down (no power due to gravity).

    If I have not been clear tell me that I will explain maybe with some drawings.
    Thank you
  4. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF
    All the parameters that you set in SMC3Utils are saved to EEPROM (permanent storage) on the Arduino. So those are used in SimTools. As far as SimTools is concerned the Arduino is a black box that you send positions to.

    You should try setting the “filter length” KS. This parameter smooths the acceleration and deceleration to minimize jerk. So if you are having a rough ride this could help. This will increase the following error but a value of 4 is 1ms. I doubt you could feel 10-20 ms of following error.
  5. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 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.
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -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.
  7. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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.
  8. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 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.
  9. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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?
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -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.
  11. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 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.
  12. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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
  13. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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:(
  14. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    18,427
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    131,886Coins
    Ratings:
    +10,200 / 48 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  15. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 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:

  16. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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?
  17. Joe Cortexian

    Joe Cortexian New Member

    Joined:
    Sep 8, 2021
    Messages:
    29
    Balance:
    232Coins
    Ratings:
    +5 / 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.
  18. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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:

  19. Manes

    Manes Member

    Joined:
    Jun 12, 2020
    Messages:
    105
    Balance:
    223Coins
    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!
  20. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    88
    Balance:
    552Coins
    Ratings:
    +3 / 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