diff --git a/.gitignore b/.gitignore index 8c6fb22..b797911 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,14 @@ .tmp_versions/ .idea/ -gather*/ +gather/ *~ *.pyc -usralgo.ko -usralgo.mod.c +src/*/*.ko +src/*/*.mod.c *.o *o.cmd Module.symvers modules.order -python/images/ \ No newline at end of file +python/images/ +python/MXTuning/ +old/ \ No newline at end of file diff --git a/PBInspect3.pbi b/PBInspect3.pbi new file mode 100644 index 0000000..c3ec8b9 --- /dev/null +++ b/PBInspect3.pbi @@ -0,0 +1,153 @@ +[ + [ + "StatusGblListCtrl", + [], + "name=g;caption=global;state=67377148;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=41;floaty=486;floatw=208;floath=377;notebookid=-1;transparent=255" + ], + [ + "MotorListCtrl", + [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16 + ], + "name=p;caption=motor pos;state=67377148;dir=4;layer=0;row=0;pos=1;prop=100000;bestw=200;besth=350;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255" + ], + [ + "WatchListCtrl", + [ + [ + "Motor[1].idCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[1].iqCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[1].ServoOut", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[2].iqCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[2].idCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[2].ServoOut", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[3].iqCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[3].idCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[3].ServoOut", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[4].iqCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[4].idCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[4].ServoOut", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[5].iqCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[5].idCmd", + "lambda v: '%.8g'%float(v)" + ], + [ + "Motor[5].ServoOut", + "lambda v: '%.8g'%float(v)" + ], + [ + "P1000", + null + ], + [ + "P2000", + null + ], + [ + "Gather.Samples", + null + ], + [ + "Gather.MaxLines", + null + ] + ], + "name=w;caption=watch;state=67377148;dir=4;layer=0;row=1;pos=0;prop=100000;bestw=200;besth=369;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=221;floaty=858;floatw=208;floath=377;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 1 + ], + "name=m1;caption=motor1;state=67377148;dir=4;layer=0;row=4;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=485;floaty=810;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 2 + ], + "name=m2;caption=motor2;state=67377148;dir=4;layer=0;row=4;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=520;floaty=734;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusCoordListCtrl", + [ + 1 + ], + "name=c1;caption=coord1;state=67377148;dir=4;layer=0;row=2;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=350;floaty=493;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 4 + ], + "name=m4;caption=motor4;state=67377148;dir=4;layer=0;row=5;pos=1;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=991;floaty=738;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 5 + ], + "name=m5;caption=motor5;state=67377148;dir=4;layer=0;row=6;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1181;floaty=512;floatw=208;floath=677;notebookid=-1;transparent=255" + ], + [ + "StatusMotorListCtrl", + [ + 3 + ], + "name=m3;caption=motor3;state=67377148;dir=4;layer=0;row=5;pos=0;prop=100000;bestw=200;besth=669;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=1168;floaty=473;floatw=208;floath=677;notebookid=-1;transparent=255" + ] +] \ No newline at end of file diff --git a/Readme.md b/Readme.md index 739f6c9..54ec6d8 100644 --- a/Readme.md +++ b/Readme.md @@ -55,6 +55,12 @@ Tested with shapepath.py: THE BEST TRAJECTORY RESULT IST WITH PVT MOTION Optimize/Test Parameters with Parker Stage ------------------------------------------ ``` +used ESB_MX/python/move_record.py to record and plot friction +used src/usrServo/usrcode.c to filter the following error of the stage + +Check Simulink project at /home/zamofing_t/afs/ESB-MX +subl /home/zamofing_t/afs/ESB-MX/Readme.md + cd /home/zamofing_t/Documents/prj/SwissFEL/epics_ioc_modules/ESB_MX/cfg gpasciiCommander --host SAR-CPPM-EXPMX1 -i !mx-stage() @@ -1017,7 +1023,6 @@ Gate3[1].Chan[0].UserFlag -> is set to 0 when event triggered (mapped to output Testing Helical Coord Trf ------------------------- ``` - B0.3504637004371034 X-13.68414496427224 Y-8.029999999998836 Z-1483.096457761122 @@ -1085,6 +1090,10 @@ cpx pmatch cpx ;linear abs; X0 Z0 Y575 B0 cpx ;linear abs; X0 Z0 Y575 B100000 +``` +Matlab models 3.10.2018 +----------------------- +``` -TODO: CLEANUP CODE OF HELICALSCAN, REMOVE LOGGING (comment out) +``` diff --git a/SAR-EXPMX3.subs b/SAR-EXPMX3.subs index 2646ccd..105eacb 100644 --- a/SAR-EXPMX3.subs +++ b/SAR-EXPMX3.subs @@ -13,8 +13,6 @@ #caget SAROP21-OAPU092:ASYN.TINP #caput SAROP21-OAPU092:ASYN.AOUT '&1;cpx abs;X(-900)Y(10)A(5200)B(5100)' -file stream.template {{P="$(P_M)",Q="MOT_GIR_",ID="3",PORT=$(PORT_M)}} - file PPMACMotor.template { pattern { DESC , P , M , PORT , ADDR, DIR, VELO, MRES , PREC, EGU } diff --git a/TestTrf.py b/TestTrf.py deleted file mode 100755 index c973739..0000000 --- a/TestTrf.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -import os, sys, json -from numpy import sin -from numpy import arcsin as asin -import numpy as np - -def forward(D0,L1,L2,L3,L4,L5): - #define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5') - #define(r='L6',scl='L7') - #define(S1='L11',S2='L12',S3='L13',S4='L14',S5='L15') - #define(X='C6',Y='C7',U='C3',V='C4',W='C5') - L6=2000./500000 - L7=5000/1.41421356237 - L11=L7*sin(L1*1.74532925199e-05) - L12=L7*sin(L2*1.74532925199e-05) - L13=L7*sin(L3*1.74532925199e-05) - L14=L7*sin(L4*1.74532925199e-05) - L15=L7*sin(L5*1.74532925199e-05) - - print("fwd_inp(%f) %f %f %f %f %f"%(D0,L1,L2,L3,L4,L5)) - print("fwd_inp(%f) %f %f %f %f %f"%(D0,L11,L12,L13,L14,L15)) - - - #//C6=D^-1*S - C6=+.5*L11 -.5*L12 +(L6+.25)*L13 +(L6-.75)*L14 +(.25-L6)*1.41421356237*L15 - C7=+.5*L11 +.5*L12 +.25*L13 +.25*L14 +.25*1.41421356237*L15 - C3= +1.*L13 +1.*L14 -1.*1.41421356237*L15 - C4=-1.*L11 +1.*L12 +1.5*L13 -.5*L14 -.5*1.41421356237*L15 - C5=-1.*L11 -1.*L12 +.5*L13 +.5*L14 +.5*1.41421356237*L15 - - print("fwd_res %f %f %f %f %f"%(C6,C7,C3,C4,C5)) - - #Dinv=[[+.5, -.5, +(L6+.25), +(L6-.75), +(.25-L6)*1.41421356237], - # [+.5, +.5, +.25, +.25, +.25*1.41421356237], - # [ 0, 0, +1., +1., -1.*1.41421356237], - # [-1., +1., +1.5, -.5, -.5*1.41421356237], - # [-1., -1., +.5, +.5, +.5*1.41421356237]] - #Dinv=np.matrix(Dinv) - #print(Dinv) - #print(Dinv**-1) - - - #D0=$000000f8; //C3=$8 C4=$10 C5=$20 C6=$40 C7=$80 hex(8+int('10',16)+int('20',16)+int('40',16)+int('80',16)) -> '0xf8' - #close - return (D0,C6,C7,C3,C4,C5) - -def inverse(D0,C6,C7,C3,C4,C5): -#// define(AA1='L1',AA2='L2',AA3='L3',AA4='L4',AA5='L5') -#// define(r='L6',scl='L7') -#// define(S1='L11',S2='L12',S3='L13',S4='L14',S5='L15') -#// define(X='C6',Y='C7',U='C3',V='C4',W='C5') - - #//if(D0>0) - #// send 1"Velocity calculation NOT SUPPORTED\n" - - print("inv_inp(%f) %f %f %f %f %f"%(D0,C6,C7,C3,C4,C5)) - - L6=2000./500000 - - L11=+.5*C6 +.5*C7 +(.25-.5*L6)*C3 -.25*C4 -.25*C5 - L12=-.5*C6 +.5*C7 +(.5*L6-.25)*C3 +.25*C4 -.25*C5 - L13=+.5*C6 +.5*C7 +(.25-.5*L6)*C3 +.25*C4 +.25*C5 - L14=-.5*C6 +.5*C7 +(.25+.5*L6)*C3 -.25*C4 +.25*C5 - L15= .5*1.41421356237*C7 -.25*1.41421356237*C3 +.25*1.41421356237*C5 - - L7=1.41421356237/5000 - L1=asin(L11*L7)/1.74532925199e-05 - L2=asin(L12*L7)/1.74532925199e-05 - L3=asin(L13*L7)/1.74532925199e-05 - L4=asin(L14*L7)/1.74532925199e-05 - L5=asin(L15*L7)/1.74532925199e-05 - - print("inv_res %f %f %f %f %f"%(L1,L2,L3,L4,L5)) - - #D=[[+.5, +.5, +(.25-.5*L6), -.25, -.25], - # [-.5, +.5, +(.5*L6-.25), +.25, -.25], - # [+.5, +.5, +(.25-.5*L6), +.25, +.25], - # [-.5, +.5, +(.25+.5*L6), -.25, +.25], - # [ 0, .5*1.41421356237, -.25*1.41421356237, 0, +.25*1.41421356237]] - - #D=np.matrix(D) - #print(D) - #print(D**-1) - - - return (D0,L1,L2,L3,L4,L5) - -#close - - - -f=forward(0,0,0,0,0,0) -print('') -i=inverse(*f) -print('\n') -f=forward(0,10000,20000,30000,40000,50000) -print('') -i=inverse(*f) - -#SOMETHING IS WRONG IN THE COORD TRF !!! - - - -#inverse(0,0,0,0,0,0) diff --git a/cfg/old/dirMicrostep.cfg b/cfg/old/dirMicrostep.cfg deleted file mode 100644 index 7ad1dba..0000000 --- a/cfg/old/dirMicrostep.cfg +++ /dev/null @@ -1,83 +0,0 @@ -// Here we use 'real encoder with direct microstepping'. Further the axis are scaled -// in this configuration, the PID gives 'speed' to iqCmd this is multiplied with 0.25 (SlipGain) to result in the phasePos -// The torque is constant given as idCmd -// the PID regulates the position by setting speed, if the motor is not at the desired position - -// x einraster == -> x-N and x-S poles =2*x poles -> 1 rev = x*2048 ustep=phase_step -// changing the polarity from S-N-S (one pole cycle) are 2048 phase_step. phase_step is also called ustep - -//Mot 1: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step -//Enc 1: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps - -//Mot 2: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 2: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//Mot 3: Stage Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 3: Stage Y Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//Mot 4: Test Servo: Trinamic QBL 4208 motor 8 poles 1 rev = 4*2048=8192 phase_step -//Enc 4: Test Servo: Incremental encoder mounted with motor 1 1 rev = 2000 enc count (500 inc_ quadrature encoder) -//Enc 5: Test Servo: Trinamic QBL 4208 hall sensor 1 rev = 24 enc count (hall sensor encoder) - -//Mot 6: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 6: Test Stepper: inc_enc 1 rev = 1600 enc_step - -//Mot 7: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 7: Test Stepper: ssi_enc multiturn 1 rev = 4096 enc_step - -$$$*** -!common() -//rot stage -//--------- -//use 360'000 for 360 deg as motor unit -!encoder_sim(enc=1,tbl=9,mot=9,posSf=360000./32768) -!encoder_biss(enc=1,tbl=1,mot=1,numBits=20,posSf=360000./1048576) -!motor(mot=1,dirCur=200,contCur=500,peakCur=1000,timeAtPeak=.5,JogSpeed=8.,numPhase=3,invDir=True,servoSf=32768/360000.) -//#1j:90000 // = moves 90 deg - - -//Stage X Parker MX80L -//-------------------- -//use um as motor unit -!encoder_sim(enc=2,tbl=10,mot=10,posSf=13000./2048) -!encoder_inc(enc=2,tbl=2,mot=2,posSf=13000./650000) -!motor(mot=2,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.,numPhase=3,invDir=True,servoSf=2048/13000.) -//#2j:1000 -> moves 1000um - - -//Stage Y Parker MX80L -//-------------------- -//use um as motor unit -!encoder_sim(enc=3,tbl=11,mot=11,posSf=13000./2048) -!encoder_inc(enc=3,tbl=3,mot=3,posSf=13000./650000) -!motor(mot=3,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.,numPhase=3,invDir=True,servoSf=2048/13000.) -//#3j:1000 -> moves 1000um - - -//Test Servo: Trinamic QBL 4208 motor -//----------------------------------- -//use 360 for 360 deg as motor unit -!encoder_sim(enc=4,tbl=12,mot=12,posSf=360./8192) -!encoder_inc(enc=4,tbl=4,mot=4,posSf=360./2000) // incremental encoder -!encoder_inc(enc=5,tbl=13,mot=13,encctrl=15,posSf=360./24) //Hall sensor encoder -!motor(mot=4,dirCur=400,contCur=500,peakCur=1000,timeAtPeak=.5,JogSpeed=8.,numPhase=3,servoSf=8192/360.) -//#4j:360 -> moves 1 rev - - -//Test Stepper: Vextra PK244M inc_enc -//----------------------------------- -//use 360 for 360 deg as motor unit -!encoder_sim(enc=6,tbl=14,mot=14,posSf=360./204800) -!encoder_inc(enc=6,tbl=6,mot=6,posSf=360./1600) -!motor(mot=6,dirCur=200,contCur=400,peakCur=600,timeAtPeak=1,numPhase=2,invDir=False,servoSf=204800/360.) -//#6j:360 -> moves 1 rev - - -//Test Stepper: Vextra PK244M abs_enc -//----------------------------------- -//use 360 for 360 deg as motor unit -> JogSpeed=2048./204800*360 -!encoder_sim(enc=7,tbl=7,mot=7,posSf=360./204800) -!encoder_ssi(enc=7,tbl=15,mot=15,numBits=25,posSf=360./4096) -!motor(mot=7,dirCur=100,contCur=400,peakCur=600,timeAtPeak=1,numPhase=2,invDir=False,servoSf=204800/360.,JogSpeed=3.6) -//#7j:360 -> moves 1 rev - diff --git a/cfg/old/init_limit.cfg b/cfg/old/init_limit.cfg deleted file mode 100644 index 60f8309..0000000 --- a/cfg/old/init_limit.cfg +++ /dev/null @@ -1,71 +0,0 @@ -//home by bove to physical limits and set these to -5000um - -define(PLC_Homing='1') - -open plc PLC_Homing -define(status='P100',timer='P101') - -L20=Motor[2].MaxDac -Motor[2].MaxDac=500 -L21=Motor[2].FatalFeLimit -Motor[2].FatalFeLimit=2000 -L22=Motor[2].JogSpeed -Motor[2].JogSpeed=1 - -L30=Motor[3].MaxDac -Motor[3].MaxDac=500 -L31=Motor[3].FatalFeLimit -Motor[3].FatalFeLimit=2000 -L32=Motor[3].JogSpeed -Motor[3].JogSpeed=1 - - -Motor[2].PhaseFindingStep=1 -Motor[3].PhaseFindingStep=1 -timer = Sys.RunTime + 1;while (Sys.RunTime < timer){} //wait 1 sec - -jog-2; jog-3; - -status=1 -while(1) -{ - if(Motor[2].FeWarn==1 && (status&2)==0) - { - status=status|2 - jog/2 - Motor[2].PhasePos=310 - Motor[2].HomePos=Motor[2].ActPos+5000 - jog2=0 - } - if(Motor[3].FeWarn==1 && (status&4)==0) - { - status=status|4 - jog/3 - Motor[3].PhasePos=1210 - Motor[3].HomePos=Motor[3].ActPos+5000 - jog3=0 - } - if(status==7) - { - status=status|8 - break - } -} - -timer = Sys.RunTime + 2 -while (Sys.RunTime < timer){} //wait 2 sec -status=100 -timer = Sys.RunTime + 2 -status=200 -while (Sys.RunTime < timer){} //wait 2 sec -status=201 - -Motor[2].MaxDac=L20 -Motor[2].FatalFeLimit=L21 -Motor[2].JogSpeed=L22 -Motor[3].MaxDac=L30 -Motor[3].FatalFeLimit=L31 -Motor[3].JogSpeed=L32 - -disable plc PLC_Homing -close diff --git a/cfg/old/simEncoder.cfg b/cfg/old/simEncoder.cfg deleted file mode 100644 index 9d65ce2..0000000 --- a/cfg/old/simEncoder.cfg +++ /dev/null @@ -1,82 +0,0 @@ -// Here we use 'simulated encoder with direct microstepping' -// in this configuration, the PID gives 'speed' to iqCmd this is multiplied with 0.25 (SlipGain) to result in the phasePos -// The torque is constant given as idCmd -// the PID does no regulation, as a real encoder is not used - -// x einraster == -> x-N and x-S poles =2*x poles -> 1 rev = x*2048 ustep=phase_step -// changing the polarity from S-N-S (one pole cycle) are 2048 phase_step. phase_step is also called ustep - -//Mot 1: Rotation stage LS Mecapion MDM-DC06DNC0H 32 poles = 1 rev = 16*2048=32768 phase_step -//Enc 1: Rotation stage LS Mecapion 1 rev = 1048576 enc_steps - -//Mot 2: Stage X Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 2: Stage X Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//Mot 3: Stage Y Parker MX80L D11 25mm one pole cycle = 13mm = 2048 phase_step -//Enc 3: Stage Y Parker MX80L D11 inc_enc 20nm one pole cycle = 13mm = 650000 enc_step (20nm/enc_step) - -//Mot 4: Test Servo: Trinamic QBL 4208 motor 8 poles 1 rev = 4*2048=8192 phase_step -//Enc 4: Test Servo: Incremental encoder mounted with motor 1 1 rev = 2000 enc count (500 inc_ quadrature encoder) -//Enc 5: Test Servo: Trinamic QBL 4208 hall sensor 1 rev = 24 enc count (hall sensor encoder) - -//Mot 6: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 6: Test Stepper: inc_enc 1 rev = 1600 enc_step - -//Mot 7: Test Stepper: Vextra PK244M 200 poles 1 rev = 100*2048 phase_step (2 stepper motor) -//Enc 7: Test Stepper: ssi_enc multiturn 1 rev = 4096 enc_step - -$$$*** -!common() -//rot stage -//--------- -!encoder_sim(enc=1,tbl=1,mot=1) -!encoder_biss(enc=1,tbl=9,mot=9,numBits=20,posSf=1.) -!motor(mot=1,dirCur=200,contCur=500,peakCur=1000,timeAtPeak=.5,JogSpeed=8.,numPhase=3,invDir=True) -//#1j:32768 = 1 rev - - -//Stage X Parker MX80L -//-------------------- -!encoder_sim(enc=2,tbl=2,mot=2) -!encoder_inc(enc=2,tbl=10,mot=10,posSf=1.) -!motor(mot=2,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.,numPhase=3,invDir=True) -//#2j:2048 -> moves one pole cycle= 650000 enc_step =13mm (Electrical Pitch in MX80 doc) - - - -//Stage Y Parker MX80L -//-------------------- -!encoder_sim(enc=3,tbl=3,mot=3) -!encoder_inc(enc=3,tbl=11,mot=11,posSf=1.) -!motor(mot=3,dirCur=400,contCur=500,peakCur=2400,timeAtPeak=1,IiGain=1,IpfGain=0,IpbGain=2,JogSpeed=1.,numPhase=3,invDir=True) -//#3j:2048 -> moves one pole cycle= 650000 enc_step =13mm (Electrical Pitch in MX80 doc) - - -//Test Servo: Trinamic QBL 4208 motor -//----------------------------------- - -!encoder_sim(enc=4,tbl=4,mot=4) -!encoder_inc(enc=4,tbl=12,mot=12,posSf=1.) // incremental encoder -!encoder_inc(enc=5,tbl=13,mot=13,encctrl=15) //encctrl=11 Hall sensor encoder -!motor(mot=4,dirCur=200,contCur=500,peakCur=1000,timeAtPeak=.5,JogSpeed=32.,numPhase=3) -//#4j:8192 -> moves 1 rev -//#4j:2048 -> moves one pole cycle= 90deg -> 8 poles - - -//Test Stepper: Vextra PK244M inc_enc -//----------------------------------- - -!encoder_sim(enc=6,tbl=6,mot=6) -!encoder_inc(enc=6,tbl=14,mot=14) -!motor(mot=6,dirCur=100,contCur=400,peakCur=600,timeAtPeak=1,numPhase=2,invDir=False,JogSpeed=2048) -//#6j:204800 moves 1 rev -//#6j:2048 ->moves one pole cycle - - -//Test Stepper: Vextra PK244M abs_enc -//----------------------------------- -!encoder_sim(enc=7,tbl=7,mot=7) -!encoder_ssi(enc=7,tbl=15,mot=15,numBits=25) -!motor(mot=7,dirCur=100,contCur=400,peakCur=600,timeAtPeak=1,numPhase=2,invDir=False,JogSpeed=2048) -//#7j:204800 moves 1 rev -//#7j:2048 ->moves one pole cycle diff --git a/cfg/old/startOnTrigger.cfg b/cfg/old/startOnTrigger.cfg deleted file mode 100644 index fd8a72a..0000000 --- a/cfg/old/startOnTrigger.cfg +++ /dev/null @@ -1,21 +0,0 @@ -//changes the Timebase of coord system 1 - -//modifies the timebase to start/stop a running program -//this can also be used to adjust the execution speed - -open plc 1 -Coord[1].DesTimeBase=0 // freezes timebase at boot -while(1) -{ - if(PowerBrick[0].GpioData[0].0.1==1) - { - PowerBrick[0].GpioData[0].16.8=255 - Coord[1].DesTimeBase=Sys.ServoPeriod - } - else - { - PowerBrick[0].GpioData[0].16.8=7 - Coord[1].DesTimeBase=0 - } -} -close diff --git a/cfg/old/testPerfGrid.cfg b/cfg/old/testPerfGrid.cfg deleted file mode 100644 index 1fd5cf9..0000000 --- a/cfg/old/testPerfGrid.cfg +++ /dev/null @@ -1,834 +0,0 @@ -define(PRG_GridXY='10',PRG_GridYX='11') - - - -//this program is generated with ./shapepath.py -//cfg = {"sequencer": ['gen_grid_points(w=20,h=20,pitch=50,rnd=0.2)', 'sort_points()','gen_prog(file="'+fn+'.prg") -//then modifiing start and end to not use gathering and to make a loop - - -open prog PRG_GridXY -N0: -linearabs -X505.488Y7.15189 -dwell10 -pvt10abs -X505.488:2526.97Y7.15189:-85.15309999999999 -X556.028:4937.42Y5.44883:-34.6476 -X604.237:4917.41Y6.45894:173.445 -X654.376:5270Y8.917730000000001:-131.226 -X709.6369999999999:5177.07Y3.83442:-181.439 -X757.917:4802.19Y5.28895:271.078 -X805.6799999999999:4639.66Y9.25597:-220.883 -X850.71:4726.09Y0.871293:-46.4884 -X900.202:5353.56Y8.3262:391.441 -X957.782:5479.2Y8.70012:-16.7306 -X1009.79:4841.66Y7.99159:-44.7415 -X1054.61:4569.83Y7.80529:-79.61879999999999 -X1101.18:4840.94Y6.39921:82.0699 -X1151.43:5201.79Y9.44669:-112.63 -X1205.22:5060.6Y4.14662:-85.2176 -X1252.65:4967.15Y7.74234:76.886 -X1304.56:4877.12Y5.68434:-78.2991 -X1350.19:5077.97Y6.17635:24.25 -X1406.12:5462.48Y6.16934:32.0924 -X1459.44:2342.02Y6.8182:2250.9 -X1452.96:-2830.47Y51.1873:2219.19 -X1402.83:-4778.44Y51.202:-39.77 -X1357.39:-4653.02Y50.3919:242.324 -X1309.77:-4881.4Y56.0485:214.732 -X1259.76:-5069.41Y54.6865:-254.374 -X1208.38:-5077.73Y50.961:-185.775 -X1158.21:-5320.68Y50.971:136.313 -X1101.97:-5082.33Y53.6873:20.5408 -X1056.56:-5018.81Y51.3818:-129.175 -X1001.59:-5095.01Y51.1038:53.1213 -X954.663:-4752.93Y52.4443:71.45820000000001 -X906.5309999999999:-5128.72Y52.5329:-41.558 -X852.0890000000001:-4832.37Y51.6131:-75.6234 -X809.884:-4819.34Y51.0204:138.646 -X755.702:-5336.47Y54.386:130.833 -X703.154:-5179.91Y53.6371:-154.838 -X652.104:-4824.33Y51.2893:153.464 -X606.668:-4756.38Y56.7064:-34.3504 -X556.976:-5153.63Y50.6023:-116.803 -X503.595:-2689.82Y54.3703:2677.02 -X503.18:2352.32Y104.143:2627.72 -X550.641:5124.31Y106.925:-74.43680000000001 -X605.6660000000001:5229.55Y102.654:-299.266 -X655.232:5004.67Y100.939:331.953 -X705.759:4897.66Y109.293:286.735 -X753.186:4777.93Y106.674:-106.484 -X801.318:4985.42Y107.163:-242.11 -X852.894:5227.36Y101.832:-348.11 -X905.865:5269.77Y100.201:-89.2479 -X958.289:5045.65Y100.047:124.95 -X1006.78:4953.13Y102.7:478.747 -X1057.35:4785.47Y109.622:153.075 -X1102.49:4928.42Y105.762:-194.968 -X1155.92:4987.16Y105.723:188.296 -X1202.23:4927.54Y109.527:137.078 -X1254.47:5238.2Y108.464:-327.656 -X1306.99:5183.34Y102.974:-224.951 -X1358.14:5090.81Y103.965:141.918 -X1408.81:5033.97Y105.813:148.013 -X1458.82:2263.04Y106.925:2243.95 -X1454.07:-2537.21Y150.692:2438.28 -X1408.07:-5141.68Y155.691:389.421 -X1351.24:-5322.41Y158.48:23.2294 -X1301.62:-4987.19Y156.156:10.0589 -X1251.49:-4724.13Y158.681:191.644 -X1207.14:-5024.61Y159.988:25.6783 -X1151:-4954.02Y159.195:-147.479 -X1108.06:-4832.18Y157.039:-13.7796 -X1054.36:-4954.82Y158.919:-168.163 -X1008.97:-4891.88Y153.676:-230.252 -X956.521:-5161.11Y154.314:142.819 -X905.7430000000001:-5041.07Y156.532:79.7272 -X855.7:-5219.43Y155.909:-177.459 -X801.355:-4975.97Y152.983:-81.05200000000001 -X756.1799999999999:-4737.65Y154.288:-4.10236 -X706.602:-5299.41Y152.901:-63.5969 -X650.192:-5118.16Y153.016:158.158 -X604.239:-4531.55Y156.064:171.208 -X559.561:-4849.3Y156.44:-52.5344 -X507.253:-2629.33Y155.013:2404.78 -X506.974:2498.4Y204.535:2682.53 -X557.221:5139.05Y208.664:201.13 -X609.755:4644.83Y208.558:-253.202 -X650.117:4877.23Y203.6:-342.087 -X707.3:5254.66Y201.716:-152.82 -X755.21:4735Y200.543:-76.5539 -X802:5136.33Y200.185:84.7933 -X857.937:5072.68Y202.239:454.78 -X903.454:4955.36Y209.281:-96.0429 -X957.044:4909.67Y200.318:-153.301 -X1001.65:4936.41Y206.215:103.027 -X1055.77:5384.76Y202.379:-3.75622 -X1109.34:4979.2Y206.14:176.009 -X1155.36:4897.95Y205.899:-151.01 -X1207.3:4931.29Y203.119:-190.033 -X1253.98:4728.04Y202.098:316.214 -X1301.86:5170.66Y209.444:140.308 -X1357.4:5020.61Y204.905:-345.008 -X1402.27:4659.24Y202.544:-28.0211 -X1450.58:2525.11Y204.344:2666.21 -X1452.78:-2341.93Y255.868:2514.58 -X1403.74:-5035.08Y254.636:-81.04940000000001 -X1352.07:-4927.98Y254.247:-218.956 -X1305.18:-4976.76Y250.257:-105.687 -X1252.54:-4785.42Y252.133:352.597 -X1209.47:-4783.23Y257.309:1.09785 -X1156.87:-5380.87Y252.155:110.968 -X1101.86:-5206.97Y259.528:291.27 -X1052.74:-4778.33Y257.98:-40.0705 -X1006.29:-4842.61Y258.727:16.5008 -X955.883:-5154.48Y258.31:-244.593 -X903.2:-5283.83Y253.835:-36.3349 -X850.207:-4828.47Y257.584:-60.0708 -X806.631:-4515.16Y252.633:-270.741 -X759.903:-5063.25Y252.169:316.674 -X705.366:-5155.47Y258.967:118.4 -X656.794:-5255.95Y254.537:-414.711 -X600.247:-5150.82Y250.672:-137.047 -X553.778:-4856.44Y251.796:314.547 -X503.118:-2256.95Y256.963:2468.96 -X508.639:2602.79Y301.175:2217.86 -X555.174:4926.5Y301.321:139.264 -X607.169:5024.02Y303.961:25.6059 -X655.654:4713.99Y301.833:45.9983 -X701.448:4895.1Y304.881:378.576 -X753.556:5310.24Y309.404:130.304 -X807.653:5274.05Y307.487:-428.505 -X859.037:4893.43Y300.834:-82.0938 -X905.522:5029.11Y305.845:104.363 -X959.619:4844.32Y302.921:-242.091 -X1002.41:4527.25Y301.003:318.691 -X1050.16:5214.54Y309.295:342.429 -X1106.7:5132.65Y307.852:-171.56 -X1152.82:4697.02Y305.864:-149.763 -X1200.64:5347.88Y304.856:145.048 -X1259.77:5137.1Y308.765:237.971 -X1303.38:4627.1Y309.616:36.4068 -X1352.32:5301.61Y309.493:-81.18380000000001 -X1409.41:5199.37Y307.992:-37.5154 -X1456.3:2459.59Y308.743:2463.92 -X1458.61:-2604.95Y357.27:2341.54 -X1404.21:-5094.25Y355.574:-240.839 -X1356.72:-5170.51Y352.454:-233.883 -X1300.8:-4950.73Y350.896:-49.2103 -X1257.71:-4676.96Y351.469:-39.0878 -X1207.26:-5319.05Y350.114:-46.7597 -X1151.32:-5159.18Y350.534:110.403 -X1104.07:-4899.67Y352.322:13.8371 -X1053.33:-4750.34Y350.811:270.907 -X1009.07:-4680.11Y357.74:439.867 -X959.729:-5404.36Y359.608:44.0721 -X900.978:-5230.8Y358.622:-368.259 -X855.1130000000001:-4637.86Y352.243:-336.172 -X808.221:-5071.37Y351.898:-43.7084 -X753.686:-5162.36Y351.369:224.812 -X704.974:-4693.38Y356.395:170.735 -X659.818:-5075.08Y354.784:-245.666 -X603.472:-5181.98Y351.481:-232.567 -X556.179:-5027.11Y350.132:350.401 -X502.93:-2673.77Y358.489:2559.12 -X502.703:2381.18Y401.315:2226.33 -X550.554:4995.9Y403.016:162.329 -X602.621:5313.95Y404.561:197.013 -X656.833:5010.7Y406.956:-38.1068 -X702.835:4748.93Y403.799:46.46 -X751.812:4886.66Y407.885:158.535 -X800.568:5298.77Y406.97:-5.56898 -X857.787:5101.29Y407.774:-161.592 -X902.5940000000001:4904.45Y403.738:-252.293 -X955.876:5055.72Y402.728:-88.3794 -X1003.71:4936.13Y401.971:-114.105 -X1054.6:5214.47Y400.446:-60.0489 -X1108:5029.49Y400.77:131.099 -X1155.19:4888.87Y403.068:441.238 -X1205.78:5063.37Y409.594:-135.724 -X1256.46:4926.43Y400.354:-224.708 -X1304.3:4945.3Y405.1:323.015 -X1355.36:4923.6Y406.814:-190.578 -X1402.78:4928.25Y401.289:137.507 -X1453.93:2369.37Y409.564:2528.19 -X1450.16:-2518.65Y451.852:2200.15 -X1403.55:-4991.51Y453.567:386.875 -X1350.33:-5048.34Y459.59:246.166 -X1302.59:-4985.3Y458.49:-267.475 -X1250.63:-4814.89Y454.24:-225.302 -X1206.29:-4623.59Y453.984:-132.309 -X1158.16:-4904.07Y451.594:255.205 -X1108.21:-4931.82Y459.088:208.168 -X1059.52:-4981.52Y455.758:-225.81 -X1008.58:-5246.87Y454.572:7.6165 -X954.581:-5030.67Y455.91:250.972 -X907.9640000000001:-5109.06Y459.592:-215.223 -X852.4:-5019.81Y451.605:-161.553 -X807.568:-4770.2Y456.361:83.5908 -X756.996:-4926.37Y453.277:26.982 -X709.04:-4987.73Y456.9:35.6525 -X657.242:-5011Y453.99:-115.711 -X608.8200000000001:-5090.18Y454.586:28.943 -X555.438:-5347.46Y454.569:222.69 -X501.871:-2571.27Y459.04:2736.19 -X504.013:2456.24Y509.293:2520.66 -X550.996:5234.11Y509.453:-237.565 -X608.6950000000001:5113.54Y504.542:-356.279 -X653.2670000000001:4872.49Y502.327:-210.544 -X706.145:4844.45Y500.331:98.0258 -X750.1559999999999:4726.8Y504.288:109.433 -X800.681:5102.78Y502.519:-87.8023 -X852.212:5031.49Y502.532:-119.952 -X901.311:4947.16Y500.12:182.645 -X951.155:5421.6Y506.185:489.154 -X1009.74:5146.78Y509.903:-227.763 -X1054.09:4832.25Y501.63:-250.02 -X1106.39:5290.18Y504.903:-48.8251 -X1159.89:5072.24Y500.653:-100.953 -X1207.83:4626Y502.884:298.6 -X1252.41:4731.41Y506.625:188.73 -X1302.46:5137.94Y506.659:-119.208 -X1355.17:5154.31Y504.241:-189.404 -X1405.55:5094.63Y502.871:-4.61606 -X1457.07:2719.86Y504.149:2582.39 -X1459.94:-2503.5Y554.518:2776.55 -X1407:-5027.1Y559.6799999999999:149.472 -X1359.4:-5032.79Y557.508:-50.3381 -X1306.34:-5218.91Y558.673:95.90940000000001 -X1255.02:-4897.4Y559.426:-314.774 -X1208.39:-5026.55Y552.377:-319.058 -X1154.49:-5300.69Y553.045:-32.9444 -X1102.38:-5037.5Y551.7190000000001:222.16 -X1053.74:-4982.69Y557.4880000000001:103.602 -X1002.72:-4821.79Y553.7910000000001:66.46599999999999 -X957.307:-4791.33Y558.817:-160.35 -X906.898:-4889.88Y550.5839999999999:-324.15 -X859.51:-5220.17Y552.3339999999999:23.7749 -X802.494:-5327.2Y551.059:379.295 -X752.966:-4640.22Y559.92:399.521 -X709.6900000000001:-4740.79Y559.049:-3.25991 -X658.15:-5368.17Y559.855:-278.214 -X602.326:-4945Y553.485:-469.742 -X559.25:-4936.04Y550.46:240.069 -X503.605:-2927.05Y558.287:2623.39 -X500.709:2395.9Y602.928:2294.41 -X551.524:5030.21Y604.175:155.662 -X601.313:5115.23Y606.0410000000001:238.95 -X653.828:5418.25Y608.954:-28.6165 -X709.678:4946.01Y605.4690000000001:-151.578 -X752.748:4964.48Y605.922:-70.0758 -X808.968:5138.63Y604.067:-160.289 -X855.521:4779.34Y602.717:-2.50991 -X904.554:4848.17Y604.0170000000001:117.107 -X952.484:4927.47Y605.059:-14.3393 -X1003.1:5138.28Y603.73:122.364 -X1055.25:5011.56Y607.506:275.562 -X1103.34:5168.67Y609.242:-350.952 -X1158.62:4960.07Y600.487:-239.012 -X1202.54:4621.15Y604.461:149.893 -X1251.05:5243.23Y603.485:117.189 -X1307.4:5258.88Y606.8049999999999:181.026 -X1356.22:4732.41Y607.105:-169.408 -X1402.05:5026.93Y603.417:84.3532 -X1456.76:2709.19Y608.792:2772.63 -X1456.23:-2724.24Y658.87:2265.53 -X1402.28:-4964.67Y654.103:-398.038 -X1356.94:-4892.86Y650.909:54.8254 -X1304.42:-4951.56Y655.2:3.1786 -X1257.91:-4966.11Y650.972:-92.99379999999999 -X1205.1:-5047.18Y653.34:358.218 -X1156.96:-4773.52Y658.1369999999999:-158.547 -X1109.63:-5048.05Y650.169:-112.47 -X1056:-5480.03Y655.8869999999999:315.162 -X1000.03:-4964.22Y656.472:180.061 -X956.72:-4712.78Y659.489:24.0367 -X905.771:-5231.1Y656.953:-416.579 -X852.097:-4977.45Y651.157:-208.101 -X806.222:-5092.72Y652.7910000000001:113.454 -X750.2430000000001:-5266.37Y653.426:63.4372 -X700.895:-4746.89Y654.059:289.75 -X655.3049999999999:-5040.81Y659.221:-16.6316 -X600.079:-5250.15Y653.727:-105.887 -X550.302:-4732.1Y657.103:-44.9897 -X505.437:-2205.7Y652.827:2211.56 -X506.188:2718.45Y701.335:2794.54 -X559.806:4941.95Y708.718:394.443 -X605.027:4780.4Y709.223:25.7602 -X655.414:5163.59Y709.2329999999999:22.9692 -X708.299:5189.2Y709.683:-443.636 -X759.198:4672.44Y700.36:-289.576 -X801.748:5016.18Y703.891:131.998 -X859.521:4992.85Y703:248.585 -X901.605:4747.13Y708.8630000000001:303.923 -X954.4640000000001:4999.88Y709.079:-112.594 -X1001.6:4996.93Y706.611:-415.694 -X1054.4:5268.12Y700.765:-206.859 -X1106.96:4799.68Y702.474:-8.271240000000001 -X1150.4:4682.31Y700.599:330.167 -X1200.61:5350.13Y709.077:419.059 -X1257.4:5305.75Y708.981:-189.397 -X1306.73:4782.28Y705.289:49.9499 -X1353.04:4844.8Y709.98:-29.1455 -X1403.62:5036.9Y704.706:-9.21766 -X1453.78:2613.75Y709.795:2637.37 -X1455.9:-2630.46Y757.454:2063.74 -X1401.17:-4908.31Y751.0700000000001:106.671 -X1357.73:-4842.52Y759.587:207.496 -X1304.32:-5355.22Y755.22:-358.42 -X1250.63:-5048.39Y752.419:-187.155 -X1203.35:-4649.04Y751.477:228.173 -X1157.65:-4679.64Y756.982:371.054 -X1109.76:-5063.49Y758.898:57.4027 -X1056.38:-5312.17Y758.131:-84.1935 -X1003.52:-5120.16Y757.2140000000001:93.1121 -X953.973:-4880.43Y759.9930000000001:-31.1151 -X905.91:-5150.23Y756.592:-327.943 -X850.968:-4810.27Y753.434:-262.869 -X809.705:-4820.14Y751.3339999999999:-2.95717 -X754.5650000000001:-5227.99Y753.375:117.244 -X705.145:-5086.26Y753.679:-49.5321 -X652.84:-4953.63Y752.384:54.8595 -X606.072:-4801.83Y754.776:-87.6028 -X556.803:-5216.3Y750.6319999999999:-74.8293 -X501.747:-2416.1Y753.28:2936.31 -X508.482:2904.38Y809.3579999999999:2535.91 -X559.8339999999999:4766.09Y803.998:-394.012 -X603.803:4850.75Y801.478:128.48 -X656.849:5240.86Y806.568:-25.2753 -X708.621:4906.42Y800.973:-37.84 -X754.978:4689.75Y805.811:35.8837 -X802.4160000000001:5180.9Y801.6900000000001:-261.274 -X858.596:5114.53Y800.585:-26.5957 -X904.706:4798.74Y801.158:460.714 -X954.571:4976.54Y809.8:370.645 -X1004.24:4830.13Y808.571:-354.355 -X1051.17:4990.04Y802.713:-228.656 -X1104.04:5277.03Y803.998:36.733 -X1156.71:5154.99Y803.447:119.687 -X1207.14:4863.89Y806.3920000000001:43.521 -X1253.99:4950.38Y804.318:-284.572 -X1306.15:5211.62Y800.7:110.831 -X1358.22:5055.91Y806.534:233.44 -X1407.26:4644.04Y805.369:-124.193 -X1451.1:2311.55Y804.05:2622.28 -X1453.49:-2338.75Y857.8150000000001:2561.6 -X1404.33:-5098.04Y855.282:-290.942 -X1351.53:-4829.76Y851.996:-35.9123 -X1307.73:-4995.62Y854.564:180.043 -X1251.62:-5353.93Y855.597:199.933 -X1200.66:-4948.54Y858.563:-246.766 -X1152.65:-4922.1Y850.6609999999999:-378.131 -X1102.21:-5092.25Y851:9.580730000000001 -X1050.81:-4924.09Y850.853:61.4249 -X1003.73:-4781.19Y852.229:378.733 -X955.181:-5091.32Y858.428:-101.87 -X901.9059999999999:-4996.98Y850.191:-238.838 -X855.242:-4827.83Y853.651:192.56 -X805.349:-4828.51Y854.042:-167.955 -X758.672:-4787.89Y850.292:-150.473 -X709.591:-5081.97Y851.033:302.798 -X657.032:-5424.68Y856.348:251.505 -X601.098:-5336.63Y856.063:51.234 -X550.3:-4852.21Y857.373:-142.633 -X504.054:-2139.46Y853.21:2594.98 -X507.51:2311.79Y909.272:2787.32 -X550.29:4820.77Y908.957:-24.4197 -X603.926:5330.92Y908.784:45.8287 -X656.908:5183.36Y909.873:-256.914 -X707.593:4905.14Y903.645:-305.48 -X755.011:4802.81Y903.764:-51.8201 -X803.649:4997.45Y902.609:152.675 -X854.96:4956.21Y906.817:131.738 -X902.773:4810.7Y905.244:-260.947 -X951.174:4884.73Y901.598:223.176 -X1000.47:4943.24Y909.707:9.36734 -X1050.04:5283.03Y901.7859999999999:-444.681 -X1106.13:5439.02Y900.814:270.52 -X1158.82:5176.76Y907.196:213.133 -X1209.66:4709.25Y905.076:-85.0598 -X1253:4982.21Y905.495:6.56295 -X1309.31:4983.4Y905.208:163.949 -X1352.67:4720.55Y908.774:-259.689 -X1403.72:4990.24Y900.014:-279.583 -X1452.48:2439.24Y903.182:2741.01 -X1452.5:-2427.94Y954.8339999999999:2461.97 -X1403.92:-4637.26Y952.422:224.584 -X1359.76:-4897.68Y959.326:-62.3265 -X1305.96:-5203.83Y951.175:-343.002 -X1255.68:-5085.89Y952.466:-4.95397 -X1204.25:-5132.01Y951.076:-85.5989 -X1153.04:-5161.12Y950.754:24.3828 -X1101.02:-4730.67Y951.564:371.337 -X1058.43:-4981.67Y958.1799999999999:135.261 -X1001.39:-5032.34Y954.269:13.1008 -X957.782:-4842.99Y958.442:33.5267 -X904.5309999999999:-4927.71Y954.9400000000001:-275.079 -X859.228:-5118.32Y952.941:-163.955 -X802.165:-5123.53Y951.66:-24.5936 -X756.7569999999999:-4625.15Y952.449:312.916 -X709.6609999999999:-4841.9Y957.919:65.9259 -X659.919:-5042.73Y953.7670000000001:76.5736 -X608.807:-5273.65Y959.45:-20.3195 -X554.446:-5010.95Y953.361:-243.262 -X508.588:-2292.9Y954.585:61.2005 -X508.588:0Y954.585:0 -X508.588Y954.585 -dwell10 -goto 0 -close - - - -open prog PRG_GridYX -N0: -linearabs -X505.488 Y7.15189 -dwell 10 - pvt10 abs -X505.488:-94.6528 Y7.15189:2360.92 -X503.595:-115.415 Y54.3703:4849.54 -X503.18:182.873 Y104.143:5032.15 -X507.253:189.723 Y155.013:5019.64 -X506.974:-206.729 Y204.535:5097.51 -X503.118:83.2134 Y256.963:4831.99 -X508.639:-9.3878 Y301.175:5076.3 -X502.93:-296.764 Y358.489:5006.98 -X502.703:-52.9447 Y401.315:5027.52 -X501.871:65.4658 Y459.04:5398.9 -X504.013:86.7073 Y509.293:4962.34 -X503.605:-165.195 Y558.287:4681.75 -X500.709:91.5662 Y602.928:4727.02 -X505.437:273.978 Y652.827:4920.33 -X506.188:-184.51 Y701.335:5022.64 -X501.747:114.662 Y753.28:5401.19 -X508.482:115.358 Y809.358:4996.53 -X504.054:-48.5644 Y853.21:4995.69 -X507.51:226.702 Y909.272:5068.73 -X508.588:2346.78 Y954.585:2204.45 -X554.446:2085.09 Y953.361:-2281.41 -X550.29:-207.318 Y908.957:-4799.42 -X550.3:477.237 Y857.373:-5247.94 -X559.834:325.199 Y803.998:-5337.02 -X556.803:-1.42305 Y750.632:-4764.01 -X559.806:-325.057 Y708.718:-4676.44 -X550.302:-414.113 Y657.103:-5227.15 -X551.524:447.366 Y604.175:-5332.16 -X559.25:-26.3699 Y550.46:-4736.09 -X550.996:-190.58 Y509.453:-4794.55 -X555.438:-22.1203 Y454.569:-5321.85 -X550.554:37.0354 Y403.016:-5221.84 -X556.179:231.002 Y350.132:-5084.77 -X555.174:-120.062 Y301.321:-4916.82 -X553.778:102.338 Y251.796:-4632.84 -X557.221:289.166 Y208.664:-4767.81 -X559.561:-328.954 Y156.44:-5086.96 -X550.641:-129.226 Y106.925:-5291.88 -X556.976:269.308 Y50.6023:-5073.79 -X556.028:2363.01 Y5.44883:-2207.17 -X604.237:2532 Y6.45894:2562.88 -X606.668:71.4733 Y56.7064:4809.75 -X605.666:-121.456 Y102.654:4967.88 -X604.239:204.46 Y156.064:5295.21 -X609.755:-199.588 Y208.558:4730.43 -X600.247:-129.331 Y250.672:4770.13 -X607.169:161.277 Y303.961:5040.45 -X603.472:-227.371 Y351.481:5030.04 -X602.621:267.404 Y404.561:5155.23 -X608.82:303.685 Y454.586:4999.01 -X608.695:-324.707 Y504.542:4944.96 -X602.326:-369.1 Y553.485:5074.98 -X601.313:-112.371 Y606.041:5012.08 -X600.079:185.716 Y653.727:5159.12 -X605.027:299.683 Y709.223:5052.48 -X606.072:-61.1928 Y754.776:4612.73 -X603.803:-248.732 Y801.478:5064.33 -X601.098:6.1168 Y856.063:5365.28 -X603.926:385.447 Y908.784:5169.36 -X608.807:2799.66 Y959.45:2249.18 -X659.919:2405.05 Y953.767:-2478.84 -X656.908:-144.336 Y909.873:-4870.98 -X657.032:-2.92517 Y856.348:-5165.29 -X656.849:-209.609 Y806.568:-5198.19 -X652.84:-71.7768 Y752.384:-4866.73 -X655.414:123.269 Y709.233:-4658.15 -X655.305:-79.2864 Y659.221:-5013.96 -X653.828:142.215 Y608.954:-4968.31 -X658.15:-28.0536 Y559.855:-5331.32 -X653.267:-45.3994 Y502.327:-5293.23 -X657.242:178.29 Y453.99:-4768.56 -X656.833:128.831 Y406.956:-4960.33 -X659.818:-58.93 Y354.784:-5256.17 -X655.654:-151.218 Y301.833:-5012.34 -X656.794:-276.854 Y254.537:-4911.65 -X650.117:-330.1 Y203.6:-5076.06 -X650.192:255.767 Y153.016:-5133.02 -X655.232:95.5947 Y100.939:-5086.32 -X652.104:-42.8304 Y51.2893:-4601.08 -X654.376:2876.64 Y8.91773:-2372.74 -X709.637:2438.92 Y3.83442:2235.97 -X703.154:-193.858 Y53.6371:5272.93 -X705.759:172.373 Y109.293:4963.18 -X706.602:77.022 Y152.901:4621.17 -X707.3:-61.7972 Y201.716:5303.3 -X705.366:-292.571 Y258.967:5158.21 -X701.448:-19.5939 Y304.881:4871.4 -X704.974:69.3355 Y356.395:4945.94 -X702.835:203.327 Y403.799:5025.28 -X709.04:165.473 Y456.9:4826.57 -X706.145:32.4637 Y500.331:5107.46 -X709.69:176.665 Y559.049:5256.91 -X709.678:-439.739 Y605.469:4750.5 -X700.895:-68.9487 Y654.059:5210.7 -X708.299:212.509 Y709.683:4980.99 -X705.145:16.0826 Y753.679:4564.49 -X708.621:222.315 Y800.973:4867.69 -X709.591:-51.3901 Y851.033:5133.64 -X707.593:3.5026 Y903.645:5344.29 -X709.661:2458.2 Y957.919:2440.17 -X756.757:2267.46 Y952.449:-2707.75 -X755.011:95.739 Y903.764:-5107.85 -X758.672:-1.64313 Y850.292:-4897.65 -X754.978:-205.324 Y805.811:-4845.86 -X754.565:211.003 Y753.375:-5272.52 -X759.198:-216.103 Y700.36:-4997.43 -X750.243:-322.48 Y653.426:-4721.9 -X752.748:136.122 Y605.922:-4675.3 -X752.966:-129.609 Y559.92:-5081.72 -X750.156:201.533 Y504.288:-5332.15 -X756.996:82.7724 Y453.277:-4820.13 -X751.812:-165.519 Y407.885:-5095.41 -X753.686:87.2309 Y351.369:-4924.06 -X753.556:310.877 Y309.404:-4960 -X759.903:82.7119 Y252.169:-5443.05 -X755.21:-186.162 Y200.543:-4894.06 -X756.18:-101.234 Y154.288:-4693.46 -X753.186:-23.9093 Y106.674:-4995.08 -X755.702:236.578 Y54.386:-5069.26 -X757.917:2498.92 Y5.28895:-2256.5 -X805.68:2598.32 Y9.25597:2286.57 -X809.884:-218.123 Y51.0204:4895.37 -X801.318:-426.45 Y107.163:5098.12 -X801.355:34.0993 Y152.983:4651.1 -X802:263.802 Y200.185:4982.52 -X806.631:282.664 Y252.633:5365.07 -X807.653:79.5198 Y307.487:4963.26 -X808.221:-354.239 Y351.898:4974.17 -X800.568:-32.6695 Y406.97:5223.11 -X807.568:5.613 Y456.361:4777.47 -X800.681:-253.679 Y502.519:4734.92 -X802.494:414.344 Y551.059:5077.4 -X808.968:186.406 Y604.067:5086.58 -X806.222:-360.995 Y652.791:4991.2 -X801.748:174.131 Y703.891:4927.19 -X809.705:33.3925 Y751.334:4889.95 -X802.416:-217.788 Y801.69:5135.4 -X805.349:61.6774 Y854.042:5045.94 -X803.649:-159.23 Y902.609:4880.9 -X802.165:2778.92 Y951.66:2516.59 -X859.228:2639.76 Y952.941:-2242.15 -X854.96:-199.286 Y906.817:-4964.49 -X855.242:181.805 Y853.651:-5311.6 -X858.596:-213.69 Y800.585:-5010.85 -X850.968:46.2809 Y753.434:-4879.25 -X859.521:56.473 Y703:-5113.84 -X852.097:-200.032 Y651.157:-5014.19 -X855.521:370.601 Y602.717:-4941.14 -X859.51:-165.459 Y552.334:-5009.23 -X852.212:-355.466 Y502.532:-5036.44 -X852.4:278.767 Y451.605:-4737.89 -X857.787:135.649 Y407.774:-4968.11 -X855.113:62.5122 Y352.243:-5346.99 -X859.037:-245.334 Y300.834:-4732.97 -X850.207:-55.011 Y257.584:-4929.75 -X857.937:274.657 Y202.239:-5083.75 -X855.7:-252.146 Y155.909:-5020.37 -X852.894:-180.544 Y101.832:-5214.78 -X852.089:-109.185 Y51.6131:-5048.03 -X850.71:2405.67 Y0.871293:-2164.34 -X900.202:2791.04 Y8.3262:2583.08 -X906.531:283.147 Y52.5329:4593.74 -X905.865:-39.3915 Y100.201:5199.95 -X905.743:-120.581 Y156.532:5453.99 -X903.454:-127.154 Y209.281:4865.13 -X903.2:103.42 Y253.835:4828.2 -X905.522:-111.086 Y305.845:5239.36 -X900.978:-146.385 Y358.622:4894.67 -X902.594:349.273 Y403.738:5048.49 -X907.964:-64.1837 Y459.592:4819.11 -X901.311:-53.3116 Y500.12:4549.59 -X906.898:162.194 Y550.584:5194.84 -X904.554:-56.314 Y604.017:5318.46 -X905.771:-147.488 Y656.953:5242.3 -X901.605:6.94333 Y708.863:4981.95 -X905.91:155.077 Y756.592:4614.76 -X904.706:-200.23 Y801.158:4679.97 -X901.906:-96.6403 Y850.191:5204.27 -X902.773:131.264 Y905.244:5237.42 -X904.531:2750.42 Y954.94:2659.93 -X957.782:2332.14 Y958.442:-2667.06 -X951.174:-130.011 Y901.598:-5000.73 -X955.181:169.839 Y858.428:-4589.94 -X954.571:-60.4465 Y809.8:-4921.75 -X953.973:-5.33217 Y759.993:-5036.04 -X954.464:137.35 Y709.079:-5025.21 -X956.72:-98.9905 Y659.489:-5201 -X952.484:29.376 Y605.059:-5033.57 -X957.307:-66.4646 Y558.817:-4943.69 -X951.155:-136.285 Y506.185:-5145.37 -X954.581:236.058 Y455.91:-5172.83 -X955.876:257.39 Y402.728:-4815.07 -X959.729:187.168 Y359.608:-4990.34 -X959.619:-192.301 Y302.921:-5064.89 -X955.883:-128.761 Y258.31:-5130.15 -X957.044:31.8931 Y200.318:-5199.82 -X956.521:62.2628 Y154.314:-5013.57 -X958.289:-92.8962 Y100.047:-5093.5 -X954.663:-25.3916 Y52.4443:-4567.34 -X957.782:2756.15 Y8.70012:-2222.63 -X1009.79:2190.41 Y7.99159:2120.18 -X1001.59:-150.401 Y51.1038:4735.42 -X1006.78:368.789 Y102.7:5128.59 -X1008.97:-256.561 Y153.676:5175.74 -X1001.65:-133.782 Y206.215:5252.54 -X1006.29:38.0673 Y258.727:4739.41 -X1002.41:138.787 Y301.003:4950.7 -X1009.07:65.012 Y357.74:5048.38 -X1003.71:-24.4164 Y401.971:4841.59 -X1008.58:301.702 Y454.572:5396.65 -X1009.74:-292.643 Y509.903:4960.92 -X1002.72:-331.938 Y553.791:4691.34 -X1003.1:-134.867 Y603.73:5134.07 -X1000.03:-75.0752 Y656.472:5144.04 -X1001.6:174.595 Y706.611:5037.11 -X1003.52:131.738 Y757.214:5098 -X1004.24:10.6615 Y808.571:4750.73 -X1003.73:-188.45 Y852.229:5056.8 -X1000.47:-117.072 Y909.707:5102.02 -X1001.39:2898.02 Y954.269:2423.65 -X1058.43:2432.39 Y958.18:-2624.16 -X1050.04:-381.161 Y901.786:-5366.36 -X1050.81:56.7276 Y850.853:-4953.66 -X1051.17:278.525 Y802.713:-4636.13 -X1056.38:161.474 Y758.131:-5097.38 -X1054.4:-18.5952 Y700.765:-5112.16 -X1056:42.3533 Y655.887:-4662.95 -X1055.25:-113.048 Y607.506:-4919.98 -X1053.74:-57.9582 Y557.488:-5293.82 -X1054.09:288.789 Y501.63:-5086.52 -X1059.52:25.4009 Y455.758:-5059.17 -X1054.6:-309.365 Y400.446:-5247.32 -X1053.33:-221.713 Y350.811:-4557.54 -X1050.16:-29.8016 Y309.295:-4641.53 -X1052.74:280.399 Y257.98:-5345.82 -X1055.77:81.1614 Y202.379:-4953.06 -X1054.36:78.9827 Y158.919:-4637.85 -X1057.35:110.232 Y109.622:-5376.87 -X1056.56:-136.857 Y51.3818:-5090.83 -X1054.61:2230.97 Y7.80529:-2249.13 -X1101.18:2367.55 Y6.39921:2294.1 -X1101.97:65.2394 Y53.6873:4968.12 -X1102.49:304.806 Y105.762:5167.58 -X1108.06:342.73 Y157.039:5018.9 -X1109.34:-310.279 Y206.14:5124.45 -X1101.86:-132.149 Y259.528:5085.59 -X1106.7:110.803 Y307.852:4639.72 -X1104.07:64.9397 Y352.322:4645.9 -X1108:206.763 Y400.77:5338.3 -X1108.21:-80.5171 Y459.088:5206.67 -X1106.39:-291.48 Y504.903:4631.5 -X1102.38:-152.627 Y551.719:5216.93 -X1103.34:362.482 Y609.242:4922.51 -X1109.63:181.478 Y650.169:4661.62 -X1106.96:6.72767 Y702.474:5436.46 -X1109.76:-146.335 Y758.898:5076.21 -X1104.04:-377.415 Y803.998:4605.11 -X1102.21:104.537 Y851:4840.78 -X1106.13:-59.4913 Y900.814:5028.18 -X1101.02:2345.67 Y951.564:2496.99 -X1153.04:2889.74 Y950.754:-2218.38 -X1158.82:-19.5795 Y907.196:-5004.6 -X1152.65:-105.257 Y850.661:-5187.45 -X1156.71:249.761 Y803.447:-4683.95 -X1157.65:-315.884 Y756.982:-5142.39 -X1150.4:-34.0398 Y700.599:-4942.28 -X1156.96:411.352 Y658.137:-5005.63 -X1158.62:-123.595 Y600.487:-5254.61 -X1154.49:63.5456 Y553.045:-4991.69 -X1159.89:183.116 Y500.653:-5072.53 -X1158.16:-235.287 Y451.594:-4879.25 -X1155.19:-341.518 Y403.068:-5052.99 -X1151.32:-118.553 Y350.534:-4860.2 -X1152.82:277.5 Y305.864:-4918.96 -X1156.87:126.951 Y252.155:-4998.25 -X1155.36:-293.631 Y205.899:-4648.01 -X1151:28.2046 Y159.195:-5008.83 -X1155.92:360.383 Y105.723:-5411.19 -X1158.21:-224.344 Y50.971:-4813.79 -X1151.43:2350.43 Y9.44669:-2341.22 -X1205.22:2847.3 Y4.14662:2075.71 -X1208.38:-149.383 Y50.961:5269.04 -X1202.23:-61.8518 Y109.527:5451.37 -X1207.14:253.52 Y159.988:4679.6 -X1207.3:116.565 Y203.119:4866 -X1209.47:-333.083 Y257.309:5086.84 -X1200.64:-110.888 Y304.856:4640.29 -X1207.26:256.794 Y350.114:5236.9 -X1205.78:-48.348 Y409.594:5193.5 -X1206.29:102.846 Y453.984:4664.48 -X1207.83:105.145 Y502.884:4919.65 -X1208.39:-264.796 Y552.377:5078.87 -X1202.54:-164.691 Y604.461:5048.11 -X1205.1:-96.282 Y653.34:5230.8 -X1200.61:-87.1545 Y709.077:4906.86 -X1203.35:326.344 Y751.477:4865.73 -X1207.14:-134.947 Y806.392:5354.3 -X1200.66:126.312 Y858.563:4934.22 -X1209.66:179.529 Y905.076:4625.67 -X1204.25:2300.91 Y951.076:2369.46 -X1255.68:2437.87 Y952.466:-2279.06 -X1253:-203.049 Y905.495:-4843.44 -X1251.62:49.3787 Y855.597:-5058.87 -X1253.99:-49.7421 Y804.318:-5158.89 -X1250.63:170.361 Y752.419:-4766.85 -X1257.4:364.102 Y708.981:-5072.33 -X1257.91:-317.628 Y650.972:-5274.79 -X1251.05:-144.225 Y603.485:-4577.33 -X1255.02:68.3954 Y559.426:-4842.99 -X1252.41:-219.838 Y506.625:-5259.28 -X1250.63:202.076 Y454.24:-5313.57 -X1256.46:353.934 Y400.354:-5138.54 -X1257.71:165.962 Y351.469:-4579.43 -X1259.77:-258.32 Y308.765:-4966.82 -X1252.54:-289.637 Y252.133:-5333.33 -X1253.98:-52.2467 Y202.098:-4672.59 -X1251.49:24.4522 Y158.681:-4681.72 -X1254.47:413.506 Y108.464:-5199.74 -X1259.76:-91.2849 Y54.6865:-5036.09 -X1252.65:2239.85 Y7.74234:-2450.11 -X1304.56:2856.1 Y5.68434:2415.31 -X1309.77:121.664 Y56.0485:4864.5 -X1306.99:-407.134 Y102.974:5005.36 -X1301.62:-256.643 Y156.156:5323.47 -X1301.86:177.854 Y209.444:4705.05 -X1305.18:75.983 Y250.257:5008.6 -X1303.38:-219.339 Y309.616:5031.97 -X1300.8:46.1217 Y350.896:4774.22 -X1304.3:89.581 Y405.1:5379.72 -X1302.59:-92.1696 Y458.49:5077.92 -X1302.46:187.657 Y506.659:5009.13 -X1306.34:247.017 Y558.673:5007.33 -X1307.4:-95.981 Y606.805:4826.33 -X1304.42:-33.7576 Y655.2:4924.21 -X1306.73:-4.87708 Y705.289:5001.02 -X1304.32:-29.0273 Y755.22:4770.55 -X1306.15:170.587 Y800.7:4967.21 -X1307.73:158.146 Y854.564:5225.36 -X1309.31:-88.5112 Y905.208:4830.56 -X1305.96:2522.53 Y951.175:2705.9 -X1359.76:2335.39 Y959.326:-2120.06 -X1352.67:-411.257 Y908.774:-5366.48 -X1351.53:277.6 Y851.996:-5111.99 -X1358.22:309.857 Y806.534:-4620.43 -X1357.73:-258.98 Y759.587:-4827.73 -X1353.04:-39.5636 Y709.98:-5433.93 -X1356.94:158.969 Y650.909:-5143.72 -X1356.22:123.127 Y607.105:-4670.06 -X1359.4:-52.538 Y557.508:-5143.22 -X1355.17:-453.453 Y504.241:-4895.89 -X1350.33:9.43449 Y459.59:-4871.35 -X1355.36:319.372 Y406.814:-5356.81 -X1356.72:-152.238 Y352.454:-4866.04 -X1352.32:-232.289 Y309.493:-4910.34 -X1352.07:253.925 Y254.247:-5229.43 -X1357.4:-41.825 Y204.905:-4788.34 -X1351.24:37.1235 Y158.48:-5046.98 -X1358.14:307.722 Y103.965:-5404.41 -X1357.39:-397.504 Y50.3919:-4889.44 -X1350.19:2436.42 Y6.17635:-2211.13 -X1406.12:2632.01 Y6.16934:2251.28 -X1402.83:134.504 Y51.202:4982.17 -X1408.81:262.256 Y105.813:5224.45 -X1408.07:-326.844 Y155.691:4836.54 -X1402.27:-216.574 Y202.544:4947.24 -X1403.74:356.982 Y254.636:5272.42 -X1409.41:23.1847 Y307.992:5046.9 -X1404.21:-331.891 Y355.574:4664.83 -X1402.78:-32.5853 Y401.289:4899.67 -X1403.55:138.546 Y453.567:5079.1 -X1405.55:172.103 Y502.871:5305.63 -X1407:-174.882 Y559.68:5027.32 -X1402.05:-235.908 Y603.417:4721.17 -X1402.28:78.6327 Y654.103:5064.48 -X1403.62:-55.2195 Y704.706:4848.35 -X1401.17:182.077 Y751.07:5033.14 -X1407.26:157.832 Y805.369:5210.61 -X1404.33:-177.212 Y855.282:4732.23 -X1403.72:-20.5936 Y900.014:4856.97 -X1403.92:2439.24 Y952.422:2741.01 -X1452.5:2427.94 Y954.834:-2461.97 -X1452.48:49.521 Y903.182:-4850.96 -X1453.49:-68.604 Y857.815:-4956.6 -X1451.1:120.127 Y804.05:-5018.04 -X1455.9:133.884 Y757.454:-4712.75 -X1453.78:16.8 Y709.795:-4929.22 -X1456.23:148.999 Y658.87:-5050.15 -X1456.76:185.553 Y608.792:-5217.57 -X1459.94:15.1661 Y554.518:-5232.19 -X1457.07:-489.036 Y504.149:-5133.29 -X1450.16:-156.95 Y451.852:-4729.23 -X1453.93:422.111 Y409.564:-4729.09 -X1458.61:118.886 Y357.27:-5041.06 -X1456.3:-291.461 Y308.743:-5070.13 -X1452.78:-286.209 Y255.868:-5219.94 -X1450.58:64.7773 Y204.344:-5258.81 -X1454.07:411.853 Y150.692:-4870.94 -X1458.82:-55.5215 Y106.925:-4975.22 -X1452.96:31.0064 Y51.1873:-5005.36 -X1459.44:323.804 Y6.8182:-2218.45 -X1459.44:0 Y6.8182:0 -X1459.44 Y6.8182 -dwell10 -goto 0 -close \ No newline at end of file diff --git a/cfg/stream.cfg b/cfg/stream.cfg deleted file mode 100644 index 134bdc6..0000000 --- a/cfg/stream.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# Author : zamofing_t - -#Terminator = CR; -#ExtraInput = Ignore; -WaitDelay = 40; -WriteTimeout = 500; -ReplyTimeout = 4000; -#ReadTimeout = 500; - -# ---------------- debug DEBUG debug DEBUG----------- # - -debug { - out "%s";wait $WaitDelay; in "%#s" -} - -#same as debug but without readback -debug0 { - out "%s"; -} - -moveXYUVW { - out "cpx abs linear;call 15; X(%(\$1X.VAL)f)Y(%(\$1Y.VAL)f)U(%(\$1U.VAL)f)V(%(\$1V.VAL)f)W(%(\$1W.VAL)f);call 16"; - wait $WaitDelay; - in "%#s" -} \ No newline at end of file diff --git a/prg/testPerfGridXY.prg b/prg/testPerfGridXY.prg deleted file mode 100644 index 5f05b31..0000000 --- a/prg/testPerfGridXY.prg +++ /dev/null @@ -1,432 +0,0 @@ -//this program is generated with ./shapepath.py -//cfg = {"sequencer": ['gen_grid_points(w=20,h=20,pitch=50,rnd=0.2)', 'sort_points()','gen_prog(file="'+fn+'.prg") -//then modifiing start and end to not use gathering and to make a loop - -open plc 1 -Coord[1].DesTimeBase=0 // freezes timebase at boot -while(1) -{ - if(PowerBrick[0].GpioData[0].0.1==1) - { - PowerBrick[0].GpioData[0].16.8=255 - Coord[1].DesTimeBase=Sys.ServoPeriod - } - else - { - PowerBrick[0].GpioData[0].16.8=7 - Coord[1].DesTimeBase=0 - } -} -close - -open prog 2 -N0: -linearabs -X505.488Y7.15189 -dwell10 -pvt10abs -X505.488:2526.97Y7.15189:-85.15309999999999 -X556.028:4937.42Y5.44883:-34.6476 -X604.237:4917.41Y6.45894:173.445 -X654.376:5270Y8.917730000000001:-131.226 -X709.6369999999999:5177.07Y3.83442:-181.439 -X757.917:4802.19Y5.28895:271.078 -X805.6799999999999:4639.66Y9.25597:-220.883 -X850.71:4726.09Y0.871293:-46.4884 -X900.202:5353.56Y8.3262:391.441 -X957.782:5479.2Y8.70012:-16.7306 -X1009.79:4841.66Y7.99159:-44.7415 -X1054.61:4569.83Y7.80529:-79.61879999999999 -X1101.18:4840.94Y6.39921:82.0699 -X1151.43:5201.79Y9.44669:-112.63 -X1205.22:5060.6Y4.14662:-85.2176 -X1252.65:4967.15Y7.74234:76.886 -X1304.56:4877.12Y5.68434:-78.2991 -X1350.19:5077.97Y6.17635:24.25 -X1406.12:5462.48Y6.16934:32.0924 -X1459.44:2342.02Y6.8182:2250.9 -X1452.96:-2830.47Y51.1873:2219.19 -X1402.83:-4778.44Y51.202:-39.77 -X1357.39:-4653.02Y50.3919:242.324 -X1309.77:-4881.4Y56.0485:214.732 -X1259.76:-5069.41Y54.6865:-254.374 -X1208.38:-5077.73Y50.961:-185.775 -X1158.21:-5320.68Y50.971:136.313 -X1101.97:-5082.33Y53.6873:20.5408 -X1056.56:-5018.81Y51.3818:-129.175 -X1001.59:-5095.01Y51.1038:53.1213 -X954.663:-4752.93Y52.4443:71.45820000000001 -X906.5309999999999:-5128.72Y52.5329:-41.558 -X852.0890000000001:-4832.37Y51.6131:-75.6234 -X809.884:-4819.34Y51.0204:138.646 -X755.702:-5336.47Y54.386:130.833 -X703.154:-5179.91Y53.6371:-154.838 -X652.104:-4824.33Y51.2893:153.464 -X606.668:-4756.38Y56.7064:-34.3504 -X556.976:-5153.63Y50.6023:-116.803 -X503.595:-2689.82Y54.3703:2677.02 -X503.18:2352.32Y104.143:2627.72 -X550.641:5124.31Y106.925:-74.43680000000001 -X605.6660000000001:5229.55Y102.654:-299.266 -X655.232:5004.67Y100.939:331.953 -X705.759:4897.66Y109.293:286.735 -X753.186:4777.93Y106.674:-106.484 -X801.318:4985.42Y107.163:-242.11 -X852.894:5227.36Y101.832:-348.11 -X905.865:5269.77Y100.201:-89.2479 -X958.289:5045.65Y100.047:124.95 -X1006.78:4953.13Y102.7:478.747 -X1057.35:4785.47Y109.622:153.075 -X1102.49:4928.42Y105.762:-194.968 -X1155.92:4987.16Y105.723:188.296 -X1202.23:4927.54Y109.527:137.078 -X1254.47:5238.2Y108.464:-327.656 -X1306.99:5183.34Y102.974:-224.951 -X1358.14:5090.81Y103.965:141.918 -X1408.81:5033.97Y105.813:148.013 -X1458.82:2263.04Y106.925:2243.95 -X1454.07:-2537.21Y150.692:2438.28 -X1408.07:-5141.68Y155.691:389.421 -X1351.24:-5322.41Y158.48:23.2294 -X1301.62:-4987.19Y156.156:10.0589 -X1251.49:-4724.13Y158.681:191.644 -X1207.14:-5024.61Y159.988:25.6783 -X1151:-4954.02Y159.195:-147.479 -X1108.06:-4832.18Y157.039:-13.7796 -X1054.36:-4954.82Y158.919:-168.163 -X1008.97:-4891.88Y153.676:-230.252 -X956.521:-5161.11Y154.314:142.819 -X905.7430000000001:-5041.07Y156.532:79.7272 -X855.7:-5219.43Y155.909:-177.459 -X801.355:-4975.97Y152.983:-81.05200000000001 -X756.1799999999999:-4737.65Y154.288:-4.10236 -X706.602:-5299.41Y152.901:-63.5969 -X650.192:-5118.16Y153.016:158.158 -X604.239:-4531.55Y156.064:171.208 -X559.561:-4849.3Y156.44:-52.5344 -X507.253:-2629.33Y155.013:2404.78 -X506.974:2498.4Y204.535:2682.53 -X557.221:5139.05Y208.664:201.13 -X609.755:4644.83Y208.558:-253.202 -X650.117:4877.23Y203.6:-342.087 -X707.3:5254.66Y201.716:-152.82 -X755.21:4735Y200.543:-76.5539 -X802:5136.33Y200.185:84.7933 -X857.937:5072.68Y202.239:454.78 -X903.454:4955.36Y209.281:-96.0429 -X957.044:4909.67Y200.318:-153.301 -X1001.65:4936.41Y206.215:103.027 -X1055.77:5384.76Y202.379:-3.75622 -X1109.34:4979.2Y206.14:176.009 -X1155.36:4897.95Y205.899:-151.01 -X1207.3:4931.29Y203.119:-190.033 -X1253.98:4728.04Y202.098:316.214 -X1301.86:5170.66Y209.444:140.308 -X1357.4:5020.61Y204.905:-345.008 -X1402.27:4659.24Y202.544:-28.0211 -X1450.58:2525.11Y204.344:2666.21 -X1452.78:-2341.93Y255.868:2514.58 -X1403.74:-5035.08Y254.636:-81.04940000000001 -X1352.07:-4927.98Y254.247:-218.956 -X1305.18:-4976.76Y250.257:-105.687 -X1252.54:-4785.42Y252.133:352.597 -X1209.47:-4783.23Y257.309:1.09785 -X1156.87:-5380.87Y252.155:110.968 -X1101.86:-5206.97Y259.528:291.27 -X1052.74:-4778.33Y257.98:-40.0705 -X1006.29:-4842.61Y258.727:16.5008 -X955.883:-5154.48Y258.31:-244.593 -X903.2:-5283.83Y253.835:-36.3349 -X850.207:-4828.47Y257.584:-60.0708 -X806.631:-4515.16Y252.633:-270.741 -X759.903:-5063.25Y252.169:316.674 -X705.366:-5155.47Y258.967:118.4 -X656.794:-5255.95Y254.537:-414.711 -X600.247:-5150.82Y250.672:-137.047 -X553.778:-4856.44Y251.796:314.547 -X503.118:-2256.95Y256.963:2468.96 -X508.639:2602.79Y301.175:2217.86 -X555.174:4926.5Y301.321:139.264 -X607.169:5024.02Y303.961:25.6059 -X655.654:4713.99Y301.833:45.9983 -X701.448:4895.1Y304.881:378.576 -X753.556:5310.24Y309.404:130.304 -X807.653:5274.05Y307.487:-428.505 -X859.037:4893.43Y300.834:-82.0938 -X905.522:5029.11Y305.845:104.363 -X959.619:4844.32Y302.921:-242.091 -X1002.41:4527.25Y301.003:318.691 -X1050.16:5214.54Y309.295:342.429 -X1106.7:5132.65Y307.852:-171.56 -X1152.82:4697.02Y305.864:-149.763 -X1200.64:5347.88Y304.856:145.048 -X1259.77:5137.1Y308.765:237.971 -X1303.38:4627.1Y309.616:36.4068 -X1352.32:5301.61Y309.493:-81.18380000000001 -X1409.41:5199.37Y307.992:-37.5154 -X1456.3:2459.59Y308.743:2463.92 -X1458.61:-2604.95Y357.27:2341.54 -X1404.21:-5094.25Y355.574:-240.839 -X1356.72:-5170.51Y352.454:-233.883 -X1300.8:-4950.73Y350.896:-49.2103 -X1257.71:-4676.96Y351.469:-39.0878 -X1207.26:-5319.05Y350.114:-46.7597 -X1151.32:-5159.18Y350.534:110.403 -X1104.07:-4899.67Y352.322:13.8371 -X1053.33:-4750.34Y350.811:270.907 -X1009.07:-4680.11Y357.74:439.867 -X959.729:-5404.36Y359.608:44.0721 -X900.978:-5230.8Y358.622:-368.259 -X855.1130000000001:-4637.86Y352.243:-336.172 -X808.221:-5071.37Y351.898:-43.7084 -X753.686:-5162.36Y351.369:224.812 -X704.974:-4693.38Y356.395:170.735 -X659.818:-5075.08Y354.784:-245.666 -X603.472:-5181.98Y351.481:-232.567 -X556.179:-5027.11Y350.132:350.401 -X502.93:-2673.77Y358.489:2559.12 -X502.703:2381.18Y401.315:2226.33 -X550.554:4995.9Y403.016:162.329 -X602.621:5313.95Y404.561:197.013 -X656.833:5010.7Y406.956:-38.1068 -X702.835:4748.93Y403.799:46.46 -X751.812:4886.66Y407.885:158.535 -X800.568:5298.77Y406.97:-5.56898 -X857.787:5101.29Y407.774:-161.592 -X902.5940000000001:4904.45Y403.738:-252.293 -X955.876:5055.72Y402.728:-88.3794 -X1003.71:4936.13Y401.971:-114.105 -X1054.6:5214.47Y400.446:-60.0489 -X1108:5029.49Y400.77:131.099 -X1155.19:4888.87Y403.068:441.238 -X1205.78:5063.37Y409.594:-135.724 -X1256.46:4926.43Y400.354:-224.708 -X1304.3:4945.3Y405.1:323.015 -X1355.36:4923.6Y406.814:-190.578 -X1402.78:4928.25Y401.289:137.507 -X1453.93:2369.37Y409.564:2528.19 -X1450.16:-2518.65Y451.852:2200.15 -X1403.55:-4991.51Y453.567:386.875 -X1350.33:-5048.34Y459.59:246.166 -X1302.59:-4985.3Y458.49:-267.475 -X1250.63:-4814.89Y454.24:-225.302 -X1206.29:-4623.59Y453.984:-132.309 -X1158.16:-4904.07Y451.594:255.205 -X1108.21:-4931.82Y459.088:208.168 -X1059.52:-4981.52Y455.758:-225.81 -X1008.58:-5246.87Y454.572:7.6165 -X954.581:-5030.67Y455.91:250.972 -X907.9640000000001:-5109.06Y459.592:-215.223 -X852.4:-5019.81Y451.605:-161.553 -X807.568:-4770.2Y456.361:83.5908 -X756.996:-4926.37Y453.277:26.982 -X709.04:-4987.73Y456.9:35.6525 -X657.242:-5011Y453.99:-115.711 -X608.8200000000001:-5090.18Y454.586:28.943 -X555.438:-5347.46Y454.569:222.69 -X501.871:-2571.27Y459.04:2736.19 -X504.013:2456.24Y509.293:2520.66 -X550.996:5234.11Y509.453:-237.565 -X608.6950000000001:5113.54Y504.542:-356.279 -X653.2670000000001:4872.49Y502.327:-210.544 -X706.145:4844.45Y500.331:98.0258 -X750.1559999999999:4726.8Y504.288:109.433 -X800.681:5102.78Y502.519:-87.8023 -X852.212:5031.49Y502.532:-119.952 -X901.311:4947.16Y500.12:182.645 -X951.155:5421.6Y506.185:489.154 -X1009.74:5146.78Y509.903:-227.763 -X1054.09:4832.25Y501.63:-250.02 -X1106.39:5290.18Y504.903:-48.8251 -X1159.89:5072.24Y500.653:-100.953 -X1207.83:4626Y502.884:298.6 -X1252.41:4731.41Y506.625:188.73 -X1302.46:5137.94Y506.659:-119.208 -X1355.17:5154.31Y504.241:-189.404 -X1405.55:5094.63Y502.871:-4.61606 -X1457.07:2719.86Y504.149:2582.39 -X1459.94:-2503.5Y554.518:2776.55 -X1407:-5027.1Y559.6799999999999:149.472 -X1359.4:-5032.79Y557.508:-50.3381 -X1306.34:-5218.91Y558.673:95.90940000000001 -X1255.02:-4897.4Y559.426:-314.774 -X1208.39:-5026.55Y552.377:-319.058 -X1154.49:-5300.69Y553.045:-32.9444 -X1102.38:-5037.5Y551.7190000000001:222.16 -X1053.74:-4982.69Y557.4880000000001:103.602 -X1002.72:-4821.79Y553.7910000000001:66.46599999999999 -X957.307:-4791.33Y558.817:-160.35 -X906.898:-4889.88Y550.5839999999999:-324.15 -X859.51:-5220.17Y552.3339999999999:23.7749 -X802.494:-5327.2Y551.059:379.295 -X752.966:-4640.22Y559.92:399.521 -X709.6900000000001:-4740.79Y559.049:-3.25991 -X658.15:-5368.17Y559.855:-278.214 -X602.326:-4945Y553.485:-469.742 -X559.25:-4936.04Y550.46:240.069 -X503.605:-2927.05Y558.287:2623.39 -X500.709:2395.9Y602.928:2294.41 -X551.524:5030.21Y604.175:155.662 -X601.313:5115.23Y606.0410000000001:238.95 -X653.828:5418.25Y608.954:-28.6165 -X709.678:4946.01Y605.4690000000001:-151.578 -X752.748:4964.48Y605.922:-70.0758 -X808.968:5138.63Y604.067:-160.289 -X855.521:4779.34Y602.717:-2.50991 -X904.554:4848.17Y604.0170000000001:117.107 -X952.484:4927.47Y605.059:-14.3393 -X1003.1:5138.28Y603.73:122.364 -X1055.25:5011.56Y607.506:275.562 -X1103.34:5168.67Y609.242:-350.952 -X1158.62:4960.07Y600.487:-239.012 -X1202.54:4621.15Y604.461:149.893 -X1251.05:5243.23Y603.485:117.189 -X1307.4:5258.88Y606.8049999999999:181.026 -X1356.22:4732.41Y607.105:-169.408 -X1402.05:5026.93Y603.417:84.3532 -X1456.76:2709.19Y608.792:2772.63 -X1456.23:-2724.24Y658.87:2265.53 -X1402.28:-4964.67Y654.103:-398.038 -X1356.94:-4892.86Y650.909:54.8254 -X1304.42:-4951.56Y655.2:3.1786 -X1257.91:-4966.11Y650.972:-92.99379999999999 -X1205.1:-5047.18Y653.34:358.218 -X1156.96:-4773.52Y658.1369999999999:-158.547 -X1109.63:-5048.05Y650.169:-112.47 -X1056:-5480.03Y655.8869999999999:315.162 -X1000.03:-4964.22Y656.472:180.061 -X956.72:-4712.78Y659.489:24.0367 -X905.771:-5231.1Y656.953:-416.579 -X852.097:-4977.45Y651.157:-208.101 -X806.222:-5092.72Y652.7910000000001:113.454 -X750.2430000000001:-5266.37Y653.426:63.4372 -X700.895:-4746.89Y654.059:289.75 -X655.3049999999999:-5040.81Y659.221:-16.6316 -X600.079:-5250.15Y653.727:-105.887 -X550.302:-4732.1Y657.103:-44.9897 -X505.437:-2205.7Y652.827:2211.56 -X506.188:2718.45Y701.335:2794.54 -X559.806:4941.95Y708.718:394.443 -X605.027:4780.4Y709.223:25.7602 -X655.414:5163.59Y709.2329999999999:22.9692 -X708.299:5189.2Y709.683:-443.636 -X759.198:4672.44Y700.36:-289.576 -X801.748:5016.18Y703.891:131.998 -X859.521:4992.85Y703:248.585 -X901.605:4747.13Y708.8630000000001:303.923 -X954.4640000000001:4999.88Y709.079:-112.594 -X1001.6:4996.93Y706.611:-415.694 -X1054.4:5268.12Y700.765:-206.859 -X1106.96:4799.68Y702.474:-8.271240000000001 -X1150.4:4682.31Y700.599:330.167 -X1200.61:5350.13Y709.077:419.059 -X1257.4:5305.75Y708.981:-189.397 -X1306.73:4782.28Y705.289:49.9499 -X1353.04:4844.8Y709.98:-29.1455 -X1403.62:5036.9Y704.706:-9.21766 -X1453.78:2613.75Y709.795:2637.37 -X1455.9:-2630.46Y757.454:2063.74 -X1401.17:-4908.31Y751.0700000000001:106.671 -X1357.73:-4842.52Y759.587:207.496 -X1304.32:-5355.22Y755.22:-358.42 -X1250.63:-5048.39Y752.419:-187.155 -X1203.35:-4649.04Y751.477:228.173 -X1157.65:-4679.64Y756.982:371.054 -X1109.76:-5063.49Y758.898:57.4027 -X1056.38:-5312.17Y758.131:-84.1935 -X1003.52:-5120.16Y757.2140000000001:93.1121 -X953.973:-4880.43Y759.9930000000001:-31.1151 -X905.91:-5150.23Y756.592:-327.943 -X850.968:-4810.27Y753.434:-262.869 -X809.705:-4820.14Y751.3339999999999:-2.95717 -X754.5650000000001:-5227.99Y753.375:117.244 -X705.145:-5086.26Y753.679:-49.5321 -X652.84:-4953.63Y752.384:54.8595 -X606.072:-4801.83Y754.776:-87.6028 -X556.803:-5216.3Y750.6319999999999:-74.8293 -X501.747:-2416.1Y753.28:2936.31 -X508.482:2904.38Y809.3579999999999:2535.91 -X559.8339999999999:4766.09Y803.998:-394.012 -X603.803:4850.75Y801.478:128.48 -X656.849:5240.86Y806.568:-25.2753 -X708.621:4906.42Y800.973:-37.84 -X754.978:4689.75Y805.811:35.8837 -X802.4160000000001:5180.9Y801.6900000000001:-261.274 -X858.596:5114.53Y800.585:-26.5957 -X904.706:4798.74Y801.158:460.714 -X954.571:4976.54Y809.8:370.645 -X1004.24:4830.13Y808.571:-354.355 -X1051.17:4990.04Y802.713:-228.656 -X1104.04:5277.03Y803.998:36.733 -X1156.71:5154.99Y803.447:119.687 -X1207.14:4863.89Y806.3920000000001:43.521 -X1253.99:4950.38Y804.318:-284.572 -X1306.15:5211.62Y800.7:110.831 -X1358.22:5055.91Y806.534:233.44 -X1407.26:4644.04Y805.369:-124.193 -X1451.1:2311.55Y804.05:2622.28 -X1453.49:-2338.75Y857.8150000000001:2561.6 -X1404.33:-5098.04Y855.282:-290.942 -X1351.53:-4829.76Y851.996:-35.9123 -X1307.73:-4995.62Y854.564:180.043 -X1251.62:-5353.93Y855.597:199.933 -X1200.66:-4948.54Y858.563:-246.766 -X1152.65:-4922.1Y850.6609999999999:-378.131 -X1102.21:-5092.25Y851:9.580730000000001 -X1050.81:-4924.09Y850.853:61.4249 -X1003.73:-4781.19Y852.229:378.733 -X955.181:-5091.32Y858.428:-101.87 -X901.9059999999999:-4996.98Y850.191:-238.838 -X855.242:-4827.83Y853.651:192.56 -X805.349:-4828.51Y854.042:-167.955 -X758.672:-4787.89Y850.292:-150.473 -X709.591:-5081.97Y851.033:302.798 -X657.032:-5424.68Y856.348:251.505 -X601.098:-5336.63Y856.063:51.234 -X550.3:-4852.21Y857.373:-142.633 -X504.054:-2139.46Y853.21:2594.98 -X507.51:2311.79Y909.272:2787.32 -X550.29:4820.77Y908.957:-24.4197 -X603.926:5330.92Y908.784:45.8287 -X656.908:5183.36Y909.873:-256.914 -X707.593:4905.14Y903.645:-305.48 -X755.011:4802.81Y903.764:-51.8201 -X803.649:4997.45Y902.609:152.675 -X854.96:4956.21Y906.817:131.738 -X902.773:4810.7Y905.244:-260.947 -X951.174:4884.73Y901.598:223.176 -X1000.47:4943.24Y909.707:9.36734 -X1050.04:5283.03Y901.7859999999999:-444.681 -X1106.13:5439.02Y900.814:270.52 -X1158.82:5176.76Y907.196:213.133 -X1209.66:4709.25Y905.076:-85.0598 -X1253:4982.21Y905.495:6.56295 -X1309.31:4983.4Y905.208:163.949 -X1352.67:4720.55Y908.774:-259.689 -X1403.72:4990.24Y900.014:-279.583 -X1452.48:2439.24Y903.182:2741.01 -X1452.5:-2427.94Y954.8339999999999:2461.97 -X1403.92:-4637.26Y952.422:224.584 -X1359.76:-4897.68Y959.326:-62.3265 -X1305.96:-5203.83Y951.175:-343.002 -X1255.68:-5085.89Y952.466:-4.95397 -X1204.25:-5132.01Y951.076:-85.5989 -X1153.04:-5161.12Y950.754:24.3828 -X1101.02:-4730.67Y951.564:371.337 -X1058.43:-4981.67Y958.1799999999999:135.261 -X1001.39:-5032.34Y954.269:13.1008 -X957.782:-4842.99Y958.442:33.5267 -X904.5309999999999:-4927.71Y954.9400000000001:-275.079 -X859.228:-5118.32Y952.941:-163.955 -X802.165:-5123.53Y951.66:-24.5936 -X756.7569999999999:-4625.15Y952.449:312.916 -X709.6609999999999:-4841.9Y957.919:65.9259 -X659.919:-5042.73Y953.7670000000001:76.5736 -X608.807:-5273.65Y959.45:-20.3195 -X554.446:-5010.95Y953.361:-243.262 -X508.588:-2292.9Y954.585:61.2005 -X508.588:0Y954.585:0 -X508.588Y954.585 -dwell10 -goto 0 -close diff --git a/prg/testPerfGridYX.prg b/prg/testPerfGridYX.prg deleted file mode 100644 index 650da91..0000000 --- a/prg/testPerfGridYX.prg +++ /dev/null @@ -1,415 +0,0 @@ -//this program is generated with ./shapepath.py -//cfg = {"sequencer": ['gen_grid_points(w=20,h=20,pitch=50,rnd=0.2)', 'sort_points()','gen_prog(file="'+fn+'.prg") -//then modifiing start and end to not use gathering and to make a loop - -open prog 2 -N0: -linearabs -X505.488 Y7.15189 -dwell 10 - pvt10 abs -X505.488:-94.6528 Y7.15189:2360.92 -X503.595:-115.415 Y54.3703:4849.54 -X503.18:182.873 Y104.143:5032.15 -X507.253:189.723 Y155.013:5019.64 -X506.974:-206.729 Y204.535:5097.51 -X503.118:83.2134 Y256.963:4831.99 -X508.639:-9.3878 Y301.175:5076.3 -X502.93:-296.764 Y358.489:5006.98 -X502.703:-52.9447 Y401.315:5027.52 -X501.871:65.4658 Y459.04:5398.9 -X504.013:86.7073 Y509.293:4962.34 -X503.605:-165.195 Y558.287:4681.75 -X500.709:91.5662 Y602.928:4727.02 -X505.437:273.978 Y652.827:4920.33 -X506.188:-184.51 Y701.335:5022.64 -X501.747:114.662 Y753.28:5401.19 -X508.482:115.358 Y809.358:4996.53 -X504.054:-48.5644 Y853.21:4995.69 -X507.51:226.702 Y909.272:5068.73 -X508.588:2346.78 Y954.585:2204.45 -X554.446:2085.09 Y953.361:-2281.41 -X550.29:-207.318 Y908.957:-4799.42 -X550.3:477.237 Y857.373:-5247.94 -X559.834:325.199 Y803.998:-5337.02 -X556.803:-1.42305 Y750.632:-4764.01 -X559.806:-325.057 Y708.718:-4676.44 -X550.302:-414.113 Y657.103:-5227.15 -X551.524:447.366 Y604.175:-5332.16 -X559.25:-26.3699 Y550.46:-4736.09 -X550.996:-190.58 Y509.453:-4794.55 -X555.438:-22.1203 Y454.569:-5321.85 -X550.554:37.0354 Y403.016:-5221.84 -X556.179:231.002 Y350.132:-5084.77 -X555.174:-120.062 Y301.321:-4916.82 -X553.778:102.338 Y251.796:-4632.84 -X557.221:289.166 Y208.664:-4767.81 -X559.561:-328.954 Y156.44:-5086.96 -X550.641:-129.226 Y106.925:-5291.88 -X556.976:269.308 Y50.6023:-5073.79 -X556.028:2363.01 Y5.44883:-2207.17 -X604.237:2532 Y6.45894:2562.88 -X606.668:71.4733 Y56.7064:4809.75 -X605.666:-121.456 Y102.654:4967.88 -X604.239:204.46 Y156.064:5295.21 -X609.755:-199.588 Y208.558:4730.43 -X600.247:-129.331 Y250.672:4770.13 -X607.169:161.277 Y303.961:5040.45 -X603.472:-227.371 Y351.481:5030.04 -X602.621:267.404 Y404.561:5155.23 -X608.82:303.685 Y454.586:4999.01 -X608.695:-324.707 Y504.542:4944.96 -X602.326:-369.1 Y553.485:5074.98 -X601.313:-112.371 Y606.041:5012.08 -X600.079:185.716 Y653.727:5159.12 -X605.027:299.683 Y709.223:5052.48 -X606.072:-61.1928 Y754.776:4612.73 -X603.803:-248.732 Y801.478:5064.33 -X601.098:6.1168 Y856.063:5365.28 -X603.926:385.447 Y908.784:5169.36 -X608.807:2799.66 Y959.45:2249.18 -X659.919:2405.05 Y953.767:-2478.84 -X656.908:-144.336 Y909.873:-4870.98 -X657.032:-2.92517 Y856.348:-5165.29 -X656.849:-209.609 Y806.568:-5198.19 -X652.84:-71.7768 Y752.384:-4866.73 -X655.414:123.269 Y709.233:-4658.15 -X655.305:-79.2864 Y659.221:-5013.96 -X653.828:142.215 Y608.954:-4968.31 -X658.15:-28.0536 Y559.855:-5331.32 -X653.267:-45.3994 Y502.327:-5293.23 -X657.242:178.29 Y453.99:-4768.56 -X656.833:128.831 Y406.956:-4960.33 -X659.818:-58.93 Y354.784:-5256.17 -X655.654:-151.218 Y301.833:-5012.34 -X656.794:-276.854 Y254.537:-4911.65 -X650.117:-330.1 Y203.6:-5076.06 -X650.192:255.767 Y153.016:-5133.02 -X655.232:95.5947 Y100.939:-5086.32 -X652.104:-42.8304 Y51.2893:-4601.08 -X654.376:2876.64 Y8.91773:-2372.74 -X709.637:2438.92 Y3.83442:2235.97 -X703.154:-193.858 Y53.6371:5272.93 -X705.759:172.373 Y109.293:4963.18 -X706.602:77.022 Y152.901:4621.17 -X707.3:-61.7972 Y201.716:5303.3 -X705.366:-292.571 Y258.967:5158.21 -X701.448:-19.5939 Y304.881:4871.4 -X704.974:69.3355 Y356.395:4945.94 -X702.835:203.327 Y403.799:5025.28 -X709.04:165.473 Y456.9:4826.57 -X706.145:32.4637 Y500.331:5107.46 -X709.69:176.665 Y559.049:5256.91 -X709.678:-439.739 Y605.469:4750.5 -X700.895:-68.9487 Y654.059:5210.7 -X708.299:212.509 Y709.683:4980.99 -X705.145:16.0826 Y753.679:4564.49 -X708.621:222.315 Y800.973:4867.69 -X709.591:-51.3901 Y851.033:5133.64 -X707.593:3.5026 Y903.645:5344.29 -X709.661:2458.2 Y957.919:2440.17 -X756.757:2267.46 Y952.449:-2707.75 -X755.011:95.739 Y903.764:-5107.85 -X758.672:-1.64313 Y850.292:-4897.65 -X754.978:-205.324 Y805.811:-4845.86 -X754.565:211.003 Y753.375:-5272.52 -X759.198:-216.103 Y700.36:-4997.43 -X750.243:-322.48 Y653.426:-4721.9 -X752.748:136.122 Y605.922:-4675.3 -X752.966:-129.609 Y559.92:-5081.72 -X750.156:201.533 Y504.288:-5332.15 -X756.996:82.7724 Y453.277:-4820.13 -X751.812:-165.519 Y407.885:-5095.41 -X753.686:87.2309 Y351.369:-4924.06 -X753.556:310.877 Y309.404:-4960 -X759.903:82.7119 Y252.169:-5443.05 -X755.21:-186.162 Y200.543:-4894.06 -X756.18:-101.234 Y154.288:-4693.46 -X753.186:-23.9093 Y106.674:-4995.08 -X755.702:236.578 Y54.386:-5069.26 -X757.917:2498.92 Y5.28895:-2256.5 -X805.68:2598.32 Y9.25597:2286.57 -X809.884:-218.123 Y51.0204:4895.37 -X801.318:-426.45 Y107.163:5098.12 -X801.355:34.0993 Y152.983:4651.1 -X802:263.802 Y200.185:4982.52 -X806.631:282.664 Y252.633:5365.07 -X807.653:79.5198 Y307.487:4963.26 -X808.221:-354.239 Y351.898:4974.17 -X800.568:-32.6695 Y406.97:5223.11 -X807.568:5.613 Y456.361:4777.47 -X800.681:-253.679 Y502.519:4734.92 -X802.494:414.344 Y551.059:5077.4 -X808.968:186.406 Y604.067:5086.58 -X806.222:-360.995 Y652.791:4991.2 -X801.748:174.131 Y703.891:4927.19 -X809.705:33.3925 Y751.334:4889.95 -X802.416:-217.788 Y801.69:5135.4 -X805.349:61.6774 Y854.042:5045.94 -X803.649:-159.23 Y902.609:4880.9 -X802.165:2778.92 Y951.66:2516.59 -X859.228:2639.76 Y952.941:-2242.15 -X854.96:-199.286 Y906.817:-4964.49 -X855.242:181.805 Y853.651:-5311.6 -X858.596:-213.69 Y800.585:-5010.85 -X850.968:46.2809 Y753.434:-4879.25 -X859.521:56.473 Y703:-5113.84 -X852.097:-200.032 Y651.157:-5014.19 -X855.521:370.601 Y602.717:-4941.14 -X859.51:-165.459 Y552.334:-5009.23 -X852.212:-355.466 Y502.532:-5036.44 -X852.4:278.767 Y451.605:-4737.89 -X857.787:135.649 Y407.774:-4968.11 -X855.113:62.5122 Y352.243:-5346.99 -X859.037:-245.334 Y300.834:-4732.97 -X850.207:-55.011 Y257.584:-4929.75 -X857.937:274.657 Y202.239:-5083.75 -X855.7:-252.146 Y155.909:-5020.37 -X852.894:-180.544 Y101.832:-5214.78 -X852.089:-109.185 Y51.6131:-5048.03 -X850.71:2405.67 Y0.871293:-2164.34 -X900.202:2791.04 Y8.3262:2583.08 -X906.531:283.147 Y52.5329:4593.74 -X905.865:-39.3915 Y100.201:5199.95 -X905.743:-120.581 Y156.532:5453.99 -X903.454:-127.154 Y209.281:4865.13 -X903.2:103.42 Y253.835:4828.2 -X905.522:-111.086 Y305.845:5239.36 -X900.978:-146.385 Y358.622:4894.67 -X902.594:349.273 Y403.738:5048.49 -X907.964:-64.1837 Y459.592:4819.11 -X901.311:-53.3116 Y500.12:4549.59 -X906.898:162.194 Y550.584:5194.84 -X904.554:-56.314 Y604.017:5318.46 -X905.771:-147.488 Y656.953:5242.3 -X901.605:6.94333 Y708.863:4981.95 -X905.91:155.077 Y756.592:4614.76 -X904.706:-200.23 Y801.158:4679.97 -X901.906:-96.6403 Y850.191:5204.27 -X902.773:131.264 Y905.244:5237.42 -X904.531:2750.42 Y954.94:2659.93 -X957.782:2332.14 Y958.442:-2667.06 -X951.174:-130.011 Y901.598:-5000.73 -X955.181:169.839 Y858.428:-4589.94 -X954.571:-60.4465 Y809.8:-4921.75 -X953.973:-5.33217 Y759.993:-5036.04 -X954.464:137.35 Y709.079:-5025.21 -X956.72:-98.9905 Y659.489:-5201 -X952.484:29.376 Y605.059:-5033.57 -X957.307:-66.4646 Y558.817:-4943.69 -X951.155:-136.285 Y506.185:-5145.37 -X954.581:236.058 Y455.91:-5172.83 -X955.876:257.39 Y402.728:-4815.07 -X959.729:187.168 Y359.608:-4990.34 -X959.619:-192.301 Y302.921:-5064.89 -X955.883:-128.761 Y258.31:-5130.15 -X957.044:31.8931 Y200.318:-5199.82 -X956.521:62.2628 Y154.314:-5013.57 -X958.289:-92.8962 Y100.047:-5093.5 -X954.663:-25.3916 Y52.4443:-4567.34 -X957.782:2756.15 Y8.70012:-2222.63 -X1009.79:2190.41 Y7.99159:2120.18 -X1001.59:-150.401 Y51.1038:4735.42 -X1006.78:368.789 Y102.7:5128.59 -X1008.97:-256.561 Y153.676:5175.74 -X1001.65:-133.782 Y206.215:5252.54 -X1006.29:38.0673 Y258.727:4739.41 -X1002.41:138.787 Y301.003:4950.7 -X1009.07:65.012 Y357.74:5048.38 -X1003.71:-24.4164 Y401.971:4841.59 -X1008.58:301.702 Y454.572:5396.65 -X1009.74:-292.643 Y509.903:4960.92 -X1002.72:-331.938 Y553.791:4691.34 -X1003.1:-134.867 Y603.73:5134.07 -X1000.03:-75.0752 Y656.472:5144.04 -X1001.6:174.595 Y706.611:5037.11 -X1003.52:131.738 Y757.214:5098 -X1004.24:10.6615 Y808.571:4750.73 -X1003.73:-188.45 Y852.229:5056.8 -X1000.47:-117.072 Y909.707:5102.02 -X1001.39:2898.02 Y954.269:2423.65 -X1058.43:2432.39 Y958.18:-2624.16 -X1050.04:-381.161 Y901.786:-5366.36 -X1050.81:56.7276 Y850.853:-4953.66 -X1051.17:278.525 Y802.713:-4636.13 -X1056.38:161.474 Y758.131:-5097.38 -X1054.4:-18.5952 Y700.765:-5112.16 -X1056:42.3533 Y655.887:-4662.95 -X1055.25:-113.048 Y607.506:-4919.98 -X1053.74:-57.9582 Y557.488:-5293.82 -X1054.09:288.789 Y501.63:-5086.52 -X1059.52:25.4009 Y455.758:-5059.17 -X1054.6:-309.365 Y400.446:-5247.32 -X1053.33:-221.713 Y350.811:-4557.54 -X1050.16:-29.8016 Y309.295:-4641.53 -X1052.74:280.399 Y257.98:-5345.82 -X1055.77:81.1614 Y202.379:-4953.06 -X1054.36:78.9827 Y158.919:-4637.85 -X1057.35:110.232 Y109.622:-5376.87 -X1056.56:-136.857 Y51.3818:-5090.83 -X1054.61:2230.97 Y7.80529:-2249.13 -X1101.18:2367.55 Y6.39921:2294.1 -X1101.97:65.2394 Y53.6873:4968.12 -X1102.49:304.806 Y105.762:5167.58 -X1108.06:342.73 Y157.039:5018.9 -X1109.34:-310.279 Y206.14:5124.45 -X1101.86:-132.149 Y259.528:5085.59 -X1106.7:110.803 Y307.852:4639.72 -X1104.07:64.9397 Y352.322:4645.9 -X1108:206.763 Y400.77:5338.3 -X1108.21:-80.5171 Y459.088:5206.67 -X1106.39:-291.48 Y504.903:4631.5 -X1102.38:-152.627 Y551.719:5216.93 -X1103.34:362.482 Y609.242:4922.51 -X1109.63:181.478 Y650.169:4661.62 -X1106.96:6.72767 Y702.474:5436.46 -X1109.76:-146.335 Y758.898:5076.21 -X1104.04:-377.415 Y803.998:4605.11 -X1102.21:104.537 Y851:4840.78 -X1106.13:-59.4913 Y900.814:5028.18 -X1101.02:2345.67 Y951.564:2496.99 -X1153.04:2889.74 Y950.754:-2218.38 -X1158.82:-19.5795 Y907.196:-5004.6 -X1152.65:-105.257 Y850.661:-5187.45 -X1156.71:249.761 Y803.447:-4683.95 -X1157.65:-315.884 Y756.982:-5142.39 -X1150.4:-34.0398 Y700.599:-4942.28 -X1156.96:411.352 Y658.137:-5005.63 -X1158.62:-123.595 Y600.487:-5254.61 -X1154.49:63.5456 Y553.045:-4991.69 -X1159.89:183.116 Y500.653:-5072.53 -X1158.16:-235.287 Y451.594:-4879.25 -X1155.19:-341.518 Y403.068:-5052.99 -X1151.32:-118.553 Y350.534:-4860.2 -X1152.82:277.5 Y305.864:-4918.96 -X1156.87:126.951 Y252.155:-4998.25 -X1155.36:-293.631 Y205.899:-4648.01 -X1151:28.2046 Y159.195:-5008.83 -X1155.92:360.383 Y105.723:-5411.19 -X1158.21:-224.344 Y50.971:-4813.79 -X1151.43:2350.43 Y9.44669:-2341.22 -X1205.22:2847.3 Y4.14662:2075.71 -X1208.38:-149.383 Y50.961:5269.04 -X1202.23:-61.8518 Y109.527:5451.37 -X1207.14:253.52 Y159.988:4679.6 -X1207.3:116.565 Y203.119:4866 -X1209.47:-333.083 Y257.309:5086.84 -X1200.64:-110.888 Y304.856:4640.29 -X1207.26:256.794 Y350.114:5236.9 -X1205.78:-48.348 Y409.594:5193.5 -X1206.29:102.846 Y453.984:4664.48 -X1207.83:105.145 Y502.884:4919.65 -X1208.39:-264.796 Y552.377:5078.87 -X1202.54:-164.691 Y604.461:5048.11 -X1205.1:-96.282 Y653.34:5230.8 -X1200.61:-87.1545 Y709.077:4906.86 -X1203.35:326.344 Y751.477:4865.73 -X1207.14:-134.947 Y806.392:5354.3 -X1200.66:126.312 Y858.563:4934.22 -X1209.66:179.529 Y905.076:4625.67 -X1204.25:2300.91 Y951.076:2369.46 -X1255.68:2437.87 Y952.466:-2279.06 -X1253:-203.049 Y905.495:-4843.44 -X1251.62:49.3787 Y855.597:-5058.87 -X1253.99:-49.7421 Y804.318:-5158.89 -X1250.63:170.361 Y752.419:-4766.85 -X1257.4:364.102 Y708.981:-5072.33 -X1257.91:-317.628 Y650.972:-5274.79 -X1251.05:-144.225 Y603.485:-4577.33 -X1255.02:68.3954 Y559.426:-4842.99 -X1252.41:-219.838 Y506.625:-5259.28 -X1250.63:202.076 Y454.24:-5313.57 -X1256.46:353.934 Y400.354:-5138.54 -X1257.71:165.962 Y351.469:-4579.43 -X1259.77:-258.32 Y308.765:-4966.82 -X1252.54:-289.637 Y252.133:-5333.33 -X1253.98:-52.2467 Y202.098:-4672.59 -X1251.49:24.4522 Y158.681:-4681.72 -X1254.47:413.506 Y108.464:-5199.74 -X1259.76:-91.2849 Y54.6865:-5036.09 -X1252.65:2239.85 Y7.74234:-2450.11 -X1304.56:2856.1 Y5.68434:2415.31 -X1309.77:121.664 Y56.0485:4864.5 -X1306.99:-407.134 Y102.974:5005.36 -X1301.62:-256.643 Y156.156:5323.47 -X1301.86:177.854 Y209.444:4705.05 -X1305.18:75.983 Y250.257:5008.6 -X1303.38:-219.339 Y309.616:5031.97 -X1300.8:46.1217 Y350.896:4774.22 -X1304.3:89.581 Y405.1:5379.72 -X1302.59:-92.1696 Y458.49:5077.92 -X1302.46:187.657 Y506.659:5009.13 -X1306.34:247.017 Y558.673:5007.33 -X1307.4:-95.981 Y606.805:4826.33 -X1304.42:-33.7576 Y655.2:4924.21 -X1306.73:-4.87708 Y705.289:5001.02 -X1304.32:-29.0273 Y755.22:4770.55 -X1306.15:170.587 Y800.7:4967.21 -X1307.73:158.146 Y854.564:5225.36 -X1309.31:-88.5112 Y905.208:4830.56 -X1305.96:2522.53 Y951.175:2705.9 -X1359.76:2335.39 Y959.326:-2120.06 -X1352.67:-411.257 Y908.774:-5366.48 -X1351.53:277.6 Y851.996:-5111.99 -X1358.22:309.857 Y806.534:-4620.43 -X1357.73:-258.98 Y759.587:-4827.73 -X1353.04:-39.5636 Y709.98:-5433.93 -X1356.94:158.969 Y650.909:-5143.72 -X1356.22:123.127 Y607.105:-4670.06 -X1359.4:-52.538 Y557.508:-5143.22 -X1355.17:-453.453 Y504.241:-4895.89 -X1350.33:9.43449 Y459.59:-4871.35 -X1355.36:319.372 Y406.814:-5356.81 -X1356.72:-152.238 Y352.454:-4866.04 -X1352.32:-232.289 Y309.493:-4910.34 -X1352.07:253.925 Y254.247:-5229.43 -X1357.4:-41.825 Y204.905:-4788.34 -X1351.24:37.1235 Y158.48:-5046.98 -X1358.14:307.722 Y103.965:-5404.41 -X1357.39:-397.504 Y50.3919:-4889.44 -X1350.19:2436.42 Y6.17635:-2211.13 -X1406.12:2632.01 Y6.16934:2251.28 -X1402.83:134.504 Y51.202:4982.17 -X1408.81:262.256 Y105.813:5224.45 -X1408.07:-326.844 Y155.691:4836.54 -X1402.27:-216.574 Y202.544:4947.24 -X1403.74:356.982 Y254.636:5272.42 -X1409.41:23.1847 Y307.992:5046.9 -X1404.21:-331.891 Y355.574:4664.83 -X1402.78:-32.5853 Y401.289:4899.67 -X1403.55:138.546 Y453.567:5079.1 -X1405.55:172.103 Y502.871:5305.63 -X1407:-174.882 Y559.68:5027.32 -X1402.05:-235.908 Y603.417:4721.17 -X1402.28:78.6327 Y654.103:5064.48 -X1403.62:-55.2195 Y704.706:4848.35 -X1401.17:182.077 Y751.07:5033.14 -X1407.26:157.832 Y805.369:5210.61 -X1404.33:-177.212 Y855.282:4732.23 -X1403.72:-20.5936 Y900.014:4856.97 -X1403.92:2439.24 Y952.422:2741.01 -X1452.5:2427.94 Y954.834:-2461.97 -X1452.48:49.521 Y903.182:-4850.96 -X1453.49:-68.604 Y857.815:-4956.6 -X1451.1:120.127 Y804.05:-5018.04 -X1455.9:133.884 Y757.454:-4712.75 -X1453.78:16.8 Y709.795:-4929.22 -X1456.23:148.999 Y658.87:-5050.15 -X1456.76:185.553 Y608.792:-5217.57 -X1459.94:15.1661 Y554.518:-5232.19 -X1457.07:-489.036 Y504.149:-5133.29 -X1450.16:-156.95 Y451.852:-4729.23 -X1453.93:422.111 Y409.564:-4729.09 -X1458.61:118.886 Y357.27:-5041.06 -X1456.3:-291.461 Y308.743:-5070.13 -X1452.78:-286.209 Y255.868:-5219.94 -X1450.58:64.7773 Y204.344:-5258.81 -X1454.07:411.853 Y150.692:-4870.94 -X1458.82:-55.5215 Y106.925:-4975.22 -X1452.96:31.0064 Y51.1873:-5005.36 -X1459.44:323.804 Y6.8182:-2218.45 -X1459.44:0 Y6.8182:0 -X1459.44 Y6.8182 -dwell10 -goto 0 -close \ No newline at end of file diff --git a/python/FKIKfaststage.m b/python/FKIKfaststage.m deleted file mode 100644 index 8a37e34..0000000 --- a/python/FKIKfaststage.m +++ /dev/null @@ -1,142 +0,0 @@ -% FK/IK using homogenous matrices %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% This script demonstrates how homogenous matrices can be used to create -% both a forward kinematics (FK)and an inverse kinematics (IK) model of -% a serial kinematics manipulator, with 5 % motors (q1,q2,q3,q4,q5) -% and 4 user coordinates (X,Y,Z,theta). -% -% The script uses a chain of Homogenous Transformation Matrices to create -% the FK model. And the Moore-Penrose Pseudo-Inverse of the Jacobian -% to iteratively solve the IK model (Newton-Raphson). -% -% 5.10.2017 Wayne Glettig - -clear all; -syms offsetX offsetY offsetZ ... - alpha beta gamma... - q1 q2 q3 q4 q5; - -%% Here the Transformation Matrix HBA is constructed from a translation -% matrix and 3 rotation matrices, using symbolic variables. -%Translation: -HXYZ = [1,0,0,offsetX;... - 0,1,0,offsetY;... - 0,0,1,offsetZ;... - 0,0,0,1]; -%Rot around X: -HRX = [1,0 ,0 ,0;... - 0,cos(alpha),-sin(alpha),0;... - 0,sin(alpha), cos(alpha),0;... - 0,0 ,0 ,1]; -%Rot around Y: -HRY = [ cos(beta),0,sin(beta),0;... - 0 ,1,0 ,0;... - -sin(beta),0,cos(beta),0;... - 0 ,0,0 ,1]; -%Rot around Z: -HRZ = [cos(gamma),-sin(gamma),0,0;... - sin(gamma), cos(gamma),0,0;... - 0 ,0 ,1,0;... - 0 ,0 ,0,1]; -%Create HBA (first rotation then translation) -HBA=HXYZ*HRZ*HRY*HRX; -%Create HAB (inverse) -HAB=inv(HBA); - - -%% Here the Kinematic Chain is created (q1,q2,q3,q4,q5 are motor coordinates) -%Essentially the HBA matrix above is filled with the offsetXYZ and angle -%values to assemble the chain. The chain consists here of the reference -%frames 0-1-2-3-4-5-6-7: -%Frame 0: MATLAB darstellungsframe (for plot3) -%Frame 1: Beamline UCS -%Frame 2: on Z Stage -%Frame 3: on X Stage -%Frame 4: on RX Stage -%Frame 5: on Fast X Stage -%Frame 6: on Fast Y Stage -%Frame 7: Sample pos - -H10 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [0,0,0,90/180*pi,0/180*pi,90/180*pi]); -H21 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [0,0,q1,0,0,0]); %Z Stage -H32 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [q2,0,0,0,0,0]); %X Stage -H43 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [0,0,0,0,q3/180*pi,0]); %Rotation RY -H54 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [q4,0,0,0,0,0]); %Fast Stage X -H65 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [0,q5,0,0,0,0]); %Fast Stage Y -H76 = subs(HBA,[offsetX,offsetY,offsetZ,alpha,beta,gamma],... - [0,0,0,0,0,0]); %sample Offset -H70 = H10*H21*H32*H43*H54*H65*H76; -H07 = inv(H70); - -%% The FK model (forward kinematics) can be defined as -% [X;Y;Z;theta] = f(q1,q2,q3,q4,q5) -H71 = H21*H32*H43*H54*H65*H76; %UCS: reference frame 1 -f= H71*[0;0;0;1]; %XYZ position of orgin of reference frame 7 -f(4)=q3; %theta angle directly connected to q3 - -%% The IK model is more difficult to find. Different IK solution methods -% exist, this is one of the basic ones, using the Pseudo-inverse of the -% Jacobian matrix to converge a solution towards a solution -% (Newton-Raphson) - -% Jacobian of FK f function derived over motor coordinates -J= jacobian(f,[q1,q2,q3,q4,q5]); -Jinv = pinv(J); - -tic -% Algorithm for IK (q are motor coords, x are user coords) -xt=[2;1;0;32]; %SET TARGET USER COORDS -q0=[0;0;0;0;0]; %motor start values -qc = q0; %set current q values for loop -loopcond = 1; -loopcounter=0; -while loopcond - xc = vpa(subs(f, [q1,q2,q3,q4,q5], qc')); %get current x values based on q - deltax=xt-xc; %get x error (target - current) - if abs(deltax)<1e-9 %if abs error small enough, get out of loop - loopcond=0; - end - Jinvc=vpa(subs(Jinv, [q1,q2,q3,q4,q5], qc')); %inv Jacobian with current q - deltaq=Jinvc*deltax; %By multiplying the x error with Jinv, a q correction can be deduced - qc = qc+deltaq;%update current motor values - loopcounter=loopcounter+1; -end -q = qc %output q as the motor coordinates -toc - -%% Plot the results (construct sample position using motors) -Oin1 = [0;0;0;1]; -e1in1 = [1;0;0;1]; -e2in1 = [0;1;0;1]; -e3in1 = [0;0;1;1]; - -clf; -hold on; -grid on; -axis vis3d; -axis([-10 10 -10 10 -10 10]); -title('Sample Position, constructed with (q1,q2,q3,q4,q5)'); -xlabel('Beamline Z-Axis'); -ylabel('Beamline X-Axis'); -zlabel('Beamline Y-Axis'); - - -for i= 0:1 -H60c = subs(H70, [q1 q2 q3, q4, q5], q'); - -Oin0 = H60c*Oin1; -e1in0 = H60c*e1in1; -e2in0 = H60c*e2in1; -e3in0 = H60c*e3in1; - -plot3([Oin0(1),e1in0(1)],[Oin0(2),e1in0(2)],[Oin0(3),e1in0(3)],'r-'); -plot3([Oin0(1),e2in0(1)],[Oin0(2),e2in0(2)],[Oin0(3),e2in0(3)],'g-'); -plot3([Oin0(1),e3in0(1)],[Oin0(2),e3in0(2)],[Oin0(3),e3in0(3)],'b-'); -plot3([-10,0],[0,0],[0,0],'r-') -end \ No newline at end of file diff --git a/python/MXTuning.py b/python/MXTuning.py index 9797b0a..f13dcc0 100755 --- a/python/MXTuning.py +++ b/python/MXTuning.py @@ -208,9 +208,10 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n ' args=parser.parse_args() #plt.ion() - comm = PPComm(host=args.host) - gt = Gather(comm) - tune=MXTuning(comm,gt) + #comm = PPComm(host=args.host) + #gt = Gather(comm) + #tune=MXTuning(comm,gt) + tune = MXTuning(None,None) base='MXTuning' if args.dir is not None: base=args.dir @@ -258,7 +259,7 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n ' for ext,amp,minFrq,maxFrq,tSec in (('a',100, 1, 200,15), ('b', 20,10, 300,5), ('c', 5,10, 300,5), - ('d', 1,10, 600,5), + ('d', 1,10,1000,5), ): f=fcrp+ext+'.npz' if not os.path.isfile(f): tune.init_stage();plt.close('all') diff --git a/python/MAError.py b/python/PBMotionAnalyzer/MAError.py similarity index 100% rename from python/MAError.py rename to python/PBMotionAnalyzer/MAError.py diff --git a/python/MAVelocity.py b/python/PBMotionAnalyzer/MAVelocity.py similarity index 100% rename from python/MAVelocity.py rename to python/PBMotionAnalyzer/MAVelocity.py diff --git a/python/MAxyPlot.py b/python/PBMotionAnalyzer/MAxyPlot.py similarity index 100% rename from python/MAxyPlot.py rename to python/PBMotionAnalyzer/MAxyPlot.py diff --git a/python/images/PBMA.ico b/python/PBMotionAnalyzer/PBMA.ico similarity index 100% rename from python/images/PBMA.ico rename to python/PBMotionAnalyzer/PBMA.ico diff --git a/python/images/PBMA.png b/python/PBMotionAnalyzer/PBMA.png similarity index 100% rename from python/images/PBMA.png rename to python/PBMotionAnalyzer/PBMA.png diff --git a/python/PBMotionAnalyzer.py b/python/PBMotionAnalyzer/PBMotionAnalyzer.py similarity index 100% rename from python/PBMotionAnalyzer.py rename to python/PBMotionAnalyzer/PBMotionAnalyzer.py diff --git a/python/data/mode0.npz b/python/PBMotionAnalyzer/records/mode0.npz similarity index 100% rename from python/data/mode0.npz rename to python/PBMotionAnalyzer/records/mode0.npz diff --git a/python/data/mode0.prg b/python/PBMotionAnalyzer/records/mode0.prg similarity index 100% rename from python/data/mode0.prg rename to python/PBMotionAnalyzer/records/mode0.prg diff --git a/python/data/mode1.npz b/python/PBMotionAnalyzer/records/mode1.npz similarity index 100% rename from python/data/mode1.npz rename to python/PBMotionAnalyzer/records/mode1.npz diff --git a/python/data/mode1.prg b/python/PBMotionAnalyzer/records/mode1.prg similarity index 100% rename from python/data/mode1.prg rename to python/PBMotionAnalyzer/records/mode1.prg diff --git a/python/data/mode2.npz b/python/PBMotionAnalyzer/records/mode2.npz similarity index 100% rename from python/data/mode2.npz rename to python/PBMotionAnalyzer/records/mode2.npz diff --git a/python/data/mode2.prg b/python/PBMotionAnalyzer/records/mode2.prg similarity index 100% rename from python/data/mode2.prg rename to python/PBMotionAnalyzer/records/mode2.prg diff --git a/python/data/path_phase20k_PhasePerServo1.npz b/python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo1.npz similarity index 100% rename from python/data/path_phase20k_PhasePerServo1.npz rename to python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo1.npz diff --git a/python/data/path_phase20k_PhasePerServo2.npz b/python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo2.npz similarity index 100% rename from python/data/path_phase20k_PhasePerServo2.npz rename to python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo2.npz diff --git a/python/data/path_phase20k_PhasePerServo4.npz b/python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo4.npz similarity index 100% rename from python/data/path_phase20k_PhasePerServo4.npz rename to python/PBMotionAnalyzer/records/path_phase20k_PhasePerServo4.npz diff --git a/python/data/prog_1.npz b/python/PBMotionAnalyzer/records/prog_1.npz similarity index 100% rename from python/data/prog_1.npz rename to python/PBMotionAnalyzer/records/prog_1.npz diff --git a/python/data/prog_2.npz b/python/PBMotionAnalyzer/records/prog_2.npz similarity index 100% rename from python/data/prog_2.npz rename to python/PBMotionAnalyzer/records/prog_2.npz diff --git a/python/data/shapepath.npz b/python/PBMotionAnalyzer/records/shapepath.npz similarity index 100% rename from python/data/shapepath.npz rename to python/PBMotionAnalyzer/records/shapepath.npz diff --git a/python/data/shapepath.prg b/python/PBMotionAnalyzer/records/shapepath.prg similarity index 100% rename from python/data/shapepath.prg rename to python/PBMotionAnalyzer/records/shapepath.prg diff --git a/python/wxutils.py b/python/PBMotionAnalyzer/wxutils.py similarity index 98% rename from python/wxutils.py rename to python/PBMotionAnalyzer/wxutils.py index bfde205..94fc2be 100755 --- a/python/wxutils.py +++ b/python/PBMotionAnalyzer/wxutils.py @@ -20,7 +20,7 @@ class Path(): path=symPath path=os.path.abspath(path) path=os.path.dirname(path) - return os.path.join(path,'images') + return path class StopWatch(): @classmethod diff --git a/python/coordTrfTest.py b/python/coordTrfTest.py deleted file mode 100755 index ebc58f7..0000000 --- a/python/coordTrfTest.py +++ /dev/null @@ -1,366 +0,0 @@ -#!/usr/bin/env python -# *-----------------------------------------------------------------------* -# | | -# | Copyright (c) 2017 by Paul Scherrer Institute (http://www.psi.ch) | -# | | -# | Author Thierry Zamofing (thierry.zamofing@psi.ch) | -# *-----------------------------------------------------------------------* -''' -tools to check kinematics -''' -import os, sys, json -import numpy as np -import matplotlib as mpl -import matplotlib.pyplot as plt -import mpl_toolkits.mplot3d as plt3d -import matplotlib.animation as anim -from matplotlib.widgets import Slider -import subprocess as sprc -from utilities import * -import telnetlib - -class GpasciiCommunicator(): - '''Communicates with the Delta Tau gpascii programm - ''' - gpascii_ack="\x06\r\n" - gpascii_inp='Input\r\n' - - def connect(self, host, username='root', password='deltatau',prompt='ppmac# ',verbose=0): - p=telnetlib.Telnet(host) - s=p.read_until('login: ') - if verbose: print(s) - p.write(username+'\n') - s =p.read_until('Password: ') - if verbose: print(s) - p.write(password+'\n') - s =p.read_until(prompt) # command prompt - if verbose: print(s) - p.write('gpascii -2\n') # execute gpascii command - s=p.read_until(self.gpascii_inp) - if verbose: print(s) - return p - - -class CoordTrf: - def __init__(self,**kwargs): - for k,v in kwargs.iteritems(): - setattr(self,k,v) - pass - - def show_vel(self): - rec=self.rec - fig = plt.figure() - #y = np.diff(rec[:, 2]) - y = np.diff(rec,axis=0) - mx=y.max(0) - mn=y.min(0) - scl=np.maximum(mx,-mn) - scl=np.where(scl==0, 1, scl) # replace 0 by 1 - y/=scl - x = np.arange(0, y.shape[0]); - x= x.reshape(-1,1).dot(np.ones((1,y.shape[1]))) - lbl=('cx','cz','w','fy') - #plt.plot(x, y,label=lbl) - for i in range(y.shape[1]): - plt.plot(x[:,i], y[:,i],label=lbl[i]) - - plt.legend() - - def show_pos(self): - rec=self.rec - y = rec - #plt.ion() - fig = plt.figure(figsize=(20,6)) - c='bg' - lbl=('q1','q2') - dx=.1/len(lbl) - for i in range(rec.shape[1]): - if i==0: - ax = fig.add_axes([.1, .05, .85, .90]) - axl =[ax,] - else: - ax = fig.add_axes(axl[0].get_position(), sharex=ax) - ax.spines['top'].set_visible(False) - ax.spines['bottom'].set_visible(False) - ax.xaxis.set_visible(False) - ax.patch.set_visible(False) - ax.spines['left'].set_position(('axes', -dx*i)) - axl.append(ax) - ax.set_ylabel(lbl[i], color=c[i]) - ax.tick_params(axis='y', colors=c[i]) - - x = np.arange(0, y.shape[0]); - h=[] - for i in range(rec.shape[1]): - h+=axl[i].plot(x, y[:,i],c[i],label=lbl[i]) - plt.legend(handles=h) - cid = fig.canvas.mpl_connect('motion_notify_event', self.onmove) - fig.obj=self - fig.data=y - - - @staticmethod - def onmove(event): - #print 'button=%s, x=%d, y=%d, xdata=%f, ydata=%f'%( - # event.button, event.x, event.y, event.xdata, event.ydata) - obj = event.canvas.figure.obj - data = event.canvas.figure.data - if(event.xdata): - idx=round(event.xdata) - msg='%d: q1:%.3f q2:%.3f'%((idx,)+tuple(data[idx,:])) - #print msg - event.canvas.toolbar.set_message(msg) - - def download_code(self, prg, file=None, gather=False): - host=self.host - if self.verbose & 4: - for ln in prg: - print(ln) - if file is not None: - fh = open(file, 'w') - fh.write('\n'.join(prg)) - fh.close() - if host is not None: - cmd = 'gpasciiCommander --host ' + host + ' ' + file - print(cmd) - p = sprc.Popen(cmd, shell=True) # , stdout=sprc.PIPE, stderr=sprc.STDOUT) - # res=p.stdout.readlines(); print res - retval = p.wait() - # gather -u /var/ftp/gather/out.txt - if gather: - # ***wait program finished P1000=1*** - com=GpasciiCommunicator().connect(host,prompt='# ') - ack=GpasciiCommunicator.gpascii_ack - sys.stdout.write('wait execution...');sys.stdout.flush() - while(True): - #Gather.MaxLines calculates maximum numbewr of gathering into memory - com.write('P1000\n') - val=com.read_until(ack) - #print val - val=int(val[val.find('=')+1:].rstrip(ack)) - if val==1:break - #com.write('Gather.Index\n') - #val=com.read_until(ack) - #print val - time.sleep(.2) - sys.stdout.write('.');sys.stdout.flush() - fnRmt = '/var/ftp/gather/out.txt' - fnLoc = '/tmp/gather.txt' - print('\ngather data to %s...' % fnRmt) - p = sprc.Popen(('ssh', 'root@' + host, 'gather ', '-u', fnRmt), shell=False, stdin=sprc.PIPE, stdout=sprc.PIPE, - stderr=sprc.PIPE) - res = p.wait() - if res: - print('ssh failed. ssh root@%s to open a session' % host) - return - - print('transfer data to %s...' % fnLoc) - p = sprc.Popen(('scp', 'root@' + host + ':' + fnRmt, fnLoc), shell=False, stdin=sprc.PIPE, stdout=sprc.PIPE, - stderr=sprc.PIPE) - res = p.wait() - self.rec = np.genfromtxt(fnLoc, delimiter=' ') - #plt.ion() - self.show_pos();self.show_vel() - plt.show() - - - - - def gen_code(self, mode): - prg=[] - file='/tmp/prg%d.cfg'%mode - gather=True - if mode==0: - gather=False - prg.append(''' -$$$*** -!common() -!encoder_sim(enc=1,tbl=1,mot=1) -!motor(mot=1,dirCur=0,contCur=100,peakCur=100,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[1].pLimits=0;Motor[1].AmpFaultLevel=0;Motor[1].pAmpEnable=0;Motor[1].pAmpFault=0 - -!encoder_sim(enc=2,tbl=2,mot=2) -!motor(mot=2,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[2].pLimits=0;Motor[2].AmpFaultLevel=0;Motor[2].pAmpEnable=0;Motor[2].pAmpFault=0 - -!encoder_sim(enc=3,tbl=3,mot=3) -!motor(mot=3,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[3].pLimits=0;Motor[3].AmpFaultLevel=0;Motor[3].pAmpEnable=0;Motor[3].pAmpFault=0 - -!encoder_sim(enc=4,tbl=4,mot=4) -!motor(mot=4,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[4].pLimits=0;Motor[4].AmpFaultLevel=0;Motor[4].pAmpEnable=0;Motor[4].pAmpFault=0 - -!encoder_sim(enc=5,tbl=5,mot=5) -!motor(mot=5,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[5].pLimits=0;Motor[5].AmpFaultLevel=0;Motor[5].pAmpEnable=0;Motor[5].pAmpFault=0 - -!encoder_sim(enc=6,tbl=6,mot=6) -!motor(mot=6,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[6].pLimits=0;Motor[6].AmpFaultLevel=0;Motor[6].pAmpEnable=0;Motor[6].pAmpFault=0 - -!encoder_sim(enc=7,tbl=7,mot=7) -!motor(mot=7,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[7].pLimits=0;Motor[7].AmpFaultLevel=0;Motor[7].pAmpEnable=0;Motor[7].pAmpFault=0 - -!encoder_sim(enc=8,tbl=8,mot=8) -!motor(mot=8,dirCur=0,contCur=100,peakCur=1000,timeAtPeak=1,JogSpeed=8.,numPhase=3,invDir=True) -Motor[8].pLimits=0;Motor[8].AmpFaultLevel=0;Motor[8].pAmpEnable=0;Motor[8].pAmpFault=0 - -Motor[3].JogSpeed=1000 //used for joging -Motor[3].MaxSpeed=1000 //used for motion program -#1..8j/ -''') - if mode==1: - gather=False - prg.append(''' -#1..2j=0 - -Gather.Enable=0 -Gather.Items=2 -Gather.MaxSamples=1000000 -Gather.Period=10 -Gather.Addr[0]=Motor[1].ActPos.a -Gather.Addr[1]=Motor[2].ActPos.a - -open prog 1 - jog1=0 - dwell100 - P1000=0 - nofrax - linearabs - Gather.Enable=2 - Y2.0 - dwell100 - Y4.0 - dwell100 - Y6.0 - dwell100 - Y8.0 - dwell100 - Gather.Enable=0 - P1000=1 -close - -open prog 2 - jog1=0 - dwell100 - P1000=0 - nofrax - Gather.Enable=2 - pvt100abs - Y0:0 - Y2:20 - Y4:20 - Y6:20 - Y8:0 - dwell100 - Gather.Enable=0 - P1000=1 -close -''') - if mode==2: - gather=False - prg.append(''' -//motors CX CZ RY FY -// 4 5 3 1 -&1 -a -#1->0 -#2->0 -#3->0 -#4->0 -#5->0 -#6->0 -#7->0 -#8->0 - -#1->Y -open forward -close -open inverse -close -''') - if mode==3: - gather=False - prg.append(''' -// Set the motors as inverse kinematic axes in CS 1 -//motors CX CZ RY FY -// 4 5 3 1 -&1 -a -#1->0 -#2->0 -#3->0 -#4->0 -#5->0 -#6->0 -#7->0 -#8->0 - -#1->I - -open forward - define(q1='L1') - define(Y='C7') - //coord Y - send 1"forward D0: %f \\n",D0 - if(D0>0) callsub 100 - D0=$00000080; //B=$2 X=$40 Y=$80 Z=$100 hex(2+int('40',16)+int('80',16)+int('100',16)) -> 0x1c2 -N100: - Y=q1 - send 1"forward result %f\\n",Y - P1001+=1 -close - -open inverse - define(q1='L1', vq1='R1') - define(Y='C7',vY='C39') - //coord Y - send 1"inverse D0:%f _Y:%f:%f\\n",D0,Y,vY - //D0 is set to $000001c2 - define(q1='L1') - q1=Y - if(D0>0) - { - vq1=vY // THIS LINE IS USED FOR PVT MOVE !!! - send 1"inverse result _q1:%f:%f\\n",q1,vq1 - } - else - { - send 1"inverse result %f\\n",q1 - } - P1002+=1 -close -''') - self.download_code(prg, file, gather) - - def test(self): - file='/tmp/prg.cfg' - #self.gen_code(0) #motor config - self.gen_code(1) #program code - - self.gen_code(2) #simple coord trf - #self.download_code(['&1;b1r',], file, True) - self.download_code(['&1;b2r',], file, True) - - self.gen_code(3) #fwd/inv kinematics - #prg.append(' Coord[1].AltFeedRate=0') # allow maximum speed - #prg.append(' Coord[1].SegMoveTime=0') # turn off segmented mode - - #self.download_code(['&1;b1r',], file, True) - #self.download_code(['Coord[1].AltFeedRate=100','Coord[1].SegMoveTime=0','&1;b2r',], file, True) - self.download_code(['Coord[1].AltFeedRate=0','Coord[1].SegMoveTime=0','&1;b2r',], file, True) - #self.download_code(['Coord[1].AltFeedRate=1','Coord[1].SegMoveTime=.1','&1;b2r',], file, True) - #self.download_code(['Coord[1].AltFeedRate=0','Coord[1].SegMoveTime=.1','&1;b2r',], file, True) - #self.download_code(['&1;b3r',], file, True) - - -# *** READ USER MANUAL P 455 *** -# Inverse-Kinematic Program for PVT Mode, No Segmentation -# - -if __name__=='__main__': - ct=CoordTrf(verbose=255,host='MOTTEST-CPPM-CRM0485') - ct.test() - diff --git a/python/helicalscan1.svg b/python/helicalscanDoc/helicalscan1.svg similarity index 100% rename from python/helicalscan1.svg rename to python/helicalscanDoc/helicalscan1.svg diff --git a/python/helicalscan2.svg b/python/helicalscanDoc/helicalscan2.svg similarity index 100% rename from python/helicalscan2.svg rename to python/helicalscanDoc/helicalscan2.svg diff --git a/python/findxtal.py b/python/imgAnalysis/findxtal.py similarity index 100% rename from python/findxtal.py rename to python/imgAnalysis/findxtal.py diff --git a/python/imgAnalysis/imgStack.py b/python/imgAnalysis/imgStack.py new file mode 100644 index 0000000..529e07e --- /dev/null +++ b/python/imgAnalysis/imgStack.py @@ -0,0 +1,551 @@ +#!/usr/bin/env python +#*-----------------------------------------------------------------------* +#| | +#| Copyright (c) 2013 by Paul Scherrer Institute (http://www.psi.ch) | +#| | +#| Author Thierry Zamofing (thierry.zamofing@psi.ch) | +#*-----------------------------------------------------------------------* +''' +implements an image view to show a colored image of a hdf5 dataset. +''' + +if __name__ == '__main__': + #Used to guarantee to use at least Wx2.8 + import wxversion + wxversion.ensureMinimal('2.8') +import wx +import matplotlib as mpl +if __name__ == '__main__': + mpl.use('WXAgg') + #or mpl.use('WX') + #matplotlib.get_backend() + +import os +import numpy as np +from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas +from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar +import pylab as plt #used for the colormaps + + +class SliderGroup(): + def __init__(self, parent, label, range=(0,100),val=0): + self.sliderLabel = wx.StaticText(parent, label=label) + self.sliderText = wx.TextCtrl(parent, -1, style=wx.TE_PROCESS_ENTER) + self.slider = wx.Slider(parent, -1) + self.slider.SetRange(range[0],range[1]) + sizer = wx.BoxSizer(wx.HORIZONTAL) + sizer.Add(self.sliderLabel, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=2) + sizer.Add(self.sliderText, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=2) + sizer.Add(self.slider, 1, wx.EXPAND) + self.sizer = sizer + self.slider.Bind(wx.EVT_SLIDER, self.sliderHandler) + self.sliderText.Bind(wx.EVT_TEXT_ENTER, self.sliderTextHandler) + self.SetValue(val) + + def SetValue(self, value): + self.value = value + self.slider.SetValue(value) + self.sliderText.SetValue(str(value)) + + def SetCallback(self,funcCB,usrData): + self.cbFuncData=(funcCB,usrData) + + def Callback(self,value,msg): + try: + (funcCB,usrData)=self.cbFuncData + except BaseException as e: + pass + else: + funcCB(usrData,value,msg) + + def sliderHandler(self, evt): + value = evt.GetInt() + self.sliderText.SetValue(str(value)) + self.value=value + self.Callback(value,0) + + def sliderTextHandler(self, evt): + value = int(self.sliderText.GetValue()) + self.slider.SetValue(value) + value = self.slider.Value + self.sliderText.SetValue(str(value)) + self.value=value + self.Callback(value,0) + + +def AddToolbar(parent,sizer): + toolbar = NavigationToolbar(parent) + toolbar.Realize() + if wx.Platform == '__WXMAC__': + # Mac platform (OSX 10.3, MacPython) does not seem to cope with + # having a toolbar in a sizer. This work-around gets the buttons + # back, but at the expense of having the toolbar at the top + parent.SetToolBar(toolbar) + else: + # On Windows platform, default window size is incorrect, so set + # toolbar width to figure width. + tw, th = toolbar.GetSizeTuple() + fw, fh = parent.GetSizeTuple() + # By adding toolbar in sizer, we are able to put it at the bottom + # of the frame - so appearance is closer to GTK version. + # As noted above, doesn't work for Mac. + toolbar.SetSize(wx.Size(fw, th)) + sizer.Add(toolbar, 0, wx.LEFT | wx.EXPAND) + # update the axes menu on the toolbar + toolbar.update() + return toolbar + + +#class ShiftedLogNorm(mpl.colors.Normalize): +class ShiftedLogNorm(mpl.colors.LogNorm): + #copied and modified from LogNorm + def __call__(self, value, clip=None): + #print value.shape,self.vmin,self.vmax,self.clip,clip + if clip is None: + clip = self.clip + ofs0=1-self.vmin + ofs1=1./(np.log(self.vmax+1-self.vmin)) + result=np.log(value+ofs0)*ofs1 + result = np.ma.masked_less_equal(result, 0, copy=False) + return result + def inverse(self, value): + if not self.scaled(): + raise ValueError("Not invertible until scaled") + vmin, vmax = self.vmin, self.vmax + ofs0=1-vmin + if mpl.cbook.iterable(value): + val = np.ma.asarray(value) + return vmin * np.ma.power((vmax/vmin), val)-ofs0 + else: + return vmin * pow((vmax/vmin), value)-ofs0 + def autoscale_None(self, A): + if self.vmin is None: + self.vmin = np.ma.min(A) + if self.vmax is None: + self.vmax = np.ma.max(A) + pass + def autoscale(self, A): + pass + +class MPLCanvasImg(FigureCanvas): + def __init__(self,parent,SetStatusCB=None): + if SetStatusCB: + self.SetStatusCB=SetStatusCB + fig = mpl.figure.Figure() + ax = fig.add_axes([0.075,0.1,0.75,0.85]) + FigureCanvas.__init__(self,parent, -1, fig) + self.mpl_connect('motion_notify_event', self.OnMotion) + self.mpl_connect('button_press_event', self.OnBtnPress) + self.mpl_connect('button_release_event', self.OnBtnRelease) + self.mpl_connect('scroll_event', self.OnBtnScroll) + self.mpl_connect('key_press_event',self.OnKeyPress) + self.fig=fig + self.ax=ax + + def InitChild(self,data): + if data.dtype==np.complex128: + self.dataRaw=data + #data=np.angle(data) + data=np.absolute(data) + + fig=self.fig + ax=self.ax + + msk=~np.isnan(data);msk=data[msk] + avg=np.average(msk); std=np.std(msk) + vmin=np.min(msk);vmax=np.max(msk) + vmin=max(vmin,avg-3*std);vmax=min(vmax,avg+3*std) + if vmin==0:vmin=1 + if vmax<=vmin: + vmax=vmin+1 + + #norm=ShiftedLogNorm() + norm=mpl.colors.Normalize() + #img = ax.imshow(data,interpolation='nearest',cmap=mpl.cm.jet, norm=ShiftedLogNorm(vmin=vmin, vmax=vmax)) + + img = ax.imshow(data,interpolation='nearest',cmap=mpl.cm.jet, vmin=vmin, vmax=vmax) + colBar=fig.colorbar(img,orientation='vertical',norm=norm) + #colBar.norm=ShiftedLogNorm(vmin=vmin, vmax=vmax) + colBar.norm=mpl.colors.Normalize(vmin=vmin, vmax=vmax) + img.set_norm(colBar.norm) + img.cmap._init();bg=img.cmap._lut[0].copy();bg[:-1]/=4 + ax.set_axis_bgcolor(bg) + + + self.colBar=colBar + self.colCycle = sorted([i for i in dir(plt.cm) if hasattr(getattr(plt.cm,i),'N')]) + self.colIndex = self.colCycle.index(colBar.get_cmap().name) + self.img=img + + def OnMotion(self,event): + #print event,event.x,event.y,event.inaxes,event.xdata,event.ydata + if event.inaxes==self.ax: + x=int(round(event.xdata)) + y=int(round(event.ydata)) + try: + v=self.img.get_array()[y,x] + except IndexError as e: + pass + else: + #print x,y,v + self.SetStatusCB(self.Parent,0,(x,y,v)) + elif event.inaxes==self.colBar.ax: + colBar=self.colBar + pt=colBar.ax.bbox.get_points()[:,1] + nrm=colBar.norm + vmin,vmax,p0,p1,pS = (nrm.vmin,nrm.vmax,pt[0],pt[1],event.y) + if isinstance(colBar.norm,mpl.colors.LogNorm):#type(colBar.norm)==mpl.colors.LogNorm does not work... + vS=0 + else:#scale around point + vS=vmin+(vmax-vmin)/(p1-p0)*(pS-p0) + self.SetStatusCB(self.Parent,1,vS) + try: + vmin,vmax,p0,p1,pS=self.colBarPressed + except AttributeError: + return + #if event.inaxes != self.cbar.ax: return + colBar=self.colBar + #print vmin,vmax,p0,p1,pS,type(colBar.norm) + #print 'x0=%f, xpress=%f, event.xdata=%f, dx=%f, x0+dx=%f'%(x0, xpress, event.xdata, dx, x0+dx) + + if isinstance(colBar.norm,mpl.colors.LogNorm):#type(colBar.norm)==mpl.colors.LogNorm does not work... + if event.button==1: + #colBar.norm.vmin=.1 + colBar.norm.vmax=vmax*np.exp((pS-event.y)/100) + #scale= np.exp((event.y-pS)/100) + elif event.button==1:#move top,bottom,both + pD = event.y - pS + vD=(vmax-vmin)/(p1-p0)*(pS-event.y) + colBar.norm.vmin = vmin+vD + colBar.norm.vmax = vmax+vD + elif event.button==3:#scale around point + scale= np.exp((pS-event.y)/100) + vS=vmin+(vmax-vmin)/(p1-p0)*(pS-p0) + #print scale,vS + colBar.norm.vmin = vS-scale*(vS-vmin) + colBar.norm.vmax = vS-scale*(vS-vmax) + self.img.set_norm(colBar.norm)#force image to redraw + colBar.patch.figure.canvas.draw() + + def OnBtnPress(self, event): + """on button press we will see if the mouse is over us and store some data""" + #print dir(event.guiEvent) + if event.inaxes == self.colBar.ax: + #if event.guiEvent.LeftDClick()==True: + # print dlg + pt=self.colBar.ax.bbox.get_points()[:,1] + nrm=self.colBar.norm + self.colBarPressed = (nrm.vmin,nrm.vmax,pt[0],pt[1],event.y) + #self.colBarPressed = event.x, event.y + #print self.colBarPressed + #self.OnMouse(event) + pass + + def OnBtnRelease(self, event): + """on release we reset the press data""" + #self.OnMouse(event) + try: del self.colBarPressed + except AttributeError: pass + + def OnBtnScroll(self, event): + #self.OnMouse(event) + colBar=self.colBar + if event.inaxes==colBar.ax: + pt=colBar.ax.bbox.get_points()[:,1] + nrm=colBar.norm + vmin,vmax,p0,p1,pS = (nrm.vmin,nrm.vmax,pt[0],pt[1],event.y) + if isinstance(colBar.norm,mpl.colors.LogNorm):#type(colBar.norm)==mpl.colors.LogNorm does not work... + scale= np.exp((-event.step)/10) + colBar.norm.vmax=vmax*scale + else:#scale around point + scale= np.exp((-event.step)/10) + vS=vmin+(vmax-vmin)/(p1-p0)*(pS-p0) + #print scale,vS + colBar.norm.vmin = vS-scale*(vS-vmin) + colBar.norm.vmax = vS-scale*(vS-vmax) + self.img.set_norm(colBar.norm)#force image to redraw + colBar.patch.figure.canvas.draw() + + def OnKeyPress(self, event): + colCycle=self.colCycle + colBar=self.colBar + if event.key=='down': + self.colIndex += 1 + elif event.key=='up': + self.colIndex -= 1 + self.colIndex%=len(colCycle) + cmap = colCycle[self.colIndex] + colBar.set_cmap(cmap) + colBar.draw_all() + self.img.set_cmap(cmap) + self.img.get_axes().set_title(cmap) + colBar.patch.figure.canvas.draw() + + def OnMouse(self, event): + for k in dir(event): + if k[0]!='_': + print k,getattr(event,k) + + +class DlgColBarSetup(wx.Dialog): + def __init__(self,parent): + wx.Dialog.__init__(self,parent,-1,'Colormap Setup') + colBar=parent.canvas.colBar + cmap=colBar.cmap + nrm=colBar.norm + + txtVMin=wx.StaticText(self,-1,'vmin') + txtVMax=wx.StaticText(self,-1,'vmax') + txtColMap=wx.StaticText(self,-1,'colormap') + self.edVMin=edVMin=wx.TextCtrl(self,-1,'%g'%nrm.vmin,style=wx.TE_PROCESS_ENTER) + self.edVMax=edVMax=wx.TextCtrl(self,-1,'%g'%nrm.vmax,style=wx.TE_PROCESS_ENTER) + + txtTxrFunc=wx.StaticText(self,-1,'function') + self.cbtxrFunc=cbtxrFunc=wx.ComboBox(self, -1, choices=('linear','logarithmic'), style=wx.CB_READONLY) + cbtxrFunc.SetSelection(0 if nrm.__class__==mpl.colors.Normalize else 1) + + #colMapLst=('Accent', 'Blues', 'BrBG', 'BuGn', 'BuPu', 'Dark2', 'GnBu', 'Greens', 'Greys', 'OrRd', 'Oranges', 'PRGn', 'Paired', + #'Pastel1', 'Pastel2', 'PiYG', 'PuBu', 'PuBuGn', 'PuOr', 'PuRd', 'Purples', 'RdBu', 'RdGy', 'RdPu', 'RdYlBu', 'RdYlGn', 'Reds', + #'Set1', 'Set2', 'Set3', 'Spectral', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd', 'afmhot', 'autumn', 'binary', 'bone', 'brg', 'bwr', + #'cool', 'coolwarm', 'copper', 'cubehelix', 'flag', 'gist_earth', 'gist_gray', 'gist_heat', 'gist_ncar', 'gist_rainbow', 'gist_stern', + #'gist_yarg', 'gnuplot', 'gnuplot2', 'gray', 'hot', 'hsv', 'jet', 'ocean', 'pink', 'prism', 'rainbow', 'seismic', 'spectral', + #'spring', 'summer', 'terrain', 'winter') + + colMapLst=('hot','spectral','jet','gray','RdYlBu','hsv','gist_stern','gist_ncar','BrBG','RdYlBu','brg','gnuplot2', + 'prism','rainbow',) + + self.cbColMap=cbColMap=wx.ComboBox(self, -1, choices=colMapLst, style=wx.CB_READONLY) + cbColMap.Value=cmap.name + + sizer=wx.BoxSizer(wx.VERTICAL) + fgs=wx.FlexGridSizer(4,2,5,5) + fgs.Add(txtVMin,0,wx.ALIGN_RIGHT) + fgs.Add(edVMin,0,wx.EXPAND) + fgs.Add(txtVMax,0,wx.ALIGN_RIGHT) + fgs.Add(edVMax,0,wx.EXPAND) + fgs.Add(txtTxrFunc,0,wx.ALIGN_RIGHT) + fgs.Add(cbtxrFunc,0,wx.EXPAND) + fgs.Add(txtColMap,0,wx.ALIGN_RIGHT) + fgs.Add(cbColMap,0,wx.EXPAND) + sizer.Add(fgs,0,wx.EXPAND|wx.ALL,5) + + edVMin.SetFocus() + + btns = self.CreateButtonSizer(wx.OK|wx.CANCEL) + btnApply=wx.Button(self, -1, 'Apply') + btns.Add(btnApply, 0, wx.ALL, 5) + sizer.Add(btns,0,wx.EXPAND|wx.ALL,5) + self.Bind(wx.EVT_BUTTON, self.OnModify, id=wx.ID_OK) + self.Bind(wx.EVT_BUTTON, self.OnModify, btnApply) + #self.Bind(wx.EVT_TEXT_ENTER, self.OnModify, edVMin) + #self.Bind(wx.EVT_TEXT_ENTER, self.OnModify, edVMax) + self.Bind(wx.EVT_TEXT, self.OnModify, edVMin) + self.Bind(wx.EVT_TEXT, self.OnModify, edVMax) + self.Bind(wx.EVT_COMBOBOX, self.OnModify, cbtxrFunc) + self.Bind(wx.EVT_COMBOBOX, self.OnModify, cbColMap) + + self.SetSizer(sizer) + sizer.Fit(self) + + def OnModify(self, event): + #print 'OnModify' + parent=self.GetParent() + canvas=parent.canvas + colBar=canvas.colBar + cmap=colBar.cmap + nrm=colBar.norm + img=canvas.img + ax=img.get_axes() + data=img.get_array() + + v=self.cbColMap.Value + if v!=cmap.name: + cmap=getattr(mpl.cm,v) + colBar.set_cmap(cmap) + colBar.draw_all() + img.set_cmap(cmap) + ax.set_title(cmap.name) + colBar.patch.figure.canvas.draw() + + vmin,vmax=(float(self.edVMin.Value),float(self.edVMax.Value)) + nrm.vmin=vmin; nrm.vmax=vmax + v=self.cbtxrFunc.GetCurrentSelection() + func=(mpl.colors.Normalize,ShiftedLogNorm) + if nrm.__class__!=func[v]: + if v==0: #linear mapping + colBar.norm = mpl.colors.Normalize(vmin, vmax) + elif v==1: #log mapping + img.cmap._init();bg=img.cmap._lut[0].copy();bg[:-1]/=4 + ax.set_axis_bgcolor(bg) + vmin=1 + colBar.norm = mpl.colors.LogNorm(vmin,vmax) + img.set_norm(colBar.norm) + colBar.patch.figure.canvas.draw() + parent.Refresh(False) + if event.GetId()==wx.ID_OK: + event.Skip()#do not consume (use event to close the window and sent return code) + +class HdfImageFrame(wx.Frame): + def __init__(self, parent,lbl,ims): + wx.Frame.__init__(self, parent, title=lbl, size=wx.Size(850, 650)) + + canvas = MPLCanvasImg(self,self.SetStatusCB) + + sizer = wx.BoxSizer(wx.VERTICAL) + sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW) + self.SetSizer(sizer) + + toolbar=AddToolbar(canvas,sizer) + + l=len(ims) + wxAxCtrl=SliderGroup(self, label='Axis:%d'%0,range=(0,l-1)) + sizer.Add(wxAxCtrl.sizer, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.ALL, border=5) + wxAxCtrl.SetCallback(HdfImageFrame.OnSetView,wxAxCtrl) + + idx=wxAxCtrl.value + data=ims[idx] + canvas.InitChild(data) + + #self.Fit() + self.Centre() + + self.BuildMenu(data.dtype) + self.canvas=canvas + self.sizer=sizer + self.toolbar=toolbar + self.ims=ims + self.wxAxCtrl=wxAxCtrl + + def BuildMenu(self,dtype): + mnBar = wx.MenuBar() + + #-------- Edit Menu -------- + mn = wx.Menu() + mnItem=mn.Append(wx.ID_ANY, 'Setup Colormap', 'Setup the color mapping ');self.Bind(wx.EVT_MENU, self.OnColmapSetup, mnItem) + mnItem=mn.Append(wx.ID_ANY, 'Invert X-Axis', kind=wx.ITEM_CHECK);self.Bind(wx.EVT_MENU, self.OnInvertAxis, mnItem) + self.mnIDxAxis=mnItem.GetId() + mnItem=mn.Append(wx.ID_ANY, 'Invert Y-Axis', kind=wx.ITEM_CHECK);self.Bind(wx.EVT_MENU, self.OnInvertAxis, mnItem) + mnItem=mn.Append(wx.ID_ANY, 'Tomo Normalize', 'Multiplies each pixel with a normalization factor. Assumes there exist an array exchange/data_white', kind=wx.ITEM_CHECK);self.Bind(wx.EVT_MENU, self.OnTomoNormalize, mnItem) + self.mnItemTomoNormalize=mnItem + + if dtype==np.complex128: + mnItem=mn.Append(wx.ID_ANY, 'Complex: Phase', kind=wx.ITEM_CHECK);self.Bind(wx.EVT_MENU, self.OnSetComplexData, mnItem) + + + mnBar.Append(mn, '&Edit') + mn = wx.Menu() + mnItem=mn.Append(wx.ID_ANY, 'Help', 'How to use the image viewer');self.Bind(wx.EVT_MENU, self.OnHelp, mnItem) + mnBar.Append(mn, '&Help') + + self.SetMenuBar(mnBar) + self.CreateStatusBar() + + def SetIdxXY(self,x,y): + self.idxXY=(x,y) + + @staticmethod + def SetStatusCB(obj,mode,v): + if mode==0: + obj.SetStatusText( "x= %d y=%d val=%g"%v,0) + elif mode==1: + obj.SetStatusText( "Colormap Value %d (drag to scale)"%v,0) + else: + raise KeyError('wrong mode') + + @staticmethod + def OnSetView(usrData,value,msg): + 'called when a slice is selected with the slider controls' + imgFrm=usrData.slider.Parent + #imgFrm.img.set_array(imgFrm.data[usrData.value,...]) + idx=imgFrm.wxAxCtrl.value + data=imgFrm.ims[idx] + try: + tomoNorm=imgFrm.tomoNorm + except AttributeError: + imgFrm.canvas.img.set_array(data) + else: + data=data*tomoNorm + imgFrm.canvas.img.set_array(data) + + imgFrm.canvas.draw() + pass + + + def OnTomoNormalize(self,event): + if event.IsChecked(): + #try to find white image + #calculate average + #show white normalize factors + white=self.data.parent['data_white'] + tomoNorm=white[1,:,:] + #tomoNorm=white[:,:,:].mean(axis=0) + #np.iinfo(tomoNorm.dtype).max + #tomoNorm=float(np.iinfo(tomoNorm.dtype).max/2)/tomoNorm + tomoNorm=tomoNorm.mean()/tomoNorm + #tomoNorm=tomoNorm/float(np.iinfo(tomoNorm.dtype).max) + data=self.canvas.img.get_array() + data*=tomoNorm + #data/=tomoNorm + self.tomoNorm=tomoNorm + self.canvas.img.set_array(data) + else: + tomoNorm=self.tomoNorm + data=self.canvas.img.get_array() + data/=tomoNorm + self.canvas.img.set_array(data) + del self.tomoNorm + self.canvas.draw() + + def OnSetComplexData(self, event): + if event.IsChecked(): + data=np.angle(self.canvas.dataRaw) + else: + data=np.absolute(self.canvas.dataRaw) + self.canvas.img.set_array(data) + self.canvas.draw() + + def OnHelp(self,event): + msg='''to change the image selection: +use the toolbar at the bottom to pan and zoom the image +use the scrollbars at the bottom (if present) to select an other slice + +to change the colorscale: +drag with left mouse button to move the colorbar up and down +drag with right mouse button to zoom in/out the colorbar at a given point +use mouse weel to zoom in/out the colorbar at a given point +double click left mouse button to set maximum and minimun colorbar values +use cursor up and down to use a different colormap''' + dlg = wx.MessageDialog(self, msg, 'Help', wx.OK|wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + + def OnColmapSetup(self,event): + dlg=DlgColBarSetup(self) + if dlg.ShowModal()==wx.ID_OK: + pass + dlg.Destroy() + + def OnInvertAxis(self,event): + ax=self.canvas.ax + #event.Checked() + if self.mnIDxAxis==event.GetId(): + ax.invert_xaxis() + else: + ax.invert_yaxis() + self.canvas.draw() + pass + +class ImgStackApp(wx.App): + def OnInit(self): + #parser=GetParser(False) # debug with exampleCmd + return True + + def OnExit(self): + pass + +def Run(ims): + app=ImgStackApp() + frame=HdfImageFrame(None, 'Title', ims) + frame.Show() + app.SetTopWindow(frame) + app.MainLoop() diff --git a/python/5camMeas.py b/python/meas_5cam.py similarity index 100% rename from python/5camMeas.py rename to python/meas_5cam.py diff --git a/python/move_record.py b/python/rec_friction.py similarity index 100% rename from python/move_record.py rename to python/rec_friction.py diff --git a/python/plot_interfero.py b/python/rec_interfero.py similarity index 100% rename from python/plot_interfero.py rename to python/rec_interfero.py diff --git a/python/stage_rms_current.py b/python/stage_rms_current.py deleted file mode 100644 index 92a7373..0000000 --- a/python/stage_rms_current.py +++ /dev/null @@ -1,44 +0,0 @@ -#plot and calculate rms values of sine, six state trapezoidal etc. - -import numpy as np -import matplotlib as mpl -import matplotlib.pyplot as pyplot -pyplot.figure() -x=np.arange(360.) -y=np.sin(x/360.*2.*np.pi) -y1=x.copy() -y1[0: 60]=x[0:60]/60 -y1[ 60:120]=1 -y1[120:180]=1-x[0:60]/60 -y1[180:240]=-x[0:60]/60 -y1[240:300]=-1 -y1[300:360]=-1+x[0:60]/60 - -y2=x.copy() -y2[0: 30]=0 -y2[30:150]=1 -y2[150:210]=0 -y2[210:330]=-1 -y2[330:360]=0 - -y3=x.copy() -y3[0: 60]=.5 -y3[60:120]=1 -y3[120:180]=.5 -y3[180:240]=-.5 -y3[240:300]=-1 -y3[300:360]=-.5 - -pyplot.plot(x,y,x,y1,x,y2,x,y3);pyplot.show() - -rms=np.sqrt(np.mean(y**2)) -b=np.sqrt(2)/2 -rms1=np.sqrt(np.mean(y1**2)) -rms2=np.sqrt(np.mean(y2**2)) -rms3=np.sqrt(np.mean(y3**2)) -print rms,rms1,rms2,rms3,b - -print 0.8/rms, 0.8/rms1, 0.8/rms2, 0.8/rms3 - - -#https://e2e.ti.com/blogs_/b/motordrivecontrol/archive/2013/11/08/generate-your-own-commutation-table-trapezoidal-control-3-phase-bldc-motors-using-hall-sensors \ No newline at end of file diff --git a/python/utilities.py b/python/utilities.py deleted file mode 100755 index 320ee31..0000000 --- a/python/utilities.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python -#*-----------------------------------------------------------------------* -#| | -#| Copyright (c) 2016 by Paul Scherrer Institute (http://www.psi.ch) | -#| | -#| Author Thierry Zamofing (thierry.zamofing@psi.ch) | -#*-----------------------------------------------------------------------* -''' -utilities classes -''' -import json -import numpy as np -import time,os - - -class dotdict(dict): - """dot.notation access to dictionary attributes""" - def __init__(self,arg=None,**kwargs): - if arg!=None: - self.__fill__(arg) - self.__fill__(kwargs) - - def __fill__(self,kw): - for k,v in kw.iteritems(): - if type(v)==dict: - self[k]=dotdict(v) - else: - self[k]=v - if type(v)==list: - for i,w in enumerate(v): - if type(w)==dict: - v[i]=dotdict(w) - pass - - def __dir__(self): - l=dir(object) - #l.extend(self.keys()) - l.extend(map(str,self.keys())) - return l - - def __getattr__(self, attr): - #return self.get(attr) - try: - return self[attr] - except KeyError as e: - raise AttributeError("%r instance has no attribute %r" % (self.__class__, attr)) - - def __repr__(self): - return '<' + dict.__repr__(self)[1:-1] + '>' - - def PrettyPrint(self,indent=0): - for k,v in self.iteritems(): - if type(v)==dotdict: - print ' '*indent,str(k)+':' - v.PrettyPrint(indent+2) - else: - print ' '*indent+str(k)+'\t'+str(v) - - __setattr__= dict.__setitem__ - __delattr__= dict.__delitem__ - #__getattr__= dict.__getattr__ - - -def ConvUtf8(s): - 'convert unicoded json object to ASCII encoded' - #http://stackoverflow.com/questions/956867/how-to-get-string-objects-instead-of-unicode-ones-from-json-in-python - if isinstance(s, dict): - return {ConvUtf8(key): ConvUtf8(value) for key, value in s.iteritems()} - elif isinstance(s, list): - return [ConvUtf8(element) for element in s] - elif isinstance(s, unicode): - return s.encode('utf-8') - else: - return s - -class GpasciiCommunicator(): - '''Communicates with the Delta Tau gpascii programm - ''' - gpascii_ack="\x06\r\n" - gpascii_inp='Input\r\n' - - def connect(self, host, username='root', password='deltatau',prompt='ppmac# '): - p=telnetlib.Telnet(host) - print p.read_until('login: ') - p.write(username+'\n') - print p.read_until('Password: ') - p.write(password+'\n') - print p.read_until(prompt) # command prompt - p.write('gpascii -2\n') # execute gpascii command - print p.read_until(self.gpascii_inp) - return p diff --git a/stream.template b/stream.template deleted file mode 100644 index fb62a5a..0000000 --- a/stream.template +++ /dev/null @@ -1,104 +0,0 @@ -#! Generated by VisualDCT v2.6 -#! DBDSTART -#! DBD("/home/zamofing_t/Documents/prj/SwissFEL/test_ioc/MasterDBD/dbd/test.dbd") -#! DBDEND - - -#record(motor, "$(P):$(Q)X") {} -#record(motor, "$(P):$(Q)Y") {} -#record(motor, "$(P):$(Q)U") {} -#record(motor, "$(P):$(Q)V") {} -#record(motor, "$(P):$(Q)W") {} -record(calc, "$(P):5CAM_X") { - field(CALC, "A/B") - field(INPA, "$(P):$(Q)X.VAL") - field(INPB, "$(P):$(Q)X.MRES") -} - -record(calc, "$(P):5CAM_Y") { - field(CALC, "A/B") - field(INPA, "$(P):$(Q)Y.VAL") - field(INPB, "$(P):$(Q)Y.MRES") -} - -record(calc, "$(P):5CAM_U") { - field(CALC, "A/B") - field(INPA, "$(P):$(Q)U.VAL") - field(INPB, "$(P):$(Q)U.MRES") -} - -record(calc, "$(P):5CAM_V") { - field(CALC, "A/B") - field(INPA, "$(P):$(Q)V.VAL") - field(INPB, "$(P):$(Q)V.MRES") -} - -record(calc, "$(P):5CAM_W") { - field(CALC, "A/B") - field(INPA, "$(P):$(Q)W.VAL") - field(INPB, "$(P):$(Q)W.MRES") -} - -# record(asyn, "$(P):asyn") { -# field(DESC, "asyn record") -# field(PORT, "$(PORT)") -# } -#record (stringout, "$(P):debug$(ID)") is limited to 40 characters therefore use waveform record -record(waveform, "$(P):debug$(ID)") { - field(DESC, "debug$(ID)") - field(FTVL, "CHAR") - field(NELM, "256") - field(DTYP, "stream") - field(INP, "@stream.cfg debug $(PORT)") -} - -# # debug0 does not expect a response -# record(waveform, "$(P):debug0") { -# field(FTVL, "CHAR") -# field(NELM, "256") -# field(DESC, "debug") -# field(DTYP, "stream") -# field(INP, "@stream.cfg debug0 $(PORT)") -# } - -record(bo, "$(P):MOVE_XYUVW") { - field(DESC, "move complex") - field(DTYP, "stream") - field(OUT, "@stream.cfg moveXYUVW($(P):5CAM_) $(PORT)") -} - -#! Further lines contain data used by VisualDCT -#! View(0,160,1.0) -#! Record("$(P):5CAM_X",300,22,0,0,"$(P):5CAM_X") -#! Field("$(P):5CAM_X.INPA",16777215,0,"$(P):5CAM_X.INPA") -#! Field("$(P):5CAM_X.INPB",16777215,0,"$(P):5CAM_X.INPB") -#! Field("$(P):5CAM_X.VAL",16777215,1,"$(P):5CAM_X.VAL") -#! Record("$(P):5CAM_Y",300,202,0,0,"$(P):5CAM_Y") -#! Field("$(P):5CAM_Y.INPA",16777215,0,"$(P):5CAM_Y.INPA") -#! Field("$(P):5CAM_Y.INPB",16777215,0,"$(P):5CAM_Y.INPB") -#! Field("$(P):5CAM_Y.VAL",16777215,1,"$(P):5CAM_Y.VAL") -#! Record("$(P):5CAM_U",280,382,0,0,"$(P):5CAM_U") -#! Field("$(P):5CAM_U.INPA",16777215,0,"$(P):5CAM_U.INPA") -#! Field("$(P):5CAM_U.INPB",16777215,0,"$(P):5CAM_U.INPB") -#! Field("$(P):5CAM_U.VAL",16777215,1,"$(P):5CAM_U.VAL") -#! Record("$(P):5CAM_V",280,562,0,0,"$(P):5CAM_V") -#! Field("$(P):5CAM_V.INPA",16777215,0,"$(P):5CAM_V.INPA") -#! Field("$(P):5CAM_V.INPB",16777215,0,"$(P):5CAM_V.INPB") -#! Field("$(P):5CAM_V.VAL",16777215,1,"$(P):5CAM_V.VAL") -#! Record("$(P):5CAM_W",280,742,0,0,"$(P):5CAM_W") -#! Field("$(P):5CAM_W.INPA",16777215,0,"$(P):5CAM_W.INPA") -#! Field("$(P):5CAM_W.INPB",16777215,0,"$(P):5CAM_W.INPB") -#! Field("$(P):5CAM_W.VAL",16777215,1,"$(P):5CAM_W.VAL") -#! Record("$(P):debug$(ID)",660,274,0,0,"$(P):debug$(ID)") -#! Record("$(P):MOVE_XYUVW",660,128,0,0,"$(P):MOVE_XYUVW") -#! Record(SEL,660,414,0,1,"SEL") -#! Field("SEL.INPA",16777215,0,"SEL.INPA") -#! Link("SEL.INPA","$(P):5CAM_X.VAL") -#! Field("SEL.INPB",16777215,0,"SEL.INPB") -#! Link("SEL.INPB","$(P):5CAM_Y.VAL") -#! Field("SEL.INPC",16777215,0,"SEL.INPC") -#! Link("SEL.INPC","$(P):5CAM_U.VAL") -#! Field("SEL.INPD",16777215,0,"SEL.INPD") -#! Link("SEL.INPD","$(P):5CAM_V.VAL") -#! Field("SEL.INPE",16777215,0,"SEL.INPE") -#! Link("SEL.INPE","$(P):5CAM_W.VAL")