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

Question Convert 6dof Stewart platform to SimTools

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by Chris_Beeves, Sep 30, 2020.

  1. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Hi guys!

    I have gotten the opportunity to take over a 6dof motion platform that has been standing in a corner collecting dust for a few years now.

    IMG_4480.jpg

    Obviously I am very excited, but a bit worried that I have gotten in over my head.
    It has been working, but now there is noone with insight in the arduino code or Simulink model that comes with it.
    My idea is to convert it for using with SimTools instead.
    It has 6 SKF CAT33H linear actuators with encoders (incremental I assume) and one ESCON maxon motor controller per actuator. It has one Arduino Mega with an Ethernet shield and another plain Arduino Mega. The one with the ETH controls the motor controllers and communicates with the server and the other Arduino Mega handles all the encoders.

    I have been on here searching for similar solutions, but can't really find any. I can absolutely change the Megas to something faster or change other components if needed.

    SO, I'm reaching out to you experienced people;
    - Would you say its a possible project for a non-programmer enthusiast?
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    971
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    4,733Coins
    Ratings:
    +810 / 8 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    I assume these are brushless motors... perhaps you can use odrive...
  4. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I think the motor controllers will work fine. They are DC motors.

    The main issue is the Arduino code I guess.
  5. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    What motor drivers does it use ?
  6. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    35B6161C-214A-4562-880D-2FC02F4336D5.jpeg

    To my current knowledge, it just needs a PWM signal and direction from the Arduino.
  7. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    971
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    4,733Coins
    Ratings:
    +810 / 8 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    Its actually an ESC controller, for brushless motors or 4-quadrant PWM servo controller for permanent magnet-activated brushed DC motors, meaning these motors have four poles, not two poles that DC motors have.

    https://www.maxongroup.com/maxon/view/product/control/4-Q-Servokontroller/409510

    See some info on these four quadrant type servo motors:
    https://circuitglobe.com/four-quadrant-operation-of-dc-motor.html
  8. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF

    Use 3 arduinos and the smc3 program to control
  9. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    But these actuators use encoders, not pots. Do you know of any arduino sketch that has that?
  10. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I may have salvaged the old Arduino code that is in the megas right now. I'll look in there how they are controlled.

    I'll look this up though, thanks! A new concept for me. I will contact SKF (Ewellix nowadays) for some more info on these actuators.
    Last edited: Oct 1, 2020
  11. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I now have the code, and the actuators are just controlled with PWM, CW, CCW and ENABLE. It is not obvious to me how I would convert this to SMC3 type arduinos though..
  12. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    971
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    4,733Coins
    Ratings:
    +810 / 8 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    Yeah, all good, but you still need position feedback sensor for the smc3 control loop.
  13. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF

    here is an example of pid using an encoder



    sketch here -- https://github.com/XRobots/Actuator_Linear


    the guy in the video is awesome used to be a toy designer
    • Informative Informative x 1
  14. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    Last edited: Oct 2, 2020
  15. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    it my be possible to use your existing code to work with simtools

    explain how the current system works

    can we take a look at the code ?

    what make is the sim ? is there a story with it ?
  16. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Yeah, exactly. Replacing the pots in the smc3 with encoder values seems challenging.

    Maybe one could map the encoder position integer to just replace the pot value... Sounds like a dirty workaround though..

    I'll have to see if I can get some help with looking through the code for possible solutions.
    Last edited: Oct 2, 2020
  17. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    It was made at my univeristy as a Bachelors thesis about 6 or 7 years ago, and has been standing still since they finished.
    It has one Arduino Mega that communicates via ethernet with a server running SimuLink. I think the Simulink model got data from the simulator "Racer" (Now Crudens Panthera) and ran it through a vahicle model and then sent data back to the Arduino for controlling the actuators.
    Another Arduino Mega reads the encoders and sends the data through serial to the first Mega. That sketch is quite compact and uses the encoder.h library.
    The ethernet connected Mega's code looks more complex obviously.

    The sim is scratch built, without much documentation.
    During the process they had a lot of contact with Cruden and my university ended up buying a HexaTech motion rig from them. Needless to say, it outperformed this one. Thats why it ended up in a corner, but now I want to adopt it. <3

    I'm not really comfortable sharing the code, since it is not really mine and I don't know who to ask permission from.
    Maybe I could set up a Zoom or Teams meeting, and share screen so you could take a look at it?
    I know it's a lot to ask, and I will take no offense if that request is completely ignored :)
  18. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    what you have may already work with sim tools !

    can you find out the format of the data that is transmitted

    it may be like this

    [Axis1][Axis2][Axis3][Axis4][Axis5][Axis6]
  19. Chris_Beeves

    Chris_Beeves Member

    Joined:
    May 31, 2019
    Messages:
    73
    Balance:
    553Coins
    Ratings:
    +23 / 1 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    It contains a bunch of matrices. A few for the motor controls and some for sending encoder data over UDP.

    What looks like actuator position;
    Code:
        Serial2.readBytes(pos,encElements);
        Udp.beginPacket(remIP, remPort);
        for( int i = 0; i < encElements; i++){
          posOut = pos[i];
          Udp.write(posOut);
     
    And one "status" that seems to contain something important too;


    Code:
    if(Udp.parsePacket())
      {
        bitSet(Status,RecieveUDP);
        Udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
     
    The code does not seem to contain any PID regulation though. Would that be an issue?
  20. Gadget999

    Gadget999 Well-Known Member

    Joined:
    Dec 27, 2015
    Messages:
    1,062
    Location:
    London
    Balance:
    7,665Coins
    Ratings:
    +240 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, 6DOF
    pid may not be a problem

    the actuator may just drive to its new position as fast as possible
  21. Thanos

    Thanos Building the Future one AC Servo at a time... or 6

    Joined:
    Jul 6, 2017
    Messages:
    971
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    4,733Coins
    Ratings:
    +810 / 8 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF

    The PID position loop is calculated on another "software" on the PC, not in the microcontrollers, unless you have that software, then the microcontrollers are kind of handicapped.