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

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

Discussion in 'FlyPt Mover' started by pmvcda, Jan 2, 2019.

  1. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    Hmmm, maybe a bug in the code. I will take a look today
  2. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    @Thanos & @Gabor Pittner,
    I think I found the problem.

    When you put <0> or <255>, I convert this to a byte.
    Thanos board expects 16 bit (2 byte values) for the axis, so when the 7 and 8th axis are send, it receives only one byte for each axis on the last string I told you.
    So we are missing two bytes (the board expects 20).

    Try this:

    <255><255><Axis1a><Axis2a><Axis3a><Axis4a><Axis5a><Axis6a><0><0><0><0><10><13> <<<< Correct string but in wrong order, see first page of thread!

    It should now work.

    Sorry, because I didn't look as I should.
    For starting I didn't see Axis1b and Axis2b. I don't send those values right now, but I can start passing them directly from Simtools (maybe in next version).
    Then I forgot it has to be 16 bits values on the axis...
    • Like Like x 1
    Last edited: Feb 8, 2019
  3. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    943
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    7,683Coins
    Ratings:
    +884 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    "It works with Hexapod interface", you mean your rig moves when you are moving the force in the "pose" section of hexapod, right? I see that you have not activated the Simtool red button in the interface. Maybe you need to set it on just to activate the transfert. Just a wild guess.
  4. Thanos

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

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,700Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF

    Are you using AsciiCodes to transmit the byte codes? Here a piece of the code that I use on the latest AMC1280USB interface plugin:

    InterfaceOutput = CStr(AsciiCodes(255)) & CStr(AsciiCodes(255)) & "<" & MyForm._InterfaceSettings._Axis1 & "><" & MyForm._InterfaceSettings._Axis2 & "><" & MyForm._InterfaceSettings._Axis3 & "><" & MyForm._InterfaceSettings._Axis4 & "><" & MyForm._InterfaceSettings._Axis5 & "><" & MyForm._InterfaceSettings._Axis6 & "><" & MyForm._InterfaceSettings._Axis7 & "><" & MyForm._InterfaceSettings._Axis8 & ">" & CStr(AsciiCodes(10)) & CStr(AsciiCodes(13))


    Also make sure you this part of the code is like this. It prevents simtools sending 255 values on initialization of the interface.
    Code:
    Private Function GetOutPut(ByVal InputPercent As Double, ByVal BitsNeeded As String) As String
            Dim OutPut As Double = 0
            Dim FinalOutput As String = ""
    
            'Bits
            Select Case BitsNeeded
                Case "8"
                    'Positives are one higher - then we add the bottom amount
                    '128 + 127 = 255 8bit
                    If InputPercent > 0 Then
                        OutPut = (InputPercent * 127) + 127 '(used to be OutPut = (InputPercent * 128) + 127 , but we -1 for new AMC fix)
                    ElseIf InputPercent < 0 Then
                        OutPut = 127 - (InputPercent * -127)
                    Else
                        'middle
                        OutPut = 127
                    End If
                Case "16"
                    '65535
                    If InputPercent > 0 Then
                        OutPut = (InputPercent * 32767) + 32767 '(used to be OutPut = (InputPercent * 32768) + 32767 , but we -1 for new AMC fix)
                    ElseIf InputPercent < 0 Then
                        OutPut = 32767 - (InputPercent * -32767)
                    Else
                        OutPut = 32767
                    End If
            End Select
     'Convert to an integer
            OutPut = Math.Round(OutPut, 0)
    
            'get output as binary
            FinalOutput = GetChr(OutPut)
    
            'output same number of char's always
            If CInt(BitsNeeded) > 8 Then
                If FinalOutput.Length = 1 Then
                    FinalOutput = CStr(AsciiCodes(0)) & FinalOutput
                End If
            End If
            If CInt(BitsNeeded) > 16 Then
                If FinalOutput.Length = 2 Then
                    FinalOutput = CStr(AsciiCodes(0)) & FinalOutput
                End If
            End If
            If CInt(BitsNeeded) > 24 Then
                If FinalOutput.Length = 3 Then
                    FinalOutput = CStr(AsciiCodes(0)) & FinalOutput
                End If
            End If
    
            Return FinalOutput
        End Function
    
    


    Thanks
    Thanos
    Last edited: Feb 8, 2019
  5. Gabor Pittner

    Gabor Pittner Active Member

    Joined:
    Oct 25, 2018
    Messages:
    190
    Location:
    Szekesfehervar Hungary
    Balance:
    1,294Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    6DOF
    Yes it works now, but wrong motors order :) The first actuator on the AMC board is the front left and the second is the front right. But I can not find the correct order yet :)
    Anyway it works fine but all motion are mixed :)
    I tried this
    <255><255><Axis6a><Axis1a><Axis2a><Axis3a><Axis4a><Axis5a><0><0><0><0><10><13>
    its almost good :)
    Last edited: Feb 8, 2019
  6. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    I'm generating a byte array (in this case 20 bytes) and send it at once.
    I was sending this (look at debug textbox over 3d visualization):

    2.jpg

    But as you can see the zero in axis1b and axis2b are just one byte.
    So it was missing an extra byte for each I had only 18 bytes in that image. With the new string it sends the 20.
  7. Gabor Pittner

    Gabor Pittner Active Member

    Joined:
    Oct 25, 2018
    Messages:
    190
    Location:
    Szekesfehervar Hungary
    Balance:
    1,294Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    6DOF
    Firstly I want to move the rig with sliders of FlyPT, I talked about another interface made by @hexpod that works for me.
  8. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    Good!
    I think you can change the order of the axis.
    The AMC board uses the first axis as number one, second as number two and so on.
    Just put your correct order.
    But you should not repeat axis! And you are sending 8 axis!
    Use:
    <255><255><Axis1a><Axis2a><Axis3a><Axis4a><Axis5a><Axis6a><0><0><0><0><10><13> <<<< Correct string but in wrong order, see first page of thread!

    The 4 zeros at the end represent axis1b and axis2b. In this interface, I don't pass those axis and I think you don't need them for your rig.
    I don't know for what Thanos uses them. Maybe for vibration, that idea of mixing vibe and motion.
    Last edited: Feb 8, 2019
  9. Thanos

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

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,700Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF

    The order is wrong because of the numbering is not same... I used Ian's numbering on Hexpod plugin to have one common order for all software so users don't have to rewire their hardware for each software... Here is the standard order of the actuators:


    Actuators connection order for AMC 6DOF.jpg
    • Like Like x 1
  10. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    In this interface it's:
    Actuators connection order for AMC 6DOF.jpg
    So correct string should be:

    <255><255><Axis3a><Axis4a><Axis5a><Axis6a><Axis1a><Axis2a><0><0><0><0><10><13> <<<< CORRECT STRING!
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Feb 8, 2019
  11. Thanos

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

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,700Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF

    Thanks for the clarification. I could not find anywhere this assignment order...
  12. Gabor Pittner

    Gabor Pittner Active Member

    Joined:
    Oct 25, 2018
    Messages:
    190
    Location:
    Szekesfehervar Hungary
    Balance:
    1,294Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    6DOF
    Im getting confused with axis order...
  13. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    My error.
    When I made the rig, took a look at the forum and saw some rigs with that order, so decided to make everything based on that.
    It's not even described on the badly written manual on this thread.
    I will update the first posts with this info
    Try the last string I posted:
    <255><255><Axis3a><Axis4a><Axis5a><Axis6a><Axis1a><Axis2a><0><0><0><0><10><13>
    • Like Like x 1
  14. Thanos

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

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,700Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    • Like Like x 1
  15. Gabor Pittner

    Gabor Pittner Active Member

    Joined:
    Oct 25, 2018
    Messages:
    190
    Location:
    Szekesfehervar Hungary
    Balance:
    1,294Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    6DOF
    It works this way
    • Like Like x 1
  16. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    You still have the X and Y axis swapped.
    Sway is swapped with surge and roll with pitch.
    Witch one is your #1 actuator? The one connected to the AMC board?
    Should be like this (for your rig):
    20190106_174803 (1).jpg
    Last edited: Feb 8, 2019
  17. Thanos

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

    Joined:
    Jul 6, 2017
    Messages:
    1,347
    Occupation:
    Electronics Engineer
    Location:
    United States
    Balance:
    2,700Coins
    Ratings:
    +1,043 / 9 / -0
    My Motion Simulator:
    AC motor, Motion platform, 4DOF, 6DOF
    Ok, this could happen if he is counting the order of actuators counter-clockwise...

    In this case the motion cues are up side down inverted
  18. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    Yes, maybe the order the actuators/controllers are connected to the board.
    • Agree Agree x 1
  19. Gabor Pittner

    Gabor Pittner Active Member

    Joined:
    Oct 25, 2018
    Messages:
    190
    Location:
    Szekesfehervar Hungary
    Balance:
    1,294Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    6DOF
    My first actuator is front left and the second is front right. You marked them #4 #5
    And the others are clockwise. 3 4 and 5 6
    Should I rewire them on AMC board?
  20. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,869
    Location:
    Portugal
    Balance:
    14,210Coins
    Ratings:
    +2,186 / 16 / -0
    My Motion Simulator:
    6DOF
    Maybe to be less confusing and since you are using the AMC, use that order, the one I posted in the picture.
    If you use that order, just use the last string I gave you for connection.
    If you want to keep that connection, I can see take a look a make you the string. Give me a minute...