Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Rousselle
bliss
Commits
b2dee87d
Commit
b2dee87d
authored
Feb 22, 2018
by
Cyril Guilloud
Browse files
tab2 calc controller + schema
tab2 is derived from tabsup
parent
9da5a158
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
bliss/controllers/motors/tab2.py
0 → 100644
View file @
b2dee87d
"""
2 legs table
* 2 legs : back & front
* 2 degrees of freedom : rotation and translation
Configuration parameters:
* <back> : alias for real back leg axis
* <front> : alias for real front leg axis
* <ttrans> : Y-axis translation calculated axis alias
* <trot> : Z-axis rotation calculated axis alias (in degrees)
* <d1> : distance from front leg to sample
* [<d2> : distance from sample to back leg]
See sphinx documentation for a nice schema.
tests ??
"""
from
bliss.controllers.motor
import
CalcController
import
math
class
tabsup
(
CalcController
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
CalcController
.
__init__
(
self
,
*
args
,
**
kwargs
)
self
.
d1
=
self
.
config
.
get
(
"d1"
,
float
)
try
:
self
.
d2
=
self
.
config
.
get
(
"d2"
,
float
)
except
KeyError
:
self
.
d2
=
self
.
d1
def
calc_from_real
(
self
,
positions_dict
):
tyf
=
float
(
positions_dict
[
"front"
])
tyb
=
float
(
positions_dict
[
"back"
])
return
{
"ttrans"
:
(
self
.
d1
*
tyb
+
self
.
d2
*
tyf
)
/
(
self
.
d1
+
self
.
d2
),
"trot"
:
math
.
degrees
(
math
.
atan
((
tyf
-
tyb
)
/
(
self
.
d1
+
self
.
d2
)))}
def
calc_to_real
(
self
,
positions_dict
):
ttrans
=
positions_dict
[
"ttrans"
]
trot
=
positions_dict
[
"trot"
]
return
{
"back"
:
ttrans
+
self
.
d2
*
math
.
tan
(
math
.
radians
(
trot
)),
"front"
:
ttrans
-
self
.
d1
*
math
.
tan
(
math
.
radians
(
trot
))}
doc/tab2.png
0 → 100644
View file @
b2dee87d
125 KB
doc/tab2.svg
0 → 100644
View file @
b2dee87d
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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