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

Question Sim tools network interface for SC-MBOX

Discussion in 'SimTools compatible interfaces' started by Blastertoad, Nov 21, 2023.

  1. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    There have been a few users ask about this controller / interface with minimal actionable info provided. I wanted to start a new post that I will update to provide setup info for this unit.

    Programming SC-MBOX
    Font keypad of device press "Mode" twice until in function mode ( Fn ### ) is displayed. Use ⇧ and ⇩ to set flashing digit. Quick press / tap "Set" to cycle though digits. When selected function ID is entered hold / long press "Set" to modify value. When desired value is input hold / long press "Set" to confirm change. Power cycle ( Turn of and on ) to apply changes.

    IP Addres: Device may not show in router / switch network map.
    Fn 020 = 192.168.15.201
    Fn 021 = 192.168.15.201
    Fn 022 = 192.168.15.201
    Fn 023 = 192.168.15.201

    Port:
    Fn 024 = 7408 ( SC-MBOX sending UDP port )
    Fn 025 = 7408 ( SC-MBOX Receiving UDP port )

    Handshake Password:
    Fn 008 = 3721 ( Credit @pmneo https://www.xsimulator.net/community/threads/how-to-interface-an-sc-mbox-v3.17113/#post-239226 )

    Number of servos:
    Fn 009 = range 1 - 4

    Baud rate:
    Fn 0FF= 10 in ms, Filtering Analogue
    Fn 100= 10 in ms, Sampling
    Fn OC2=10 in mm, Lead Screw Calc (how much the rod advances for a full motor rotation)

    Credit @pmneo for functions not listed in SC-MBOX manual https://www.xsimulator.net/community/threads/how-to-interface-an-sc-mbox-v3.17113/#post-239226

    UDP protocol:
    Spec
    upload_2023-11-21_9-52-34.png

    upload_2023-11-21_9-47-29.png

    3-axis relative time data
    upload_2023-11-21_9-50-46.png

    Attached are a machine translated copy of SC-MBOX manual, and an english manual for integrated MBOX product that uses same interface. Credit @velik0ff for integrated MDBOX manual https://www.xsimulator.net/community/threads/dc-mbox-v2-software.18058/#post-241207

    Sim Tools:
    From what I have gathered this should be a simple enough setup in sim tools via network interface
    @pmneo provided startup and shut down commands which trigger SC-MBOX servo stop functions.
    Fn 090 -1 S-on enable
    Fn 091 1 stop behavior
    https://www.xsimulator.net/community/threads/how-to-interface-an-sc-mbox-v3.17113/#post-239226

    What myself and other searching members are now missing is the output string that will format SimTools axis data to the above spec. Any help with constructing the interface - Output string would be much apreciated.

    upload_2023-11-21_10-6-50.png

    Attached Files:

    Last edited: Nov 21, 2023
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,565
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,208Coins
    Ratings:
    +10,781 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    @yobuddy can you possibly assist and advise on the interface settings.
  3. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    That is the part I need help with as well. Working on it though. Had a bit of a breakthrough using a packet sniffer and will be trying a hex to ascii converter to construct an interface sting later tonight.
  4. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    I think we just need to figure out what each part is.
    upload_2023-11-21_14-13-4.png

    Like is the confirm code always 55aa?
    Is pass code always 0000?
    Object counter is probably static at 0000 for 3 axis mode?
    Line looks like a packet counter?
    Once we identify all the pieces, I bet i could modify the network interface to do what we need to.
    • Like Like x 1
  5. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    All examples share same opening confirm code. Passcode is user set, default on hardware = 3721 ( listed as handshake pascode in initial post ). Function code is setting 3 axis. Object channel is for reading or writing memory Fx channel for functions / setting, Dx for diagnostic or feedback data. Since we are not changing memory this stays empty "00 00". Who entries "ff ff" seem to be if interface should listen and if it should reply back and for handling daisy chained interfaces to accomodate more axis. Note sure about line. It changes based on time mode function code but has no explination in docs. Abs time is time to reach target, since sim tool is constantly broadcasting this could probably be set to baud rate using relative mode and then do smoothing in simtool. The Dout and Dac fields are not explained in the manuals however the values stay the same in every example so should just be left as is. Dout has something to do with breaking resistance and surge protection.

    Info taken from pages 28 - 40 ( ethernet protocol section ) of MD-BOX document. Matches other manual however since MD_BOX doc is native english I trust it more than machine translated doc.
  6. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    Hit a brick wall. Was trying to make interface string with a hex to ascii converter so that the whole data line could be pre filled with just axis being variable. Not human readable but promising as packet sniffer showed it was sending parts of the converted data
    upload_2023-11-21_18-2-22.png
    The blocker to this potential solution is that the input field does not accept null characters ( hex 00 ), not even when manualy typed ( Alt+00 ). This lead to malformed data.
    upload_2023-11-21_18-6-3.png

    Null character persist when copied, this was confirmed by pasting converted string into Notepad++ that support null characters.

    @yobuddy If the network interface input fields could be modified to allow ascii null characters this could be a solution for supporting this interface.
  7. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    Possibly even better solution would be modified network plugin that would transmit raw hex as entered in fields instead of converting field to hex.
  8. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    Whatever you type on the line gets sent, only the stuff in the < > gets changed.
  9. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    What happens is you send this as a string?
    "55aa000013010000ffffffff000000010000283200002000000020000000200012345678abcd"

    If you put this as the interface output string in simtools it may do something.
    <85><170><0><0><19><1><0><0><255><255><255><255><0><0><0><1><0><0><40><50><0><0><32><0><0><0><32><0><0><0><32><0> <18><52><86><120><171><205>

    You wont be able to convert hex to ascii as a lot of asc chars are not printable to the screen.
    What the line above does, it tells simtools to look of the ascii chars for each integer between the < > and send that in place. notice 55 is <85> and aa is <170> and so on.
    Last edited: Nov 22, 2023
  10. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    Pasted as you sent upload_2023-11-21_19-1-40.png

    Wire shark shows data value of:
    55aa372120313420303120303020303020666620666620666620666620303020303020303020396620303020303020303020363420ce207f207f203132203334203536203738206162206364

    Wireshark udp hex packet:
    55 aa 37 21 20 31 34 20 30 31 20 30 30 20 30 30 20 66 66 20 66 66 20 66 66 20 66 66 20 30 30 20 30 30 20 30 30 20 39 66 20 30 30 20 30 30 20 30 30 20 36 34 20 ce
    20 7f 20 7f 20 31 32 20 33 34 20 35 36 20 37 38 20 61 62 20 63 64
    upload_2023-11-21_19-5-47.png

    No responce from interface, continues to sit with display reading "rEADY"
  11. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    I added on to the message above, probably also worth a try.
    So did anything happen? did a actuator move?
  12. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    Packet output
    55 aa 00 00 13 01 00 00 ff ff ff ff 00 00 00 01 00 00 28 32 00 00 20 00 00 00 20 00 00 00 20 00 20 12 34 56 78 ab cd

    That update is damn close. Has an aborant 20 though. No responce from interface. I have it sitting on my desk for testing, woudl take me just 10 min to throw it back in rig if we can get the sample output 1 to 1
  13. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    Ok there was a typo that you transposed. I converted the relative 3 axis input into hex as decimal char
    <85><170><0><0><20><1><0><0><255><255><255><255><0><0><0><159><0><0><0><100><0><0><96><0><0><0><96><0><0><0><96><0><18><52><86><120><171><205>

    which equals the sample
    55 aa 00 00 14 01 00 00 ff ff ff ff 00 00 00 9f 00 00 00 64 00 00 60 00 00 00 60 00 00 00 60 00 12 34 56 78 ab cd

    I reprogrammed my password to 00 00 ( FN 008 = 0000 )

    now I am getting a responce back from interface in wireshark.
    55 aa 00 00 00 00 00 00 00 00 00 00

    Going to look at doc to see what empty responce means. If it is not errored I will try replacing "<0><0><96><0>" with axis and see if formatting holds or I continue to get a responce.

    We are close, I can feel it in my sack!
  14. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    @yobuddy We got it, now just need to get axis values in range.

    So my feeling earlier was correct the relative time needs to match baud rate. I swaped 64 out for 10, set interface out to 10 and programmed baud rate to 10 and the platform moved. It was a very small movement but movement.

    I then replaced "00 00 60 00" with "00 00 Axis 00" and I could drive movement in hex and binary mode. Small movement though like 1" of my 7" travel slamming slider to max. The axis value varies between 1 and 2 pairs ( ff to ff ff ) puting axis line length out of spec so the axis output like "<0><0><Axis1a><0>" will not work. I then replaced all 3 axis lines with value args. Punched one piston to max and errored out controller.

    So now we just need to find a way to keep axis value to a 4 pair line.

    Code I used to launch a piston

    <85><170><0><0><20><1><0><0><255><255><255><255><0><0><0><159><0><0><0><16><0><0><Axis1a><0><0><0><Axis2a><0><0><0><Axis3a><0><18><52><86><120><171><205>
  15. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    I would think we would do this "00 00 60 00" with "00 00 Axis" and set the axis to 16bit. (always 2 chars) - or <0><0><Axis3a> if you will...
    Last edited: Nov 22, 2023
  16. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    18 bit does it. I need to be in the 2nd set and drive between 0 and 4 for my servos. 18 bit binary setup as <0><Axis> gives me output maxing at "00 03 ff ff". So I dont get my max travel but any other combination I try either way under or over drives the values.

    Current working setup:
    18bit binary

    Start Up: <85><170><0><0><20><1><0><0><255><255><255><255><0><0><0><159><0><0><10><0><0><1><255><255><0><1><255><255><0><1><255><255><18><52><86><120><171><205> 1800ms
    Slowly take platform to mid point.

    Interface: <85><170><0><0><20><1><0><0><255><255><255><255><0><0><0><159><0><0><0><10><0><Axis1a><0><Axis2a><0><Axis3a><18><52><86><120><171><205> 10ms
    Drive last 3 of 4 pairs for each servo.

    Shutdown: <85><170><0><0><20><1><0><0><255><255><255><255><0><0><0><159><0><0><10><0><0><0><5><0><0><0><5><0><0><0><5><0><18><52><86><120><171><205> 30ms
    Slowly lower platform to 0

    I will be trying to setup LFS profile now, then if all goes well be buying a sim tools subscription tomorrow night.

    @yobuddy Thanks for the help. As I tweak things I will post here and when I feel it is stable will update head for other users to get info from.
  17. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    @yobuddy Does each char have to be seperate? Or can they be grouped. Like "55 aa" being "<85 170>" vs "<85><170>"
  18. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,167
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,248Coins
    Ratings:
    +5,038 / 16 / -0
    Yes

    What about this <0><Axis><0> with the axis set to 16 bit?
    (18 seems really strange, I would think its 16 bit max, as that is the max for a lot of chips.)
  19. Blastertoad

    Blastertoad Member

    Joined:
    Nov 21, 2023
    Messages:
    59
    Balance:
    365Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor
    16 bit outputs 00 7f ff 00 and that overdrives my servos as they are at max extension around 00 04 00 00. These are industrial 220v AC linear motors I'm driving. At 18 bit I get 00 03 ff ff and it seems to be working. Scary as hell though and shake my whole damn house. Had to drop profile strength to 50% testing setup and I haven't even sat in it yet. 20231121_232759.jpg
  20. velik0ff

    velik0ff New Member

    Joined:
    Aug 26, 2023
    Messages:
    8
    Balance:
    51Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    3DOF
    As there are multiple questions on how I got my set-up working, again credit @pmneo for helping me configure the hardware, I will share the code with everyone in this community.

    What you simply need to do is convert a decimal number for each of the axises to a hexadecimal value with the significant bit to be in front.

    In the code I have listed all the constants and how they align to each other.

    The only differences in the constants is if you want a 6-axis you need to change the object_channel to 00 01 and if you want absolute playing time you need to change function code to 13 01.

    If you want to use this software as a bridge you have to send UDP data to port 7407 and then the bridge sends the converted data to port 7408 which is the MDBox controller.

    Attached Files:

    • Like Like x 1
    • Useful Useful x 1