Axes¶
-
class
pylayers.measures.parker.smparker.
Axes
(_id=1, name='x', ser='emulated', scale=1280000, typ='t')[source]¶ Bases:
pylayers.util.project.PyLayers
This class allows the control of axes
svar : system variables dstatus : status bits dusrflt : user faults ddrvflt : drive faults
Attributes Summary
Methods Summary
acceleration
([value, cmd])set/get acceleration
add_profile
(**kwargs)add a new profile to lprofile
close
()com
([command, verbose])send command to serial port
del_profile
([index])delete profile
fromfile
(cmdfile[, dirfile])getvar
([lvar])allows get state of variables
go
()move axes in translation or rotation
home
([cmd])enables back home for each axe.
info
()gives informations about system variables of PARKER
limits
([cmd])give state and set up limits
mvpro
(id_pro)move according to specified profile
parsinfo
([cmd])allows get parsing informations.
reg
([typ])read boolean quantities in registers : ST, UF, DF
reset
()reset axis
set_profile
(num)show
()test bit in status ST
step
([value, cmd])set/get distance
velocity
([value, cmd])set/get velocity
Attributes Documentation
-
ddrvflt
= {1: 'Composite Fault', 2: 'Output stage over curent', 3: 'Supply rail failure', 4: 'Ambient over temperature', 5: 'Drive over temperature', 6: 'Configuration error', 7: 'Motor high voltage rail failure', 8: 'Output fault'}¶
-
dstatus
= {1: 'command processing paused', 2: 'looping', 3: 'wait for trigger', 4: 'running program', 5: 'going home', 6: 'waiting for delay timeout', 7: 'registration in progress', 9: 'motor energised', 11: 'event trigger active until trigger inputs are reset', 12: 'input in LSEL not matching label', 13: '-ve : Fin de course atteint', 14: '+ve Fin de course atteint', 19: 'moving', 20: 'stationnary', 21: 'no registration signal seen in registration window', 22: 'cannot stop within the defined regisration distance'}¶
-
dusrflt
= {1: 'value is out of range', 2: 'incorrect command syntax', 3: 'last label already in use', 4: 'label of this name not defined', 5: 'missing Z pulse when homing', 6: 'homing failed no signal detected', 7: 'home signal too narrow', 8: 'drive de-energised', 9: 'cannot related end statement to a label', 10: 'program memory buffer full', 11: 'no more motion profiles avaible', 12: 'no more sequence labels avaible', 13: 'end of travel limit hit', 14: 'still moving', 15: 'deceleration error', 16: 'transmit buffer overflow', 17: 'user program nesting overflow', 18: 'cannot use an undefined profile', 19: 'drive not ready', 22: 'save error', 23: 'command not supported by this product'}¶
-
dvar
= {'BU': 'Buffer usage', 'CQ': 'Command queuing', 'DF': 'Drive fault status', 'EI': 'Encoder input', 'EO': 'Encoder signal output', 'EP': 'Encoder position', 'ER': 'Feedback encoder resolution', 'EX': 'Coms response style & echo control', 'IN': 'Inputs', 'IP': 'In position flag', 'IT': 'In position time', 'MC': 'Motor current', 'MR': 'Motor resolution', 'MS': 'Motor standby current', 'MV': 'Moving', 'PA': 'Position absolute', 'PE': 'Position error', 'PI': 'Position incremental', 'RB': 'Ready/Busy flag', 'RM': 'Registration Move', 'RV': 'Revision software', 'SN': 'Serial number', 'ST': 'Status of indexing', 'UF': 'User Program Fault status'}¶
Methods Documentation
-
acceleration
(value=10, cmd='get')[source]¶ set/get acceleration
value : int cmd : string
{set | get}
>>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.velocity(value=10) >>> A.velocity(cmd='get')
-
add_profile
(**kwargs)[source]¶ add a new profile to lprofile
num : profile number aa : aceleration (rps2) ad : deceleration (rps2) dstep : distance (step) v : vmax (rps) vs : vstart (rps) spr : steps per round
-
com
(command='R(SN)', verbose=False)[source]¶ send command to serial port
prefix : str command prefix (command=’R(SN)’) arg : command argument verbose :
>>> # Some suitable commands >>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> st=A.com('ON') #Energized motor >>> st=A.com('LIMITS(1,0,0)') #Disable limit +,limits normally open, mode 0 stop motion and abort prog >>> st=A.com('V15') # Change velocity to 15 >>> st=A.com('AA15') # Change acceleration to 15 >>> st=A.com('AD15') # Change deceleration to 15
-
getvar
(lvar=[])[source]¶ allows get state of variables
lvar : list of variables
>>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.getvar('PA') #Get Position absolute
-
go
()[source]¶ move axes in translation or rotation
var : distance (cm) | degres () vel : velocity (rps) aa : acceleration (rps)
>>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> R = Axes(3,'ang',typ='r',scale=2111.1111,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.step(value=0.1,cmd='set') >>> A.go() # moves over 10cm on axis 1 >>> R.go() # moves over 45 on axis 3
-
home
(cmd='set', **kwargs)[source]¶ - enables back home for each axe.
for more informations see Parker book page 108.
cmd : ‘set’|’go’ mode : int
- 0The indexer positions the motor in the active window of the
switch (default setting)
1 : The motor is positioned to the required edge of the switch + or - 2 : The indexer is set to seek the nearest drive zero phase
position to improve homing repetability
vel : velocity and direction acc : acceleration (and deceleration) edg : this parameter is used to to select the required edge of the
home switch
- typboolean used to select the type of switch to be used for homing
1 : Home switch normally closed 0 : Home switch normally open (default)
- armedboolean
0 : turned OFF 1 : turned ON
-
info
()[source]¶ gives informations about system variables of PARKER
>>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> st = A.info()
-
limits
(cmd='get', **kwargs)[source]¶ give state and set up limits
cmd : ‘get’|’set’ mask : int
0 : Enable limits (default setting) 1 : Disable limit + 2 : Disable limit - 3 : Disable limit + and -
- typboolean
0 : Limits normally closed (default setting) 1 : Limits normally open
- modeboolean
0 : Stop motion and abort the prog when a limit is hit 1 : Stop motion and continue the prog when a limit is hit
LD : sets the required deceleration rate after hitting a limit
-
mvpro
(id_pro)[source]¶ move according to specified profile
axis id_pro
str
>>> from pylayers.measures.parker import smparker >>> A = Axes() >>> A.mvpro(1)
-
reg
(typ='ST')[source]¶ read boolean quantities in registers : ST, UF, DF
ST : Status (default) UF : User Faults DF : Drive Faults
>>> # To check and parse the axis status >>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.reg('ST') >>> #scans over axis 1 by given status
-
reset
()[source]¶ reset axis
>>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.reset() #reset axis X
-
stationnary
()[source]¶ test bit in status ST
>>> # To check and parse the axis status >>> from pylayers.measures.parker import smparker >>> A = Axes(1,'x',typ='t',scale=1280000,ser=Serial(port=gettty(),baudrate=9600,timeout=0.05)) >>> A.reg('ST')
>>> from pylayers.measures.parker import smparker >>> S = smparker.Scanner() >>> S.a[1].stationnary() >>> #scans over axis 1 by given status
-