{ "info": { "author": "Lukas Scheffler", "author_email": "luke@lukecodewalker.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "Python TMCL client library\n==========================\n\n
\n\nClone of [NativeDesign/python-tmcl](https://github.com/NativeDesign/python-tmcl)\n\nPython wrapper around Trinamic's TMCL serial interface for controlling TMCM stepper modules\nvia a serial-to-rs485 converter.\n\n\n\nInstallation\n------------\n\n### Install using pip\n```sh\n> pip install pytmcl\n```\n\n### Install without pip\n```sh\n> git clone https://github.com/LukeSkywalker92/pyTMCL.git\n> cd pyTMCL\n> python setup.py install\n```\n\n\nUsage\n-----\n\nUse an RS485-to-serial adapter to connect your PC to one or more TMCM modules.\nBefore starting you should check the modules' serial-address and baud-rate is\na known value. Out of the box (_warning: anecdotal_) modules usually have an address\nof `1` and a baud-rate of `9600` but this is not guarenteed. The easiest way to check\nthese values is by using the [TMCL IDE][1] on a windows machine.\n\nIf using multiple TMCM modules attached to the same rs485 bus you __must__ ensure that\neach module is set to a _different_ serial-address so that they don't clash.\n\n\n### Example usage (single-axis modules)\n```python\nfrom serial import Serial\nfrom time import sleep\nimport pyTMCL\n\n## serial-address as set on the TMCM module.\nMODULE_ADDRESS = 1\n\n## Open the serial port presented by your rs485 adapter\nserial_port = Serial(\"/dev/tty.usbmodem1241\")\n\n## Create a Bus instance using the open serial port\nbus = pyTMCL.connect(serial_port)\n\n## Get the motor\nmotor = bus.get_motor(MODULE_ADDRESS)\n\n## From this point you can start issuing TMCL commands\n## to the motor as per the TMCL docs. This example will\n## rotate the motor left at a speed of 1234 for 2 seconds\nmotor.rotate_left(1234)\nsleep(2)\nmotor.stop()\n```\n\n\n### Example usage (multi-axis modules)\n```python\nfrom serial import Serial\nimport pyTMCL\n\n## Open the serial port presented by your rs485 adapter\nserial_port = Serial(\"/dev/tty.usbmodem1241\")\n\n## Create a Bus instance using the open serial port\nbus = pyTMCL.connect(serial_port)\n\n## Get the motor on axis 0 of module with address 1\nmodule = bus.get_module( 1 )\n\na0 = module.get_motor(0)\na1 = module.get_motor(1)\na2 = module.get_motor(2)\n\n```\n\n### Example usage (callbacks)\n```python\nfrom serial import Serial\nfrom time import sleep\nimport pyTMCL\n\n# serial-address as set on the TMCM module.\nMODULE_ADDRESS = 0\n\n# Open the serial port presented by your rs485 adapter\nserial_port = Serial(\"COM4\")\n\n# Create a Bus instance using the open serial port\nbus = pyTMCL.connect(serial_port)\n\n# Get the motor\nmotor = bus.get_motor(MODULE_ADDRESS)\nmotor.axis.max_positioning_speed = 200\n# From this point you can start issuing pyTMCL commands\n# to the motor as per the pyTMCL docs. This example will\n# rotate the motor left at a speed of 1234 for 2 seconds\n\n\ndef angle_to_steps(angle):\n return int(angle * 256 / 1.8)\n\ndef callback(arg1, arg2):\n\tprint(\"Argument 1: \" + str(arg1) + \" Argument2: \" + str(arg2))\n\nmotor.move_relative(angle_to_steps(360), callback=callback, args=(\"Finished Moving\", \"Turned 360 Degree\"))\n```\n\n\nAPI Overview\n------------\n\n\n#### class Motor (bus, address, axis)\n\n##### `move_absolute (position, callback=None, args=(), kwargs={})`\nMove the motor to the specified _absolute_ position.\nCall callback function with `*args` and `**kwargs` when position is reached. (callback is optional).\n\n##### `move_relative (offset, callback=None, args=(), kwargs={})`\nMove the motor by the specified offset _relative to current position_.\nCall callback function with `*args` and `**kwargs` when position is reached. (callback is optional).\n\n##### `reference_search (rfs_type)`\nStart a reference search routine to locate limit switches.\n\n##### `rotate_left (velocity)`\nRotate the motor left-wards at the specified velocity.\n\n##### `rotate_right (velocity)`\nRotate the motor right-wards at the specified velocity.\n\n##### `run_command (cmd)`\nExecute a predefined user subroutine written to TMCM module firmware\n\n##### `send (cmd, type, motorbank, value)`\nSend a raw TMCL command to the motor.\n\n##### `stop ()`\nStop the motor\n\n\n[1]: https://www.trinamic.com/support/software/tmcl-ide/", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LukeSkywalker92/pyTMCL", "keywords": "tmcl,trinamic,rs485,stepper,motor,tmcm", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyTMCL", "package_url": "https://pypi.org/project/pyTMCL/", "platform": "", "project_url": "https://pypi.org/project/pyTMCL/", "project_urls": { "Homepage": "https://github.com/LukeSkywalker92/pyTMCL" }, "release_url": "https://pypi.org/project/pyTMCL/1.0.10/", "requires_dist": null, "requires_python": "", "summary": "Talk to Trinamic Stepper Motors using TMCL over serial", "version": "1.0.10" }, "last_serial": 4493350, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c30532d3b0935cae04e290f4d583299c", "sha256": "06dbaf8b279cffaf60528073e5f1ab1eb789f0050d843ca7206059e30583f60e" }, "downloads": -1, "filename": "pyTMCL-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "c30532d3b0935cae04e290f4d583299c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8242, "upload_time": "2018-10-04T11:34:36", "url": "https://files.pythonhosted.org/packages/e7/7f/3c9d58067f261b7ee19989c19ac71d2b58ba8b42e20a383bd93e25fdde75/pyTMCL-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db35bdde65e2af7c52c329542049b8b4", "sha256": "d0493906e2f39b0f406e6693cfd2d85fdf2fe269c723aa4d13f1f084b5227261" }, "downloads": -1, "filename": "pyTMCL-1.0.0.tar.gz", "has_sig": false, "md5_digest": "db35bdde65e2af7c52c329542049b8b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6385, "upload_time": "2018-10-04T11:34:37", "url": "https://files.pythonhosted.org/packages/3c/ee/dcd2666202ebf64d72515183458ba2d47dedfcebf7b9543411a1faaf2bbc/pyTMCL-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b64577142d65696bbd246fc779285b57", "sha256": "a11048379058649dcc3e8ece9208e6c172975bcaa988981ff04799ac4aa6a9b6" }, "downloads": -1, "filename": "pyTMCL-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b64577142d65696bbd246fc779285b57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6982, "upload_time": "2018-10-06T15:09:37", "url": "https://files.pythonhosted.org/packages/4b/e6/a0984ce8cc14abbe39e7c7a3e40fceff95cf9a8b8e3c846e57e439d43fc4/pyTMCL-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "19919f99961fd43c07dc35a34c1ae941", "sha256": "fde9aee35dee54b3db80964a0d0a91873faa5979c33d4ae146c2002f17d87d0c" }, "downloads": -1, "filename": "pyTMCL-1.0.10.tar.gz", "has_sig": false, "md5_digest": "19919f99961fd43c07dc35a34c1ae941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2018-11-16T11:12:34", "url": "https://files.pythonhosted.org/packages/ea/c2/3d569a3a978d415d20d27b6622ab3ab973068951227588ddefc06918ecd8/pyTMCL-1.0.10.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "998ccfaeb37677becd2ed3d4dc6e9d0c", "sha256": "78004b9aa46238947ce56e8d23326baf8eff6b7e2595928fa115cc5ee3212c16" }, "downloads": -1, "filename": "pyTMCL-1.0.3.tar.gz", "has_sig": false, "md5_digest": "998ccfaeb37677becd2ed3d4dc6e9d0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6989, "upload_time": "2018-10-06T15:33:39", "url": "https://files.pythonhosted.org/packages/75/04/341a589384f0962b32ccfc470560cab8e811005db2d73df90c7372254a30/pyTMCL-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "86189ecfad307ac175469f18974b5054", "sha256": "214a359f95ab0332efeb87113160b7ea5c21cccbf18ad657b0b3911f51a468a4" }, "downloads": -1, "filename": "pyTMCL-1.0.5.tar.gz", "has_sig": false, "md5_digest": "86189ecfad307ac175469f18974b5054", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7082, "upload_time": "2018-10-09T13:23:09", "url": "https://files.pythonhosted.org/packages/25/8c/c49664f8a6fe2c9b753bf12c4a94e17e94d8a5a29311b40dfc4b90df2c7c/pyTMCL-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "2081796573ae74bdc5294d11f9e09dc3", "sha256": "164b3b7116f6ed8507e8ce5933fa4f93629dded9f0769aa9a1858c8b93308947" }, "downloads": -1, "filename": "pyTMCL-1.0.6.tar.gz", "has_sig": false, "md5_digest": "2081796573ae74bdc5294d11f9e09dc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7106, "upload_time": "2018-10-11T10:21:23", "url": "https://files.pythonhosted.org/packages/58/d3/ef894b645cc1e0da15d9865bdad5ee346631120f952582ec354d88e06568/pyTMCL-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "ed46356a44e950b5c2637e9d658d4e2c", "sha256": "cbed3d8d10afa1665330a98b64018b410c0dfab2885b739d63f8a1c102d2f301" }, "downloads": -1, "filename": "pyTMCL-1.0.7.tar.gz", "has_sig": false, "md5_digest": "ed46356a44e950b5c2637e9d658d4e2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7179, "upload_time": "2018-10-18T13:22:45", "url": "https://files.pythonhosted.org/packages/50/1d/7cbb8f5aecf734f4d30a7a6347911a67329fdd4a039a692e6666d15970bd/pyTMCL-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "c244a6c5367380106fa84a9fdf651cb0", "sha256": "18a93e76de635b7edf1e3342d3b4d8c1b818cf5e9ac6fd6696cf0c8d52a89dba" }, "downloads": -1, "filename": "pyTMCL-1.0.8.tar.gz", "has_sig": false, "md5_digest": "c244a6c5367380106fa84a9fdf651cb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7172, "upload_time": "2018-10-23T08:48:49", "url": "https://files.pythonhosted.org/packages/32/e5/56f78cab210b22abe6abfdc7b8ae71436638cea9a977285b852ff607ee66/pyTMCL-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "a4d512d7b5afed7e621f29dd1669cee4", "sha256": "3676f5a313b2800b1b2ac8f8dfaa4bf0503ef04607cf4c6a68d38ddae9902253" }, "downloads": -1, "filename": "pyTMCL-1.0.9.tar.gz", "has_sig": false, "md5_digest": "a4d512d7b5afed7e621f29dd1669cee4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7210, "upload_time": "2018-10-26T13:38:59", "url": "https://files.pythonhosted.org/packages/50/a2/af3e3c767c2653f9df24dd1a52e89f377f94f37baa04a2b2a0c3950d44d7/pyTMCL-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19919f99961fd43c07dc35a34c1ae941", "sha256": "fde9aee35dee54b3db80964a0d0a91873faa5979c33d4ae146c2002f17d87d0c" }, "downloads": -1, "filename": "pyTMCL-1.0.10.tar.gz", "has_sig": false, "md5_digest": "19919f99961fd43c07dc35a34c1ae941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2018-11-16T11:12:34", "url": "https://files.pythonhosted.org/packages/ea/c2/3d569a3a978d415d20d27b6622ab3ab973068951227588ddefc06918ecd8/pyTMCL-1.0.10.tar.gz" } ] }