Updated the ACM1219 driver
This commit is contained in:
parent
92c53ad3ba
commit
0a5de1ebc2
@ -33,7 +33,7 @@ Mod('V2',
|
|||||||
Mod('io2',
|
Mod('io2',
|
||||||
'frappy_psi.ACM1219.ACM1219IO',
|
'frappy_psi.ACM1219.ACM1219IO',
|
||||||
'communication',
|
'communication',
|
||||||
uri='serial:///dev/tty.usbserial-A700fmAI?baudrate=9600+bytesize=8+parity=none+stopbits=1')
|
uri='serial:///dev/tty.usbserial-A904TGR7?baudrate=9600+bytesize=8+parity=none+stopbits=1')
|
||||||
Mod('C1C2',
|
Mod('C1C2',
|
||||||
'frappy_psi.ACM1219.BothChannels',
|
'frappy_psi.ACM1219.BothChannels',
|
||||||
'Capacitance channels 1 and 2',
|
'Capacitance channels 1 and 2',
|
||||||
@ -58,6 +58,24 @@ Mod('F',
|
|||||||
Cp=0.0755,
|
Cp=0.0755,
|
||||||
f0_curve={'a':38.9,'b':-0.0147,'c':-0.000346,'d':8.96e-7,'e':-1.58e-9},
|
f0_curve={'a':38.9,'b':-0.0147,'c':-0.000346,'d':8.96e-7,'e':-1.58e-9},
|
||||||
temp='T')
|
temp='T')
|
||||||
|
Mod('stress',
|
||||||
|
'frappy_psi.ACM1219.Stress',
|
||||||
|
'Sample stress from force',
|
||||||
|
force='F',
|
||||||
|
area=0.1,
|
||||||
|
)
|
||||||
|
Mod('strain',
|
||||||
|
'frappy_psi.ACM1219.Strain',
|
||||||
|
'Sample strain from force',
|
||||||
|
displacement='d',
|
||||||
|
L=3,
|
||||||
|
)
|
||||||
|
Mod('YM',
|
||||||
|
'frappy_psi.ACM1219.YoungsModulus',
|
||||||
|
'Sample youngs modulus from stress and strain',
|
||||||
|
stress='stress',
|
||||||
|
strain='strain',
|
||||||
|
)
|
||||||
|
|
||||||
Mod('T',
|
Mod('T',
|
||||||
'frappy_psi.dummy.Temp',
|
'frappy_psi.dummy.Temp',
|
||||||
|
@ -23,7 +23,7 @@ from frappy.core import Readable, Parameter, FloatRange, HasIO, StringIO, Proper
|
|||||||
|
|
||||||
class ACM1219IO(StringIO):
|
class ACM1219IO(StringIO):
|
||||||
"""communication with ACM1219"""
|
"""communication with ACM1219"""
|
||||||
end_of_line = '\n'
|
end_of_line = ('\r\n', '\r') # ('\n', '\r') ('\r\n', '\r')
|
||||||
wait_before = 0.05
|
wait_before = 0.05
|
||||||
identification = [('*IDN?', r'.*')]
|
identification = [('*IDN?', r'.*')]
|
||||||
|
|
||||||
@ -152,4 +152,41 @@ class Force(Readable):
|
|||||||
return force
|
return force
|
||||||
|
|
||||||
|
|
||||||
|
class Stress(Readable):
|
||||||
|
|
||||||
|
# attached classes for displacement
|
||||||
|
force = Attached()
|
||||||
|
|
||||||
|
# modifying a property of inherited parameters (unit is propagated to the FloatRange datatype)
|
||||||
|
value = Parameter('stress', FloatRange(None, None, unit='GPa'), readonly=True)
|
||||||
|
area = Parameter('cross sectional area of sample in mm^2', FloatRange(None, None, unit='mm^2'), readonly=False)
|
||||||
|
|
||||||
|
def read_value(self):
|
||||||
|
return self.force.value / self.area / 1000
|
||||||
|
|
||||||
|
|
||||||
|
class Strain(Readable):
|
||||||
|
|
||||||
|
# attached classes for displacement
|
||||||
|
displacement = Attached()
|
||||||
|
|
||||||
|
# modifying a property of inherited parameters (unit is propagated to the FloatRange datatype)
|
||||||
|
value = Parameter('strain', FloatRange(None, None, unit='m/m'), readonly=True)
|
||||||
|
L = Parameter('length of sample in mm', FloatRange(None, None, unit='mm'), readonly=False)
|
||||||
|
|
||||||
|
def read_value(self):
|
||||||
|
return self.displacement.value / (1000*self.L)
|
||||||
|
|
||||||
|
|
||||||
|
class YoungsModulus(Readable):
|
||||||
|
|
||||||
|
# attached classes for displacement
|
||||||
|
stress = Attached()
|
||||||
|
strain = Attached()
|
||||||
|
|
||||||
|
# modifying a property of inherited parameters (unit is propagated to the FloatRange datatype)
|
||||||
|
value = Parameter('Young\'s modulus', FloatRange(None, None, unit='GPa'), readonly=True)
|
||||||
|
|
||||||
|
def read_value(self):
|
||||||
|
return self.stress.value / self.strain.value
|
||||||
|
|
@ -29,3 +29,6 @@ class Temp(Writable):
|
|||||||
|
|
||||||
def write_target(self, target):
|
def write_target(self, target):
|
||||||
self.value = target
|
self.value = target
|
||||||
|
|
||||||
|
def read_value(self):
|
||||||
|
return 0
|
Loading…
x
Reference in New Issue
Block a user