├── .gitignore
├── LICENSE
├── README.md
├── autotune_tmc.py
├── install.sh
├── motor_constants.py
└── motor_database.cfg
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | share/python-wheels/
24 | *.egg-info/
25 | .installed.cfg
26 | *.egg
27 | MANIFEST
28 |
29 | # PyInstaller
30 | # Usually these files are written by a python script from a template
31 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
32 | *.manifest
33 | *.spec
34 |
35 | # Installer logs
36 | pip-log.txt
37 | pip-delete-this-directory.txt
38 |
39 | # Unit test / coverage reports
40 | htmlcov/
41 | .tox/
42 | .nox/
43 | .coverage
44 | .coverage.*
45 | .cache
46 | nosetests.xml
47 | coverage.xml
48 | *.cover
49 | *.py,cover
50 | .hypothesis/
51 | .pytest_cache/
52 | cover/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | .pybuilder/
76 | target/
77 |
78 | # Jupyter Notebook
79 | .ipynb_checkpoints
80 |
81 | # IPython
82 | profile_default/
83 | ipython_config.py
84 |
85 | # pyenv
86 | # For a library or package, you might want to ignore these files since the code is
87 | # intended to run in multiple environments; otherwise, check them in:
88 | # .python-version
89 |
90 | # pipenv
91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
94 | # install all needed dependencies.
95 | #Pipfile.lock
96 |
97 | # poetry
98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99 | # This is especially recommended for binary packages to ensure reproducibility, and is more
100 | # commonly ignored for libraries.
101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102 | #poetry.lock
103 |
104 | # pdm
105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106 | #pdm.lock
107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108 | # in version control.
109 | # https://pdm.fming.dev/#use-with-ide
110 | .pdm.toml
111 |
112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113 | __pypackages__/
114 |
115 | # Celery stuff
116 | celerybeat-schedule
117 | celerybeat.pid
118 |
119 | # SageMath parsed files
120 | *.sage.py
121 |
122 | # Environments
123 | .env
124 | .venv
125 | env/
126 | venv/
127 | ENV/
128 | env.bak/
129 | venv.bak/
130 |
131 | # Spyder project settings
132 | .spyderproject
133 | .spyproject
134 |
135 | # Rope project settings
136 | .ropeproject
137 |
138 | # mkdocs documentation
139 | /site
140 |
141 | # mypy
142 | .mypy_cache/
143 | .dmypy.json
144 | dmypy.json
145 |
146 | # Pyre type checker
147 | .pyre/
148 |
149 | # pytype static type analyzer
150 | .pytype/
151 |
152 | # Cython debug symbols
153 | cython_debug/
154 |
155 | # PyCharm
156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158 | # and can be added to the global gitignore or merged into this file. For a more nuclear
159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160 | #.idea/
161 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Klipper TMC Autotune
2 |
3 | Klipper extension for automatic configuration and tuning of TMC drivers.
4 |
5 | This extension calculates good values for most registers of TMC stepper motor drivers, given the motor's datasheet information and user selected tuning goal.
6 |
7 | In particular, it enables StealthChop by default on Z motors and extruders, CoolStep where possible, and correctly switches to full step operation at very high speeds. Where multiple modes are possible, it should select the lowest power and quietest modes available, subject to the constraints of sensorless homing (which does not allow certain combinations).
8 |
9 |
10 | ### Current status
11 |
12 | - Official support for TMC2209, TMC2240, and TMC5160.
13 | - Support for TMC2130, TMC2208 and TMC2660 may work, but is completely untested.
14 | - Sensorless homing with autotuning enabled is known to work on TMC2209, TMC2240 and TMC5160, provided you home fast enough (homing_speed should be numerically greater than rotation_distance for those axes using sensorless homing). As always, be very careful when trying sensorless homing for the first time.
15 | - Using autotuning for your motors can improve efficiency by allowing them to run cooler and consume less power. However, it's important to note that this process can also cause the TMC drivers to run hotter, so proper cooling measures must be implemented.
16 |
17 |
18 | ## Installation
19 |
20 | To install this plugin, run the installation script using the following command over SSH. This script will download this GitHub repository to your RaspberryPi home directory, and symlink the files in the Klipper extra folder.
21 |
22 | ```bash
23 | wget -O - https://raw.githubusercontent.com/andrewmcgr/klipper_tmc_autotune/main/install.sh | bash
24 | ```
25 |
26 | Then, add the following to your `moonraker.conf` to enable automatic updates:
27 | ```ini
28 | [update_manager klipper_tmc_autotune]
29 | type: git_repo
30 | channel: dev
31 | path: ~/klipper_tmc_autotune
32 | origin: https://github.com/andrewmcgr/klipper_tmc_autotune.git
33 | managed_services: klipper
34 | primary_branch: main
35 | install_script: install.sh
36 | ```
37 |
38 | ## Adjusting existing configuration
39 |
40 | Your driver configurations should contain:
41 | * Pins
42 | * Currents (run current, hold current, homing current if using a Klipper version that supports the latter)
43 | * `interpolate: true`
44 | * Comment out any other register settings and sensorless homing values (keep them for reference, but they will not be active)
45 |
46 | The Klipper documentation recommends not using interpolation. However, that is most applicable if using low microstep counts, and using the default driver configuration. Autotune gives better results, both dimensionally and quality, by using interpolation and as many microsteps as feasible.
47 |
48 | Check the pinouts of your stepper driver boards: BTT TMC 2240 boards require configuring `diag1_pin` not `diag0_pin`, but MKS TMC 2240 stepsticks require `diag0_pin` and *not* `diag1_pin`. There may be other unusual drivers.
49 |
50 | ## Sensorless homing
51 |
52 | Autotune can be used together with homing overrides for sensorless homing. However, you must adjust the `sg4_thrs` (TMC2209, TMC2260) and/or `sgt` (TMC5160, TMC2240, TMC2130, TMC2660) values specifically in the autotune sections. Attempting to make these changes via gcode or via the tmc driver sections will not result in an error message, but will have no effect since the autotuning algorithm will simply override them.
53 |
54 | Also note that the sensorless homing tuning will most likely change due to the other settings. In particular, autotune may require faster homing speeds to work; take the `rotation_distance` of the stepper as a minimum speed that can work, and if it is hard to tune home faster. Sensorless homing becomes much more sensitive at higher speeds.
55 |
56 | ## Autotune configuration
57 |
58 | Add the following to your `printer.cfg` (change motor names and remove or add any sections as needed) to enable the autotuning for your TMC drivers and motors and restart Klipper:
59 | ```ini
60 | [autotune_tmc stepper_x]
61 | motor: ldo-42sth48-2004mah
62 | [autotune_tmc stepper_y]
63 | motor: ldo-42sth48-2004mah
64 |
65 | [autotune_tmc stepper_z]
66 | motor: ldo-42sth48-2004ac
67 | [autotune_tmc stepper_z1]
68 | motor: ldo-42sth48-2004ac
69 | [autotune_tmc stepper_z2]
70 | motor: ldo-42sth48-2004ac
71 | [autotune_tmc stepper_z3]
72 | motor: ldo-42sth48-2004ac
73 |
74 | [autotune_tmc extruder]
75 | motor: ldo-36sth20-1004ahg
76 | ```
77 |
78 | All the `[autotune_tmc]` sections accept additional parameters to tweak the behavior of the autotune process for each motor:
79 |
80 | | Parameter | Default value | Range | Description |
81 | | --- | --- | --- | --- |
82 | | motor | | [See DB](motor_database.cfg) | This parameter is used to retrieve the physical constants of the motor connected to the TMC driver |
83 | | tuning_goal | `auto` | `auto`, `silent`, `performance`, and `autoswitch` | Parameter to choose how to fine-tune the TMC driver using StealthChop and tailored parameters. By opting for `auto`, it will automatically apply `performance` for the X and Y axes and `silent` for the Z axis and extruder unless the motor is very small. `autoswitch` is an highly experimental choice that enables dynamic switching between `silent` and `performance` modes in real-time when needed. However, at the moment, this transition can potentially be troublesome, resulting in unwanted behavior, noise disturbances and lost steps. Hence, it is recommended to avoid using 'autoswitch' until its identified issues are fully addressed |
84 | | extra_hysteresis | 0 | 0 to 8 | Additional hysteresis to reduce motor humming and vibration at low to medium speeds and maintain proper microstep accuracy. Warning: use only as much as necessary as a too high value will result in more chopper noise and motor power dissipation (ie. more heat) |
85 | | tbl | 2 | 0 to 3 | Comparator blank time. This time must safely cover the TMC switching events. A value of 1 or 2 (default) should be fine for most typical applications, but higher capacitive loads may require this to be set to 3. Also, lower values allow StealthChop to regulate to lower coil current values |
86 | | toff | 0 | 0 to 15 | Sets the slow decay time (off time) of the chopper cycle. This setting also limits the maximum chopper frequency. When set to 0, the value is automatically computed by this autotuning algorithm. Highest motor velocities sometimes benefit from forcing `toff` to 1 or 2 and a setting a short `tbl` of 1 or 0 |
87 | | sgt | 1 | -64 to 63 | Sensorless homing threshold for TMC5160, TMC2240, TMC2130, TMC2660. Set value appropriately if using sensorless homing (lower value means more sensitive detection and easier stall) |
88 | | sg4_thrs | 10 | 0 to 255 | Sensorless homing threshold for TMC2209 and TMC2260. Set value appropriately if using sensorless homing (higher value means more sensitive detection and easier stall). This parameter is also used as the CoolStep current regulation threshold for TMC2209, TMC2240 and TMC5160. A default value of 80 is usually a good starting point for CoolStep (in the case of TMC2209, the tuned sensorless homing value will also work correctly) |
89 | | pwm_freq_target | 55e3 | 10e3 to 60e3 | Switching frequency target, in Hz. The code selects the highest available PWM switching frequency less than or equal to this. The default usually results in 48 kHz switching. |
90 | | voltage | 24 | 0.0 to 60.0 | Voltage used to power this motor and stepper driver |
91 | | overvoltage_vth | | 0.0 to 60.0 | Set the optional overvoltage snubber built into the TMC2240 and TMC5160. Users of the BTT SB2240 toolhead board should use it for the extruder by reading the actual toolhead voltage and adding 0.8V |
92 |
93 | Also if needed, you can adjust everything on the go when the printer is running by using the `AUTOTUNE_TMC` macro in the Klipper console. All previous parameters are available:
94 | ```
95 | AUTOTUNE_TMC STEPPER= [PARAMETER=]
96 | ```
97 |
98 |
99 | ## User-defined motors
100 |
101 | The motor names and their physical constants are in the [motor_database.cfg file](motor_database.cfg), which is automatically loaded by the script. If a motor is not listed, feel free to add its proper definition in your own `printer.cfg` configuration file by adding this section (PRs for other motors are also welcome). You can usually find this information in their datasheets but pay very special attention to the units!
102 | ```ini
103 | [motor_constants my_custom_motor]
104 | # Coil resistance, Ohms
105 | resistance: 0.00
106 | # Coil inductance, Henries
107 | inductance: 0.00
108 | # Holding torque, Nm
109 | holding_torque: 0.00
110 | # Nominal rated current, Amps
111 | max_current: 0.00
112 | # Steps per revolution (1.8deg motors use 200, 0.9deg motors use 400)
113 | steps_per_revolution: 200
114 | ```
115 |
116 | Note that lead screw motors very often do not have a published torque. Use an online calculator to estimate the torque from the lead screw thrust, for example https://www.dingsmotionusa.com/torque-calculator.
117 |
118 |
119 | ## Removing this Klipper extension
120 |
121 | Commenting out all `[autotune_tmc xxxx]` sections from your config and restarting Klipper will completely deactivate the plugin. So you can enable/disable it as you like.
122 |
123 | If you want to uninstall it completely, remove the moonraker update manager section from your `moonraker.conf` file, delete the `~/klipper_tmc_autotune` folder on your Pi and restart Klipper and Moonraker.
124 |
--------------------------------------------------------------------------------
/autotune_tmc.py:
--------------------------------------------------------------------------------
1 | import math, logging, os
2 | from enum import Enum
3 | from inspect import signature
4 | from . import tmc
5 |
6 | # Autotune config parameters
7 | TUNING_GOAL = 'auto'
8 | EXTRA_HYSTERESIS = 0
9 | TBL = 1
10 | TOFF = 0
11 | SGT = 1
12 | SG4_THRS = 40
13 | VOLTAGE = 24.0
14 | OVERVOLTAGE_VTH = None
15 |
16 | # Generic tuning parameters
17 | COOLSTEP_THRS_FACTOR = 0.75
18 | FULLSTEP_THRS_FACTOR = 1.2
19 | MULTISTEP_FILT = True
20 |
21 | # 2240-specific parameters
22 | SLOPE_CONTROL = 3
23 |
24 | # PWM parameters
25 | PWM_AUTOSCALE = True # Setup pwm autoscale even if we won't use PWM, because it
26 | # gives more data about the motor and is needed for CoolStep.
27 | PWM_AUTOGRAD = True
28 | PWM_REG = 15
29 | PWM_LIM = 4
30 |
31 | # SpreadCycle parameters
32 | TPFD = 0
33 |
34 | # CoolStep parameters
35 | FAST_STANDSTILL = True
36 | SMALL_HYSTERESIS = False
37 | SEMIN = 2
38 | SEMAX = 4
39 | SEUP = 3
40 | SEDN = 2
41 | SEIMIN = 1 # If we drop to 1/4 current, high accels don't work right
42 | SFILT = 0
43 | IHOLDDELAY = 12
44 | IRUNDELAY = 0
45 |
46 | # High speed parameters
47 | VHIGHFS = False
48 | VHIGHCHM = False # Even though we are fullstepping, we want SpreadCycle control
49 |
50 |
51 | TRINAMIC_DRIVERS = ["tmc2130", "tmc2208", "tmc2209", "tmc2240", "tmc2660", "tmc5160"]
52 | PWM_FREQ_TARGETS = {"tmc2130": 55e3,
53 | "tmc2208": 55e3,
54 | "tmc2209": 55e3,
55 | "tmc2240": 20e3, # 2240s run very hot at high frequencies
56 | "tmc2660": 55e3,
57 | "tmc5160": 55e3}
58 |
59 |
60 | AUTO_PERFORMANCE_MOTORS = {'stepper_x', 'stepper_y', 'dual_carriage', 'stepper_x1', 'stepper_y1', 'stepper_a', 'stepper_b', 'stepper_c'}
61 |
62 | class TuningGoal(str, Enum):
63 | AUTO = "auto" # This is the default: automatically choose SILENT for Z and PERFORMANCE for X/Y
64 | AUTOSWITCH = "autoswitch" # Experimental mode that use StealthChop at low speed and switch to SpreadCycle when needed
65 | SILENT = "silent" # StealthChop at all speeds
66 | PERFORMANCE = "performance" # SpreadCycle at all speeds
67 |
68 | class AutotuneTMC:
69 | def __init__(self, config):
70 | self.printer = config.get_printer()
71 |
72 | # Load motor database
73 | pconfig = self.printer.lookup_object('configfile')
74 | dirname = os.path.dirname(os.path.realpath(__file__))
75 | filename = os.path.join(dirname, 'motor_database.cfg')
76 | try:
77 | motor_db = pconfig.read_config(filename)
78 | except Exception:
79 | raise config.error("Cannot load config '%s'" % (filename,))
80 | for motor in motor_db.get_prefix_sections(''):
81 | self.printer.load_object(motor_db, motor.get_name())
82 |
83 | # Now find our stepper and driver in the running Klipper config
84 | self.name = config.get_name().split(None, 1)[-1]
85 | if not config.has_section(self.name):
86 | raise config.error(
87 | "Could not find stepper config section '[%s]' required by TMC autotuning"
88 | % (self.name))
89 | self.tmc_section = None
90 | for driver in TRINAMIC_DRIVERS:
91 | driver_name = "%s %s" % (driver, self.name)
92 | if config.has_section(driver_name):
93 | self.tmc_section = config.getsection(driver_name)
94 | self.driver_name = driver_name
95 | self.driver_type = driver
96 | break
97 | if self.tmc_section is None:
98 | raise config.error(
99 | "Could not find any TMC driver config section for '%s' required by TMC autotuning"
100 | % (self.name))
101 | # TMCtstepHelper may have two signatures, let's pick an implementation
102 | if 'pstepper' in signature(tmc.TMCtstepHelper).parameters:
103 | self._set_driver_velocity_field = self._set_driver_velocity_field_new
104 | else:
105 | self._set_driver_velocity_field = self._set_driver_velocity_field_old
106 | # AutotuneTMC config parameters
107 | self.motor = config.get('motor')
108 | self.motor_name = "motor_constants " + self.motor
109 | tgoal = config.get('tuning_goal', default=TUNING_GOAL).lower()
110 | try:
111 | self.tuning_goal = TuningGoal(tgoal)
112 | except ValueError:
113 | raise config.error(
114 | "Tuning goal '%s' is invalid for TMC autotuning"
115 | % (tgoal))
116 | self.auto_silent = False # Auto silent off by default
117 | self.tmc_object=None # look this up at connect time
118 | self.tmc_cmdhelper=None # Ditto
119 | self.tmc_init_registers=None # Ditto
120 | self.run_current = 0.0
121 | self.fclk = None
122 | self.motor_object = None
123 | self.extra_hysteresis = config.getint('extra_hysteresis', default=EXTRA_HYSTERESIS,
124 | minval=0, maxval=8)
125 | self.tbl = config.getint('tbl', default=TBL, minval=0, maxval=3)
126 | self.toff = config.getint('toff', default=None, minval=1, maxval=15)
127 | self.tpfd = config.getint('tpfd', default=None, minval=0, maxval=15)
128 | self.sgt = config.getint('sgt', default=SGT, minval=-64, maxval=63)
129 | self.sg4_thrs = config.getint('sg4_thrs', default=SG4_THRS, minval=0, maxval=255)
130 | self.voltage = config.getfloat('voltage', default=VOLTAGE, minval=0.0, maxval=60.0)
131 | self.overvoltage_vth = config.getfloat('overvoltage_vth', default=OVERVOLTAGE_VTH,
132 | minval=0.0, maxval=60.0)
133 | self.pwm_freq_target = config.getfloat('pwm_freq_target',
134 | default=PWM_FREQ_TARGETS[self.driver_type],
135 | minval=10e3, maxval=100e3)
136 | self.printer.register_event_handler("klippy:connect",
137 | self.handle_connect)
138 | self.printer.register_event_handler("klippy:ready",
139 | self.handle_ready)
140 | # Register command
141 | gcode = self.printer.lookup_object("gcode")
142 | gcode.register_mux_command("AUTOTUNE_TMC", "STEPPER", self.name,
143 | self.cmd_AUTOTUNE_TMC,
144 | desc=self.cmd_AUTOTUNE_TMC_help)
145 |
146 | def handle_connect(self):
147 | self.tmc_object = self.printer.lookup_object(self.driver_name)
148 | # The cmdhelper itself isn't a member... but we can still get to it.
149 | self.tmc_cmdhelper = self.tmc_object.get_status.__self__
150 | try:
151 | motor = self.printer.lookup_object(self.motor_name)
152 | except Exception:
153 | raise self.printer.config_error(
154 | "Could not find motor definition '[%s]' required by TMC autotuning. "
155 | "It is not part of the database, please define it in your config!"
156 | % (self.motor_name))
157 | if self.tuning_goal == TuningGoal.AUTO:
158 | # Very small motors may not run in silent mode.
159 | self.auto_silent = self.name not in AUTO_PERFORMANCE_MOTORS and motor.T > 0.3
160 | self.tuning_goal = TuningGoal.SILENT if self.auto_silent else TuningGoal.PERFORMANCE
161 | self.motor_object = self.printer.lookup_object(self.motor_name)
162 | #self.tune_driver()
163 |
164 | def handle_ready(self):
165 | # klippy:ready handlers are limited in what they may do. Communicating with a MCU
166 | # will pause the reactor and is thus forbidden. That code has to run outside of the event handler.
167 | self.printer.reactor.register_callback(self._handle_ready_deferred)
168 |
169 | def _handle_ready_deferred(self, eventtime):
170 | if self.tmc_init_registers is not None:
171 | self.tmc_init_registers(print_time=print_time)
172 | try:
173 | self.fclk = self.tmc_object.mcu_tmc.get_tmc_frequency()
174 | except AttributeError:
175 | pass
176 | if self.fclk is None:
177 | self.fclk = 12.5e6
178 | self.tune_driver()
179 |
180 | cmd_AUTOTUNE_TMC_help = "Apply autotuning configuration to TMC stepper driver"
181 | def cmd_AUTOTUNE_TMC(self, gcmd):
182 | logging.info("AUTOTUNE_TMC %s", self.name)
183 | tgoal = gcmd.get('TUNING_GOAL', None)
184 | if tgoal is not None:
185 | try:
186 | self.tuning_goal = TuningGoal(tgoal)
187 | except ValueError:
188 | # TODO: add some logging/error here in case the tuning_goal doesn't exist
189 | pass
190 | if self.tuning_goal == TuningGoal.AUTO:
191 | self.tuning_goal = TuningGoal.SILENT if self.auto_silent else TuningGoal.PERFORMANCE
192 | extra_hysteresis = gcmd.get_int('EXTRA_HYSTERESIS', None)
193 | if extra_hysteresis is not None:
194 | if extra_hysteresis >= 0 or extra_hysteresis <= 8:
195 | self.extra_hysteresis = extra_hysteresis
196 | tbl = gcmd.get_int('TBL', None)
197 | if tbl is not None:
198 | if tbl >= 0 or tbl <= 3:
199 | self.tbl = tbl
200 | toff = gcmd.get_int('TOFF', None)
201 | if toff is not None:
202 | if toff >= 1 or toff <= 15:
203 | self.toff = toff
204 | tpfd = gcmd.get_int('TPFD', None)
205 | if tpfd is not None:
206 | if tpfd >= 0 or tpfd <= 15:
207 | self.tpfd = tpfd
208 | sgt = gcmd.get_int('SGT', None)
209 | if sgt is not None:
210 | if sgt >= -64 or sgt <= 63:
211 | self.sgt = sgt
212 | sg4_thrs = gcmd.get_int('SG4_THRS', None)
213 | if sg4_thrs is not None:
214 | if sg4_thrs >= 0 or sg4_thrs <= 255:
215 | self.sg4_thrs = sg4_thrs
216 | voltage = gcmd.get_float('VOLTAGE', None)
217 | if voltage is not None:
218 | if voltage >= 0.0 or voltage <= 60.0:
219 | self.voltage = voltage
220 | overvoltage_vth = gcmd.get_float('OVERVOLTAGE_VTH', None)
221 | if overvoltage_vth is not None:
222 | if overvoltage_vth >= 0.0 or overvoltage_vth <= 60.0:
223 | self.overvoltage_vth = overvoltage_vth
224 | self.tune_driver()
225 |
226 | def tune_driver(self, print_time=None):
227 | _currents = self.tmc_cmdhelper.current_helper.get_current()
228 | self.run_current = _currents[0]
229 | self._set_pwmfreq()
230 | self._setup_spreadcycle()
231 | self._set_hysteresis(self.run_current)
232 | self._set_sg4thrs()
233 | motor = self.motor_object
234 | maxpwmrps = motor.maxpwmrps(volts=self.voltage, current=self.run_current)
235 | rdist, _ = self.tmc_cmdhelper.stepper.get_rotation_distance()
236 | # Speed at which we run out of PWM control and should switch to fullstep
237 | vmaxpwm = maxpwmrps * rdist
238 | logging.info("autotune_tmc using max PWM speed %f", vmaxpwm)
239 | if self.overvoltage_vth is not None:
240 | vth = int((self.overvoltage_vth / 0.009732))
241 | self._set_driver_field('overvoltage_vth', vth)
242 | coolthrs = COOLSTEP_THRS_FACTOR * rdist
243 | self._setup_pwm(self.tuning_goal, self._pwmthrs(vmaxpwm, coolthrs))
244 | # One revolution every two seconds is about as slow as coolstep can go
245 | self._setup_coolstep(coolthrs)
246 | self._setup_highspeed(FULLSTEP_THRS_FACTOR * vmaxpwm)
247 | self._set_driver_field('multistep_filt', MULTISTEP_FILT)
248 | # Cool down 2240s
249 | self._set_driver_field('slope_control', SLOPE_CONTROL)
250 |
251 |
252 | def _set_driver_field(self, field, arg):
253 | tmco = self.tmc_object
254 | register = tmco.fields.lookup_register(field, None)
255 | # Just bail if the field doesn't exist.
256 | if register is None:
257 | return
258 | logging.info("autotune_tmc set %s %s=%s", self.name, field, repr(arg))
259 | val = tmco.fields.set_field(field, arg)
260 | tmco.mcu_tmc.set_register(register, val, None)
261 |
262 | def _set_driver_velocity_field_new(self, field, velocity):
263 | tmco = self.tmc_object
264 | register = tmco.fields.lookup_register(field, None)
265 | # Just bail if the field doesn't exist.
266 | if register is None:
267 | return
268 | arg = tmc.TMCtstepHelper(tmco.mcu_tmc, velocity,
269 | pstepper=self.tmc_cmdhelper.stepper)
270 | logging.info("autotune_tmc set %s %s=%s(%s)",
271 | self.name, field, repr(arg), repr(velocity))
272 | tmco.fields.set_field(field, arg)
273 |
274 | def _set_driver_velocity_field_old(self, field, velocity):
275 | tmco = self.tmc_object
276 | register = tmco.fields.lookup_register(field, None)
277 | # Just bail if the field doesn't exist.
278 | if register is None:
279 | return
280 | step_dist = self.tmc_cmdhelper.stepper.get_step_dist()
281 | mres = tmco.fields.get_field("mres")
282 | arg = tmc.TMCtstepHelper(step_dist, mres, self.fclk, velocity)
283 | logging.info("autotune_tmc set %s %s=%s(%s)",
284 | self.name, field, repr(arg), repr(velocity))
285 | tmco.fields.set_field(field, arg)
286 |
287 | def _set_pwmfreq(self):
288 | # calculate the highest pwm_freq that gives less than 50 kHz chopping
289 | pwm_freq = next((i
290 | for i in [(3, 2./410),
291 | (2, 2./512),
292 | (1, 2./683),
293 | (0, 2./1024),
294 | (0, 0.) # Default case, just do the best we can.
295 | ]
296 | if self.fclk*i[1] < self.pwm_freq_target))[0]
297 | self._set_driver_field('pwm_freq', pwm_freq)
298 |
299 | def _set_hysteresis(self, run_current):
300 | hstrt, hend = self.motor_object.hysteresis(
301 | volts=self.voltage,
302 | current=run_current,
303 | tbl=self.tbl,
304 | toff=self.toff,
305 | fclk=self.fclk,
306 | extra=self.extra_hysteresis)
307 | self._set_driver_field('hstrt', hstrt)
308 | self._set_driver_field('hend', hend)
309 |
310 | def _set_sg4thrs(self):
311 | if self.tmc_object.fields.lookup_register("sg4_thrs", None) is not None:
312 | # we have SG4
313 | self._set_driver_field('sg4_thrs', self.sg4_thrs)
314 | self._set_driver_field('sg4_filt_en', True)
315 | elif self.tmc_object.fields.lookup_register("sgthrs", None) is not None:
316 | # With SG4 on 2209, pwmthrs should be greater than coolthrs
317 | self._set_driver_field('sgthrs', self.sg4_thrs)
318 | else:
319 | # We do not have SG4
320 | pass
321 |
322 | def _pwmthrs(self, vmaxpwm, coolthrs):
323 | if self.tmc_object.fields.lookup_register("sg4_thrs", None) is not None:
324 | # we have SG4
325 | # 2240 doesn't care about pwmthrs vs coolthrs ordering, but this is desirable
326 | return max(0.2 * vmaxpwm, 1.125 * coolthrs)
327 | elif self.tmc_object.fields.lookup_register("sgthrs", None) is not None:
328 | # With SG4 on 2209, pwmthrs should be greater than coolthrs
329 | return max(0.2 * vmaxpwm, 1.125 * coolthrs)
330 | else:
331 | # We do not have SG4, so this makes the world safe for
332 | # sensorless homing in the presence of CoolStep
333 | # return 0.5 * coolthrs
334 | return 0.5 * vmaxpwm
335 |
336 | def _setup_pwm(self, tgoal, pwmthrs):
337 | motor = self.motor_object
338 | pwmgrad = motor.pwmgrad(volts=self.voltage, fclk=self.fclk)
339 | pwmofs = motor.pwmofs(volts=self.voltage, current=self.run_current)
340 | self._set_driver_field('pwm_autoscale', PWM_AUTOSCALE)
341 | self._set_driver_field('pwm_autograd', PWM_AUTOGRAD)
342 | self._set_driver_field('pwm_grad', pwmgrad)
343 | self._set_driver_field('pwm_ofs', pwmofs)
344 | self._set_driver_field('pwm_reg', PWM_REG)
345 | self._set_driver_field('pwm_lim', PWM_LIM)
346 | if tgoal == TuningGoal.AUTOSWITCH:
347 | self._set_driver_velocity_field('tpwmthrs', pwmthrs)
348 | self._set_driver_field('en_pwm_mode', True)
349 | self._set_driver_field('en_spreadcycle', False) # TMC2208 use en_spreadcycle instead of en_pwm_mode
350 | elif tgoal == TuningGoal.SILENT:
351 | self._set_driver_field('tpwmthrs', 0)
352 | self._set_driver_field('en_pwm_mode', True)
353 | self._set_driver_field('en_spreadcycle', False) # TMC2208 use en_spreadcycle instead of en_pwm_mode
354 | elif tgoal == TuningGoal.PERFORMANCE:
355 | self._set_driver_field('tpwmthrs', 0xfffff)
356 | self._set_driver_field('en_pwm_mode', False)
357 | self._set_driver_field('en_spreadcycle', True) # TMC2208 use en_spreadcycle instead of en_pwm_mode
358 |
359 | def _setup_spreadcycle(self):
360 | ncycles = int(math.ceil(self.fclk / self.pwm_freq_target))
361 | sdcycles = ncycles / 4
362 | if self.toff == 0 or self.toff is None:
363 | # About half the cycle should be taken by the two slow decay cycles
364 | self.toff = max(min(int(math.ceil(max(sdcycles - 24, 0) / 32)), 15), 1)
365 |
366 | if self.tbl is None:
367 | self.tbl = TBL
368 |
369 | if self.toff == 1 and self.tbl == 0:
370 | # blank time of 16 cycles will not work in this case
371 | self.tbl = 1
372 |
373 | pfdcycles = ncycles - (24 + 32 * self.toff) * 2 - [16, 34, 36, 54][self.tbl]
374 | if self.tpfd is None:
375 | self.tpfd = max(0, min(15, int(math.ceil(pfdcycles / 128))))
376 |
377 | logging.info("autotune_tmc %s ncycles=%d pfdcycles=%d", self.name, ncycles, pfdcycles)
378 |
379 | self._set_driver_field('tpfd', self.tpfd)
380 | self._set_driver_field('tbl', self.tbl)
381 | self._set_driver_field('toff', self.toff)
382 |
383 | def _setup_coolstep(self, coolthrs):
384 | self._set_driver_velocity_field('tcoolthrs', coolthrs)
385 | self._set_driver_field('sgt', self.sgt)
386 | self._set_driver_field('fast_standstill', FAST_STANDSTILL)
387 | self._set_driver_field('small_hysteresis', SMALL_HYSTERESIS)
388 | self._set_driver_field('semin', SEMIN)
389 | self._set_driver_field('semax', SEMAX)
390 | self._set_driver_field('seup', SEUP)
391 | self._set_driver_field('sedn', SEDN)
392 | self._set_driver_field('seimin', SEIMIN)
393 | self._set_driver_field('sfilt', SFILT)
394 | self._set_driver_field('iholddelay', IHOLDDELAY)
395 | self._set_driver_field('irundelay', IRUNDELAY)
396 |
397 | def _setup_highspeed(self, vhigh):
398 | self._set_driver_velocity_field('thigh', vhigh)
399 | self._set_driver_field('vhighfs', VHIGHFS)
400 | self._set_driver_field('vhighchm', VHIGHCHM)
401 |
402 |
403 | def load_config_prefix(config):
404 | return AutotuneTMC(config)
405 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | KLIPPER_PATH="${HOME}/klipper"
4 | AUTOTUNETMC_PATH="${HOME}/klipper_tmc_autotune"
5 |
6 | if [[ -e ${KLIPPER_PATH}/klippy/plugins/ ]]; then
7 | KLIPPER_PLUGINS_PATH="${KLIPPER_PATH}/klippy/plugins/"
8 | else
9 | KLIPPER_PLUGINS_PATH="${KLIPPER_PATH}/klippy/extras/"
10 | fi
11 |
12 | set -eu
13 | export LC_ALL=C
14 |
15 |
16 | function preflight_checks {
17 | if [ "$EUID" -eq 0 ]; then
18 | echo "[PRE-CHECK] This script must not be run as root!"
19 | exit -1
20 | fi
21 |
22 | if [ "$(sudo systemctl list-units --full -all -t service --no-legend | grep -F 'klipper.service')" ]; then
23 | printf "[PRE-CHECK] Klipper service found! Continuing...\n\n"
24 | else
25 | echo "[ERROR] Klipper service not found, please install Klipper first!"
26 | exit -1
27 | fi
28 | }
29 |
30 | function check_download {
31 | local autotunedirname autotunebasename
32 | autotunedirname="$(dirname ${AUTOTUNETMC_PATH})"
33 | autotunebasename="$(basename ${AUTOTUNETMC_PATH})"
34 |
35 | if [ ! -d "${AUTOTUNETMC_PATH}" ]; then
36 | echo "[DOWNLOAD] Downloading Autotune TMC repository..."
37 | if git -C $autotunedirname clone https://github.com/andrewmcgr/klipper_tmc_autotune.git $autotunebasename; then
38 | chmod +x ${AUTOTUNETMC_PATH}/install.sh
39 | printf "[DOWNLOAD] Download complete!\n\n"
40 | else
41 | echo "[ERROR] Download of Autotune TMC git repository failed!"
42 | exit -1
43 | fi
44 | else
45 | printf "[DOWNLOAD] Autotune TMC repository already found locally. Continuing...\n\n"
46 | fi
47 | }
48 |
49 | function link_extension {
50 | echo "[INSTALL] Linking extension to Klipper..."
51 |
52 | ln -srfn "${AUTOTUNETMC_PATH}/autotune_tmc.py" "${KLIPPER_PLUGINS_PATH}/autotune_tmc.py"
53 | ln -srfn "${AUTOTUNETMC_PATH}/motor_constants.py" "${KLIPPER_PLUGINS_PATH}/motor_constants.py"
54 | ln -srfn "${AUTOTUNETMC_PATH}/motor_database.cfg" "${KLIPPER_PLUGINS_PATH}/motor_database.cfg"
55 | }
56 |
57 | function restart_klipper {
58 | echo "[POST-INSTALL] Restarting Klipper..."
59 | sudo systemctl restart klipper
60 | }
61 |
62 |
63 | printf "\n======================================\n"
64 | echo "- Autotune TMC install script -"
65 | printf "======================================\n\n"
66 |
67 |
68 | # Run steps
69 | preflight_checks
70 | check_download
71 | link_extension
72 | restart_klipper
73 |
--------------------------------------------------------------------------------
/motor_constants.py:
--------------------------------------------------------------------------------
1 | import math, logging
2 | # Motor database, contains specifications for stepper motors.
3 |
4 | # R is coil resistance, Ohms
5 | # L is coil inductance, Henries
6 | # T is holding torque, Nm (be careful about units here)
7 | # I is nominal rated current, Amps
8 |
9 |
10 | class MotorConstants:
11 | def __init__(self, config):
12 | self.printer = config.get_printer()
13 | self.name = config.get_name().split()[-1]
14 | self.R = config.getfloat('resistance', minval=0.)
15 | self.L = config.getfloat('inductance', minval=0.)
16 | self.T = config.getfloat('holding_torque', minval=0.)
17 | self.S = config.getint('steps_per_revolution', minval=0)
18 | self.I = config.getfloat('max_current', minval=0.)
19 | self.cbemf = self.T / (2.0 * self.I)
20 | def pwmgrad(self, fclk=12.5e6, steps=0, volts=24.0):
21 | if steps==0:
22 | steps=self.S
23 | return int(math.ceil(self.cbemf * 2 * math.pi * fclk * 1.46 / (volts * 256.0 * steps)))
24 | def pwmofs(self, volts=24.0, current=0.0):
25 | I = current if current > 0.0 else self.I
26 | return int(math.ceil(374 * self.R * I / volts))
27 | # Maximum revolutions per second before PWM maxes out.
28 | def maxpwmrps(self, fclk=12.5e6, steps=0, volts=24.0, current=0.0):
29 | if steps==0:
30 | steps=self.S
31 | return (255 - self.pwmofs(volts, current)) / ( math.pi * self.pwmgrad(fclk, steps))
32 | def hysteresis(self, extra=0, fclk=12.5e6, volts=24.0, current=0.0, tbl=1, toff=0):
33 | I = current if current > 0.0 else self.I
34 | logging.info("autotune_tmc seting hysteresis based on %s V", volts)
35 | tblank = 16.0 * (1.5 ** tbl) / fclk
36 | tsd = (12.0 + 32.0 * toff) / fclk
37 | dcoilblank = volts * tblank / self.L
38 | dcoilsd = self.R * I * 2.0 * tsd / self.L
39 | logging.info("dcoilblank = %f, dcoilsd = %f", dcoilblank, dcoilsd)
40 | hysteresis = extra + int(math.ceil(max(0.5 + ((dcoilblank + dcoilsd) * 2 * 248 * 32 / I) / 32 - 8, -2)))
41 | htotal = min(hysteresis, 14)
42 | hstrt = max(min(htotal, 8), 1)
43 | hend = min(htotal - hstrt, 12)
44 | logging.info("hysteresis = %d, htotal = %d, hstrt = %d, hend = %d", hysteresis, htotal, hstrt, hend)
45 | return hstrt - 1, hend + 3
46 |
47 |
48 | def load_config_prefix(config):
49 | return MotorConstants(config)
50 |
51 |
--------------------------------------------------------------------------------
/motor_database.cfg:
--------------------------------------------------------------------------------
1 | # Motor database, contains specifications for stepper motors.
2 |
3 | # R is coil resistance, Ohms
4 | # L is coil inductance, Henries
5 | # T is holding torque, Nm (be careful about units here)
6 | # I is nominal rated current, Amps
7 |
8 | ### LDO Motors ###
9 |
10 | ## NEMA 14
11 |
12 | [motor_constants ldo-36sth17-1004ahg]
13 | resistance: 10.0
14 | inductance: 0.006
15 | holding_torque: 0.10
16 | max_current: 1.0
17 | steps_per_revolution: 200
18 |
19 | [motor_constants ldo-36sth20-1004ahg-9T]
20 | resistance: 2.4
21 | inductance: 0.0014
22 | holding_torque: 0.10
23 | max_current: 1.0
24 | steps_per_revolution: 200
25 |
26 | [motor_constants ldo-36sth20-1004ahg]
27 | resistance: 2.1
28 | inductance: 0.0016
29 | holding_torque: 0.10
30 | max_current: 1.0
31 | steps_per_revolution: 200
32 |
33 | [motor_constants ldo-35sth52-1504ah]
34 | resistance: 2.8
35 | inductance: 0.0038
36 | holding_torque: 0.37
37 | max_current: 1.5
38 | steps_per_revolution: 200
39 |
40 | [motor_constants ldo-42sth47-1684a]
41 | resistance: 1.65
42 | inductance: 0.0028
43 | holding_torque: 0.50
44 | max_current: 1.68
45 | steps_per_revolution: 200
46 |
47 | [motor_constants ldo-35sth48-1684ah]
48 | # These are the problematic LDO motors sent with their first V0 kits
49 | # They are very prone to VFAs with the default TMC settings in Klipper
50 | resistance: 1.65
51 | inductance: 0.0028
52 | holding_torque: 0.4
53 | max_current: 1.68
54 | steps_per_revolution: 200
55 |
56 | [motor_constants ldo-36sth17-0354ahg]
57 | # Basically a LDO-36STH17-1004AHG but 0.35A rated
58 | resistance: 10.8
59 | inductance: 0.006
60 | holding_torque: 0.06
61 | max_current: 0.35
62 | steps_per_revolution: 200
63 |
64 | ## NEMA 17
65 |
66 | [motor_constants ldo-42sth40-1684cl350et]
67 | #Trident Z motor kit from LDO
68 | resistance: 1.65
69 | inductance: 0.0041
70 | holding_torque: 0.45
71 | max_current: 2.0
72 | steps_per_revolution: 200
73 |
74 | [motor_constants ldo-42sth40-1684l300e]
75 | #Trident Z motor kit from LDO
76 | resistance: 1.65
77 | inductance: 0.0041
78 | holding_torque: 0.45
79 | max_current: 1.68
80 | steps_per_revolution: 200
81 |
82 | [motor_constants ldo-42sth40-1684ac]
83 | resistance: 1.65
84 | inductance: 0.0036
85 | holding_torque: 0.45
86 | max_current: 1.68
87 | steps_per_revolution: 200
88 |
89 | [motor_constants ldo-42sth40-2004mah]
90 | resistance: 1.1
91 | inductance: 0.0028
92 | holding_torque: 0.35
93 | max_current: 2.0
94 | steps_per_revolution: 400
95 |
96 | [motor_constants ldo-42sth48-1684mah]
97 | resistance: 1.65
98 | inductance: 0.0028
99 | holding_torque: 0.40
100 | max_current: 1.68
101 | steps_per_revolution: 400
102 |
103 | [motor_constants ldo-42sth48-2804ah]
104 | # Also use for 2804-ac-r
105 | resistance: 0.7
106 | inductance: 0.0006
107 | holding_torque: 0.42
108 | max_current: 2.8
109 | steps_per_revolution: 200
110 |
111 | [motor_constants ldo-42sth48-2504ac]
112 | resistance: 1.2
113 | inductance: 0.0015
114 | holding_torque: 0.55
115 | max_current: 2.5
116 | steps_per_revolution: 200
117 |
118 | [motor_constants ldo-42sth48-2504ah]
119 | resistance: 1.2
120 | inductance: 0.0015
121 | holding_torque: 0.55
122 | max_current: 2.5
123 | steps_per_revolution: 200
124 |
125 | [motor_constants ldo-42sth48-2004ac]
126 | resistance: 1.6
127 | inductance: 0.003
128 | holding_torque: 0.59
129 | max_current: 2.0
130 | steps_per_revolution: 200
131 |
132 | [motor_constants ldo-42sth48-2004mah]
133 | resistance: 1.4
134 | inductance: 0.002
135 | holding_torque: 0.44
136 | max_current: 2.0
137 | steps_per_revolution: 400
138 |
139 | [motor_constants ldo-42sth40-1004a]
140 | #Prusa Mk3 steppers XYE axis
141 | #https://cfl.prusa3d.com/display/PI3M3/Stepper+motors
142 | resistance: 6.5
143 | inductance: 0.013
144 | holding_torque: 0.49
145 | max_current: 1
146 | steps_per_revolution: 200
147 |
148 | [motor_constants ldo-42sth34-1004l321e]
149 | # Prusa Mk3 steppers Z axis
150 | resistance: 8.00
151 | inductance: 0.0095
152 | holding_torque: 107.7
153 | max_current: 1.00
154 | steps_per_revolution: 200
155 |
156 | [motor_constants ldo-42sth40-1004mah]
157 | resistance: 4.1
158 | inductance: 0.0115
159 | holding_torque: 0.39
160 | max_current: 1
161 | steps_per_revolution: 400
162 |
163 |
164 | [motor_constants ldo-42sth20-1004ash]
165 | resistance: 7.2
166 | inductance: 0.007
167 | holding_torque: 0.18
168 | max_current: 1
169 | steps_per_revolution: 200
170 |
171 | [motor_constants ldo-42sth25-1004cl200et]
172 | #LDO V0.1 Teflon coated 8x8 leadscrew Z motor
173 | resistance: 5.5
174 | inductance: 0.007
175 | holding_torque: 0.24
176 | max_current: 1
177 | steps_per_revolution: 200
178 |
179 | [motor_constants ldo-42sth25-1004acg]
180 | # Bondtech LGX (big) motor that is in fact a rebranded LDO motor
181 | resistance: 5.5
182 | inductance: 0.007
183 | holding_torque: 0.20
184 | max_current: 1
185 | steps_per_revolution: 200
186 |
187 | [motor_constants ldo-42sth60-2004ac]
188 | resistance: 2.1
189 | inductance: 0.0041
190 | holding_torque: 0.85
191 | max_current: 2
192 | steps_per_revolution: 200
193 |
194 | [motor_constants ldo-42sth60-2004mah]
195 | resistance: 1.4
196 | inductance: 0.0030
197 | holding_torque: 0.6
198 | max_current: 2
199 | steps_per_revolution: 400
200 |
201 | [motor_constants ldo-42sth25-1404ac]
202 | # Microswiss NG extruder
203 | resistance: 2.4
204 | inductance: 0.0055
205 | holding_torque: 0.23
206 | max_current: 1.4
207 | steps_per_revolution: 200
208 |
209 |
210 | ### Moons Motors ###
211 |
212 | ## NEMA 14
213 |
214 | [motor_constants moons-ms14hs5p4200]
215 | resistance: 1.34
216 | inductance: 0.0021
217 | holding_torque: 0.4
218 | max_current: 2.0
219 | steps_per_revolution: 200
220 |
221 | [motor_constants moons-ms14hs5p4150]
222 | resistance: 2.2
223 | inductance: 0.0036
224 | holding_torque: 0.4
225 | max_current: 1.5
226 | steps_per_revolution: 200
227 |
228 | # Many vendors call this motor cse14ra1l410a
229 | # but the h in the part number is correct.
230 | [motor_constants moons-cse14hra1l410a]
231 | resistance: 1.9
232 | inductance: 0.00141
233 | holding_torque: 0.1
234 | max_current: 1.0
235 | steps_per_revolution: 200
236 |
237 | ## NEMA 17
238 |
239 | [motor_constants moons-ms17hdbp4200]
240 | resistance: 1.49
241 | inductance: 0.0038
242 | holding_torque: 0.83
243 | max_current: 2.0
244 | steps_per_revolution: 200
245 |
246 | [motor_constants moons-ms17hd6p4200]
247 | resistance: 1.3
248 | inductance: 0.0029
249 | holding_torque: 0.63
250 | max_current: 2.0
251 | steps_per_revolution: 200
252 |
253 | [motor_constants moons-ms17hd6p4150]
254 | resistance: 2.2
255 | inductance: 0.0049
256 | holding_torque: 0.62
257 | max_current: 1.5
258 | steps_per_revolution: 200
259 |
260 | [motor_constants moons-le174s-t0804-300-ar3-s-150]
261 | resistance: 1.75
262 | inductance: 0.0028
263 | holding_torque: 0.29
264 | max_current: 1.5
265 | steps_per_revolution: 200
266 |
267 | [motor_constants moons-le174s-t0808-200-ar3-s-065]
268 | resistance: 8.7
269 | inductance: 0.0152
270 | holding_torque: 0.054
271 | max_current: 0.65
272 | steps_per_revolution: 200
273 |
274 | [motor_constants moons-ms17hd6p420I-04]
275 | resistance: 1.3
276 | inductance: 0.0027
277 | holding_torque: 0.67
278 | max_current: 2.0
279 | steps_per_revolution: 200
280 |
281 | [motor_constants moons-ms17hd6p420I-05]
282 | resistance: 1.3
283 | inductance: 0.0027
284 | holding_torque: 0.67
285 | max_current: 2.0
286 | steps_per_revolution: 200
287 |
288 | # Comes stock on many older Creality printers, e.g: Ender 3, V2, Max
289 | [motor_constants moons-c17hd2024n-01n]
290 | resistance: 4.1
291 | inductance: 0.0085
292 | holding_torque: 0.39
293 | max_current: 1.0
294 | steps_per_revolution: 200
295 |
296 | ## NEMA 23
297 |
298 | [motor_constants moons-ml23hs8l4550-20]
299 | resistance: 0.28
300 | inductance: 0.00103
301 | holding_torque: 1.5
302 | max_current: 5.5
303 | steps_per_revolution: 200
304 |
305 | [motor_constants moons-ml23hs0l4350-000]
306 | resistance: 0.56
307 | inductance: 0.0013
308 | holding_torque: 0.82
309 | max_current: 3.5
310 | steps_per_revolution: 200
311 |
312 | ### OMC Stepperonline ###
313 |
314 | ## NEMA 14
315 |
316 | [motor_constants omc-14ms20-1504s]
317 | resistance: 2.80
318 | inductance: 0.0038
319 | holding_torque: 0.40
320 | max_current: 1.50
321 | steps_per_revolution: 200
322 |
323 | [motor_constants omc-14hs20-1504s]
324 | resistance: 2.8
325 | inductance: 0.0038
326 | holding_torque: 0.4
327 | max_current: 1.5
328 | steps_per_revolution: 200
329 |
330 | [motor_constants omc-14hr07-1004vrn]
331 | resistance: 3.9
332 | inductance: 0.002
333 | holding_torque: 0.09
334 | max_current: 1.00
335 | steps_per_revolution: 400
336 |
337 | # Adding the two stepper motors for the original V0 release:
338 | # OMC 14HS17-0504S (A/B/Z)
339 | # OMC 14HS10-0404S (Clockwork)
340 |
341 | [motor_constants omc-14hs17-0504s]
342 | resistance: 15.00
343 | inductance: 0.026
344 | holding_torque: 0.23
345 | max_current: 0.50
346 | steps_per_revolution: 200
347 |
348 | [motor_constants omc-14hs10-0404s]
349 | resistance: 30.00
350 | inductance: 0.030
351 | holding_torque: 0.140
352 | max_current: 0.40
353 | steps_per_revolution: 200
354 |
355 | ## NEMA 17
356 |
357 | [motor_constants omc-17he19-2004s]
358 | resistance: 1.3
359 | inductance: 0.0024
360 | holding_torque: 0.55
361 | max_current: 2.0
362 | steps_per_revolution: 200
363 |
364 | [motor_constants omc-17he15-1504s]
365 | resistance: 2.3
366 | inductance: 0.004
367 | holding_torque: 0.42
368 | max_current: 1.50
369 | steps_per_revolution: 200
370 |
371 |
372 | [motor_constants omc-17hs15-1504s]
373 | resistance: 2.30
374 | inductance: 0.0044
375 | holding_torque: 0.45
376 | max_current: 1.50
377 | steps_per_revolution: 200
378 |
379 | [motor_constants omc-17hm19-1684S]
380 | resistance: 1.65
381 | inductance: 0.0041
382 | holding_torque: 0.44
383 | max_current: 1.68
384 | steps_per_revolution: 400
385 |
386 | [motor_constants omc-17hm19-2004s]
387 | resistance: 1.45
388 | inductance: 0.004
389 | holding_torque: 0.46
390 | max_current: 2.0
391 | steps_per_revolution: 400
392 |
393 | [motor_constants omc-17hs19-2504s-h]
394 | resistance: 1.1
395 | inductance: 0.0016
396 | holding_torque: 0.55
397 | max_current: 2.5
398 | steps_per_revolution: 200
399 |
400 | [motor_constants omc-17hs24-2104s]
401 | resistance: 1.6
402 | inductance: 0.003
403 | holding_torque: 0.65
404 | max_current: 2.1
405 | steps_per_revolution: 200
406 |
407 | [motor_constants omc-17hs19-2004s1]
408 | resistance: 1.4
409 | inductance: 0.003
410 | holding_torque: 0.59
411 | max_current: 2
412 | steps_per_revolution: 200
413 |
414 | [motor_constants omc-17hs08-1004s]
415 | resistance: 3.70
416 | inductance: 0.0045
417 | holding_torque: 0.16
418 | max_current: 1.00
419 | steps_per_revolution: 200
420 |
421 | [motor_constants omc-17me15-1504s]
422 | resistance: 2.0
423 | inductance: 0.0052
424 | holding_torque: 0.30
425 | max_current: 1.50
426 | steps_per_revolution: 400
427 |
428 | ### Trinamic (yes, they also make stepper motors) ###
429 |
430 | [motor_constants tmc-qsh4218-35-10-027]
431 | resistance: 5.30
432 | inductance: 0.0066
433 | holding_torque: 0.27
434 | max_current: 1.00
435 | steps_per_revolution: 200
436 |
437 | [motor_constants tmc-qsh4218-41-10-035]
438 | resistance: 4.50
439 | inductance: 0.0075
440 | holding_torque: 0.35
441 | max_current: 1.00
442 | steps_per_revolution: 200
443 |
444 | [motor_constants tmc-qsh4218-51-10-049]
445 | resistance: 5.00
446 | inductance: 0.008
447 | holding_torque: 0.49
448 | max_current: 1.00
449 | steps_per_revolution: 200
450 |
451 | # Gucci Trinamic stepper motor, the one LDO used as model for their 2.8A one
452 | [motor_constants tmc-qsh4218-47-28-040]
453 | resistance: 0.50
454 | inductance: 0.0006
455 | holding_torque: 0.40
456 | max_current: 2.80
457 | steps_per_revolution: 200
458 |
459 | #Fysetc motors
460 | #NEMA 14
461 | [motor_constants fysetc-g36hsy4405-6d-80a]
462 | resistance: 2.4
463 | inductance: 0.0017
464 | holding_torque: 0.11
465 | max_current: 1.0
466 | steps_per_revolution: 200
467 |
468 | [motor_constants fysetc-g36hsy4407-6d-1200a]
469 | resistance: 13
470 | inductance: 0.01
471 | holding_torque: 0.12
472 | max_current: 0.5
473 | steps_per_revolution: 200
474 |
475 | [motor_constants fysetc-g36hsy4405-6d-30]
476 | resistance: 2.4
477 | inductance: 0.0017
478 | holding_torque: 0.11
479 | max_current: 1.0
480 | steps_per_revolution: 200
481 |
482 | [motor_constants fysetc-35hsh7402-24b-60a]
483 | resistance: 2.8
484 | inductance: 0.0055
485 | holding_torque: 0.42
486 | max_current: 1.5
487 | steps_per_revolution: 200
488 |
489 | [motor_constants fysetc-35hsh7402-24b-60b]
490 | resistance: 2.8
491 | inductance: 0.0055
492 | holding_torque: 0.42
493 | max_current: 1.5
494 | steps_per_revolution: 200
495 |
496 | [motor_constants fysetc-42hsc1433b-200n8]
497 | resistance: 8
498 | inductance: 0.01
499 | holding_torque: 0.35
500 | max_current: 1
501 | steps_per_revolution: 200
502 |
503 | #NEMA 17
504 | [motor_constants fysetc-42hsc1404b-200n8]
505 | resistance: 29
506 | inductance: 0.0038
507 | holding_torque: 0.32
508 | max_current: 0.4
509 | steps_per_revolution: 200
510 |
511 |
512 | [motor_constants TB-3544]
513 | #Fysetc bom Voron 2.4 steppers
514 | resistance: 1.8
515 | inductance: 0.0038
516 | holding_torque: 0.50
517 | max_current: 1.5
518 | steps_per_revolution: 200
519 |
520 | [motor_constants fysetc-17HS19-2004S-C]
521 | #Fysetc bom Trident A/B steppers
522 | resistance: 1.4
523 | inductance: 0.003
524 | holding_torque: 0.59
525 | max_current: 2.0
526 | steps_per_revolution: 200
527 |
528 | [motor_constants fysetc-42HC40-204A-300N84]
529 | #Fysetc bom Trident Z integrated leadscrew steppers
530 | resistance: 1.1
531 | inductance: 0.0026
532 | holding_torque: 0.45
533 | max_current: 2.0
534 | steps_per_revolution: 200
535 |
536 | [motor_constants fysetc-17D2201Z-22B-500]
537 | #Fysetc Prusa Clone
538 | resistance: 6.5
539 | inductance: 0.013
540 | holding_torque: 0.49
541 | max_current: 1.0
542 | steps_per_revolution: 200
543 |
544 | ### Other manufacturers
545 |
546 | [motor_constants dfh-14mcrn-1848]
547 | #DFH Micron/Saladfork Kit NEMA14 stepper
548 | resistance: 2.8
549 | inductance: 0.0055
550 | holding_torque: 0.42
551 | max_current: 1.5
552 | steps_per_revolution: 200
553 |
554 | [motor_constants dfh-14mcrn-1815]
555 | #DFH Micron/Saladfork Kit NEMA14 pancake stepper
556 | resistance: 13.0
557 | inductance: 0.0010
558 | holding_torque: 0.12
559 | max_current: 0.5
560 | steps_per_revolution: 200
561 |
562 | [motor_constants zyltech-17hd48002h-22b]
563 | #Zyltech 84 ozin Basic steppers https://www.zyltech.com/nema-17-stepper-motor-1-7-a-0-59-nm-84-ozin-1-3-or-5-pack/
564 | resistance: 1.8
565 | inductance: 0.0038
566 | holding_torque: 0.59
567 | max_current: 1.7
568 | steps_per_revolution: 200
569 |
570 | [motor_constants siboor-14sth20-1004a]
571 | #Siboor BOM Voron Trident AWD
572 | resistance: 1.7
573 | inductance: 0.0015
574 | holding_torque: 0.12
575 | max_current: 1.88
576 | steps_per_revolution: 200
577 |
578 | [motor_constants siboor-35sth52-1204a]
579 | #Siboor BOM Voron 0.2 steppers
580 | resistance: 2.3
581 | inductance: 0.0035
582 | holding_torque: 0.4
583 | max_current: 1.2
584 | steps_per_revolution: 200
585 |
586 | [motor_constants siboor-35hbx904-22b]
587 | #Siboor BOM Voron 0.1 Young edition steppers
588 | resistance: 2.50
589 | inductance: 0.0043
590 | holding_torque: 0.40
591 | max_current: 1.50
592 | steps_per_revolution: 200
593 |
594 | [motor_constants siboor-42sth26-0804a]
595 | #Siboor BOM Voron 0.2 Z integrated leadscrew stepper
596 | resistance: 5.5
597 | inductance: 0.0066
598 | holding_torque: 0.26
599 | max_current: 1.0
600 | steps_per_revolution: 200
601 |
602 | [motor_constants siboor-42sth40-2004a]
603 | resistance: 1.1
604 | inductance: 0.0026
605 | holding_torque: 0.45
606 | max_current: 2.0
607 | steps_per_revolution: 200
608 |
609 | [motor_constants siboor-42sth48-2504(s45)]
610 | #Siboor BOM Voron Trident AWD
611 | resistance: 0.9
612 | inductance: 0.0016
613 | holding_torque: 0.6
614 | max_current: 2.5
615 | steps_per_revolution: 200
616 |
617 | [motor_constants siboor-14sth20-1004a]
618 | #Siboor NEMA14 pancake stepper motor
619 | resistance: 1.70
620 | inductance: 0.0015
621 | holding_torque: 0.12
622 | max_current: 1.88
623 | steps_per_revolution: 200
624 |
625 | [motor_constants siboor-42sth28-0804a]
626 | #Siboor BOM Voron 0.2 Z integrated leadscrew stepper (metal version)
627 | resistance: 5.5
628 | inductance: 0.0066
629 | holding_torque: 0.26
630 | max_current: 1.0
631 | steps_per_revolution: 200
632 |
633 | [motor_constants wantai-42byghw811]
634 | # Wantai Stepper Motor 42BYGHW811 and 42BYGHW811-X11
635 | resistance: 1.25
636 | inductance: 0.0018
637 | holding_torque: 0.48
638 | max_current: 2.50
639 | steps_per_revolution: 200
640 |
641 | [motor_constants ldo-42sth60-3004ac]
642 | resistance: 1.1
643 | inductance: 0.0023
644 | holding_torque: 0.9
645 | max_current: 3.0
646 | steps_per_revolution: 200
647 |
648 | [motor_constants ldo-42sth60-3004mac]
649 | resistance: 1.1
650 | inductance: 0.0035
651 | holding_torque: 0.8
652 | max_current: 3.0
653 | steps_per_revolution: 400
654 | # QIDI motors
655 |
656 | [motor_constants qidi-BJ42D29-28V07]
657 | # used for X/Y-axis on QIDI X MAX 3
658 | resistance: 1.4
659 | inductance: 0.0026
660 | holding_torque: 0.41
661 | max_current: 1.5
662 | steps_per_revolution: 200
663 |
664 | [motor_constants qidi-BJ42D29-22V08]
665 | # used for Z-Axis on QIDI X MAX 3
666 | resistance: 4.7
667 | inductance: 0.011
668 | holding_torque: 0.6
669 | max_current: 1.2
670 | steps_per_revolution: 200
671 |
672 | [motor_constants qidi-BJY36D12-04V13]
673 | # used for extruder on QIDI X MAX 3
674 | resistance: 2.0
675 | inductance: 0.0012
676 | holding_torque: 0.09
677 | max_current: 1.0
678 | steps_per_revolution: 200
679 |
680 | # Creality motors
681 |
682 | [motor_constants creality-42-34]
683 | resistance: 6.0
684 | inductance: 0.006
685 | holding_torque: 0.4
686 | max_current: 1.0
687 | steps_per_revolution: 200
688 |
689 | [motor_constants creality-42-40]
690 | resistance: 3.6
691 | inductance: 0.008
692 | holding_torque: 0.48
693 | max_current: 1.0
694 | steps_per_revolution: 200
695 |
696 | [motor_constants creality-42-48]
697 | #BJ42D29-16V03 https://www.kelimotorgroup.com/shaded-pole-motor/atm-hb-bj35d-stepper-motor.html
698 | resistance: 5
699 | inductance: 0.011
700 | holding_torque: 0.57
701 | max_current: 1.0
702 | steps_per_revolution: 200
703 |
704 | [motor_constants creality-42-60]
705 | #Creality Ender 7 (X,Y) - RB Step Motor 17HDC8033-32B - https://14.23.50.34/en/biaozhunshihunheshibujindianji/41
706 | resistance: 1.2
707 | inductance: 0.0034
708 | holding_torque: 0.76
709 | max_current: 2.00
710 | steps_per_revolution: 200
711 |
712 | [motor_constants BJ42D09-20V02]
713 | #Creality Sprite Pro https://user-images.githubusercontent.com/862951/235050029-79124b76-81d3-4f77-9501-6404f7c38336.png
714 | resistance: 1.75
715 | inductance: 0.003
716 | holding_torque: 0.15
717 | max_current: 0.84
718 | steps_per_revolution: 200
719 |
720 | [motor_constants bondtech-42H025H-0704A-005]
721 | #Bondtech LGX https://www.bondtech.se/downloads/TDS/Bondtech-LGX-Motor-42H025H-0704-002.pdf
722 | resistance: 4.4
723 | inductance: 0.0055
724 | holding_torque: 0.16
725 | max_current: 0.7
726 | steps_per_revolution: 200
727 |
728 | [motor_constants orientalmotor-PKP245D23A]
729 | #Oriental Motor PKP245D23A https://catalog.orientalmotor.com/item/all-categories-legacy-products/legacy-pkp-series-2-phase-bipolar-stepper-motors/pkp245d23a
730 | resistance: 1.12
731 | inductance: 0.0029
732 | holding_torque: 0.58
733 | max_current: 2.3
734 | steps_per_revolution: 200
735 |
736 | [motor_constants orientalmotor-PKP245D15A]
737 | #Oriental Motor PKP245D15A https://catalog.orientalmotor.com/item/all-categories-legacy-products/legacy-pkp-series-2-phase-bipolar-stepper-motors/pkp245d15a
738 | resistance: 2.4
739 | inductance: 0.0066
740 | holding_torque: 0.58
741 | max_current: 1.5
742 | steps_per_revolution: 200
743 |
744 | [motor_constants orientalmotor-PKP235D23A]
745 | #Oriental Motor PKP235D23A https://catalog.orientalmotor.com/item/2-phase-bipolar-stepper-motors/35mm-pkp-series-2-phase-bipolar-stepper-motors/pkp235d23a-l
746 | resistance: 0.97
747 | inductance: 0.0012
748 | holding_torque: 0.37
749 | max_current: 2.3
750 | steps_per_revolution: 200
751 |
752 | [motor_constants orientalmotor-PKP235D15A]
753 | #Oriental Motor PKP235D15A https://catalog.orientalmotor.com/item/2-phase-bipolar-stepper-motors/35mm-pkp-series-2-phase-bipolar-stepper-motors/pkp235d15a-l
754 | resistance: 2.4
755 | inductance: 0.0026
756 | holding_torque: 0.37
757 | max_current: 1.5
758 | steps_per_revolution: 200
759 |
760 | [motor_constants flsun-v400-42]
761 | #FLSUN 42BYGH718-B27HQT (V400) http://m.wantmotor.com/hybrid-stepper-motor/2-phases-hybrid-stepper-motor/42bygh-stepper-motor.html
762 | resistance: 18.00
763 | inductance: 0.023
764 | holding_torque: 0.284
765 | max_current: 0.5
766 | steps_per_revolution: 200
767 |
768 | [motor_constants flsun-v400-36]
769 | #FLSUN 36BYG1204-M-8QTGW https://s.click.aliexpress.com/e/_mq0CHVA
770 | resistance: 13.00
771 | inductance: 0.01
772 | holding_torque: 0.12
773 | max_current: 0.5
774 | steps_per_revolution: 200
775 |
776 | [motor_constants honeybadger-42hs48-25044a]
777 | #HoneyBadger by Fabreeko 42HS48-25044A https://www.fabreeko.com/collections/honeybadger/products/zero-g-ab-motors-by-honeybadger?variant=43510563176703
778 | resistance: 1.6
779 | inductance: 0.0018
780 | holding_torque: 0.49
781 | max_current: 2.5
782 | steps_per_revolution: 200
783 |
784 | # Motech motors
785 |
786 | [motor_constants motech-mt-1701hsm140ae]
787 | #E3D Slimline Motor
788 | resistance: 1.9
789 | inductance: 0.0020
790 | holding_torque: 0.127
791 | max_current: 1.4
792 | steps_per_revolution: 400
793 |
794 | [motor_constants motech-mt-1702e133g6-365e]
795 | #E3D Leadscrew Motor
796 | resistance: 2.1
797 | inductance: 0.0025
798 | holding_torque: 0.314
799 | max_current: 1.33
800 | steps_per_revolution: 200
801 |
802 | [motor_constants motech-mt-1703hs120ag518e]
803 | #E3D Geared Motor
804 | resistance: 3.0
805 | inductance: 0.0060
806 | holding_torque: 0.431
807 | max_current: 1.2
808 | steps_per_revolution: 200
809 |
810 | [motor_constants motech-mt-1703hsm168re]
811 | #E3D Compact but Powerful Motor
812 | resistance: 1.65
813 | inductance: 0.0036
814 | holding_torque: 0.343
815 | max_current: 1.68
816 | steps_per_revolution: 400
817 |
818 | [motor_constants motech-mt-1704hsm168re]
819 | #E3D High Torque Motor
820 | resistance: 1.65
821 | inductance: 0.0028
822 | holding_torque: 0.431
823 | max_current: 1.68
824 | steps_per_revolution: 400
825 |
826 | [motor_constants motech-mt-1705hs200ae]
827 | #E3D Super Whopper Motor
828 | resistance: 2.0
829 | inductance: 0.0033
830 | holding_torque: 0.804
831 | max_current: 2.0
832 | steps_per_revolution: 200
833 |
834 | [motor_constants BTT-17H4401S]
835 | #BTT 17H4401S lead screw motor
836 | resistance: 2.40
837 | inductance: 0.0037
838 | holding_torque: 0.42
839 | max_current: 1.50
840 | steps_per_revolution: 200
841 |
842 | [motor_constants ok42sth34-044e-200g]
843 | resistance: 30.0
844 | inductance: 0.037
845 | holding_torque: 0.28
846 | max_current: 0.4
847 | steps_per_revolution: 200
848 |
849 | [motor_constants jinkong-jk42hs34-1334]
850 | #MPSM X&Y
851 | resistance: 2.10
852 | inductance: 0.0025
853 | holding_torque: 0.2549729
854 | max_current: 1.33
855 | steps_per_revolution: 200
856 |
857 | [motor_constants monoprice-42hb34f08ab]
858 | #MPSM Extruder
859 | resistance: 2.20
860 | inductance: 0.0025
861 | holding_torque: 0.22
862 | max_current: 1.33
863 | steps_per_revolution: 200
864 |
865 | [motor_constants monoprice-17hs4401s]
866 | #MPSM Z
867 | resistance: 1.50
868 | inductance: 0.0028
869 | holding_torque: 0.40
870 | max_current: 1.70
871 | steps_per_revolution: 200
872 |
873 | [motor_constants oukeda-ok42hc40-204a306n84]
874 | #formbot kit trident Z
875 | resistance: 1.10
876 | inductance: 0.0026
877 | holding_torque: 0.45
878 | max_current: 2.00
879 | steps_per_revolution: 200
880 |
881 | [motor_constants oukeda-17hs4401]
882 | resistance: 1.5
883 | inductance: 0.0028
884 | holding_torque: 0.40
885 | max_current: 1.7
886 | steps_per_revolution: 200
887 |
888 | [motor_constants trianglelab-tl-42bygh20]
889 | # ERCF v1.1 kit motor (NEMA 17)
890 | resistance: 6.8
891 | inductance: 0.0071
892 | holding_torque: 0.21
893 | max_current: 1.0
894 | steps_per_revolution: 200
895 |
896 | [motor_constants bj42d41-14v06]
897 | #Creality K1&Max A/B motors
898 | resistance: 1.1
899 | inductance: 0.0028
900 | holding_torque: 0.65
901 | max_current: 2
902 | steps_per_revolution: 200
903 |
904 | [motor_constants bjd42d22-53v02]
905 | #Flashforge adventurer 5m/pro motors
906 | resistance: 2.10
907 | inductance: 0.0046
908 | holding_torque: 0.40
909 | max_current: 1.50
910 | steps_per_revolution: 200
911 |
912 | [motor_constants geetech-d42hs3418-24b22]
913 | #ShenZhen Geetech Technology Nema 17 extruder motor, e.g. A20M
914 | resistance: 1.65
915 | inductance: 0.0032
916 | holding_torque: 0.4
917 | max_current: 1.68
918 | steps_per_revolution: 200
919 |
920 | [motor_constants usongshine-17hs4023]
921 | #Generic Usongshine Nema 17 Pancake Stepper
922 | resistance: 4
923 | inductance: 0.0032
924 | holding_torque: 0.14
925 | max_current: 0.7
926 | steps_per_revolution: 200
927 |
928 | [motor_constants mercury-42byg011-25]
929 | #Generic Mercuy Stepper Motor
930 | resistance: 3.4
931 | inductance: 0.046
932 | holding_torque: 0.23
933 | max_current: 0.33
934 | steps_per_revolution: 200
935 |
936 | [motor_constants cloudray-17CS07A-180E]
937 | #Cloudray motors https://www.aliexpress.com/item/4000934544704.html?spm=a2g0o.detail.1000023.8.43b1FDQEFDQE3d
938 | resistance: 1.94
939 | inductance: 0.00496
940 | holding_torque: 0.71
941 | max_current: 1.8
942 | steps_per_revolution: 200
943 |
944 | [motor_constants act-17hs4417]
945 | resistance: 1.5
946 | inductance: 0.0028
947 | holding_torque: 0.40
948 | max_current: 1.7
949 | steps_per_revolution: 200
950 |
951 | [motor_constants jkong-jk42hS40-1704]
952 | resistance: 1.65
953 | inductance: 0.0032
954 | holding_torque: 0.4
955 | max_current: 1.7
956 | steps_per_revolution: 200
957 |
958 | [motor_constants biqu-35BYGF0713-A-10HZT]
959 | resistance: 2.3
960 | inductance: 0.0020
961 | holding_torque: 0.11
962 | max_current: 1.5
963 | steps_per_revolution: 200
964 |
--------------------------------------------------------------------------------