Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Machinekit - Current Status of Machinetalk

25 vues

Publié le

Machinetalk is the middleware behind the Machinekit open source motion control software.

Compared to other middleware approaches, Machinetalk is based on de-facto standard technologies instead of custom solutions to common problems.

Machinetalk combines Protocol Buffers, ZeroMQ and DNS-SD over Multicast to one single bundle.

The talk can be viewed at https://www.youtube.com/watch?v=8qzKLiO2chU

For more information visit https://machinekoder.com/ and http://www.machinekit.io/.

Publié dans : Logiciels
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Machinekit - Current Status of Machinetalk

  1. 1. Machinekit CurrentStatusofMachinetalk Alexander Rössler
  2. 2. 2 Overview ● Machinetalk Quick Intro ● Use in Machinekit ● Machinetalk GSL ● Machinetalk Generic ● Pymachinetalk
  3. 3. 3 Whatis Machinetalk?
  4. 4. 4 Machinetalk ● Middleware ● Component Component↔ ● RT Userland↔ ● Local Remote↔ Application Application Middleware API Platform Technology API Communication Middleware API ... ...
  5. 5. 5 UseCase 1–Multi UI Single-Board Computer User Interface 1 User Interface 2 Machine Tool
  6. 6. 6 UseCase 2–MultiControl Single-Board Computer Machine Tool Workstation Single-board Computer Machine Tool
  7. 7. 7 UseCase 3–InternalandExternal Single-Board Computer Workstation Smart Device Remote Pendant GCode Interpreter Task Controller Motion Controller HAL Web UI Web Bridge Machine Tool
  8. 8. 8 Parts Machinetalk ZeroMQ Protobuf DNS-SDovermDNS OS, Platform Technology Protocol Components Transport / Messaging Serialization Service Discovery Services
  9. 9. 9 Howis Machinetalk used inmachinekit?
  10. 10. 10 Scope Remote UI API HALHaltalk Local UI API Motion Controller API Trajectory Planner Client 1 Real-Time Environment Real-Time Host 1 Task Executor GCode Interpreter Webtalk Bridge Client 2 MTMT MTMTMTMT ZeroMQ Protobuf Ring Buffers Real-Time Host 2 Real-Time Environment API HAL Userspace Application Fieldbus Client 3 Web App RB RB RB RB Websockets JSON/Protobuf WTWT Protobuf
  11. 11. 11 Services & Components Component Services Haltalk halrcmd, halrcomp, (halgroup) msgd log mklauncher launcher, launchercmd configserver config mkwrapper status, command, error, file previewmodule preview, previewcmd
  12. 12. 12 Close Up Application HAL Remote Component Client Remote Component HAL Instance Real-Time Environment Real-Time Host Haltalk HAL Remote Component halrcmd halrcomp ZeroMQ Protobuf API
  13. 13. 13 WhataboutNML? ● Replace with Machinetalk → not completed ● Major refactoring of the CNC Stack
  14. 14. 14 What’s the dealwith Machinetalk GSL?
  15. 15. 15 Reasons ● Not only Protobuf + ZMQ + DNS-SD/mDNS ● Knowledge embedded in code ● Repetitive across languages ● Protocols better formalized ● Protobuf Messages↔
  16. 16. 16 Imatix/GSL ● Model Oriented Programing ● Control Model + Generator XML Model .xml GSL Interpreter Generated Code .cpp, .py, ... GSL Template .gsl
  17. 17. 17 Example
  18. 18. 18 HalremoteinFSMs down trying Start [Start] / Start Socket / Reset Heartbeat Liveness / Send Ping / Start Heartbeat Timer Stop [Stop] / Stop Heartbeat Timer / Stop Socket up Any Msg Received [* Msg Received] / Reset Heartbeat Liveness / Reset Heartbeat Timer Stop [Stop] / Stop Heartbeat Timer / Stop Socket Heartbeat Timeout [Heartbeat Timeout] / Stop Socket / Start Socket / Reset Heartbeat Liveness / Send Ping Heartbeat Timeout [Heartbeat Timeout] / Stop Socket / Start Socket / Reset Heartbeat Liveness / Send Ping Heartbeat Tick [Heartbeat Tick] / Send Ping Any Msg Sent [* Msg Sent] / Reset Heartbeat Timer Heartbeat Tick [Heartbeat Tick] / Send Ping Any Msg Received [* Msg Received] / Reset Heartbeat Liveness Any Msg Sent [* Msg Sent] / Reset Heartbeat Timer down entry / Set Disconnected exit / Set Connecting trying Connect [Start] / Add Pins / Start Halrcmd Channel Disconnect [Stop] / Stop Halrcmd Channel / Stop Halrcomp Channel / Remove Pins bind Halrcmd Up [Halrcmd State Up] / Bind Component binding Halrcomp Bind Msg Sent [Halrcomp Bind Msg Sent] syncing No Bind [No Bind] / Start Halrcomp Channel Disconnect [Stop] / Stop Halrcmd Channel / Stop Halrcomp Channel / Remove Pins Halrcmd Trying [Halrcmd State Trying] Bind Confirmed [Halrcomp Bind Confirm Msg Received] / Start Halrcomp Channel error entry / Set Error Bind Rejected [Halrcomp Bind Reject Msg Received] / Stop Halrcmd Channel Disconnect [Stop] / Stop Halrcmd Channel / Stop Halrcomp Channel / Remove Pins Halrcmd Trying [Halrcmd State Trying] / Stop Halrcomp Channel Sync Failed [Halrcomp Error Msg Received] / Stop Halrcomp Channel / Stop Halrcmd Channel synced entry / Set Connected Halrcomp Up [Halrcomp State Up] Disconnect [Stop] / Stop Halrcmd Channel / Stop Halrcomp Channel / Remove Pins Disconnect [Stop] / Stop Halrcmd Channel / Stop Halrcomp Channel / Remove Pins Halrcmd Trying [Halrcmd State Trying] / Stop Halrcomp Channel / Unsync Pins / Set Timeout Halrcomp Trying [Halrcomp State Trying] / Unsync Pins / Set Timeout Set Rejected [Halrcomp Set Reject Msg Received] / Stop Halrcomp Channel / Stop Halrcmd Channel Halrcomp Set Msg Sent [Halrcomp Set Msg Sent] down trying Start [Start] / Start Socket Stop [Stop] / Stop Heartbeat Timer / Stop Socket up Full Update Received [Full Update Msg Received] / Reset Heartbeat Liveness / Start Heartbeat Timer Stop [Stop] / Stop Heartbeat Timer / Stop Socket Heartbeat Timeout [Heartbeat Timeout] / Stop Heartbeat Timer / Stop Socket / Start Socket Heartbeat Tick [Heartbeat Tick] / Reset Heartbeat Timer Any Msg Received [* Msg Received] / Reset Heartbeat Liveness / Reset Heartbeat Timer
  19. 19. 19 Layering Channel Layer Implementation Layer Subscriber RpcClient «abstract» RemoteComponentBase RemoteComponent Composition Layer Model
  20. 20. 20 CodeGeneration ProtosProtos Protocol Model Component Model Code Generator ProtoBuf Compiler uses Base Class Message Classes Message GSL Template Protos Component Class
  21. 21. 21 Addinga newLanguageBinding ● Find libs ● Write MVP ● Build a code generator ● Implement details Find Requirements Proof of Concept Generalize 1. 2. 3. Specialize 4.
  22. 22. 22 GSLConclusion ● Perfect for protocols ● Less repetitive ● Focus on good models ● Consistency across languages
  23. 23. 23 Applications ● QtQuickVcp ● pymachinetalk ● WebVCP (webtalk-ng) ● node-machinetalk (not in production)
  24. 24. 24 More ● Formal Verification - UPPAAL ● SCXML support
  25. 25. 25 Canweuse Machinetalkforother applications?
  26. 26. 26 Machinetalk Generic ● Generalizes – machinetalk-protobuf – machinetalk-gsl ● multiple “Machinetalks” can live side-by-side ● Adds project namespace/package ● Generate client and server base
  27. 27. 27 Howtouse ● Fork machinetalk-protobuf ● Fork machinetalk-gsl ● Change/add project name alias ● Implement your protocols ● Define your message structure ● Generate ● Implement
  28. 28. 28 Whatisthe current status of pymachinetalk?
  29. 29. 29 Update ● Continued work ● Implemented mt-gsl ● Replaced avahi with zeroconf ● Easier to use serivce discovery ● Available via PyPI
  30. 30. 30 Example import time from pymachinetalk.dns_sd import ServiceDiscovery import pymachinetalk.halremote as halremote sd = ServiceDiscovery() rcomp = halremote.RemoteComponent('anddemo', debug=False) rcomp.newpin('button0', halremote.HAL_BIT, halremote.HAL_OUT) rcomp.newpin('button1', halremote.HAL_BIT, halremote.HAL_OUT) led_pin = rcomp.newpin('led', halremote.HAL_BIT, halremote.HAL_IN) sd.register(rcomp) sd.start() try: while True: if rcomp.connected: print('LED status %s' %s str(led_pin.value) time.sleep(0.5) except KeyboardInterrupt: pass sd.stop()
  31. 31. 31 Questions?

×