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.

FlyPT 6DOF/Stewart/Hexapod Interface for linear and rotating actuators

Discussion in 'SimTools compatible interfaces' started by pmvcda, Jan 2, 2019.

  1. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    rect4489.png


    FlyPT Mover Interface
    or FlyPT Hexapod Interface v2.0 thread is open.
    Look here: https://www.xsimulator.net/community/threads/flypt-mover-interface.13464/


    Version 1.5 - Last update 09/01/2019 (download at bottom of this post, only linear actuators, mainly for FlyPT output mode)


    Version 1.9.0 - Last update 26/06/2019 (download at bottom of this post)
    About this build here.

    This interface is work in progress and was developed for a specific hexapod that can send back information about position.
    It was adapted to output serial commands. So it's somehow limited in it's possibilities when not using the FlyPT output mode.
    I didn't had the chance to test the serial output like I wished. So it might not work as pretended.
    Be careful while using it and have the emergency STOP at hand in case of any misbehaviour of the interface.
    Use at your own risk. I don't assume any responsibilities on any damage or injury caused by the use of this interface.
    Be careful!!!


    GUIDE NEEDS TO BE UPDATED!!!

    Latest video



    What does it make?

    This interface was made to convert pose into actuators positions.
    So given a determined sway, surge, heave, yaw, roll, pitch and rig dimensions, we get the actuators length/rotation to obtain that pose on the rig.

    Where can I use it?
    This is made for Stewart platforms with linear or rotating actuators.
    This interface outputs in serial (decimal and binary), just like Simtools, so she should be compatible with any hardware that receives the desired position of the actuator.
    She also outputs in the "FlyPT" mode, that was made specifically for my rig.
    My build thread: https://www.xsimulator.net/community/threads/flypt-6dof-brushless-diy-actuators.10799/

    Limitations:
    The interface is made for "symmetrical" hexapods.

    STEP 1 - Download
    Get the latest version in the attached file bellow.

    STEP 2 - Configure Simtools
    We need Simtools to send to the interface, the pretended pose.
    The information is sent with a memory mapped file that is read by the interface.
    To make it output in a recognisable format for the interface, you should install the FlyPT plugin:

    interface.jpg

    To install, just drop the plugin dll file in the download, over the plugins update.
    Go to the interfaces and select FlyPT.
    Don't forget to press Save, to be sure the interface is activated.

    Now we have to configure the axis.
    A standard axis assignment could be:

    1.jpg

    The interface uses Axis1a to Axis6a to receive the pretended 6 components of the pose.
    You can select two orders (check box over the sliders).

    FlyPT order with (unchecked):
    <Axis1a> = Sway
    <Axis2a> = Surge
    <Axis3a> = Heave
    <Axis4a> = Yaw
    <Axis5a> = Roll
    <Axis6a> = Pitch

    SimTools order (checked):
    <Axis1a> = Roll
    <Axis2a> = Pitch
    <Axis3a> = Heave
    <Axis4a> = Yaw
    <Axis5a> = Sway
    <Axis6a> =Surge

    Where each component follows this rule:

    6df-axes-of-motion-300dpi_10985020.jpg

    You can mix anything you want in each axis output or apply the Simtools filters.
    But Axis1a will always be looked by the interface as sway.
    In the example above, I'm using Extra1 instead of Yaw, because it's an assignment for a car sim that uses traction loss in Extra1.
    Traction loss is a rotation around a point, usually in front of the car. That's why I had Extra1 also on sway, so the rotation is made around a point in front.
    I'm also mixing a bit of Yaw, with washout:

    2.jpg

    In a car game, Yaw is world orientation and since I can't do 360º rotation on my rig, I make her go to zero slowly with washout, to have all the range available in the next turn.

    The important thing to retain is that those 6 axis output, are the pose components as described above.
    And in a flight sim, they can be different to a car sim.

    Continues in next post...

    Attached Files:

    • Winner Winner x 11
    • Like Like x 2
    Last edited: Jun 26, 2019
  2. Ads Master

    Ads Master

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

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    Now we can start the interface.

    We can start by testing the connection with Simtools.
    For that, turn on output testing in simtools and then go to the interface and press "Start" Simtools connection.
    You can now move the sliders in Simtools and they should be reflected in the interface.

    drawing.png

    STEP 3 - Define the dimensions
    If everything is OK, let's define our rig in the interface.
    Click in "Define Hexapod" and choose your type of actuators.

    The basic dimensions, can be given by radius and angles or distances.
    If you change in one mode, the others are calculated from what you introduced.
    If you are going to measure in the rig, it's easier specifying the dimensions (L1 to L4).
    Look at figures to guide you.
    Remember, those measures should be made between the center of rotation of the joints.

    Now, if you have a rig with linear actuators, you should specify the middle extension of the actuator and it's range.
    Again, look at the figures for guidance.
    Range should be given in such way, that limit switches are not activated when you request the actuator to go to the minimum or maximum position.
    Middle extension is going to define the default position of the rig and respective default height.
    Default height is the vertical distance from bottom joints center to top joints center.

    If you have rotating actuators, there's some more info to be introduced.
    Vertical angle, is the angle made by the rotation axis around the z axis (where they point).
    Swap direction is to say that the crank points to the opposite side.
    Middle angle is the position of the angle of the crank used as zero. This is relative to horizontal position.
    Range is the number of degrees we can rotate to each side.
    Rod and crank define the lengths of those arms (always joint to joint).
    Maximum error is a special parameter. We calculate the angle of rotation by "search", and specifying a low error, makes the program search for more time, for a more refined position. But that makes things slower.
    A big error is faster, but has less precision.

    We now have all dimensions defined.

    STEP 4 - Resolution
    This is specific for the FlyPT mode.
    In the FlyPT mode, the output is in steps, because we calculate everything on the interface. The conversion from mm to steps is made on the interface.

    mm per revolution is the distance travelled in one motor turn.
    This depends on the ball screw used. Most of the current builds use the SFU1605. This ball screw travels 5 mm per turn. So this is the value to put on that field.
    If you are using a different ball screw, check it's travel per turn.

    Steps per revolution:
    In my build, using the internal hall sensors of the brush less motors for positioning, I have 18 steps on each turn.
    Steps per revolution in this case are given by:
    Electrical_angle = Number_of_poles/2 * Mechanical_angle
    In a 6 pole motor we have 6/2*360º = 3*360º = 3 electrical angles per mechanical revolution
    Since we have 6 step in each electrical revolution, we have 3*6=18 steps in each electrical revolution
    Nanotec DB59 - 6 poles - 18 steps per revolution (the motor I use)
    ACT/Longs/Wantai 57BLF03 - 8 poles - 24 steps per revolution (alternative cheaper motor, more resolution, but slower)



    To continue in next post...
    • Like Like x 2
    Last edited: Feb 10, 2019
  4. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    STEP 5 - Connecting to the hardware
    The connection to the hardware tries to replicate what we have in Simtoools.
    First we have to define how many boards we use to control the actuators.
    This is like using multiple interfaces in Simtools.
    The options are:

    1 board to control the 6 actuators
    2 boards, each for 3 actuators where board 1 controls actuator 1 to 3 a and board 2 actuator 4 to 6.
    3 boards, each for 2 actuators, where board 1 controls actuator 1 and 2, board 2 actuator 3 and 4 and board 3 actuator 5 and 6.
    6 boards, one for each actuator

    We now choose the type of connection.
    The FlyPT type is the original and was made for a specific code on the boards (in my case ESP32 boards).
    As said before this mode besides sending the pretended step on the actuator, sends also the speed and receives the current position.
    There are no parameters for this connection, they are always the same.
    Only change allowed is the number of boards used.
    You should select the COM for each board. Be careful to not switch the order of boards/actuators (see above).
    If the port is not listed, press update COM.
    Any problem, click Open device to open the device manager and look for the current COM ports.

    The custom serial modes are similar to the ones used in Simtools.

    serial.jpg

    They can be decimal or binary. If you can use binary, it's the preferred format since it requires less bytes.
    In this modes you should specify the connection parameters.
    Use the values you used when controlling the actuators directly from Simtools (interval=output rate).
    Like in the FlyPT mode, please select the COM ports for each board, and pay attention to the order.
    You should also specify the output string, similar to the one used in Simtools.

    Press Start to connect to the hardware, but please keep your emergency Stop at hand in case of any problem!


    Out of limits
    When the calculated length of the actuators is out of range, a message is shown and the actuators are drawn in red on the 3D visualization if you allow the actuators that are in range to keep moving (top left check box):

    1.jpg

    In this case, the thin Gray lines represent the last possible pose you had.
    If you don't allow the actuators to move if the pretended pose is impossible then the Gray lines are the pose you are asking, but since it's impossible, the rig remains on the last possible one:

    2.jpg



    Filters
    It's possible to apply filters to the actuators and pose components.
    They are simple EMA filters.
    DEMA and TEMA are there because I have the code, but they are overkill, so if you want to apply filters, EMA should be enough.
    The filters can be:

    -Low pass to smooth the signal. Low frequencies pass and higher ones are filtered.
    -High pass filters frequencies cutting the low ones and keeping high frequencies.
    -Band pass keeps only frequencies between the range from low to high.
    -Band stop keeps only frequencies outside of the range from low to high.

    To set the frequencies, you specify the number of samples to take into account when applying the filter.
    Left value is for low value and right one for high value.


    Gain
    Use gain to amplify or reduce the effects of the pose components or actuators.


    Visualisation
    There's a basic rendering of the hexapod in the window.
    The position you see is the one before applying filters to the actuators.
    You can also see a graphical representation of the actuators positions:

    Graphic.jpg

    The top right check boxes represent each actuator.
    Blue line is the current position (only in FlyPT mode).
    Red line is the calculated speed taking in account the current position (only in FlyPT mode, in other modes it's calculated considering current position equals zero).
    Gray line is the requested position by Simtools or the sliders after applying the pose filters.
    Black line is the requested position after applying the actuators filters.
    The more info to show, slower and more CPU intensive!
    The application records positions, only when the graphic is visible. So if you hide the graphic and show again, he continues from the last save, loosing everything that happened between hiding and showing again.

    Mini mode
    To reduce the load on the CPU you can enable mini mode:

    Mini.jpg

    Lock in lowest position
    This moves the rig to the lowest position and ignores all input from Simtools or the sliders.
    Movement is made with a low pass filter so it's smooth and slow.
    It should move the actuators to the lowest position defined by the actuators range (not pose heave range).
    Objective is to make access to rig easier.


    I think it's all.
    Any question, please ask.
    Any problem, please report.
    • Winner Winner x 4
    • Like Like x 3
    Last edited: Feb 1, 2019
  5. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Hi , I'm just trying to test this but the "FlyPT Hexapod Interface.exe" doesn't launch I double click and it does nothing, on both my laptop and my main PC ?

    Strange ?

    edit: Ive tried as administrator and in compatability just in case and it just wont launch. The last Hexpod Interface still launches fine so there must be something wrong in the new one
    Last edited: Jan 3, 2019
  6. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    Really sorry,
    I'm taking a look. But I have no problems on my side , testing on 3 different PC's.
    Give me some time...
  7. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Can anyone please download and try to run it make sure its not at my end ? @noorbeast @yobuddy @BlazinH ? anyone ? you dont need to install anything just download and run the hexpod interface
    • Like Like x 1
  8. Zennix

    Zennix New Member Gold Contributor

    Joined:
    Mar 4, 2018
    Messages:
    12
    Location:
    Bayern
    Balance:
    81Coins
    Ratings:
    +28 / 0 / -0
    My Motion Simulator:
    2DOF
    Downloaded and started. Is working. May be there is a c++ runtime needed?
    @pmvcda
    great job, thank you.
    • Like Like x 2
  9. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    SilentChill found the problem;
    Not working with the file on the desktop.
    Should be inside folder.
    That's a bit strange, because it works for me, I will try to find the problem.
    But since the program saves the last config in a file, it's best to keep it inside a folder.
  10. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Sorry it was in the folder on the desktop, I just needed to delete the "lastConfig.FlyPT" file which was in there for it to launch.
  11. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Hi @pmvcda I have it setup and tried testing using Binary I looked at my settings didnt realise what it actually was until now and changed the bit range to 10 aswell

    Anyways it shoots the actuators off to the end emergency stop button and limit switches did their job :)

    upload_2019-1-3_19-31-16.png

    Think I have it setup right I dont know to be honest.
    Last edited: Jan 3, 2019
  12. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    What is the smallest and largest extension of your actuators?
    I'm a bit lost with your values, because the rig in default position is beyond the limits.
    I also think you should use 10 ms interval for the SMC3 but I'm not sure.
    It should be the same you where using in simtools

    EDIT: Saw this post from you: https://www.xsimulator.net/communit...r-driver-w-softstart.9277/page-19#post-169517

    If that works, it should be the same on the interface.
    Last edited: Jan 3, 2019
  13. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    Found a bug... :oops:
    If you change steps per revolution, there seems to be some bad positioning.

    Try to save the configuration.
    Close the interface.
    Now Open the interface again. It should load your last config.
    Enable the graphic for one actuator and see if it moves around the center line while changing the heave.
    Try to connect to the rig and test it.
    If the problem continues, it could be the byte order on the serial output (a doubt I had while making the software). That's an interface problem I have to correct.
    If that's the problem, that's only in binary mode, but that's the one you should use.
  14. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    What do you mean by smallest and largest extensions ? I have total range of 340mm but i cut that down to 300mm for testing ?

    If i use the graph everything seems fine its is looks like it is working correctly when I start it , the wave goes up and down around centre as it should with heave
  15. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    upload_2019-1-3_23-18-25.png

    This shows the graph looking good, when I power on now all actuators are travelling down to the lowest position until they hit the limit switches
  16. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I have changed some values and the rig still wants to go to the bottom limits on all actuators . Everything looks good on the graph but as soon as I turn the power on they slam to the ground



    upload_2019-1-3_23-42-21.png
  17. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    OK, well, not OK.
    let me take a better look.
    I have to make some tests, but I think I know how to solve it. Tomowrrow I will post a new version for testing. Sorry.
    • Friendly Friendly x 1
  18. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Also another quick question, the Middle Extension ? is that the distance from the bottom of the actuator U Joint to the top Rose joint/Platform Connector or is it the distance from the Bottom U Joint to in my case 150mm past the middle point ? if you know what I mean ?

    edit: Cool and thanks for trying to sort it :)
  19. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,514
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    19,058Coins
    Ratings:
    +3,232 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Also if you want me to get back to you quicker jump on discord https://discord.gg/tC5JFGP and I will be able to test faster if you need me to ;)
  20. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    New version 1.3

    Go to first post to download the latest version.

    Solved (I think...):
    -Corrected byte output. Was able to test up to 115200 baudrate (because of Bluetooth feedback from my boards).
    I'm not sure if the problems in the previous posts are related to speed also.
    Please test.

    -Corrected horizontal lines defining the range in the graphic.
    They had always the same constant value, even changing parameters.

    -Forced actuators dimensions update when changing actuators resolution. It was updating only after reopening the program.
    In doubt, restart program. It will open with the last config and updated values.

    Known problems:
    -Big resolutions or lower resolutions need different scaling for graphic.
    • Dislike Dislike x 1
    • Winner Winner x 1
  21. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    897
    Location:
    Portugal
    Balance:
    6,940Coins
    Ratings:
    +933 / 12 / -0
    My Motion Simulator:
    6DOF
    It's the distance between the center of the joints when the actuator is at your middle travel.
    What counts is the rotation point of the joints (universal or rose joint).
    First step in the interface is to calculate the distance between joints to achieve a determined pose.
    But the actuators have a physical minimum and maximum dimension that limits the possible poses, so we need those limits.
    Also we want it to work around the middle extension, giving us the best amplitude possible.
    You can cheat the interface and give a smaller middle extension with smaller range. This makes the rig work at a lower position.
    If you give a bigger middle extension, you have to give a smaller range also, but the rig will work higher.
    In both cases you lose amplitude.

    Hope I explained well.