Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rikor
Relime
Commits
585f099a
Commit
585f099a
authored
1 year ago
by
Михеев Никита Глебович
Browse files
Options
Download
Email Patches
Plain Diff
Dynamic step resolution added.
parent
e180d996
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
actuator.py
+8
-6
actuator.py
with
8 additions
and
6 deletions
+8
-6
actuator.py
View file @
585f099a
...
...
@@ -10,12 +10,6 @@ class Actuator():
self
.
_device_id
=
None
self
.
_unit_converter
=
None
# one rotation = 200 steps = 360 degrees
step_to_degr_conversion_coeff
=
360.0
/
200
self
.
_unit_converter
=
ximc
.
calibration_t
()
self
.
_unit_converter
.
MicrostepMode
=
ximc
.
MicrostepMode
.
MICROSTEP_MODE_FRAC_256
self
.
_unit_converter
.
A
=
step_to_degr_conversion_coeff
def
connect
(
self
):
self
.
_device_id
=
ximc
.
lib
.
open_device
(
self
.
_device_uri
.
encode
())
...
...
@@ -24,6 +18,14 @@ class Actuator():
else
:
raise
RuntimeError
(
"Failed to open device with URI"
,
self
.
_device_uri
)
# One turn = 200 steps = 360 degrees
engine_settings
=
ximc
.
engine_settings_t
()
ximc
.
lib
.
get_engine_settings
(
self
.
_device_id
,
byref
(
engine_settings
))
step_to_degr_conversion_coeff
=
360.0
/
engine_settings
.
StepsPerRev
self
.
_unit_converter
=
ximc
.
calibration_t
()
self
.
_unit_converter
.
MicrostepMode
=
ximc
.
MicrostepMode
.
MICROSTEP_MODE_FRAC_256
self
.
_unit_converter
.
A
=
step_to_degr_conversion_coeff
def
disconnect
(
self
):
ximc
.
lib
.
close_device
(
byref
(
c_int
(
self
.
_device_id
)))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help