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 - Build Real Time Systems with Python

18 vues

Publié le

Machinekit is an open source motion control software. One of the greatest parts of Machinekit the Python interface.

Machinekit has not only one Python API, but multiple Some of them are not very well documented. This presentation gives you an overview of the different Python APIs that come with the software.

In short, Machinekit can be programmed with Python to build real-time motion control systems.

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 - Build Real Time Systems with Python

  1. 1. Machinekit BuildReal-TimeSystemswithPython Alexander Rössler
  2. 2. 2 Overview ● Machinekit and HAL ● The 4 APIs ● Configure and Run ● Create HAL components ● Interface with the CNC stack ● Remote Control Machinekit
  3. 3. 3 AboutMe ● Alexander Rössler ● Embedded Systems ● All things Open Source ● 3D printing, CNC, robots, … ● “Solopreneur”
  4. 4. 4 MachinekitandHAL
  5. 5. 5 Machinekit Embedded Devices TabletsSmartphones Desktop ComputersCNC Machines Robots Quadcopters Machinekit 3D Printers Other Applications ?
  6. 6. 6 Architecture Overview Hardware Hardware Abstraction Layer (HAL) Motion Controller IO Controller Task Executor User Interface CNC Stack
  7. 7. 7 7404 abcd efgh Hardware AbstractionLayer ● Configuration – Components – Pins – Signals ● Real-Time ● Userland
  8. 8. 8 WhyMachinekitandnot…? ● RT made simple ● Portable ● Future proof ● Runs on Linux ● Tools and GUIs
  9. 9. 9 Supported Plattforms ● Desktop Linux PC ● SBCs – BeagleBone (Black, Green, Blue, …) – Raspberry Pi 3 – Altera and Xilinx SoC/FPGA – … ● POSIX, PREEMPT_RT or Xenomai
  10. 10. 10 The 4APIs
  11. 11. 11 The4 Python APIs 1) Python HAL and configuration API 2) Python HAL component API 3) Python linuxcnc API 4) pymachinetalk 5) ...
  12. 12. 12 Whatcanbedone withPython ● Create HAL configurations ● Launch and manage Machinekit/HAL instances ● Create Userland HAL components ● Interface with CNC stack ● Remotely interact with HAL ● Extend GCode ● ... 7404 UI 1 12345 SDK
  13. 13. 13 Whatcan’tbe done Python ● Create new HAL RT components 7404
  14. 14. 14 ConfigureandRun
  15. 15. 15 MachinekitModule ● import machinekit – config, launcher, hal, rtapi ● src/hal/cython ● lib/python/machinekit
  16. 16. 16 VeryBasicHALApplication ● run.py - Run file ● hal_basics.py – HAL config
  17. 17. 17 HALBasics input0 input1 input0 input1 output in0 in1 out button0 button1 led and2.demo anddemo main-thread HAL Component HAL Remote Component HAL Signals HAL Thread HAL Pins HAL Function
  18. 18. 18 Tools ● halcmd ● halmeter ● Halscope ● hal-graph
  19. 19. 20 Create HAL Components
  20. 20. 21 HALAPI ● import hal ● CPython module ● Lib/python/hal.py
  21. 21. 22 Simple HALComponent ● import hal ● Create pins ● Update pins in main loop ● custom_sum – in0 + in1 = out
  22. 22. 24 Interfacewiththe CNCStack
  23. 23. 25 Linuxcnc Module ● import linuxcnc – stat, command, ini, positionlogger ● CPython module ● lib/python/linuxcnc.so
  24. 24. 27 RemoteControl Machinekit
  25. 25. 28 Pymachinetalk ● import machinetalk ● import pymachinetalk – dns_sd, halremote, application, ... ● Available on PyPI ● Python 3 and 2 ● Windows, Linux, Mac, ... UI 3 12345 UI 2 12345 UI 1 12345 Real-time hostent 1 Real-time environment HAL instance Haltalk 12345 UI 3 12345 UI 2 12345 UI 1 12345 UUID
  26. 26. 29 Machinetalk Machinetalk ZeroMQ Protobuf DNS-SDovermDNS OS, platform technology
  27. 27. 30 HalremoteService ● halrcomp & halrcmd ● haltalk ● Remote API Real-time hostClient 1 Real-time environment HAL instance Haltalk abcd efgh Client 2 12345
  28. 28. 31 Applications ● Testing Machinetalk ● Remoting HAL ● CLIs and UIs ● Distritbuted HAL setups ● 3rd party plugins
  29. 29. 32 Questions?
  30. 30. 33 More Information ● http://machinekit.io ● https://machinekoder.com ● Machinekit on Google Google Groups ● https://github.com/machinekit ● https://github.com/machinekoder/cookiecutter-machinekit-python-hal ●

×