Commit 859f3cf7 authored by Yoann Sallaz Damaz's avatar Yoann Sallaz Damaz
Browse files

correct galil and add detcover controler

parent 0e1ae2d1
Pipeline #52754 failed with stages
from bliss.controllers.actuator import Actuator
class Actuator_multiwago(Actuator):
def __init__(self, name, config):
Actuator.__init__(self, name, config)
self.controller_state = config["controller_state"]
def _is_in(self):
""" Check if the actuator is in position IN
Returns:
(bool): True if IN. False if OUT, None if no check possible.
"""
if self.key_in:
return self.controller_state.get(self.key_in)
if self.key_out:
return not self.controller_state.get(self.key_out)
if self.key_cmd:
return self.controller.get(self.key_cmd)
def _is_out(self):
""" Check if the actuator is in position OUT
Returns:
(bool): True if OUT. False if IN, None if no check possible.
"""
if self.key_out:
return self.controller_state.get(self.key_out)
if self.key_in:
return not self.controller_state.get(self.key_in)
if self.key_cmd:
return not self.controller.get(self.key_cmd)
\ No newline at end of file
from bliss.controllers.motors.galildmc213 import *
class Galil(GalilDMC213):
def __init__(self, *args, **kwargs):
GalilDMC213.__init__(self, *args, **kwargs)
def initialize_hardware(self):
# perform hw reset
# YO do NOT reset controller each time you launch BLISS
#self._galil_query("RS")
# set default sample time
self._galil_query("TM 1000")
# set vector time constant (motion smoothing)
self._galil_query("VT 1.0")
# configure switches and latch polarity
self._galil_query("CN %d,%d,%d" % (LOW_LEVEL, HIGH_LEVEL, HIGH_LEVEL))
def initialize_hardware_axis(self, axis):
if self._galil_query("TSA") != "13" :
super().initialize_hardware_axis(axis)
\ No newline at end of file
......@@ -487,6 +487,7 @@ class grob_FIP(object):
def get_state(self):
self.read_all_memory()
value=-1
if self.SIMU:
state = self.state_grob
else:
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bliss.controllers.motor import CalcController
from bliss.common.utils import object_method
from bliss.common import *
import math
from bliss.config.static import get_config
from bliss import global_map
class pseudo_gonio(CalcController):
......@@ -22,13 +19,13 @@ class pseudo_gonio(CalcController):
self.omega = self._tagged.get("omega", [None])[0]
self.x = self._tagged.get("x", [None])[0]
self.z = self._tagged.get("z", [None])[0]
self.omega = self._tagged.get("omega", [None])[0]
axis.no_offset = True
def calc_from_real(self, reals_dict):
self._pos_dict = reals_dict # used to store ALL motors positions
pseudos_dict = dict()
omegarad = -math.radians(self.omega.position)
omegarad = -math.radians(reals_dict["omega"])
#print("omega=",reals_dict["omega"], self.omega.position)
horizontalpos = reals_dict["x"] * math.cos(omegarad) + reals_dict["z"] * math.sin(omegarad)
verticalpos = -reals_dict["x"] * math.sin(omegarad) + reals_dict["z"] * math.cos(omegarad)
pseudos_dict.update({"sample_vertical": (verticalpos)})
......@@ -36,12 +33,12 @@ class pseudo_gonio(CalcController):
self._pos_dict.update(pseudos_dict)
return pseudos_dict
def calc_to_real(self, pseudos_dict):
def calc_to_real(self, pseudos_dict2):
reals_dict = dict()
omegarad = -math.radians(self.omega.position)
verticalpos = pseudos_dict["sample_vertical"]
horizontalpos = pseudos_dict["sample_horizontal"]
verticalpos = pseudos_dict2["sample_vertical"]
horizontalpos = pseudos_dict2["sample_horizontal"]
#verticalpos = self._pos_dict["sample_vertical"]
#horizontalpos = self._pos_dict["sample_horizontal"]
......
from bliss.controllers.wago.wago import Wago as Wago_bliss
from bliss.controllers.wago.wago import MODULES_CONFIG
MODULES_CONFIG.update({"750-881": [0, 0, 0, 0, 2, 2, "cpu", "Wago PLC Ethernet/IP"]})
MODULES_CONFIG.update({"750-362": [0, 0, 0, 0, 2, 2, "cpu", "Wago PLC Ethernet/IP"]})
class Wago(Wago_bliss):
def __init__(self, name, config_tree):
Wago_bliss.__init__(self, name, config_tree)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment