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

F1 like 3DOF Simulator with heave

Discussion in 'DIY Motion Simulator Projects' started by _cOdaC_, Jun 25, 2024.

  1. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    103
    Balance:
    419Coins
    Ratings:
    +57 / 1 / -0
    Nice seeing you make progress.

    I think I might be able to help you with the settings in SMC3. You might have been victim of a case of AI hallucinations, where the AI talks very confidently about stuff it knows very little about.

    First off, if you don't have specific reasons for putting Limit and Clip to 255, I strongly suggest you lower these values by a lot (more on that below).

    From what I read in your post I am pretty sure that those are the reason why your motor lever only moves so little (you talked about 5...10% of the physically possible range). You blamed the 1:3 ratio between motor and pot shaft for that. Yes, a ratio of 1:1 will give you a wider range of motion , but you are applying a change in fine hardware to solve an issue caused by a simple mis-configuration in software. Also, by changing the ratio the way described above, you'll only get 3 times as much motion range, so still only 15...30% of what would be physically possible. It's like trying to make music feel louder by moving closer to the speaker. In most cases it makes more sense to just turn up the volume knob.

    Limit and Clip are intended to prevent your motors to move to a position you don't want them in. Usually this is used to prevent physical collisions between motor lever and frame of the rig. Clip makes the motor controller reject motor target positions that lie beyond the clip value. So if SimTools tells SMC3 to move the motor to position 95 (the range is 0...1023 with 512 being center) and clip is set to 120, SMC3 will move the motor to 120 and not further. In the diagram in SMC3utils, clip is shown as a orange horizontal line.
    Limit is like a second line of defense. Normally, the motor shouldn't move past the clip. If, for whatever reason, it does, limit comes into play. If the motor position moves past limit, SMC3 assumes a serious error and turns the motor off. This means it won't try to move the motor anymore. The motor can be reactivated by turning the Aduino off, moving the motor into a position within the limits and then turning Arduino on again.
    In the diagram in SMC3utils, limit is shown as a red horizontal line.

    So, how to set clip and limit? Here is my recommendation: Turn on your rig and SMC3utils. Switch to manual mode (radial buttons on the left) and move the slider in the right up and down. The motor that's selected in the top left corner should move up and down as you move the slider. The blue line (where the motor should be) and the green line (where the motor actually is) should be very close to or even on top of each other.
    Now decrease Limit and Clip to 0. Slowly (!!!) move the slider so that your motor approaches a the upper or lower physical limit of motion (whichever is closer to center position). Stop just before a collision happens. Look at the diagram in SMC3utils. Take a mental note of where your blue and green line currently are. This is the place where you want your limit line to be, because under no circumstances should the motor ever move past this point (to avoid a collision).
    Furthermore, I suggest setting clip at a value that's about 50 higher than limit. You can experiment with that value. If it's too high you waste range of motion, if it's too low you might find your motors run into limit and turn off when you do a crash in game.

    Why did you set PWMmax to 115? This reduces the maximum power that SMC3 can demand from your motors to 115/255=60% of their actual maximum power. Is this done deliberately, or is this a ChatGPT hallucination? 255 should be fine in most cases.

    Furthermore I recommend setting Ki and Kd to 0. As I have explained here,

    https://www.xsimulator.net/communit...d-windows-utilities.4957/page-133#post-255366

    the integrative and derivative part of the PID implementation in vanilla SMC3 is broken. Ki and Kd do stuff but it has little to do with what is expected from a PID controller. ChatGPT seems to have noticed that too, as it suggested very small values for those. With only Kp really functional, PID tuning comes down to "increase Kp until green line comes close to blue line while motion is selected on the left side. If the motion in game during a crash is so harsh that you get scared it might break something, decrease Kp"

    That shall be enough for now. Later I'll comment on the other things you wrote.
  2. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    103
    Balance:
    419Coins
    Ratings:
    +57 / 1 / -0
    Here we go again.

    It sounds strange to me that your two PSUs (1000W and 2000W, made by MeanWell, if I remember correctly?) tripped your main breaker. Yes, some surge in current when turning on is to be expected, but what you describe sounds way too much.

    How sure are you that the wiring you used to connect the two PSUs to one plug was not faulty? You could use a multimeter in "resistance measuring mode" to check the connections before plugging it into the wall.
    Both L terminals on the PSUs need to be connected to one pin on the plug. The other pin on the plug needs to be connected to both N terminals on the PSU. Also connect the grounding terminal on the PSUs to the appropiate part of the plug.

    After all, you are lucky to even have 2 wall sockets secured by different breakers in the same room. Running multiple 220V cables across your room sounds very unpreferrable. I've read a lot on this forum but never came across something like this.
  3. _cOdaC_

    _cOdaC_ Member

    Joined:
    Dec 20, 2023
    Messages:
    54
    Balance:
    291Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Oh I'm so glad to see that you are still with me @Sebastian2 , thought I lost you on my way to a proper running rig.

    So, ChatGPT might be smarter than expected. It suggested me to go down with Max Limits and Clip Input. The values I've posted are still for testing purposes (I'M going to add this info to my last post, I get that it might be confusing otherwise). I'm still playing around with the movement of the lever which is why I had temporarily set both to 255. I just wanted to make others reading my posts clear, that PWMMax not being 0 was the key to get SimTools running.
    Same thing for PWMmax which was set to low, just for first test purposes, so that the motor wont go crazy.

    Thank you for your explanation of Max Limits and Clip Input and how to find proper parameters.
    My levers can freely turn 360 degrees. So I set Max Limits and Clip Input to 0 and moved the lever to the maximum, bevore the POT would leave its range of 180 degrees. So, going up, means 45 degrees and fully vertical aligned, as well as 45 degrees down vertically aligned. That turned Max Limits to be 75 and Clip Input to 75 +50% = 113.
    Futhermore I now set PWMmax to 255 and Ki and Kd to 0.
    So now its happy testing.

    Regarding the current peaks: I've had a cable with L,N,Ground. One end connected to the connectors of the 1000W PSU, the other end connected to the connectors fo the 2000W PSU. I then chose the same connectors of the 2000W PSU to connect the power cable with its Pins to it and plug the cable into the power outlet.

    As far as I understood:
    High-power switching power supplies (like my models) have large input capacitors (e.g., 470µF @ 400V)
    These are discharged when switched on ⇒ act like a short circuit
    Inrush currents of 50–200A per power supply flow for a short time!

    I have futher measured the resistance.
    The 2000W has a constant 39 Ohm.
    The 1000W showed 2.1kOhm.

    I then recognized that there might be a shorty somewhere, as it seems that the Sabertooth and Arduino lose power every few seconds. I'll check that for the root cause.
  4. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    103
    Balance:
    419Coins
    Ratings:
    +57 / 1 / -0
    I don't plan on leaving this community :)

    Good to hear you know what Max Limit and Clip can be used for and how it works.
    But now I am confused what restricts the movement of your motor levers. You said you can currently only youse about 5...10% of the possible range, without explaining what stops you from using more. Does this range limit exisit within SMC3utils, SimTools or both? Does the usable range get bigger if Clip/Max Limit is reduced from 255 to 133/75?
  5. Attyla.pl

    Attyla.pl Active Member

    Joined:
    Oct 1, 2023
    Messages:
    302
    Location:
    Polska
    Balance:
    1,332Coins
    Ratings:
    +85 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I think publishing a video with the settings would explain a lot.
    • Agree Agree x 1
  6. _cOdaC_

    _cOdaC_ Member

    Joined:
    Dec 20, 2023
    Messages:
    54
    Balance:
    291Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    :cheers

    Sorry for the irritation.
    It is difficult for me to deduce the course of events so far, as I did a lot of testing and changes.
    I try it as good as possible.

    I started with the following settings:
    Fpwm: 25 kHz
    PWMmin 0
    PWMmax 140
    PWMrev 0
    Ks 6
    Deadzone 4
    Kp 230
    Ki 1
    Kd 7
    Max Limits 255
    Clip Input 255

    With those settings the motor lever moved 20 degrees down or up so 40 degrees in total (sorry it was not 5 or 10).
    I changed...
    PWMmax to 160
    Kp to 270
    PWMmin to 10

    It all didn't work out which is why I switched from 1:3 Ratio to 1:1 Ratio by changing the gear wheel on the POT to the same size as the one on the lever. Furthermore I used changed the following settings:
    Kp: 250
    PWMmin: 5
    Max Limits: 95
    Clip Input: 95

    This changed the movment of the lever to 135 degrees in total so 67/68 degrees up and 67/68 degrees down.

    The last change was then related to your comments on Clip and Max Limits, PWMmax, Ki and Kd.
    Had no time yet to test these settings. I hope I have time the coming weekend for further testing.
    I will @Attyla.pl comment into account and share screenshots and maybe a video.

    Let me test with the new changes and I will provide the results and see if the movement is still an issue.
    Last edited: Jul 16, 2025
  7. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    103
    Balance:
    419Coins
    Ratings:
    +57 / 1 / -0
    So with Max Limits = 255 and Clip Input = 255 you only get very restricted movement of +/-20 degrees. That makes sense.

    But why did you change the ratio between motor and pot from 1:3 to 1:1? You could have just lowered Max Limits and Clip input.
    The large ratio should increase sensor accuracy. Seems like you changed hardware to fix a software mis-configuration.

    You combined that change in hardware with reducing Max Limits and Clip input. With both actions combined, you got +/-67 degrees of movement, which should be enough.

    However you could achieve the same range of motion with the more accurate 1:3 ratio you had before. You would just need to lower the values for Max Limits and Clip Input more.
    No matter what ratio you have, you should be able find settings for SMC3utils that result in the same range of motion.

    That being said, a lot of people seem to have directly driven pots (so 1:1 ratio) and it seems to work fine for them. The increased accuracy of a ratio > 1 doesn't seem to me necessary. So, especially if your free time is heavily limited, i'd understand if you kept the 1:1 ratio.

    Just keep in mind that changing the ratio will not only require different values for Max Limits and Clip Input for the same range of motion, but also different values of Kp, Ki, Kd, Ks and Dead Zone to achieve the same control behavior.
    Thats because what you actually want to control is the angular position of the motor. But your Arduino doesn't know about that. It only knows about the signal coming from the pot. And each time you change the ratio, you change how the former affects the latter. So you might do yourself a favor if you don't change the ratio too often, as each time all the PID tuning in SMC3utils starts over again.
  8. _cOdaC_

    _cOdaC_ Member

    Joined:
    Dec 20, 2023
    Messages:
    54
    Balance:
    291Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    In that point of time, I didn't really get the idea behind Clip Input and Max Limits to be honest. It was just one thing that I read in the forum and most projects that I read of went for the 1:1 ratio.
    I'll keep the idea and work of tuning in mind if the current setup some how wont satisfy me.


    Ok, so tests went on last weekend and I was able to determine the device that causes problems ("shorty", data lagging, etc). The current settings I have seem to work pretty well regarding my tests and the graphs in SMC3Utils. The movement is good and seems to be somewhere between 40 and 45 degrees in each direction.

    I've recorded videos of SMC3Utils running and in parallel the movement of the levers. I need to cut it a bit, but will bring it online as soon as possible. You can see my current parameters there as well.

    I have to say, the rig stands in one room and my pc is in a reoom right next to it.
    I'm using a USB-Extension cable 5m with signal enhancer. As long as I attach each one of the Aruidno Unos direct to it, it all works fine. As soon as I put both Arduinos into a 6 port USB 3.0 Hub that is attached to the USB extension cable, the data transmission starts to do weird things.
    One is that the motors wont start at all, another is that the motor runs but gets stuck in between and keeps running a couple of seconds later (lokks like a lag of data).
    So the USB Hub makes problems, are there any known problems or things I need to look out for when I buy a USB hub?
  9. Attyla.pl

    Attyla.pl Active Member

    Joined:
    Oct 1, 2023
    Messages:
    302
    Location:
    Polska
    Balance:
    1,332Coins
    Ratings:
    +85 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Does the Usb HUB have power supply ?, give the specific name of the USB HUB.
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,634
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    151,461Coins
    Ratings:
    +11,038 / 56 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Hubs can sometimes create issues, but before diving into that it is useful to understand what SMC3 settings do: https://www.xsimulator.net/communit...driver-and-windows-utilities.4957/#post-48121

    For example Clip Input and Max Limits:

    Clip Input Used to create a band at either limit of the target range beyond which any values sent to the SMC3 are clipped. In addition to this clipping, if the motor feedback does move beyond this range (typically through inertia), the SMC3 will attempt to brake the motors hard by driving them in reverse until they are back out of this limit zone. The value can be anything from 0-255 (however can’t be less than the current limit setting). Reverse braking is applied in the band between the Clip Input and the Max Limit settings. Reverse braking can be disabled - refer to PWMrev.

    Max Limits Used to create a band at either limit of the feedback range beyond which if the motors move (typically through inertia) the SMC3 will automatically shutdown the drivers and keep them disabled until reset. This is essentially a safety mechanism if something goes wrong. The value can be between 0-255 (however can’t be greater than the current clip setting).

    [​IMG]
    Last edited: Jul 21, 2025 at 16:25
  11. _cOdaC_

    _cOdaC_ Member

    Joined:
    Dec 20, 2023
    Messages:
    54
    Balance:
    291Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Thank you for pointing that out. I think I understand how both values work now.
    I'm using this USB-Hub, Noname and no external power supply.
  12. Sebastian2

    Sebastian2 Active Member

    Joined:
    Dec 17, 2023
    Messages:
    103
    Balance:
    419Coins
    Ratings:
    +57 / 1 / -0
    I also use a active 5 m USB extension cable and a passive hub. Never had issues.

    I went with USB 3.0 capable tech throughout. The idea: if it dares to promise USB 3.0 speeds over that length, it should well be able to maintain data integrity at USB 2.0 speeds.

    Specifically, I use this cable:


    The forum doesn't seem to like my link. Try looking for "Monoprice 5-meter USB 3.0 A Male to A Female Active Extension Cable" on amazon.

    And this hub:
    https://www.amazon.de/gp/aw/d/B0BXX3J9NH

    Also, make sure to use a USB port directly on the mainboard of your PC. Don't connect via a port on the case, as the cable thats connecting that external port with your mainboard will likely not be as well shielded as the monoprice cable I linked above.
  13. _cOdaC_

    _cOdaC_ Member

    Joined:
    Dec 20, 2023
    Messages:
    54
    Balance:
    291Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Thank you guys, I will try the following:
    1. The printer<>USB cables are USB2.0, I'll change them to USB3.0 (https://amzn.eu/d/dEmQk8Q) UPDATE: Learning: USB3.0 printer cables won't fit into an Arduino Uno, hence I'll stay with the USB2.0 cables, but continue from there with a USB 3.0 Hub and an USB3.0 extension cable.
    2. I'll change the USB-Hub because maybe its defective (ordered the one of @Sebastian2 )
    3. I'll add ferrit cores to the cables (https://amzn.eu/d/85Zuebb)
    4. Put the two USB cables into another recess of the alu frame, as currently its put into one, together with power cables, hence there are probably interferences.

    This is the extension cable I'm using: https://amzn.eu/d/8nHAW7p
    All USB Cables that go to my PC are connected to the mainboard.
    Last edited: Jul 24, 2025 at 14:17