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

SMC3 Arduino 3DOF Motor Driver version 2.10 with soft start/stop and support for DOFReality H6 and P

Discussion in 'SimTools compatible interfaces' started by Klaus Schmidinger, Jan 27, 2023.

  1. Klaus Schmidinger

    Klaus Schmidinger Member

    Joined:
    Oct 3, 2022
    Messages:
    40
    Balance:
    302Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    AC motor, Motion platform, 6DOF
    In https://www.xsimulator.net/communit...-3dof-motor-driver-and-windows-utilities.4957
    @RufusDufus published the SMC3.ino sketch for the Arduino Uno R3. The DOFReality P6 control boxes contain Arduino Uno R3 boards and my guess is that they derived their firmware from the original SMC3.ino.

    In order to have a controlled shutdown (see http://www.tvdr.de/flightsim/poweroff.htm) I wanted to replace the original firmware with an open source version. To do so I first took the original SMC3.ino and widely refurbished the code to make it more readable and easier to extend. Then I implemented the code necessary to make it compatible with the DOFReality Tool, so that I could always go back to the original firmware. Finally, I added the soft start/stop feature. I tested it on an actual P6 platform, using the SMC3Utils-v1.01.exe program, FlyPT Mover and Sim Racing Studio (SRS).

    Only tested MODE1. MODE2 compiles, but is yet untested.

    If compiled "as is", this version should behave much like the original SMC3.ino. Only if the DOFR_BOX macro is defined will it include special functionality for DOFReality hardware.

    If you have an existing system on which you want to try this version, you may want to save your setup parameters before loading the new version, because the layout of the EEPROM content has changed.

    I would appreciate if some of you could test this version and/or look through the source to see if I broke anything. If you want to see the intermediate steps I took while refurbishing the code, you can find them at http://git.tvdr.de/?p=smc3.git.

    The latest version of my modified SMC3.ino is available here.

    See also http://www.tvdr.de/flightsim/firmware.htm on how to use this program with a DOFReality platform.

    Attached Files:

  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,549
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,112Coins
    Ratings:
    +10,778 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    • Like Like x 1
  3. Kaje

    Kaje New Member

    Joined:
    Mar 17, 2023
    Messages:
    2
    Balance:
    - 78Coins
    Ratings:
    +1 / 0 / -0
    I have been playing around with this, as love the soft start/stop options. My rig is a 3DOF siting on 4 rotating motors.
    The current code, when it goes to idle is crashes down hard, it doesn't seem to move slow, like it does during the start, no matter what setting I change, it doesn't change the speed of the "crash"/return to idle. but I figured out something that does work for me. I have no idea what I am doing, so I will just list the items I changed. maybe if I ever figure out what I am doing I will release a version.
    Line 1047
    case ToIdle:
    return AdaptedTarget(m.feedback, m.idle);
    change to
    case ToIdle:
    return AdaptedTarget(NEUTRAL_POS, m.idle);

    Its a not buttery smooth as it lowers my chair down. but its not bad. I like an adaption time of 4000.

    the other problem I had was in idle position the motors worked hard to maintain idle. I think it might be some backlash between the motors and the POTS, and they couldn't return to where it thought it should.
    To get around this I disabled the motors when it was in idle state, then enable them when in any other state. I do need to make a better work around, because this would enable the motors if they ever moved too far past the clip point, and the system would fight itself, but thought I would share anyway.
    Line 1316
    if (State == Idle)
    {
    PowerScale = 9;
    DisableMotor(Motor1);
    DisableMotor(Motor2);
    DisableMotor(Motor3);
    }
    else
    {
    PowerScale = 7;
    Motor1.disabled = false;
    Motor2.disabled = false;
    Motor3.disabled = false;
    }

    now I just need to figure out how to not blow up driver boards and I will be doing great!
    • Informative Informative x 1