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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

Building a new 6DIY

Discussion in 'DIY Motion Simulator Projects' started by Flymen, Aug 22, 2018.

  1. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF

    this video is : control with pot 20K ( +/- 10 volt 23ma out ) to direct + REF IN ( drive), the motor sound is good and with diferent speed ! but the power supply fan makes some noze :grin

    this video is: control by Arduino 5 volt to Input Level shifter (output +/- 10 volt ) to direct + REF IN ( drive) like this:
    [​IMG]But , the motor is very noisy !!!!!
    code :
    const int analogOutPin = 9; // Analog output pin
    int outputValue = 127; // value output to the PWM (analog out)
    int increment=1;
    void setup() {
    pinMode(analogOutPin, OUTPUT);
    Serial.begin(9600);
    }
    void loop() {


    // change the analog out value:
    analogWrite(analogOutPin, outputValue);
    // print speed
    Serial.print("Speed = ");
    Serial.println(outputValue-127);
    // wait 100 milliseconds
    delay(1); // Change value to make change in speed faster or slower
    // Change speed
    outputValue+=increment;
    if(outputValue==170 || outputValue==88) increment=-increment;

    }
    Arduino 0- 5 volt direct to + REF IN , does'nt work too !! lot of vibration but …
    when the Arduino and drive are still plug with level shifter ….and I bypass( level shifter) direct out put 9PMW to + Ref in drive … It working good like (40 ma) !!!:think.
    Last edited: Sep 29, 2018
  2. Thanos

    Thanos Active Member

    Joined:
    Jul 6, 2017
    Messages:
    255
    Location:
    United States
    Balance:
    1,641Coins
    Ratings:
    +278 / 4 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Joyrider, Motion platform, 6DOF
    Can I offer a clue? The arduino does not have analog output... but PWM... Get a oscilloscope...
    The motor is trying to follow the HIGH-LOW positions of the pulses...
    • Agree Agree x 1
  3. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    [​IMG]
    May be a solution ?:think
  4. Thanos

    Thanos Active Member

    Joined:
    Jul 6, 2017
    Messages:
    255
    Location:
    United States
    Balance:
    1,641Coins
    Ratings:
    +278 / 4 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Joyrider, Motion platform, 6DOF
    This is overkill, perhaps a simple RC filter would do same with R=10k and C=100uF
  5. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I will try this tomorow !!!

    plan.jpg
    Last edited: Sep 29, 2018
  6. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    ok …. ouff finaly the filter must be between the level shifter and the drive !! And the Command Sources drive must give
    + 10 and -10 volts perfect , for example,if one side is + 10v and the other -14 volts ... nothing work !!!
    This video show the speed of signal PWM with filter ( sorry I don't have oscilloscope) before level shifter 0- 5 volt and after filter with ampli (normaly: 0-20 volt ) .


    The right meter show : when it over 10 volt the actuator goes up and when it below 10 volt he goes down ! and the left one 0-5 volt PWM with this code :
    // wait 100 milliseconds
    delay(1); // Change value to make change in speed faster or slower
    // Change speed
    outputValue+=increment;
    if(outputValue==170 || outputValue==88) increment=-increment;
    Conclusion : I need amp to follow input 0-5volt like LM358 . 0Volt IN = -10Volt Out and 5 volt In = +10 volt Out or total= 20 volt
    Next step is this :
    http://henrysbench.capnfatz.com/hen...rduino-lm358-op-amp-pwm-to-voltage-converter/
    [​IMG]
    Last edited: Sep 29, 2018
  7. Thanos

    Thanos Active Member

    Joined:
    Jul 6, 2017
    Messages:
    255
    Location:
    United States
    Balance:
    1,641Coins
    Ratings:
    +278 / 4 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Joyrider, Motion platform, 6DOF
    Wow... please stay safe! Have a fire extinguisher next to you just in case.
  8. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    No problem ! I’m firefighter ‍!!
    Thanks for your help!!;) if everything burn , i will buy your
    AMC1280USB Motion Simulator Controller Deluxe Kit
    is sure!!!
    Last edited: Sep 30, 2018
  9. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Hello ,
    I try to learn C++ code but it not easy .
    I would like to do the same thing than above but with two output …. like one output goes up and others goes down !!!
    Arduino output 3 ( 0-127 )for up lineaire cyl + REF and output 5 ( 128 - 255 ) for down lineaire cylinder -REF
    Is it possible ?
    thanks
    Last edited: Oct 2, 2018
  10. Thanos

    Thanos Active Member

    Joined:
    Jul 6, 2017
    Messages:
    255
    Location:
    United States
    Balance:
    1,641Coins
    Ratings:
    +278 / 4 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Joyrider, Motion platform, 6DOF
    I have better ones than the AMC1280USB now, designed for specifically for servomotor actuators...
    • Like Like x 1
    Last edited: Oct 3, 2018
  11. pmvcda

    pmvcda Active Member

    Joined:
    Nov 3, 2010
    Messages:
    132
    Location:
    Portugal
    Balance:
    739Coins
    Ratings:
    +158 / 1 / -0
    My Motion Simulator:
    6DOF
    There's no logic in doing that.
    It's an advantage to use one pin for two directions
    How are you going to mix them?

    Either way, here's a code to make actuator move with two pins.
    The pin not in use outputs 127 witch is speed=0 rpm
    Code:
    const int pinUp = 3;
    const int pinDown = 5;
    const int speed= 127;    
    const int increment=1;
    
    void setup() 
    {
       pinMode(pinUp, OUTPUT);
       pinMode(pinDown, OUTPUT);
       Serial.begin(9600);
    }
    
    void loop() 
    {
     // Apply the speed
     if(speed<127)
    {
      analogWrite(pinUp, speed);
      analogWrite(pinDown, 127); // Make sure speed is zero in this pin
    }
    else
    {
      analogWrite(pinUp, 127); // Make sure speed is zero in this pin
      analogWrite(pinDown, speed); 
    }
    
     // print speed
     Serial.print("Speed1= ");
      Serial.print(speed);
    
     // wait 100 milliseconds
     delay(100); // Change value to make change in speed faster or slower
    
    // Change speed
    speed+=increment;
    if(speed==255 || speed==0) increment=-increment;
    }
    
  12. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Answer : I would like to do this :(one pin for two directions but , my last experience with the level shifter +/- 10 volt from Command Sources drive must give
    + 10 and -10 volts perfect , for example,if one side is + 10v and the other -14 volts ... nothing work !!! Each of my 6 drives gived+ 10 and -10 volts perfect and after the test with PWM and level shifter , one side have change to +10v for +14 volt ..May be a Bad luck Idon't know but if I repeat the experience I'm afraid to blow another drive ..( she work again but not for this way ) .
    Last edited: Oct 3, 2018
  13. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF

    Finaly I take another chance with one output :blush:popcorn
    with your first code is like this !!
    Yellow multi :0-5volt PWM
    Gray multi :after level shifter and filter +/- 10 volt ( over 0 volt goes up / below 0 volt goes down) actuator .
    Black multi : the one who must stay at 20 v and no more (Command Sources drive must give + 10 and -10 volts perfect) . You can see with the multi gray that he pass more time in negatif than positif time ! and slower than yellow one too!
    I try to put the code more faster but i'm not eable . I changed the delay for 1 ( this video) but it's still not enough short ! but working and stable with less noise .:thumbs

    this video is with delay: 100

    Last edited: Oct 3, 2018
  14. pmvcda

    pmvcda Active Member

    Joined:
    Nov 3, 2010
    Messages:
    132
    Location:
    Portugal
    Balance:
    739Coins
    Ratings:
    +158 / 1 / -0
    My Motion Simulator:
    6DOF
    OK, I took a better look at the controller.
    Maybe you could try this:

    bitmap.png
    With this code:

    Code:
    const int pinUp = 3;
    const int pinDown = 5;
    int speedx = 0;
    int directionx = 1;
    int increment=1; // Increase to make speed change faster
    
    void setup()
    {
       pinMode(pinUp, OUTPUT);
       pinMode(pinDown, OUTPUT);
       Serial.begin(9600);
    }
    
    void loop()
    {
      // Apply the speed
      if(directionx==1)
      {
        analogWrite(pinDown, 0);
        analogWrite(pinUp, speedx);
      }
      else
      {
        analogWrite(pinUp, 0);
        analogWrite(pinDown, speedx);
      }
     
      // print info
      Serial.print("Speed= ");
      Serial.print(speedx);
      Serial.print("    Direction= ");
      Serial.println(directionx);
     
     
      delay(20); // Change value to make change in speed and direction faster or slower
     
      // Change speed
      speedx+=increment;
      if(speedx>=255)
      {
        speedx=255;
        increment=-increment;
      }
      if (speedx <=0)
      {
        speedx=0;
        increment=-increment;
        directionx=-directionx; // Change direction when speed is zero
      }
    }
    
    Last edited: Oct 3, 2018
  15. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    code erreur ( speed variable) .JPG code erreur ( variable speed )
    Thanks a lot for your help and time , I really appreciate! hug:

    bitmap.png
    It will be like this ! more simply and it is not necessary to have -10 volts from driver to control input - REF IN
    Last edited: Oct 3, 2018
  16. pmvcda

    pmvcda Active Member

    Joined:
    Nov 3, 2010
    Messages:
    132
    Location:
    Portugal
    Balance:
    739Coins
    Ratings:
    +158 / 1 / -0
    My Motion Simulator:
    6DOF
    Sorry, copied the const int... it should be just int in the definition.
    Code corrected, copy again please.
    speed, increment and direction should not be constants.
  17. pmvcda

    pmvcda Active Member

    Joined:
    Nov 3, 2010
    Messages:
    132
    Location:
    Portugal
    Balance:
    739Coins
    Ratings:
    +158 / 1 / -0
    My Motion Simulator:
    6DOF
    :eek:

    OK, I tried to compile it and...
    speed and direction are keywords of the language, so I added an x on the variables names.
    Please copy all the code and try again. Really sorry.
  18. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    ok ,It's better but the delay as changed to 20 for 1 and is still too long for spacing travel that i Have ! :D
  19. pmvcda

    pmvcda Active Member

    Joined:
    Nov 3, 2010
    Messages:
    132
    Location:
    Portugal
    Balance:
    739Coins
    Ratings:
    +158 / 1 / -0
    My Motion Simulator:
    6DOF
    It works?
    You can adjust the delay for the size of your actuator, but without limits you risk to damage the actuator or burn the controller.
    You need to get some feedback for position and also the limits.
    • Like Like x 1
  20. Flymen

    Flymen Flymen Gold Contributor

    Joined:
    May 19, 2018
    Messages:
    62
    Location:
    Canada
    Balance:
    505Coins
    Ratings:
    +34 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Yes it work ! thanks
    but the delay haved change 20 to 1 and still too long !
    A chance that I have limit switch , the actuator goes every time there :grin and i'm still waiting of this product again ( the compagny are very slow ) !! https://lsicsi.com/#/products/Development-Kits/LS7366RSh , for feedback position and also limits !

    Send me your adress and I will ship this gift for your support ! IMG_0612.JPG
    It's clean and snap right there with space for some wire !!
    Last edited: Oct 3, 2018