1. You must be a registered member to be able to access this page and to download game plugins. Please register here. It´s for free.
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.
  5. All new posts and threads should be written in English. Please do not create dual posts in other languages. If you are not a master of the English language you can use an external service to create a translation of your words, for instance, Google translate or DeepL.
    Due to low activity, we've also closed the french section.
    Dismiss Notice

1DOF_nopots 1.0

1 DOF arduino code with no potentiometers needed

  1. pOmmi
    Hello everyone,

    Here is a 1 DOF arduino code that works without any potentiometers (for wipers motors).

    This code was developed in the following project : IKEA 1.5 DOF Ultra comfort

    The position is guessed/known by the code using internal increment time of the micropocessor of the arduino, mostly given by the baudrate (9600 in this example) and the complexity of the code.
    What I call "1 increment time" is the time that a void loop(){ ... } takes to execute in the arduino code.
    But you don't have to find it exactly. With one or two tests you can find a good value of the maximum range that fits with your system.
    In my case, what works with some few tests is 25000 increments time.
    So in the code : int incrMaxRange=25000; // max time increment range
    A litte schema below, for a better understanding :

    The main issue is the stress on the motors. If the engines have a big effort required during braking or acceleration, the target position of the motor won't be reached, and you will have a continuous gap.

    So in order to fix this issue, power of motors while braking is different from power of motors while you accelerate.
    Here are the two variables that you probably will have to change for your system :
    int PuissMotAccel=380; // motor pwm (power) from 0 to 1023 for accelerations / pulling back
    int PuissMotBreack=1023; // motor pwm (power) from 0 to 1023 for bracking / pushing

    SimTools Game Engine Interface Settings :

    PS1 : I'm not a progammer, and my code works but it should be horrible for a real progammer :) please forgive me ;)
    PS2 : Next step could be to build it as a 2 DOF...