diff --git a/Makefile b/Makefile index 0457a84d..98cbf925 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,10 @@ HWVERSION = v4 ifeq ($(HWVERSION),v3) COMPS += src/comps/hw/io3.c COMPS += src/comps/hvf1.c + COMPS += shared/comps/pmsm.c + COMPS += shared/comps/curpid.c + COMPS += shared/comps/dq.c + COMPS += shared/comps/idq.c SOURCES += shared/common_f1.c CFLAGS += -DV3 else @@ -42,6 +46,7 @@ else COMPS += src/comps/yaskawa.c COMPS += src/comps/encs.c COMPS += src/comps/encf.c + COMPS += src/comps/endat.c CFLAGS += -DV4 endif @@ -55,20 +60,17 @@ COMPS += src/comps/hx711.c COMPS += shared/comps/sim.c COMPS += shared/comps/term.c -COMPS += shared/comps/curpid.c COMPS += shared/comps/svm.c -COMPS += shared/comps/dq.c -COMPS += shared/comps/idq.c + COMPS += shared/comps/vel.c COMPS += shared/comps/rev.c COMPS += shared/comps/hal_test.c -COMPS += shared/comps/dc.c +# COMPS += shared/comps/dc.c COMPS += shared/comps/ypid.c COMPS += shared/comps/fault.c COMPS += shared/comps/pid.c COMPS += shared/comps/spid.c COMPS += shared/comps/pe.c -COMPS += shared/comps/pmsm.c COMPS += shared/comps/pmsm_limits.c COMPS += shared/comps/pmsm_ttc.c COMPS += shared/comps/dc_limits.c @@ -98,9 +100,20 @@ COMPS += shared/comps/velbuf.c COMPS += shared/comps/avg.c COMPS += shared/comps/mux.c COMPS += shared/comps/veltopos.c -COMPS += shared/comps/wobl.c +# COMPS += shared/comps/wobl.c COMPS += shared/comps/debounce.c COMPS += shared/comps/pos_filter.c +COMPS += shared/comps/rl.c +COMPS += shared/comps/mad.c +COMPS += shared/comps/sensorless.c +COMPS += shared/comps/field.c +COMPS += shared/comps/gain.c +COMPS += shared/comps/rlpsij.c +COMPS += shared/comps/veltime.c +COMPS += shared/comps/mpid.c +COMPS += shared/comps/fmove.c +COMPS += shared/comps/home.c +COMPS += shared/comps/en.c SOURCES += $(COMPS) @@ -111,6 +124,7 @@ SOURCES += src/syscalls.c SOURCES += shared/crc8.c SOURCES += shared/yaskawa_crc16.c +SOURCES += shared/endat.c SOURCES += shared/angle.c SOURCES += shared/hal.c SOURCES += shared/commands.c diff --git a/conf/haas_spindle_slip.txt b/conf/haas_spindle_slip.txt new file mode 100644 index 00000000..b1d377c1 --- /dev/null +++ b/conf/haas_spindle_slip.txt @@ -0,0 +1,45 @@ +link pid +link acim +link enc_fb0 +link misc + +link sserial +linrev0.scale = 1 + +conf0.r = 0.5 +conf0.l = 0.005 +conf0.j = 0.015 +conf0.max_force = 30 +conf0.max_ac_cur = 25 +conf0.polecount = 2 +conf0.vel_p = 100 +conf0.vel_i = 5 +conf0.max_sat = 1 +conf0.max_pos_error = 0 +conf0.max_vel = 840 +conf0.max_acc = 2000 +conf0.mot_fb_res = 2000 +conf0.max_dc_volt = 390 +conf0.high_dc_volt = 375 +conf0.mot_fb_rev = 1 + +iit0.cur_boost = 1.3 +iit0.max_time = 60 + +acim_ttc0.vel_n = 182.7 +acim_ttc0.torque_n = 23.0 +acim_ttc0.cur_n = 17.0 +acim_ttc0.freq_n = 60.0 +acim_ttc0.u_n = 80.0 +acim_ttc0.u_boost = 7.0 +acim_ttc0.t_boost = 1.3 + +load ramp +ramp0.rt_prio = 1.95 +ramp0.vel_ext_cmd = rev0.out_d +ramp0.en = sserial0.en +ramp0.max_vel = 838 +ramp0.max_acc = 500 + +fault0.en = ramp0.en_out +pid0.pos_en = 0 \ No newline at end of file diff --git a/conf/haas_spindle_slip_uf.txt b/conf/haas_spindle_slip_uf.txt new file mode 100644 index 00000000..7188ad9e --- /dev/null +++ b/conf/haas_spindle_slip_uf.txt @@ -0,0 +1,68 @@ +link pid +link acim +link enc_fb0 +link misc + +link sserial_uf +load idx_home +load linrev +linrev0.rt_prio = 2.1 +idx_home0.rt_prio = 2.3 +linrev0.fb_in = idx_home0.pos_out +linrev0.fb_d_in = vel1.vel +idx_home0.fb = enc_fb0.pos +idx_home0.fb_abs = enc_fb0.abs_pos +idx_home0.mot_state = enc_fb0.state +enc_fb0.amp = 5 + +idx_home0.index_en = sserial0.index_out +idx_home0.mot_state = fb_switch0.mot_state +sserial0.index_clear = idx_home0.index_clear +linrev0.rev_clear = sserial0.index_clear +sserial0.pos_fb = linrev0.fb_out +sserial0.vel_fb = linrev0.fb_d_out +linrev0.scale = -1 + +conf0.r = 1.4 +conf0.l = 0.0013 +conf0.j = 0.015 +conf0.max_force = 50 +conf0.max_ac_cur = 25 +acim_ttc0.cur_n = 20 +acim_ttc0.torque_n = 19 +acim_ttc0.freq_n = 50 +acim_ttc0.slip_n = 1.8 +acim_ttc0.u_n = 230 +acim_ttc0.u_boost = 5 +conf0.polecount = 2 +conf0.vel_p = 500 +conf0.vel_i = 1 +conf0.max_sat = 0.5 +iit0.cur_boost = 2 +iit0.max_time = 60 +conf0.max_pos_error = 0 +conf0.max_vel = 900 +conf0.max_acc = 9000 +conf0.mot_fb_res = 2000 +conf0.max_dc_volt = 390 +conf0.high_dc_volt = 375 + +pid0.max_vel = conf0.max_vel +pid0.max_torque = 50 +pid0.min_torque = -50 + +load ramp +ramp0.rt_prio = 1.95 +ramp0.vel_ext_cmd = sserial0.pos_cmd_d +ramp0.en = sserial0.out3 +ramp0.max_vel = 837 +ramp0.max_acc = 837 + +load not +not0.rt_prio = 2 +not0.in = sserial0.out3 + +pid0.vel_ext_cmd = ramp0.vel_cmd +pid0.pos_en = not0.out + +acim_ttc0.mode = 2 \ No newline at end of file diff --git a/conf/move.txt b/conf/move.txt new file mode 100644 index 00000000..eccd80e5 --- /dev/null +++ b/conf/move.txt @@ -0,0 +1,60 @@ +link pid +link pmsm +link enc_fb0 +enc_fb0.en_index = 0 +link jog_cmd +link misc +conf0.r = 2 +conf0.l = 0.007 +conf0.j = 0.000067 +conf0.j_load = 0.00005 +conf0.polecount = 5 +conf0.max_ac_cur = 5 +conf0.mot_fb_res = 20000 + +load hx +hx0.rt_prio = 9 +hx0.gain = 1 + +load en +en0.rt_prio = 2 +en0.en_in = 1 +fault0.en = en0.en_out0 +en0.fault = fault0.fault +en0.time = 3 +conf0.phase_cur = 3 +conf0.phase_time = 1 + +load home +home0.rt_prio = 9 +home0.en_in = en0.en_out1 +rev0.in = home0.pos_out +home0.home_in = io0.ind0n +home0.home_vel = -12 + +load fmove +fmove0.rt_prio = 10 +fmove0.en = home0.en_out +fmove0.force_in = hx0.out +home0.pos_in = fmove0.mpos +fmove0.max_usr_vel = 0.1 +fmove0.max_usr_acc = 0.1 +term0.wave0 = fmove0.mpos +hx0.gain = 870 +hx0.offset = -5.5 + +fmove0.damping = 0 +fmove0.real_mass = 0 +fmove0.virtual_mass = 5 +fmove0.friction = 0.5 +fmove0.min_pos = 0 +fmove0.max_pos = 1 +fmove0.scale = 340 +fmove0.max_vel = 0.025 +fmove0.max_acc = 0.15 +fmove0.max_usr_vel = 0.35 +fmove0.max_usr_acc = 5 +fmove0.force_th = 2.5 +term0.send_step = 0 +fmove0.print_freq = 10 +fmove0.force_offset_lpf = 0.05 \ No newline at end of file diff --git a/conf/sensorless_perske.txt b/conf/sensorless_perske.txt new file mode 100644 index 00000000..f355d558 --- /dev/null +++ b/conf/sensorless_perske.txt @@ -0,0 +1,38 @@ +link pid +link acim +link jog_cmd +link misc +conf0.r = 4.3 +conf0.l = 0.008 +conf0.max_ac_cur = 2 +load sensorless +sensorless0.rt_prio = 5 +sensorless0.r = conf0.r +sensorless0.l = conf0.l +sensorless0.ud = hv0.ud_fb +sensorless0.uq = hv0.uq_fb +sensorless0.id = hv0.id_fb +sensorless0.iq = hv0.iq_fb +term0.wave0 = sensorless0.udd +term0.wave1 = sensorless0.udd +term0.wave2 = sensorless0.ed +term0.wave3 = sensorless0.eq +term0.wave4 = sensorless0.vel +term0.gain0 = 10 +term0.gain1 = 10 +term0.gain2 = 10 +term0.gain3 = 10 +term0.gain4 = 0.5 +term0.gain5 = 0.5 +term0.gain6 = 0.5 +#link rl +hv0.d_cmd = 0.55 +hv0.q_cmd = 0 +hv0.pos = sensorless0.pos +sensorless0.drop = 1.5 +sensorless0.ki = 0.5 +sensorless0.min_vel = 20 +sensorless0.vel_boost = 0.2 +conf0.r = 4 +conf0.max_ac_cur = 6 +sensorless0.kb = 1 diff --git a/conf/spindle_slip_uf.txt b/conf/spindle_slip_uf.txt new file mode 100644 index 00000000..59a66d96 --- /dev/null +++ b/conf/spindle_slip_uf.txt @@ -0,0 +1,81 @@ +link pid +link acim +link res_fb0 +link enc_cmd +link misc +conf0.r = 2 +conf0.l = 0.016 +conf0.j = 0.0003 +conf0.max_force = 20 +conf0.max_ac_cur = 12 +acim_ttc0.cur_n = 3 +acim_ttc0.torque_n = 1.9 +acim_ttc0.freq_n = 100 +acim_ttc0.u_n = 160 +acim_ttc0.u_boost = 5 +conf0.polecount = 2 +conf0.mot_fb_rev = 1 +conf0.vel_p = 300 +conf0.vel_i = 2 +conf0.max_sat = 0.2 +iit0.cur_boost = 4 +iit0.max_time = 60 +pid0.max_vel = conf0.max_vel +pid0.max_torque = 20 +pid0.min_torque = -20 +conf0.max_pos_error = 0 +conf0.max_vel = 1100 +conf0.mot_fb_res = 8000 + +load mad +mad0.rt_prio = 1.9 +mad0.in = io0.in1 +mad0.mult = 84 + +load ramp +ramp0.rt_prio = 1.95 +ramp0.vel_ext_cmd = mad0.out +ramp0.en = io0.ind0 +ramp0.max_vel = 1050 +ramp0.max_acc = 500 + +load mux +mux0.rt_prio = 2 +pid0.pos_en = mux0.out0 +mux0.in0 = 1 +mux0.in10 = 0 + +pid0.vel_ext_cmd = mux0.out1 +mux0.in1 = vel0.vel +mux0.in11 = ramp0.vel_cmd + +acim_ttc0.mode = mux0.out2 +mux0.in2 = 0 +mux0.in12 = 2 + +acim_ttc0.slip_n = mux0.out3 +mux0.in3 = 1 +mux0.in13 = 2 + +fault0.max_sat = mux0.out4 +mux0.in4 = conf0.max_sat +mux0.in14 = 2 + +mux0.mux = io0.ind0 + +res0.freq = 5000 +res0.phase = 0.89 + +enc_cmd0.mode = 1 +enc_cmd0.remap = 3 + +load not +not0.rt_prio = 2 +not0.in = io0.C12 +fault0.en = not0.out + +enc_cmd0.fault = fault0.fault +term0.wave2 = mux0.out1 +term0.gain2 = 0.1 +term0.gain3 = 0.1 +conf0.max_dc_volt = 390 \ No newline at end of file diff --git a/conf/template/acim.txt b/conf/template/acim.txt index fa7c29f4..605fc63f 100644 --- a/conf/template/acim.txt +++ b/conf/template/acim.txt @@ -1,25 +1,15 @@ -load pmsm_limits load acim_ttc -pmsm_limits0.rt_prio = 7 acim_ttc0.rt_prio = 9 -pmsm_limits0.r = conf0.r -pmsm_limits0.ld = conf0.l -pmsm_limits0.lq = conf0.l -pmsm_limits0.psi = conf0.psi -pmsm_limits0.j = conf0.j -pmsm_limits0.polecount = conf0.polecount -pmsm_limits0.ac_volt = hv0.pwm_volt -pmsm_limits0.iq = hv0.q_fb -pmsm_limits0.id = hv0.d_fb -pid0.max_torque = pmsm_limits0.max_torque -pid0.min_torque = pmsm_limits0.min_torque -pid0.max_vel = pmsm_limits0.abs_max_vel +pid0.max_torque = acim_ttc0.t_max +pid0.min_torque = acim_ttc0.t_min +pid0.max_vel = conf0.max_vel acim_ttc0.torque = pid0.torque_cor_cmd acim_ttc0.polecount = conf0.polecount -acim_ttc0.vel = vel1.vel +acim_ttc0.vel_m = vel1.vel acim_ttc0.mode = 0 -hv0.q_cmd = acim_ttc0.iq -hv0.d_cmd = acim_ttc0.id -hv0.cmd_mode = 1 +acim_ttc0.sensorless = 0 +hv0.q_cmd = acim_ttc0.q_cmd +hv0.d_cmd = acim_ttc0.d_cmd +hv0.cmd_mode = acim_ttc0.cmd_mode hv0.phase_mode = 2 hv0.pos = acim_ttc0.pos \ No newline at end of file diff --git a/conf/template/conf.txt b/conf/template/conf.txt index 5608ee82..ebde4ec0 100644 --- a/conf/template/conf.txt +++ b/conf/template/conf.txt @@ -35,5 +35,5 @@ conf0.vel_p = 2000 conf0.vel_i = 5 conf0.vel_g = 1 conf0.cur_p = 0.2 -conf0.cur_i = 0.0001 +conf0.cur_i = 1.5 conf0.max_sat = 0.2 diff --git a/conf/template/dc.txt b/conf/template/dc.txt index 8bccd104..28ee8550 100644 --- a/conf/template/dc.txt +++ b/conf/template/dc.txt @@ -8,7 +8,7 @@ dc_limits0.lq = conf0.l dc_limits0.psi = conf0.psi dc_ttc0.psi = conf0.psi dc_limits0.ac_volt = hv0.pwm_volt -dc_limits0.iq = hv0.q_fb +dc_limits0.iq = hv0.iq_fb pid0.max_torque = dc_limits0.max_torque pid0.min_torque = dc_limits0.min_torque pid0.max_vel = dc_limits0.abs_max_vel diff --git a/conf/template/enc_fb0.txt b/conf/template/enc_fb0.txt index 34b12efa..f65eab6f 100644 --- a/conf/template/enc_fb0.txt +++ b/conf/template/enc_fb0.txt @@ -13,3 +13,4 @@ io0.fb0y = enc_fb0.error io0.fb0g = 1 enc_fb0.vel = vel1.vel enc_fb0.amp = adc0.amp0 +enc_fb0.en_index = 1 \ No newline at end of file diff --git a/conf/template/enc_ws_fb0.txt b/conf/template/enc_ws_fb0.txt new file mode 100644 index 00000000..65145de9 --- /dev/null +++ b/conf/template/enc_ws_fb0.txt @@ -0,0 +1,30 @@ +load enc_fb +enc_fb0.rt_prio = 2 +enc_fb0.res = conf0.mot_fb_res +enc_fb0.sin = adc0.sin0l +enc_fb0.cos = adc0.cos0l +enc_fb0.quad = adc0.quad +fb_switch0.mot_pos = enc_fb0.pos +fb_switch0.mot_abs_pos = enc_fb0.abs_pos +fb_switch0.mot_polecount = 1 +fb_switch0.mot_state = enc_fb0.state +fault0.mot_fb_error = enc_fb0.error +io0.fb0y = enc_fb0.error +io0.fb0g = 1 +enc_fb0.vel = vel1.vel +enc_fb0.amp = adc0.amp0 + +load uvw +uvw0.rt_prio = 2 +uvw0.u = io0.fb0a +uvw0.v = io0.fb0b +uvw0.w = io0.fb0z +fb_switch0.com_pos = uvw0.pos +fb_switch0.com_abs_pos = uvw0.pos +fb_switch0.com_state = uvw0.state +fb_switch0.com_polecount = conf0.com_fb_polecount +conf0.com_fb_polecount = conf0.polecount +uvw0.amp = adc0.amp0 +fault0.com_fb_error = uvw0.error +enc_fb0.en_index = uvw0.state +uvw0.mode = 1 \ No newline at end of file diff --git a/conf/template/linkv3.txt b/conf/template/linkv3.txt index 3e2acd9f..61ffaaa2 100644 --- a/conf/template/linkv3.txt +++ b/conf/template/linkv3.txt @@ -34,8 +34,7 @@ curpid0.id_cmd = fb_switch0.id curpid0.iq_cmd = pmsm_ttc0.cur curpid0.dc_volt = hv0.dc_volt curpid0.ac_volt = hv0.ac_volt -curpid0.rd = conf0.r -curpid0.rq = conf0.r +curpid0.r = conf0.r curpid0.ld = conf0.l curpid0.lq = conf0.l curpid0.ff = conf0.cur_ff @@ -57,15 +56,3 @@ fb_switch0.phase_time = conf0.phase_time pid0.min_torque = pmsm_limits0.next_min_torque pid0.max_torque = pmsm_limits0.next_max_torque - - - -curpid0.max_cur = 5 - - -pid0.max_vel = conf0. -pid0.max_torque = 5.000000 -pid0.min_torque = -5.000000 -pmsm0.vel = -curpid0.cmd_mode = 1 ? CURRENT_MODE - diff --git a/conf/template/mpid.txt b/conf/template/mpid.txt new file mode 100644 index 00000000..2080448e --- /dev/null +++ b/conf/template/mpid.txt @@ -0,0 +1,118 @@ +load adc +load reslimit +load rev +load fb_switch +load veltime +load veltime +load vel +load mpid +load fault +load hv +load sim +load io +load iit +link conf +hv0.rt_prio = 0.9 +hv0.frt_prio = 1 +adc0.rt_prio = 1 +reslimit0.rt_prio = 3 +rev0.rt_prio = 4 +fb_switch0.rt_prio = 5 +veltime0.frt_prio = 6 +veltime1.frt_prio = 6 +vel0.rt_prio = 6 +io0.rt_prio = 7 +mpid0.rt_prio = 8 +fault0.rt_prio = 10 +iit0.rt_prio = 13 +sim0.rt_prio = 13 +term0.rt_prio = 16 +rev0.rev = conf0.cmd_rev +fb_switch0.mot_rev = conf0.mot_fb_rev +fb_switch0.com_rev = conf0.com_fb_rev +fb_switch0.joint_rev = conf0.joint_fb_rev +reslimit0.res = conf0.mot_fb_res +mpid0.j = conf0.j +mpid0.pos_p = conf0.pos_p +mpid0.vel_p = conf0.vel_p +mpid0.vel_i = conf0.vel_i +mpid0.max_vel = conf0.max_vel +mpid0.max_acc = conf0.max_acc +mpid0.max_torque = conf0.max_force +fault0.max_sat = conf0.max_sat +fault0.max_pos_error = conf0.max_pos_error +fault0.max_vel_error = conf0.max_vel_error +fault0.max_dc_cur = conf0.max_dc_cur +fault0.max_ac_cur = conf0.max_ac_cur +fault0.max_dc_volt = conf0.max_dc_volt +fault0.high_dc_volt = conf0.max_dc_volt +fault0.min_dc_volt = conf0.min_dc_volt +fault0.max_hv_temp = conf0.max_hv_temp +fault0.max_mot_temp = conf0.max_mot_temp +fault0.high_hv_temp = conf0.high_hv_temp +fault0.high_mot_temp = conf0.high_mot_temp +fault0.fan_hv_temp = conf0.fan_hv_temp +fault0.fan_mot_temp = conf0.fan_mot_temp +fault0.ac_cur = hv0.abs_cur +hv0.rev = conf0.out_rev +hv0.r = conf0.r +hv0.l = conf0.l +hv0.psi = conf0.psi +hv0.cur_p = conf0.cur_p +hv0.cur_i = conf0.cur_i +hv0.cur_ff = conf0.cur_ff +hv0.cur_ind = conf0.cur_ind +hv0.max_cur = conf0.max_ac_cur +reslimit0.pos_in = rev0.out +fb_switch0.cmd_pos = reslimit0.pos_out +fb_switch0.polecount = conf0.polecount +fb_switch0.en = fault0.en_fb +fb_switch0.mot_polecount = conf0.mot_fb_polecount +fb_switch0.joint_polecount = conf0.joint_fb_polecount +fb_switch0.com_polecount = conf0.com_fb_polecount +fb_switch0.mot_offset = conf0.mot_fb_offset +fb_switch0.joint_offset = conf0.joint_fb_offset +fb_switch0.com_offset = conf0.com_fb_offset +fb_switch0.phase_time = conf0.phase_time +fb_switch0.phase_cur = conf0.phase_cur +veltime0.pos = rev0.out +veltime1.pos = fb_switch0.vel_fb +vel0.pos_in = fb_switch0.com_fb +vel0.en = fault0.en_fb +vel0.torque = mpid0.torque_cor_cmd +mpid0.en = fault0.en_pid +mpid0.pos_ext_cmd = reslimit0.pos_out +mpid0.vel_ext_cmd = veltime0.vel_lp +mpid0.pos_fb = fb_switch0.pos_fb +mpid0.vel_fb = veltime1.vel_lp +rev0.in_d = veltime0.vel_lp +fault0.pos_error = mpid0.pos_error +fault0.vel_error = mpid0.vel_error +fault0.dc_volt = hv0.dc_volt +fault0.hv_temp = hv0.hv_temp +fault0.dc_cur = hv0.dc_cur +fault0.hv_error = hv0.fault +fault0.fb_ready = fb_switch0.state +hv0.en = fault0.en_out +hv0.pos = vel2.pos_out +hv0.vel = vel2.vel +hv0.scale = fault0.scale +io0.fan = fault0.hv_fan +io0.fault = fault0.fault +io0.state = fault0.state +pe0.udc = hv0.dc_volt +pe0.idc = 0 +pe0.ud = 0 +pe0.uq = 0 +pe0.id = hv0.id_fb +pe0.iq = hv0.iq_fb +pe0.torque = mpid0.torque_cmd +pe0.vel = vel1.vel +pe0.r = conf0.r +pe0.j = conf0.j +pe0.cap = 0.00054 +iit0.max_temp = conf0.max_mot_temp +iit0.high_temp = conf0.high_mot_temp +iit0.max_cur = conf0.max_ac_cur +fault0.mot_temp = iit0.temp +iit0.cur = hv0.abs_cur \ No newline at end of file diff --git a/conf/template/mpmsm.txt b/conf/template/mpmsm.txt new file mode 100644 index 00000000..8ba37ab4 --- /dev/null +++ b/conf/template/mpmsm.txt @@ -0,0 +1,11 @@ +load pmsm_ttc +pmsm_ttc0.rt_prio = 9 +pmsm_ttc0.psi = conf0.psi +pmsm_ttc0.polecount = conf0.polecount +pmsm_ttc0.pos_in = vel0.pos_out +pmsm_ttc0.torque = mpid0.torque_cmd +hv0.d_cmd = fb_switch0.id +hv0.q_cmd = pmsm_ttc0.cur +hv0.cmd_mode = 1 +hv0.phase_mode = 2 +hv0.pos = pmsm_ttc0.pos_out \ No newline at end of file diff --git a/conf/template/pid.txt b/conf/template/pid.txt index ba4a3eca..f0a1e99c 100644 --- a/conf/template/pid.txt +++ b/conf/template/pid.txt @@ -115,8 +115,8 @@ pe0.udc = hv0.dc_volt pe0.idc = 0 pe0.ud = 0 pe0.uq = 0 -pe0.id = hv0.d_fb -pe0.iq = hv0.q_fb +pe0.id = hv0.id_fb +pe0.iq = hv0.iq_fb pe0.torque = pid0.torque_cor_cmd pe0.vel = vel1.vel pe0.r = conf0.r diff --git a/conf/template/pmsm.txt b/conf/template/pmsm.txt index a0f3c4bb..c6a94479 100644 --- a/conf/template/pmsm.txt +++ b/conf/template/pmsm.txt @@ -11,8 +11,8 @@ pmsm_limits0.polecount = conf0.polecount pmsm_ttc0.psi = conf0.psi pmsm_ttc0.polecount = conf0.polecount pmsm_limits0.ac_volt = hv0.pwm_volt -pmsm_limits0.iq = hv0.q_fb -pmsm_limits0.id = hv0.d_fb +pmsm_limits0.iq = hv0.iq_fb +pmsm_limits0.id = hv0.id_fb pmsm_ttc0.pos_in = vel2.pos_out pid0.max_torque = pmsm_limits0.max_torque pid0.min_torque = pmsm_limits0.min_torque diff --git a/conf/template/rl.txt b/conf/template/rl.txt new file mode 100644 index 00000000..817b246a --- /dev/null +++ b/conf/template/rl.txt @@ -0,0 +1,22 @@ +link pid +link pmsm +conf0.max_ac_cur = 15 +load rl +rl0.rt_prio = 6 +hv0.en = rl0.en_out +hv0.d_cmd = rl0.ud_cmd +hv0.q_cmd = rl0.uq_cmd +rl0.id_fb = hv0.id_fb +rl0.iq_fb = hv0.iq_fb +rl0.ud_fb = hv0.ud_fb +rl0.uq_fb = hv0.uq_fb +hv0.cmd_mode = 0 +hv0.pos = 0 +term0.wave0 = rl0.ud_cmd +term0.wave1 = hv0.id_fb +term0.wave2 = rl0.r +term0.wave3 = rl0.ld +term0.gain0 = 5 +term0.gain1 = 5 +term0.gain2 = 30 +term0.gain3 = 3000 \ No newline at end of file diff --git a/conf/template/sserial.txt b/conf/template/sserial.txt index 6224b0fe..33ce84aa 100644 --- a/conf/template/sserial.txt +++ b/conf/template/sserial.txt @@ -40,5 +40,5 @@ io0.out1 = sserial0.out1 io0.out2 = sserial0.out2 fault0.brake_release = sserial0.out3 term0.wave2 = linrev0.cmd_d_out -sserial0.current = hv0.q_fb +sserial0.current = hv0.iq_fb linrev0.scale = sserial0.scale diff --git a/conf/template/uvw_fb1.txt b/conf/template/uvw_fb1.txt index ec23dbe8..317272bf 100644 --- a/conf/template/uvw_fb1.txt +++ b/conf/template/uvw_fb1.txt @@ -10,3 +10,5 @@ fb_switch0.com_polecount = conf0.com_fb_polecount io0.fb1g = 1 io0.fb1y = uvw0.led conf0.com_fb_polecount = conf0.polecount +uvw0.amp = adc0.amp1 +fault0.com_fb_error = uvw0.error \ No newline at end of file diff --git a/conf/uf.txt b/conf/uf.txt index db230335..2b6185fe 100644 --- a/conf/uf.txt +++ b/conf/uf.txt @@ -11,7 +11,7 @@ hv0.pos = uf0.pos hv0.d_cmd = uf0.ud hv0.q_cmd = 0 term0.wave0 = hv0.d_cmd -term0.wave1 = hv0.d_fb +term0.wave1 = hv0.id_fb term0.wave2 = uf0.f_cmd term0.wave3 = uf0.f_fb term0.gain0 = 1 diff --git a/hw/kicad/diff_driver/diff_driver.kicad_pcb b/hw/kicad/diff_driver/diff_driver.kicad_pcb index 3cbe7b40..50a5dac4 100644 --- a/hw/kicad/diff_driver/diff_driver.kicad_pcb +++ b/hw/kicad/diff_driver/diff_driver.kicad_pcb @@ -1,12 +1,12 @@ -(kicad_pcb (version 20171130) (host pcbnew "(5.1.0-rc1-120-gc4fe6785a)") +(kicad_pcb (version 20171130) (host pcbnew "(5.1.4-0-10_14)") (general (thickness 1.6) - (drawings 10) - (tracks 111) + (drawings 13) + (tracks 100) (zones 0) - (modules 11) - (nets 17) + (modules 14) + (nets 16) ) (page A4) @@ -36,7 +36,7 @@ (setup (last_trace_width 0.25) (trace_clearance 0.2) - (zone_clearance 0.254) + (zone_clearance 0.25) (zone_45_only no) (trace_min 0.2) (via_size 0.8) @@ -55,8 +55,8 @@ (mod_edge_width 0.12) (mod_text_size 1 1) (mod_text_width 0.15) - (pad_size 1.524 1.524) - (pad_drill 0.762) + (pad_size 1.3 1.3) + (pad_drill 1) (pad_to_mask_clearance 0.051) (solder_mask_min_width 0.25) (aux_axis_origin 0 0) @@ -105,8 +105,7 @@ (net 12 "Net-(J2-Pad6)") (net 13 "Net-(J2-Pad10)") (net 14 "Net-(J2-Pad12)") - (net 15 "Net-(U1-Pad14)") - (net 16 "Net-(U1-Pad13)") + (net 15 +3V3) (net_class Default "This is the default net class." (clearance 0.2) @@ -115,6 +114,7 @@ (via_drill 0.4) (uvia_dia 0.3) (uvia_drill 0.1) + (add_net +3V3) (add_net +5V) (add_net A) (add_net B) @@ -133,115 +133,161 @@ (add_net "Net-(U1-Pad14)") ) - (module Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical (layer F.Cu) (tedit 59FED5CC) (tstamp 5C70F6C0) - (at 146.6 95.88 180) - (descr "Through hole straight pin header, 1x05, 2.54mm pitch, single row") - (tags "Through hole pin header THT 1x05 2.54mm single row") + (module stmbl:Pin_Header_RM2.54_1x7_UP (layer F.Cu) (tedit 5DA83A6C) (tstamp 5DC30DFC) + (at 146.5 98.62 180) (path /5C795FC3) - (fp_text reference J1 (at 0 -2.33 180) (layer F.SilkS) + (fp_text reference J1 (at 0 2.5) (layer F.SilkS) hide + (effects (font (size 1.5 1.5) (thickness 0.3))) + ) + (fp_text value CONN_01X07 (at 0 -2) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value CONN_01X05 (at 0 12.49 180) (layer F.Fab) - (effects (font (size 1 1) (thickness 0.15))) - ) - (fp_text user %R (at 0 5.08 270) (layer F.Fab) - (effects (font (size 1 1) (thickness 0.15))) - ) - (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) - (fp_line (start 1.8 11.95) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.8 11.95) (end 1.8 11.95) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.8 -1.8) (end -1.8 11.95) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) - (fp_line (start 1.33 1.27) (end 1.33 11.49) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.33 1.27) (end -1.33 11.49) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.33 11.49) (end 1.33 11.49) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) - (fp_line (start -1.27 11.43) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) - (fp_line (start 1.27 11.43) (end -1.27 11.43) (layer F.Fab) (width 0.1)) - (fp_line (start 1.27 -1.27) (end 1.27 11.43) (layer F.Fab) (width 0.1)) - (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) - (pad 5 thru_hole oval (at 0 10.16 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (fp_line (start -1.27 1.27) (end -1.27 -1.27) (layer F.SilkS) (width 0.15)) + (fp_line (start 1.27 1.27) (end -1.27 1.27) (layer F.SilkS) (width 0.15)) + (fp_line (start 1.27 -1.27) (end 1.27 1.27) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.27 -1.27) (end 1.27 -1.27) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.27 16.51) (end -1.27 -1.27) (layer F.SilkS) (width 0.15)) + (fp_line (start 1.27 16.51) (end -1.27 16.51) (layer F.SilkS) (width 0.15)) + (fp_line (start 1.27 -1.27) (end 1.27 16.51) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.27 -1.27) (end 1.27 -1.27) (layer F.SilkS) (width 0.15)) + (pad 7 thru_hole circle (at 0 15.24 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) + (net 15 +3V3)) + (pad 7 smd circle (at 0 15.24 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 15 +3V3)) + (pad 6 thru_hole circle (at 0 12.7 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) (net 1 GND)) - (pad 4 thru_hole oval (at 0 7.62 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (pad 6 smd circle (at 0 12.7 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 1 GND)) + (pad 5 thru_hole circle (at 0 10.16 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) (net 3 IDX)) - (pad 3 thru_hole oval (at 0 5.08 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (pad 5 smd circle (at 0 10.16 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 3 IDX)) + (pad 4 thru_hole circle (at 0 7.62 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) (net 4 A)) - (pad 2 thru_hole oval (at 0 2.54 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (pad 4 smd circle (at 0 7.62 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 4 A)) + (pad 3 thru_hole circle (at 0 5.08 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) (net 2 +5V)) - (pad 1 thru_hole rect (at 0 0 180) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask) + (pad 3 smd circle (at 0 5.08 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 2 +5V)) + (pad 2 thru_hole circle (at 0 2.54 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) (net 5 B)) - (model ${KISYS3DMOD}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x05_P2.54mm_Vertical.wrl + (pad 2 smd circle (at 0 2.54 180) (size 1.75 1.75) (layers B.Cu B.Mask) + (net 5 B)) + (pad 1 thru_hole circle (at 0 0 180) (size 1.3 1.3) (drill 1) (layers *.Cu *.Mask) + (net 6 GNDA)) + (pad 1 smd roundrect (at 0 0 180) (size 1.75 1.75) (layers B.Cu B.Mask) (roundrect_rratio 0.25) + (net 6 GNDA)) + ) + + (module stmbl:SOT-89-3 (layer F.Cu) (tedit 5DA64954) (tstamp 5DC309D1) + (at 154.4165 83.75) + (descr SOT-89-3) + (tags SOT-89-3) + (path /5DD6ED30) + (attr smd) + (fp_text reference U2 (at 0.45 -3.2) (layer F.SilkS) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text value HT75XX-1 (at 0.45 3.25) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_text user %R (at 0.38 0 90) (layer F.Fab) + (effects (font (size 0.6 0.6) (thickness 0.09))) + ) + (fp_line (start 1.78 1.2) (end 1.78 2.4) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.78 2.4) (end -0.92 2.4) (layer F.SilkS) (width 0.12)) + (fp_line (start -2.22 -2.4) (end 1.78 -2.4) (layer F.SilkS) (width 0.12)) + (fp_line (start 1.78 -2.4) (end 1.78 -1.2) (layer F.SilkS) (width 0.12)) + (fp_line (start -0.92 -1.51) (end -0.13 -2.3) (layer F.Fab) (width 0.1)) + (fp_line (start 1.68 -2.3) (end 1.68 2.3) (layer F.Fab) (width 0.1)) + (fp_line (start 1.68 2.3) (end -0.92 2.3) (layer F.Fab) (width 0.1)) + (fp_line (start -0.92 2.3) (end -0.92 -1.51) (layer F.Fab) (width 0.1)) + (fp_line (start -0.13 -2.3) (end 1.68 -2.3) (layer F.Fab) (width 0.1)) + (fp_line (start 3.23 -2.55) (end 3.23 2.55) (layer F.CrtYd) (width 0.05)) + (fp_line (start 3.23 -2.55) (end -2.48 -2.55) (layer F.CrtYd) (width 0.05)) + (fp_line (start -2.48 2.55) (end 3.23 2.55) (layer F.CrtYd) (width 0.05)) + (fp_line (start -2.48 2.55) (end -2.48 -2.55) (layer F.CrtYd) (width 0.05)) + (pad 2 smd trapezoid (at 2.667 0 270) (size 1.6 0.85) (rect_delta 0 0.6 ) (layers F.Cu F.Paste F.Mask) + (net 2 +5V)) + (pad 1 smd roundrect (at -1.5 -1.5 270) (size 1 1.5) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 2 smd roundrect (at -1 0 90) (size 1 2.5) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) + (pad 3 smd roundrect (at -1.5 1.5 270) (size 1 1.5) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 15 +3V3)) + (pad 2 smd rect (at 1.3335 0 270) (size 2.2 1.84) (layers F.Cu F.Paste F.Mask) + (net 2 +5V) (zone_connect 2)) + (pad 2 smd trapezoid (at -0.0762 0 90) (size 1.5 1) (rect_delta 0 0.7 ) (layers F.Cu F.Paste F.Mask) + (net 2 +5V)) + (model ${KISYS3DMOD}/Package_TO_SOT_SMD.3dshapes/SOT-89-3.wrl (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module Package_SO:SOIC-16_3.9x9.9mm_P1.27mm (layer F.Cu) (tedit 5A02F2D3) (tstamp 5C70F74E) - (at 154.2 91 180) + (module stmbl:SOIC-16 (layer F.Cu) (tedit 5DC2FC18) (tstamp 5DC30FD3) + (at 154.25 91.75 180) (descr "16-Lead Plastic Small Outline (SL) - Narrow, 3.90 mm Body [SOIC] (see Microchip Packaging Specification 00000049BS.pdf)") (tags "SOIC 1.27") - (path /5C78CB18) + (path /5DD226B1) (attr smd) - (fp_text reference U1 (at 0 -6 180) (layer F.SilkS) + (fp_text reference U1 (at 0 -6) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value LTC1688 (at 0 6 180) (layer F.Fab) + (fp_text value am26ls31 (at 0 6) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) - (fp_line (start -2.075 -5.05) (end -3.45 -5.05) (layer F.SilkS) (width 0.15)) - (fp_line (start -2.075 5.075) (end 2.075 5.075) (layer F.SilkS) (width 0.15)) - (fp_line (start -2.075 -5.075) (end 2.075 -5.075) (layer F.SilkS) (width 0.15)) - (fp_line (start -2.075 5.075) (end -2.075 4.97) (layer F.SilkS) (width 0.15)) - (fp_line (start 2.075 5.075) (end 2.075 4.97) (layer F.SilkS) (width 0.15)) - (fp_line (start 2.075 -5.075) (end 2.075 -4.97) (layer F.SilkS) (width 0.15)) - (fp_line (start -2.075 -5.075) (end -2.075 -5.05) (layer F.SilkS) (width 0.15)) - (fp_line (start -3.7 5.25) (end 3.7 5.25) (layer F.CrtYd) (width 0.05)) - (fp_line (start -3.7 -5.25) (end 3.7 -5.25) (layer F.CrtYd) (width 0.05)) - (fp_line (start 3.7 -5.25) (end 3.7 5.25) (layer F.CrtYd) (width 0.05)) - (fp_line (start -3.7 -5.25) (end -3.7 5.25) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.95 -3.95) (end -0.95 -4.95) (layer F.Fab) (width 0.15)) - (fp_line (start -1.95 4.95) (end -1.95 -3.95) (layer F.Fab) (width 0.15)) - (fp_line (start 1.95 4.95) (end -1.95 4.95) (layer F.Fab) (width 0.15)) - (fp_line (start 1.95 -4.95) (end 1.95 4.95) (layer F.Fab) (width 0.15)) - (fp_line (start -0.95 -4.95) (end 1.95 -4.95) (layer F.Fab) (width 0.15)) - (fp_text user %R (at 0 0 180) (layer F.Fab) + (fp_text user %R (at 0 0) (layer F.Fab) (effects (font (size 0.9 0.9) (thickness 0.135))) ) - (pad 16 smd rect (at 2.7 -4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 2 +5V)) - (pad 15 smd rect (at 2.7 -3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 1 GND)) - (pad 14 smd rect (at 2.7 -1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 15 "Net-(U1-Pad14)")) - (pad 13 smd rect (at 2.7 -0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 16 "Net-(U1-Pad13)")) - (pad 12 smd rect (at 2.7 0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 1 GND)) - (pad 11 smd rect (at 2.7 1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 10 "Net-(J2-Pad4)")) - (pad 10 smd rect (at 2.7 3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 11 "Net-(J2-Pad5)")) - (pad 9 smd rect (at 2.7 4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 3 IDX)) - (pad 8 smd rect (at -2.7 4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 1 GND)) - (pad 7 smd rect (at -2.7 3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 5 B)) - (pad 6 smd rect (at -2.7 1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 9 "Net-(J2-Pad3)")) - (pad 5 smd rect (at -2.7 0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 12 "Net-(J2-Pad6)")) - (pad 4 smd rect (at -2.7 -0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 2 +5V)) - (pad 3 smd rect (at -2.7 -1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 8 "Net-(J2-Pad2)")) - (pad 2 smd rect (at -2.7 -3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) - (net 7 "Net-(J2-Pad1)")) - (pad 1 smd rect (at -2.7 -4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) + (fp_line (start -0.95 -4.95) (end 1.95 -4.95) (layer F.Fab) (width 0.15)) + (fp_line (start 1.95 -4.95) (end 1.95 4.95) (layer F.Fab) (width 0.15)) + (fp_line (start 1.95 4.95) (end -1.95 4.95) (layer F.Fab) (width 0.15)) + (fp_line (start -1.95 4.95) (end -1.95 -3.95) (layer F.Fab) (width 0.15)) + (fp_line (start -1.95 -3.95) (end -0.95 -4.95) (layer F.Fab) (width 0.15)) + (fp_line (start -3.7 -5.25) (end -3.7 5.25) (layer F.CrtYd) (width 0.05)) + (fp_line (start 3.7 -5.25) (end 3.7 5.25) (layer F.CrtYd) (width 0.05)) + (fp_line (start -3.7 -5.25) (end 3.7 -5.25) (layer F.CrtYd) (width 0.05)) + (fp_line (start -3.7 5.25) (end 3.7 5.25) (layer F.CrtYd) (width 0.05)) + (fp_line (start -2.075 -5.075) (end -2.075 -5.05) (layer F.SilkS) (width 0.15)) + (fp_line (start 2.075 -5.075) (end 2.075 -4.97) (layer F.SilkS) (width 0.15)) + (fp_line (start 2.075 5.075) (end 2.075 4.97) (layer F.SilkS) (width 0.15)) + (fp_line (start -2.075 5.075) (end -2.075 4.97) (layer F.SilkS) (width 0.15)) + (fp_line (start -2.075 -5.075) (end 2.075 -5.075) (layer F.SilkS) (width 0.15)) + (fp_line (start -2.075 5.075) (end 2.075 5.075) (layer F.SilkS) (width 0.15)) + (fp_line (start -2.075 -5.05) (end -3.45 -5.05) (layer F.SilkS) (width 0.15)) + (pad 1 smd roundrect (at -2.7 -4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) (net 4 A)) + (pad 2 smd roundrect (at -2.7 -3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 7 "Net-(J2-Pad1)")) + (pad 3 smd roundrect (at -2.7 -1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 8 "Net-(J2-Pad2)")) + (pad 4 smd roundrect (at -2.7 -0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) + (pad 5 smd roundrect (at -2.7 0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 12 "Net-(J2-Pad6)")) + (pad 6 smd roundrect (at -2.7 1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 9 "Net-(J2-Pad3)")) + (pad 7 smd roundrect (at -2.7 3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 5 B)) + (pad 8 smd roundrect (at -2.7 4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 9 smd roundrect (at 2.7 4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 3 IDX)) + (pad 10 smd roundrect (at 2.7 3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 11 "Net-(J2-Pad5)")) + (pad 11 smd roundrect (at 2.7 1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 10 "Net-(J2-Pad4)")) + (pad 12 smd roundrect (at 2.7 0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 13 smd roundrect (at 2.7 -0.635 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) + (pad 14 smd roundrect (at 2.7 -1.905 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25)) + (pad 15 smd roundrect (at 2.7 -3.175 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 16 smd roundrect (at 2.7 -4.445 180) (size 1.5 0.6) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) (model ${KISYS3DMOD}/Package_SO.3dshapes/SOIC-16_3.9x9.9mm_P1.27mm.wrl (at (xyz 0 0 0)) (scale (xyz 1 1 1)) @@ -249,8 +295,107 @@ ) ) - (module stmbl:R_0603 (layer F.Cu) (tedit 5AC562FC) (tstamp 5C70F729) - (at 158.9 84.7 90) + (module stmbl:C_0603 (layer F.Cu) (tedit 5DA644E2) (tstamp 5DC30902) + (at 153.5 97.75) + (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") + (tags "capacitor 0603") + (path /5DD58169) + (attr smd) + (fp_text reference C5 (at -0.834 1.416) (layer F.SilkS) + (effects (font (size 0.8 0.8) (thickness 0.2))) + ) + (fp_text value 1n (at 0 1.4) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.5 -0.4) (end -0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.3 -0.6) (end 1.3 -0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (pad 2 smd roundrect (at 0.75 0) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.75 0) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.step + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module stmbl:C_0603 (layer F.Cu) (tedit 5DA644E2) (tstamp 5DC308F2) + (at 150.5 85.25 180) + (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") + (tags "capacitor 0603") + (path /5DD7DCEF) + (attr smd) + (fp_text reference C4 (at -0.834 1.416) (layer F.SilkS) + (effects (font (size 0.8 0.8) (thickness 0.2))) + ) + (fp_text value 1n (at 0 1.4) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.5 -0.4) (end -0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.3 -0.6) (end 1.3 -0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (pad 2 smd roundrect (at 0.75 0 180) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.75 0 180) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 15 +3V3)) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.step + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module stmbl:C_0603 (layer F.Cu) (tedit 5DA644E2) (tstamp 5DC308E2) + (at 151.25 83 90) + (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") + (tags "capacitor 0603") + (path /5DD85645) + (attr smd) + (fp_text reference C3 (at -0.834 1.416 90) (layer F.SilkS) + (effects (font (size 0.8 0.8) (thickness 0.2))) + ) + (fp_text value 100n (at 0 1.4 90) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.5 -0.4) (end -0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.3 -0.6) (end 1.3 -0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 15 +3V3)) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.step + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (module stmbl:R_0603 (layer F.Cu) (tedit 5DA6478D) (tstamp 5C70F729) + (at 159 85 90) (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") (tags "resistor 0603") (path /5C7AE616) @@ -258,7 +403,7 @@ (fp_text reference R5 (at -3.248 0.04 90) (layer F.SilkS) hide (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value R (at 0 1.4 90) (layer F.Fab) + (fp_text value 560 (at 0 1.4 90) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -272,18 +417,18 @@ (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 13 "Net-(J2-Pad10)") (solder_mask_margin 0.1)) + (net 13 "Net-(J2-Pad10)")) (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 9 "Net-(J2-Pad3)") (solder_mask_margin 0.1)) - (model Resistors_SMD.3dshapes/R_0603.wrl + (net 11 "Net-(J2-Pad5)")) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module stmbl:R_0603 (layer F.Cu) (tedit 5AC562FC) (tstamp 5C70F719) - (at 159.1 95.2 270) + (module stmbl:R_0603 (layer F.Cu) (tedit 5DA6478D) (tstamp 5C70F719) + (at 159.1 96.25 90) (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") (tags "resistor 0603") (path /5C7AD89A) @@ -291,7 +436,7 @@ (fp_text reference R4 (at -3.248 0.04 270) (layer F.SilkS) hide (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value R (at 0 1.4 270) (layer F.Fab) + (fp_text value 560 (at 0 1.4 270) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -304,19 +449,19 @@ (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) - (pad 2 smd roundrect (at 0.75 0 270) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 14 "Net-(J2-Pad12)") (solder_mask_margin 0.1)) - (pad 1 smd roundrect (at -0.75 0 270) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 7 "Net-(J2-Pad1)") (solder_mask_margin 0.1)) - (model Resistors_SMD.3dshapes/R_0603.wrl + (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 14 "Net-(J2-Pad12)")) + (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module stmbl:R_0603 (layer F.Cu) (tedit 5AC562FC) (tstamp 5C70F709) - (at 149.4 88.6 90) + (module stmbl:R_0603 (layer F.Cu) (tedit 5DA6478D) (tstamp 5C70F709) + (at 149.25 89 90) (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") (tags "resistor 0603") (path /5C7BBC89) @@ -324,7 +469,7 @@ (fp_text reference R3 (at -3.248 0.04 90) (layer F.SilkS) hide (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value R (at 0 1.4 90) (layer F.Fab) + (fp_text value 3.9k (at 0 1.4 90) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -338,18 +483,18 @@ (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 3 IDX) (solder_mask_margin 0.1)) + (net 3 IDX)) (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 2 +5V) (solder_mask_margin 0.1)) - (model Resistors_SMD.3dshapes/R_0603.wrl + (net 2 +5V)) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module stmbl:R_0603 (layer F.Cu) (tedit 5AC562FC) (tstamp 5C70F6F9) - (at 149.4 94.8 270) + (module stmbl:R_0603 (layer F.Cu) (tedit 5DA6478D) (tstamp 5DC31058) + (at 149.25 95.25 270) (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") (tags "resistor 0603") (path /5C7BBB0C) @@ -357,7 +502,7 @@ (fp_text reference R2 (at -3.248 0.04 270) (layer F.SilkS) hide (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value R (at 0 1.4 270) (layer F.Fab) + (fp_text value 3.9k (at 0 1.4 270) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -371,18 +516,18 @@ (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) (pad 2 smd roundrect (at 0.75 0 270) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 5 B) (solder_mask_margin 0.1)) + (net 5 B)) (pad 1 smd roundrect (at -0.75 0 270) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 2 +5V) (solder_mask_margin 0.1)) - (model Resistors_SMD.3dshapes/R_0603.wrl + (net 2 +5V)) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module stmbl:R_0603 (layer F.Cu) (tedit 5AC562FC) (tstamp 5C70F6E9) - (at 149.4 91.75 90) + (module stmbl:R_0603 (layer F.Cu) (tedit 5DA6478D) (tstamp 5C70F6E9) + (at 149.25 91.75 90) (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") (tags "resistor 0603") (path /5C7BB4F1) @@ -390,7 +535,7 @@ (fp_text reference R1 (at -3.248 0.04 90) (layer F.SilkS) hide (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value R (at 0 1.4 90) (layer F.Fab) + (fp_text value 3.9k (at 0 1.4 90) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -404,18 +549,18 @@ (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 4 A) (solder_mask_margin 0.1)) + (net 4 A)) (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 2 +5V) (solder_mask_margin 0.1)) - (model Resistors_SMD.3dshapes/R_0603.wrl + (net 2 +5V)) + (model ${KISYS3DMOD}/Resistor_SMD.3dshapes/R_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (module stmbl:RJ45_LED (layer B.Cu) (tedit 58E701F3) (tstamp 5C70F6D9) - (at 175.4 90.8 90) + (module stmbl:RJ45_LED (layer B.Cu) (tedit 58E701F3) (tstamp 5DC30F35) + (at 175.5 91 90) (path /5C78E60A) (fp_text reference J2 (at 6.194 -16.462 90) (layer B.SilkS) (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) @@ -467,87 +612,16 @@ ) ) - (module Capacitor_Tantalum_SMD:CP_EIA-2012-15_AVX-P (layer F.Cu) (tedit 5B301BBE) (tstamp 5C70F6A2) - (at 156.8875 98 180) - (descr "Tantalum Capacitor SMD AVX-P (2012-15 Metric), IPC_7351 nominal, (Body size from: https://www.vishay.com/docs/40182/tmch.pdf), generated with kicad-footprint-generator") - (tags "capacitor tantalum") - (path /5C799DAB) - (attr smd) - (fp_text reference C3 (at 0 -1.58 180) (layer F.SilkS) - (effects (font (size 1 1) (thickness 0.15))) - ) - (fp_text value CP (at 0 1.58 180) (layer F.Fab) - (effects (font (size 1 1) (thickness 0.15))) - ) - (fp_text user %R (at 0 0 180) (layer F.Fab) - (effects (font (size 0.5 0.5) (thickness 0.08))) - ) - (fp_line (start 1.7 0.88) (end -1.7 0.88) (layer F.CrtYd) (width 0.05)) - (fp_line (start 1.7 -0.88) (end 1.7 0.88) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.7 -0.88) (end 1.7 -0.88) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.7 0.88) (end -1.7 -0.88) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.71 0.785) (end 1 0.785) (layer F.SilkS) (width 0.12)) - (fp_line (start -1.71 -0.785) (end -1.71 0.785) (layer F.SilkS) (width 0.12)) - (fp_line (start 1 -0.785) (end -1.71 -0.785) (layer F.SilkS) (width 0.12)) - (fp_line (start 1 0.625) (end 1 -0.625) (layer F.Fab) (width 0.1)) - (fp_line (start -1 0.625) (end 1 0.625) (layer F.Fab) (width 0.1)) - (fp_line (start -1 -0.3125) (end -1 0.625) (layer F.Fab) (width 0.1)) - (fp_line (start -0.6875 -0.625) (end -1 -0.3125) (layer F.Fab) (width 0.1)) - (fp_line (start 1 -0.625) (end -0.6875 -0.625) (layer F.Fab) (width 0.1)) - (pad 2 smd roundrect (at 0.8875 0 180) (size 1.125 1.05) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.238095) - (net 1 GND)) - (pad 1 smd roundrect (at -0.8875 0 180) (size 1.125 1.05) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.238095) - (net 2 +5V)) - (model ${KISYS3DMOD}/Capacitor_Tantalum_SMD.3dshapes/CP_EIA-2012-15_AVX-P.wrl - (at (xyz 0 0 0)) - (scale (xyz 1 1 1)) - (rotate (xyz 0 0 0)) - ) - ) - - (module stmbl:C_0603 (layer F.Cu) (tedit 5AC56310) (tstamp 5C70F68F) - (at 159.1 91.2 90) + (module stmbl:C_0603 (layer F.Cu) (tedit 5DA644E2) (tstamp 5C70F68F) + (at 150.75 97.75 180) (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") (tags "capacitor 0603") (path /5C79998F) (attr smd) - (fp_text reference C2 (at -0.834 1.416 90) (layer F.SilkS) + (fp_text reference C2 (at -0.834 1.416) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.2))) ) - (fp_text value C (at 0 1.4 90) (layer F.Fab) - (effects (font (size 1 1) (thickness 0.15))) - ) - (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start -0.5 -0.4) (end -0.5 0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer F.SilkS) (width 0.15)) - (fp_line (start -1.3 -0.6) (end 1.3 -0.6) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) - (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) - (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) - (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 1 GND)) - (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) - (net 2 +5V)) - (model Capacitors_SMD.3dshapes/C_0603.wrl - (at (xyz 0 0 0)) - (scale (xyz 1 1 1)) - (rotate (xyz 0 0 0)) - ) - ) - - (module stmbl:C_0603 (layer F.Cu) (tedit 5AC56310) (tstamp 5C70F67F) - (at 151.1 97.1 180) - (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") - (tags "capacitor 0603") - (path /5C799546) - (attr smd) - (fp_text reference C1 (at -0.834 1.416 180) (layer F.SilkS) - (effects (font (size 0.8 0.8) (thickness 0.2))) - ) - (fp_text value C (at 0 1.4 180) (layer F.Fab) + (fp_text value 100n (at 0 1.4) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) @@ -564,624 +638,740 @@ (net 1 GND)) (pad 1 smd roundrect (at -0.75 0 180) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) (net 2 +5V)) - (model Capacitors_SMD.3dshapes/C_0603.wrl + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.step (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) ) - (gr_text "STMBL single-ended \nto diff adapter" (at 152.4 82.6) (layer F.SilkS) + (module stmbl:C_0603 (layer F.Cu) (tedit 5DA644E2) (tstamp 5C70F67F) + (at 159 82.25 90) + (descr "Capacitor SMD 0603, reflow soldering, AVX (see smccp.pdf)") + (tags "capacitor 0603") + (path /5C799546) + (attr smd) + (fp_text reference C1 (at -0.834 1.416 270) (layer F.SilkS) + (effects (font (size 0.8 0.8) (thickness 0.2))) + ) + (fp_text value 100n (at 0 1.4 270) (layer F.Fab) + (effects (font (size 1 1) (thickness 0.15))) + ) + (fp_line (start 0.5 -0.4) (end 0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.5 -0.4) (end -0.5 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 -0.4) (end -0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start 0.8 0.4) (end 0.8 -0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 0.4) (end 0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -0.8 -0.4) (end -0.8 0.4) (layer F.SilkS) (width 0.15)) + (fp_line (start -1.3 -0.6) (end 1.3 -0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start -1.3 -0.6) (end -1.3 0.6) (layer F.CrtYd) (width 0.05)) + (fp_line (start 1.3 -0.6) (end 1.3 0.6) (layer F.CrtYd) (width 0.05)) + (pad 2 smd roundrect (at 0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 1 GND)) + (pad 1 smd roundrect (at -0.75 0 90) (size 0.59 0.8) (layers F.Cu F.Paste F.Mask) (roundrect_rratio 0.25) + (net 2 +5V)) + (model ${KISYS3DMOD}/Capacitor_SMD.3dshapes/C_0603_1608Metric.step + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) + + (gr_text "3\n0\nZ\nA\n5\nB\nS" (at 145.25 91) (layer F.SilkS) (tstamp 5DC33CFE) + (effects (font (size 1.55 1.55) (thickness 0.25)) (justify right)) + ) + (gr_text "8 GND\n7 5V\n5/4 Z\n3/6 B\n1/2 A" (at 168.75 91) (layer F.SilkS) (tstamp 5DC33CAE) + (effects (font (size 1 1) (thickness 0.2)) (justify left)) + ) + (gr_text "8 GND\n7 5V\n5/4 Z\n3/6 B\n1/2 A" (at 159.5 91) (layer B.SilkS) (tstamp 5DC3402A) + (effects (font (size 1 1) (thickness 0.2)) (justify left mirror)) + ) + (gr_arc (start 174 81) (end 175 81) (angle -90) (layer Edge.Cuts) (width 0.1) (tstamp 5DC3259E)) + (gr_arc (start 174 101) (end 174 102) (angle -90) (layer Edge.Cuts) (width 0.1) (tstamp 5DC3258E)) + (gr_arc (start 144 101) (end 143 101) (angle -90) (layer Edge.Cuts) (width 0.1) (tstamp 5DC32585)) + (gr_arc (start 144 81) (end 144 80) (angle -90) (layer Edge.Cuts) (width 0.1)) + (gr_text "3.3V\nGND\nZ/W\nA/U\n5V\nB/V\nSHIELD" (at 147.75 91) (layer B.SilkS) + (effects (font (size 1.55 1.55) (thickness 0.25)) (justify right mirror)) + ) + (gr_text "STMBL single-ended \nto RS422 adapter V2" (at 156.75 100) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.25))) ) - (gr_text B/V (at 150.1 95.9) (layer B.SilkS) - (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) - ) - (gr_text 5V (at 149.3 93.5) (layer B.SilkS) - (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) - ) - (gr_text A/U (at 150 90.9) (layer B.SilkS) - (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) - ) - (gr_text IDX/W (at 151.2 88.3) (layer B.SilkS) - (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) - ) - (gr_text GND (at 150.1 85.8) (layer B.SilkS) - (effects (font (size 1.5 1.5) (thickness 0.3)) (justify mirror)) - ) - (gr_line (start 143 102) (end 143 80) (layer Edge.Cuts) (width 0.05) (tstamp 5C7110E9)) - (gr_line (start 175 102) (end 143 102) (layer Edge.Cuts) (width 0.05)) - (gr_line (start 175 80) (end 175 102) (layer Edge.Cuts) (width 0.05)) - (gr_line (start 143 80) (end 175 80) (layer Edge.Cuts) (width 0.05)) + (gr_line (start 143 101) (end 143 81) (layer Edge.Cuts) (width 0.1) (tstamp 5C7110E9)) + (gr_line (start 174 102) (end 144 102) (layer Edge.Cuts) (width 0.1)) + (gr_line (start 175 81) (end 175 101) (layer Edge.Cuts) (width 0.1)) + (gr_line (start 144 80) (end 174 80) (layer Edge.Cuts) (width 0.1)) - (via (at 163.7 90.4) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 1)) - (via (at 160.3 90.4) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 1)) - (via (at 154.2 92) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 1)) - (via (at 153.6 95) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 1)) - (segment (start 157.215 91.95) (end 156.9 91.635) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 159.1 91.95) (end 157.215 91.95) (width 0.25) (layer F.Cu) (net 2)) - (via (at 157.8 99.7) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) - (segment (start 157.775 99.675) (end 157.8 99.7) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 157.775 98) (end 157.775 99.675) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 152.52501 97.02499) (end 152.510694 97.039306) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 156.79999 97.02499) (end 152.52501 97.02499) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 157.775 98) (end 156.79999 97.02499) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 152.45 97.1) (end 151.85 97.1) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 152.52501 97.02499) (end 152.45 97.1) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 151.5 96.75) (end 151.85 97.1) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 151.5 95.445) (end 151.5 96.75) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 150.795 95.445) (end 149.4 94.05) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 151.5 95.445) (end 150.795 95.445) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 149.4 92.5) (end 149.4 94.05) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 147.31 94.05) (end 146.6 93.34) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 149.4 94.05) (end 147.31 94.05) (width 0.5) (layer F.Cu) (net 2)) - (via (at 158.1 96.7) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) - (segment (start 157.775 98) (end 157.775 97.025) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 157.775 97.025) (end 158.1 96.7) (width 0.5) (layer F.Cu) (net 2)) - (via (at 160.5 92.1) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) - (segment (start 159.719999 92.880001) (end 160.5 92.1) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 158.1 96.7) (end 158.1 94.5) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 158.1 94.5) (end 159.719999 92.880001) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 159.25 92.1) (end 159.1 91.95) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 160.5 92.1) (end 159.25 92.1) (width 0.5) (layer F.Cu) (net 2)) - (segment (start 160.408002 99.7) (end 157.8 99.7) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 168.15 88.25) (end 169.15 89.25) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 167.46 88.25) (end 168.15 88.25) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 169.15 89.25) (end 169.15 94.595998) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 169.15 94.595998) (end 166.095999 97.649999) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 166.095999 97.649999) (end 162.458003 97.649999) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 162.458003 97.649999) (end 160.408002 99.7) (width 0.5) (layer B.Cu) (net 2)) - (segment (start 148.9 89.35) (end 149.4 89.35) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 149 92.1) (end 145.9 92.1) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 149.4 92.5) (end 149 92.1) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 145.9 92.1) (end 145.2 91.4) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 145.2 91.4) (end 145.2 90.2) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 145.2 90.2) (end 145.9 89.5) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 148.75 89.5) (end 148.9 89.35) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 145.9 89.5) (end 148.75 89.5) (width 0.25) (layer F.Cu) (net 2)) - (segment (start 147.01 87.85) (end 146.6 88.26) (width 0.25) (layer F.Cu) (net 3)) - (segment (start 149.4 87.85) (end 147.01 87.85) (width 0.25) (layer F.Cu) (net 3)) - (segment (start 151.5 86.555) (end 149.845 86.555) (width 0.25) (layer F.Cu) (net 3)) - (segment (start 149.845 86.555) (end 149.4 87) (width 0.25) (layer F.Cu) (net 3)) - (segment (start 149.4 87) (end 149.4 87.85) (width 0.25) (layer F.Cu) (net 3)) - (segment (start 149.2 90.8) (end 149.4 91) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 146.6 90.8) (end 149.2 90.8) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 155.675002 95.445) (end 156.9 95.445) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 149.760694 91.550694) (end 150.489999 92.279999) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 150.489999 92.279999) (end 152.510001 92.279999) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 149.4 91) (end 149.760694 91.360694) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 152.510001 92.279999) (end 155.675002 95.445) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 149.760694 91.360694) (end 149.760694 91.550694) (width 0.25) (layer F.Cu) (net 4)) - (segment (start 149.07 95.88) (end 149.4 95.55) (width 0.25) (layer F.Cu) (net 5)) - (segment (start 146.6 95.88) (end 149.07 95.88) (width 0.25) (layer F.Cu) (net 5)) - (via (at 149.4 96.4) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 5)) - (segment (start 149.4 95.55) (end 149.4 96.4) (width 0.25) (layer F.Cu) (net 5)) - (via (at 155.5 87.9) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 5)) - (segment (start 149.4 96.4) (end 149.4 94) (width 0.25) (layer B.Cu) (net 5)) - (segment (start 149.4 94) (end 155.5 87.9) (width 0.25) (layer B.Cu) (net 5)) - (segment (start 156.825 87.9) (end 156.9 87.825) (width 0.25) (layer F.Cu) (net 5)) - (segment (start 155.5 87.9) (end 156.825 87.9) (width 0.25) (layer F.Cu) (net 5)) - (segment (start 158.825 94.175) (end 159.1 94.45) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 156.9 94.175) (end 158.825 94.175) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 166.540762 94.37) (end 167.46 94.37) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 166.310762 94.6) (end 166.540762 94.37) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 162.5 94.6) (end 166.310762 94.6) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 162.2 94.3) (end 162.5 94.6) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 159.1 94.45) (end 159.25 94.3) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 159.25 94.3) (end 162.2 94.3) (width 0.25) (layer F.Cu) (net 7)) - (segment (start 165.235 92.905) (end 165.68 93.35) (width 0.25) (layer F.Cu) (net 8)) - (segment (start 156.9 92.905) (end 165.235 92.905) (width 0.25) (layer F.Cu) (net 8)) - (segment (start 158.9 85.845) (end 158.9 85.45) (width 0.25) (layer F.Cu) (net 9)) - (segment (start 156.9 89.095) (end 157.705 89.095) (width 0.25) (layer F.Cu) (net 9)) - (segment (start 158.9 87.9) (end 158.9 85.845) (width 0.25) (layer F.Cu) (net 9)) - (segment (start 157.705 89.095) (end 158.9 87.9) (width 0.25) (layer F.Cu) (net 9)) - (segment (start 167.46 92.33) (end 163.13 92.33) (width 0.25) (layer B.Cu) (net 9)) - (via (at 161.1 87.9) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 9)) - (segment (start 163.13 92.33) (end 161.1 90.3) (width 0.25) (layer B.Cu) (net 9)) - (segment (start 161.1 90.3) (end 161.1 87.9) (width 0.25) (layer B.Cu) (net 9)) - (segment (start 161.1 87.9) (end 158.9 87.9) (width 0.25) (layer F.Cu) (net 9)) - (segment (start 164.760762 91.31) (end 165.68 91.31) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 158.591767 91.009999) (end 158.891768 91.31) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 155.509999 91.009999) (end 158.591767 91.009999) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 151.5 89.095) (end 153.595 89.095) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 158.891768 91.31) (end 164.760762 91.31) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 153.595 89.095) (end 155.509999 91.009999) (width 0.25) (layer F.Cu) (net 10)) - (segment (start 166.810001 89.640001) (end 167.46 90.29) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 166.810001 89.010001) (end 166.810001 89.640001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 166.005001 88.205001) (end 166.810001 89.010001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 164.994999 88.205001) (end 166.005001 88.205001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 153.225 87.825) (end 155.120001 89.720001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 151.5 87.825) (end 153.225 87.825) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 164.38001 88.81999) (end 164.994999 88.205001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 155.120001 89.720001) (end 157.8 89.720001) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 157.8 89.720001) (end 158.700011 88.81999) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 158.700011 88.81999) (end 164.38001 88.81999) (width 0.25) (layer F.Cu) (net 11)) - (segment (start 158.2575 90.2425) (end 158.135 90.365) (width 0.25) (layer F.Cu) (net 12)) - (segment (start 158.2575 89.9425) (end 158.2575 90.2425) (width 0.25) (layer F.Cu) (net 12)) - (segment (start 165.68 89.27) (end 158.93 89.27) (width 0.25) (layer F.Cu) (net 12)) - (segment (start 158.135 90.365) (end 156.9 90.365) (width 0.25) (layer F.Cu) (net 12)) - (segment (start 158.93 89.27) (end 158.2575 89.9425) (width 0.25) (layer F.Cu) (net 12)) - (segment (start 160.81 83.95) (end 160.82 83.94) (width 0.25) (layer F.Cu) (net 13)) - (segment (start 158.9 83.95) (end 160.81 83.95) (width 0.25) (layer F.Cu) (net 13)) - (segment (start 159.68 95.37) (end 159.1 95.95) (width 0.25) (layer F.Cu) (net 14)) - (segment (start 160.82 95.37) (end 159.68 95.37) (width 0.25) (layer F.Cu) (net 14)) + (segment (start 151.5 96.245) (end 151.55 96.195) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 151.5 97.75) (end 151.5 96.245) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 151.5 97.75) (end 152.75 97.75) (width 0.5) (layer F.Cu) (net 2)) + (via (at 152.75 96.25) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) + (segment (start 152.75 97.75) (end 152.75 96.25) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 149.25 92.5) (end 149.25 94.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.25 93.5) (end 146.54 93.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 146.54 93.5) (end 146.5 93.54) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.25 94.5) (end 149.25 93.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.75 92.5) (end 149.25 92.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.97501 92.27499) (end 149.75 92.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.97501 89.97501) (end 149.97501 92.27499) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.75 89.75) (end 149.97501 89.97501) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 149.25 89.75) (end 149.75 89.75) (width 0.25) (layer F.Cu) (net 2)) + (via (at 155.75 92.5) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) + (segment (start 155.865 92.385) (end 155.75 92.5) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 156.95 92.385) (end 155.865 92.385) (width 0.25) (layer F.Cu) (net 2)) + (via (at 159 98) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) + (segment (start 159.1 97.9) (end 159 98) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 159.1 97) (end 159.1 97.9) (width 0.25) (layer F.Cu) (net 2)) + (segment (start 157.75 83.75) (end 157.0835 83.75) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 158.5 83) (end 157.75 83.75) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 159 83) (end 158.5 83) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 153.4165 83.75) (end 154.3403 83.75) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 153.4165 83.75) (end 155.75 83.75) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 155.75 83.75) (end 157.0835 83.75) (width 0.5) (layer F.Cu) (net 2)) + (via (at 157.75 82.25) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 2)) + (segment (start 158.5 83) (end 157.75 82.25) (width 0.5) (layer F.Cu) (net 2)) + (segment (start 149.610694 87.889306) (end 149.25 88.25) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 150.25 87.25) (end 149.610694 87.889306) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 151.495 87.25) (end 150.25 87.25) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 151.55 87.305) (end 151.495 87.25) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 146.71 88.25) (end 146.5 88.46) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 149.25 88.25) (end 146.71 88.25) (width 0.25) (layer F.Cu) (net 3)) + (segment (start 149.25 91) (end 146.5 91) (width 0.25) (layer F.Cu) (net 4)) + (segment (start 154.5 91.565685) (end 154.5 91) (width 0.25) (layer F.Cu) (net 4)) + (segment (start 156.95 96.195) (end 156.1 96.195) (width 0.25) (layer F.Cu) (net 4)) + (segment (start 154.5 94.595) (end 154.5 91.565685) (width 0.25) (layer F.Cu) (net 4)) + (segment (start 156.1 96.195) (end 154.5 94.595) (width 0.25) (layer F.Cu) (net 4)) + (segment (start 146.5 91) (end 154.5 91) (width 0.25) (layer B.Cu) (net 4)) + (via (at 154.5 91) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 4)) + (segment (start 146.58 96) (end 146.5 96.08) (width 0.25) (layer F.Cu) (net 5)) + (segment (start 149.25 96) (end 146.58 96) (width 0.25) (layer F.Cu) (net 5)) + (segment (start 155.5 89.434315) (end 155.5 90) (width 0.25) (layer F.Cu) (net 5)) + (via (at 155.5 90) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 5)) + (segment (start 156.95 88.575) (end 156.1 88.575) (width 0.25) (layer F.Cu) (net 5)) + (segment (start 155.5 89.175) (end 155.5 89.434315) (width 0.25) (layer F.Cu) (net 5)) + (segment (start 156.1 88.575) (end 155.5 89.175) (width 0.25) (layer F.Cu) (net 5)) + (segment (start 155.5 91.25) (end 155.5 90) (width 0.25) (layer B.Cu) (net 5)) + (segment (start 150.75 96) (end 155.5 91.25) (width 0.25) (layer B.Cu) (net 5)) + (segment (start 146.58 96) (end 150.75 96) (width 0.25) (layer B.Cu) (net 5)) + (segment (start 146.5 96.08) (end 146.58 96) (width 0.25) (layer B.Cu) (net 5)) + (segment (start 165.326498 99.25) (end 166.67 99.25) (width 0.5) (layer B.Cu) (net 6)) + (segment (start 147 99.25) (end 165.326498 99.25) (width 0.5) (layer B.Cu) (net 6)) + (segment (start 146.5 98.75) (end 147 99.25) (width 0.5) (layer B.Cu) (net 6)) + (segment (start 146.5 98.62) (end 146.5 98.75) (width 0.5) (layer B.Cu) (net 6)) + (segment (start 156.95 94.925) (end 158.215 94.925) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 165.25 94.75) (end 167.38 94.75) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 165 94.5) (end 165.25 94.75) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 158.64 94.5) (end 165 94.5) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 167.38 94.75) (end 167.56 94.57) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 158.215 94.925) (end 158.64 94.5) (width 0.25) (layer F.Cu) (net 7)) + (segment (start 165.675 93.655) (end 165.78 93.55) (width 0.25) (layer F.Cu) (net 8)) + (segment (start 156.95 93.655) (end 165.675 93.655) (width 0.25) (layer F.Cu) (net 8)) + (via (at 158.5 89.75) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 9)) + (segment (start 158.405 89.845) (end 158.5 89.75) (width 0.25) (layer F.Cu) (net 9)) + (segment (start 156.95 89.845) (end 158.405 89.845) (width 0.25) (layer F.Cu) (net 9)) + (segment (start 164.78 92.53) (end 167.56 92.53) (width 0.25) (layer B.Cu) (net 9)) + (segment (start 162 89.75) (end 164.78 92.53) (width 0.25) (layer B.Cu) (net 9)) + (segment (start 158.5 89.75) (end 162 89.75) (width 0.25) (layer B.Cu) (net 9)) + (via (at 153 89.75) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 10)) + (segment (start 152.905 89.845) (end 153 89.75) (width 0.25) (layer F.Cu) (net 10)) + (segment (start 151.55 89.845) (end 152.905 89.845) (width 0.25) (layer F.Cu) (net 10)) + (segment (start 164.76 91.51) (end 164.860762 91.51) (width 0.25) (layer B.Cu) (net 10)) + (segment (start 162.25 89) (end 164.76 91.51) (width 0.25) (layer B.Cu) (net 10)) + (segment (start 153.75 89) (end 162.25 89) (width 0.25) (layer B.Cu) (net 10)) + (segment (start 164.860762 91.51) (end 165.78 91.51) (width 0.25) (layer B.Cu) (net 10)) + (segment (start 153 89.75) (end 153.75 89) (width 0.25) (layer B.Cu) (net 10)) + (via (at 153 88.5) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 11)) + (segment (start 152.925 88.575) (end 153 88.5) (width 0.25) (layer F.Cu) (net 11)) + (segment (start 151.55 88.575) (end 152.925 88.575) (width 0.25) (layer F.Cu) (net 11)) + (segment (start 164.74 90.49) (end 167.56 90.49) (width 0.25) (layer B.Cu) (net 11)) + (segment (start 162.5 88.25) (end 164.74 90.49) (width 0.25) (layer B.Cu) (net 11)) + (segment (start 153 88.5) (end 153.25 88.25) (width 0.25) (layer B.Cu) (net 11)) + (via (at 159 87.25) (size 0.8) (drill 0.4) (layers F.Cu B.Cu) (net 11)) + (segment (start 159 85.75) (end 159 87.25) (width 0.25) (layer F.Cu) (net 11)) + (segment (start 159 87.25) (end 159 88.25) (width 0.25) (layer B.Cu) (net 11)) + (segment (start 159 88.25) (end 162.5 88.25) (width 0.25) (layer B.Cu) (net 11)) + (segment (start 153.25 88.25) (end 159 88.25) (width 0.25) (layer B.Cu) (net 11)) + (segment (start 164.135 91.115) (end 165.75 89.5) (width 0.25) (layer F.Cu) (net 12)) + (segment (start 165.75 89.5) (end 165.78 89.47) (width 0.25) (layer F.Cu) (net 12)) + (segment (start 156.95 91.115) (end 164.135 91.115) (width 0.25) (layer F.Cu) (net 12)) + (segment (start 160.81 84.25) (end 160.92 84.14) (width 0.25) (layer F.Cu) (net 13)) + (segment (start 159 84.25) (end 160.81 84.25) (width 0.25) (layer F.Cu) (net 13)) + (segment (start 160.85 95.5) (end 160.92 95.57) (width 0.25) (layer F.Cu) (net 14)) + (segment (start 159.1 95.5) (end 160.85 95.5) (width 0.25) (layer F.Cu) (net 14)) + (segment (start 152.9165 85.25) (end 151.25 85.25) (width 0.5) (layer F.Cu) (net 15)) + (segment (start 151.25 85.25) (end 151.25 83.75) (width 0.5) (layer F.Cu) (net 15)) + (segment (start 146.87 83.75) (end 146.5 83.38) (width 0.5) (layer F.Cu) (net 15)) + (segment (start 151.25 83.75) (end 146.87 83.75) (width 0.5) (layer F.Cu) (net 15)) (zone (net 1) (net_name GND) (layer F.Cu) (tstamp 0) (hatch edge 0.508) - (connect_pads (clearance 0.254)) - (min_thickness 0.254) - (fill yes (arc_segments 32) (thermal_gap 0.254) (thermal_bridge_width 0.508)) + (connect_pads (clearance 0.25)) + (min_thickness 0.25) + (fill yes (arc_segments 32) (thermal_gap 0.25) (thermal_bridge_width 0.5)) (polygon (pts - (xy 144 81) (xy 175 81) (xy 175 101) (xy 144 101) + (xy 144 81.5) (xy 144.5 81) (xy 173.5 81) (xy 174 81.5) (xy 174 100.5) + (xy 173.5 101) (xy 144.5 101) (xy 144 100.5) ) ) (filled_polygon (pts - (xy 174.594001 100.873) (xy 144.127 100.873) (xy 144.127 98.22225) (xy 155.0565 98.22225) (xy 155.0565 98.562525) - (xy 155.071142 98.636134) (xy 155.099862 98.705471) (xy 155.141558 98.767874) (xy 155.194627 98.820942) (xy 155.257029 98.862638) - (xy 155.326367 98.891358) (xy 155.399975 98.906) (xy 155.77775 98.906) (xy 155.873 98.81075) (xy 155.873 98.127) - (xy 155.15175 98.127) (xy 155.0565 98.22225) (xy 144.127 98.22225) (xy 144.127 90.2) (xy 144.691553 90.2) - (xy 144.694001 90.224856) (xy 144.694 91.375153) (xy 144.691553 91.4) (xy 144.694 91.424846) (xy 144.694 91.424853) - (xy 144.701322 91.499192) (xy 144.730255 91.594574) (xy 144.777241 91.682479) (xy 144.840473 91.759527) (xy 144.859785 91.775376) - (xy 145.524628 92.44022) (xy 145.540473 92.459527) (xy 145.617521 92.522759) (xy 145.659711 92.54531) (xy 145.571509 92.652784) - (xy 145.457202 92.866637) (xy 145.386812 93.098682) (xy 145.363044 93.34) (xy 145.386812 93.581318) (xy 145.457202 93.813363) - (xy 145.571509 94.027216) (xy 145.72534 94.21466) (xy 145.912784 94.368491) (xy 146.126637 94.482798) (xy 146.358682 94.553188) - (xy 146.539528 94.571) (xy 146.660472 94.571) (xy 146.841318 94.553188) (xy 146.904961 94.533882) (xy 146.957739 94.577196) - (xy 147.067358 94.635789) (xy 147.104834 94.647157) (xy 145.75 94.647157) (xy 145.675311 94.654513) (xy 145.603492 94.676299) - (xy 145.537304 94.711678) (xy 145.479289 94.759289) (xy 145.431678 94.817304) (xy 145.396299 94.883492) (xy 145.374513 94.955311) - (xy 145.367157 95.03) (xy 145.367157 96.73) (xy 145.374513 96.804689) (xy 145.396299 96.876508) (xy 145.431678 96.942696) - (xy 145.479289 97.000711) (xy 145.537304 97.048322) (xy 145.603492 97.083701) (xy 145.675311 97.105487) (xy 145.75 97.112843) - (xy 147.45 97.112843) (xy 147.524689 97.105487) (xy 147.596508 97.083701) (xy 147.662696 97.048322) (xy 147.720711 97.000711) - (xy 147.768322 96.942696) (xy 147.803701 96.876508) (xy 147.825487 96.804689) (xy 147.832843 96.73) (xy 147.832843 96.386) - (xy 148.619 96.386) (xy 148.619 96.476922) (xy 148.649013 96.627809) (xy 148.707887 96.769942) (xy 148.793358 96.897859) - (xy 148.902141 97.006642) (xy 149.030058 97.092113) (xy 149.172191 97.150987) (xy 149.323078 97.181) (xy 149.476922 97.181) - (xy 149.627809 97.150987) (xy 149.674 97.131854) (xy 149.674 97.227002) (xy 149.769248 97.227002) (xy 149.674 97.32225) - (xy 149.674 97.537525) (xy 149.688642 97.611134) (xy 149.717362 97.680471) (xy 149.759058 97.742874) (xy 149.812127 97.795942) - (xy 149.874529 97.837638) (xy 149.943867 97.866358) (xy 150.017475 97.881) (xy 150.12775 97.881) (xy 150.223 97.78575) - (xy 150.223 97.227) (xy 150.203 97.227) (xy 150.203 96.973) (xy 150.223 96.973) (xy 150.223 96.41425) - (xy 150.181 96.37225) (xy 150.181 96.323078) (xy 150.150987 96.172191) (xy 150.092113 96.030058) (xy 150.078755 96.010066) - (xy 150.093464 95.992143) (xy 150.142473 95.900453) (xy 150.172653 95.800965) (xy 150.180358 95.722727) (xy 150.326899 95.869268) - (xy 150.346657 95.893343) (xy 150.370732 95.913101) (xy 150.370734 95.913103) (xy 150.415693 95.95) (xy 150.442739 95.972196) - (xy 150.444233 95.972995) (xy 150.479289 96.015711) (xy 150.537304 96.063322) (xy 150.603492 96.098701) (xy 150.675311 96.120487) - (xy 150.75 96.127843) (xy 150.869001 96.127843) (xy 150.869001 96.391448) (xy 150.825471 96.362362) (xy 150.756133 96.333642) - (xy 150.682525 96.319) (xy 150.57225 96.319) (xy 150.477 96.41425) (xy 150.477 96.973) (xy 150.497 96.973) - (xy 150.497 97.227) (xy 150.477 97.227) (xy 150.477 97.78575) (xy 150.57225 97.881) (xy 150.682525 97.881) - (xy 150.756133 97.866358) (xy 150.825471 97.837638) (xy 150.887873 97.795942) (xy 150.940942 97.742874) (xy 150.982638 97.680471) - (xy 151.011358 97.611134) (xy 151.026 97.537525) (xy 151.026 97.32225) (xy 150.930752 97.227002) (xy 151.026 97.227002) - (xy 151.026 97.167079) (xy 151.031897 97.174265) (xy 151.0319 97.174268) (xy 151.051658 97.198343) (xy 151.075733 97.218101) - (xy 151.172157 97.314525) (xy 151.172157 97.3525) (xy 151.182347 97.455965) (xy 151.212527 97.555453) (xy 151.261536 97.647143) - (xy 151.327491 97.727509) (xy 151.407857 97.793464) (xy 151.499547 97.842473) (xy 151.599035 97.872653) (xy 151.7025 97.882843) - (xy 151.9975 97.882843) (xy 152.100965 97.872653) (xy 152.200453 97.842473) (xy 152.292143 97.793464) (xy 152.368255 97.731) - (xy 152.41901 97.731) (xy 152.45 97.734052) (xy 152.48099 97.731) (xy 152.480998 97.731) (xy 152.573698 97.72187) - (xy 152.692642 97.685789) (xy 152.748392 97.65599) (xy 155.0565 97.65599) (xy 155.0565 97.77775) (xy 155.15175 97.873) - (xy 155.873 97.873) (xy 155.873 97.853) (xy 156.127 97.853) (xy 156.127 97.873) (xy 156.147 97.873) - (xy 156.147 98.127) (xy 156.127 98.127) (xy 156.127 98.81075) (xy 156.22225 98.906) (xy 156.600025 98.906) - (xy 156.673633 98.891358) (xy 156.742971 98.862638) (xy 156.805373 98.820942) (xy 156.858442 98.767874) (xy 156.900138 98.705471) - (xy 156.928858 98.636134) (xy 156.932263 98.619017) (xy 156.93631 98.626589) (xy 157.015012 98.722488) (xy 157.110911 98.80119) - (xy 157.144 98.818877) (xy 157.144001 99.27601) (xy 157.107887 99.330058) (xy 157.049013 99.472191) (xy 157.019 99.623078) - (xy 157.019 99.776922) (xy 157.049013 99.927809) (xy 157.107887 100.069942) (xy 157.193358 100.197859) (xy 157.302141 100.306642) - (xy 157.430058 100.392113) (xy 157.572191 100.450987) (xy 157.723078 100.481) (xy 157.876922 100.481) (xy 158.027809 100.450987) - (xy 158.169942 100.392113) (xy 158.297859 100.306642) (xy 158.406642 100.197859) (xy 158.492113 100.069942) (xy 158.550987 99.927809) - (xy 158.581 99.776922) (xy 158.581 99.623078) (xy 158.550987 99.472191) (xy 158.492113 99.330058) (xy 158.406642 99.202141) - (xy 158.406 99.201499) (xy 158.406 98.918908) (xy 165.239 98.918908) (xy 165.239 99.181092) (xy 165.29015 99.438238) - (xy 165.390483 99.680465) (xy 165.536145 99.898463) (xy 165.721537 100.083855) (xy 165.939535 100.229517) (xy 166.181762 100.32985) - (xy 166.438908 100.381) (xy 166.701092 100.381) (xy 166.958238 100.32985) (xy 167.200465 100.229517) (xy 167.418463 100.083855) - (xy 167.603855 99.898463) (xy 167.749517 99.680465) (xy 167.84985 99.438238) (xy 167.901 99.181092) (xy 167.901 98.918908) - (xy 167.84985 98.661762) (xy 167.749517 98.419535) (xy 167.603855 98.201537) (xy 167.418463 98.016145) (xy 167.200465 97.870483) - (xy 166.958238 97.77015) (xy 166.701092 97.719) (xy 166.438908 97.719) (xy 166.181762 97.77015) (xy 165.939535 97.870483) - (xy 165.721537 98.016145) (xy 165.536145 98.201537) (xy 165.390483 98.419535) (xy 165.29015 98.661762) (xy 165.239 98.918908) - (xy 158.406 98.918908) (xy 158.406 98.818876) (xy 158.439089 98.80119) (xy 158.534988 98.722488) (xy 158.61369 98.626589) - (xy 158.672171 98.517179) (xy 158.705011 98.408916) (xy 160.250689 98.408916) (xy 160.318399 98.566459) (xy 160.504879 98.6469) - (xy 160.703468 98.689414) (xy 160.906536 98.692368) (xy 161.106279 98.655649) (xy 161.295019 98.580668) (xy 161.321601 98.566459) - (xy 161.389311 98.408916) (xy 160.82 97.839605) (xy 160.250689 98.408916) (xy 158.705011 98.408916) (xy 158.708183 98.398462) - (xy 158.720343 98.275001) (xy 158.720343 97.746536) (xy 159.787632 97.746536) (xy 159.824351 97.946279) (xy 159.899332 98.135019) - (xy 159.913541 98.161601) (xy 160.071084 98.229311) (xy 160.640395 97.66) (xy 160.999605 97.66) (xy 161.568916 98.229311) - (xy 161.726459 98.161601) (xy 161.8069 97.975121) (xy 161.849414 97.776532) (xy 161.852368 97.573464) (xy 161.815649 97.373721) - (xy 161.740668 97.184981) (xy 161.726459 97.158399) (xy 161.568916 97.090689) (xy 160.999605 97.66) (xy 160.640395 97.66) - (xy 160.071084 97.090689) (xy 159.913541 97.158399) (xy 159.8331 97.344879) (xy 159.790586 97.543468) (xy 159.787632 97.746536) - (xy 158.720343 97.746536) (xy 158.720343 97.724999) (xy 158.708183 97.601538) (xy 158.672171 97.482821) (xy 158.61369 97.373411) - (xy 158.572694 97.323457) (xy 158.597859 97.306642) (xy 158.706642 97.197859) (xy 158.792113 97.069942) (xy 158.850987 96.927809) - (xy 158.854313 96.911084) (xy 160.250689 96.911084) (xy 160.82 97.480395) (xy 161.364811 96.935584) (xy 167.823 96.935584) - (xy 167.823 97.364416) (xy 167.90666 97.785008) (xy 168.070767 98.181196) (xy 168.309013 98.537757) (xy 168.612243 98.840987) - (xy 168.968804 99.079233) (xy 169.364992 99.24334) (xy 169.785584 99.327) (xy 170.214416 99.327) (xy 170.635008 99.24334) - (xy 171.031196 99.079233) (xy 171.387757 98.840987) (xy 171.690987 98.537757) (xy 171.929233 98.181196) (xy 172.09334 97.785008) - (xy 172.177 97.364416) (xy 172.177 96.935584) (xy 172.09334 96.514992) (xy 171.929233 96.118804) (xy 171.690987 95.762243) - (xy 171.387757 95.459013) (xy 171.031196 95.220767) (xy 170.635008 95.05666) (xy 170.214416 94.973) (xy 169.785584 94.973) - (xy 169.364992 95.05666) (xy 168.968804 95.220767) (xy 168.612243 95.459013) (xy 168.309013 95.762243) (xy 168.070767 96.118804) - (xy 167.90666 96.514992) (xy 167.823 96.935584) (xy 161.364811 96.935584) (xy 161.389311 96.911084) (xy 161.321601 96.753541) - (xy 161.135121 96.6731) (xy 160.936532 96.630586) (xy 160.733464 96.627632) (xy 160.533721 96.664351) (xy 160.344981 96.739332) - (xy 160.318399 96.753541) (xy 160.250689 96.911084) (xy 158.854313 96.911084) (xy 158.881 96.776922) (xy 158.881 96.627843) - (xy 159.3525 96.627843) (xy 159.455965 96.617653) (xy 159.555453 96.587473) (xy 159.647143 96.538464) (xy 159.727509 96.472509) - (xy 159.793464 96.392143) (xy 159.842473 96.300453) (xy 159.872653 96.200965) (xy 159.882843 96.0975) (xy 159.882843 95.882749) - (xy 159.889592 95.876) (xy 159.918124 95.876) (xy 160.01917 96.027224) (xy 160.162776 96.17083) (xy 160.331638 96.283661) - (xy 160.519268 96.36138) (xy 160.718455 96.401) (xy 160.921545 96.401) (xy 161.120732 96.36138) (xy 161.308362 96.283661) - (xy 161.477224 96.17083) (xy 161.62083 96.027224) (xy 161.733661 95.858362) (xy 161.81138 95.670732) (xy 161.851 95.471545) - (xy 161.851 95.268455) (xy 161.81138 95.069268) (xy 161.733661 94.881638) (xy 161.683121 94.806) (xy 161.990409 94.806) - (xy 162.124624 94.940215) (xy 162.140473 94.959527) (xy 162.217521 95.022759) (xy 162.305425 95.069745) (xy 162.400807 95.098678) - (xy 162.475146 95.106) (xy 162.475153 95.106) (xy 162.499999 95.108447) (xy 162.524845 95.106) (xy 166.285916 95.106) - (xy 166.310762 95.108447) (xy 166.335608 95.106) (xy 166.335616 95.106) (xy 166.409955 95.098678) (xy 166.505337 95.069745) - (xy 166.593241 95.022759) (xy 166.633894 94.989396) (xy 166.65917 95.027224) (xy 166.802776 95.17083) (xy 166.971638 95.283661) - (xy 167.159268 95.36138) (xy 167.358455 95.401) (xy 167.561545 95.401) (xy 167.760732 95.36138) (xy 167.948362 95.283661) - (xy 168.117224 95.17083) (xy 168.26083 95.027224) (xy 168.373661 94.858362) (xy 168.45138 94.670732) (xy 168.491 94.471545) - (xy 168.491 94.268455) (xy 168.45138 94.069268) (xy 168.373661 93.881638) (xy 168.26083 93.712776) (xy 168.117224 93.56917) - (xy 167.948362 93.456339) (xy 167.760732 93.37862) (xy 167.616847 93.35) (xy 167.760732 93.32138) (xy 167.948362 93.243661) - (xy 168.117224 93.13083) (xy 168.26083 92.987224) (xy 168.373661 92.818362) (xy 168.45138 92.630732) (xy 168.491 92.431545) - (xy 168.491 92.228455) (xy 168.45138 92.029268) (xy 168.373661 91.841638) (xy 168.26083 91.672776) (xy 168.117224 91.52917) - (xy 167.948362 91.416339) (xy 167.760732 91.33862) (xy 167.616847 91.31) (xy 167.760732 91.28138) (xy 167.948362 91.203661) - (xy 168.117224 91.09083) (xy 168.26083 90.947224) (xy 168.373661 90.778362) (xy 168.45138 90.590732) (xy 168.491 90.391545) - (xy 168.491 90.188455) (xy 168.45138 89.989268) (xy 168.373661 89.801638) (xy 168.26083 89.632776) (xy 168.117224 89.48917) - (xy 167.948362 89.376339) (xy 167.760732 89.29862) (xy 167.616847 89.27) (xy 167.760732 89.24138) (xy 167.948362 89.163661) - (xy 168.117224 89.05083) (xy 168.26083 88.907224) (xy 168.373661 88.738362) (xy 168.45138 88.550732) (xy 168.491 88.351545) - (xy 168.491 88.148455) (xy 168.45138 87.949268) (xy 168.373661 87.761638) (xy 168.26083 87.592776) (xy 168.117224 87.44917) - (xy 167.948362 87.336339) (xy 167.760732 87.25862) (xy 167.561545 87.219) (xy 167.358455 87.219) (xy 167.159268 87.25862) - (xy 166.971638 87.336339) (xy 166.802776 87.44917) (xy 166.65917 87.592776) (xy 166.622979 87.646938) (xy 166.6669 87.545121) - (xy 166.709414 87.346532) (xy 166.712368 87.143464) (xy 166.675649 86.943721) (xy 166.600668 86.754981) (xy 166.586459 86.728399) - (xy 166.428916 86.660689) (xy 165.859605 87.23) (xy 165.873748 87.244143) (xy 165.694143 87.423748) (xy 165.68 87.409605) - (xy 165.665858 87.423748) (xy 165.486253 87.244143) (xy 165.500395 87.23) (xy 164.931084 86.660689) (xy 164.773541 86.728399) - (xy 164.6931 86.914879) (xy 164.650586 87.113468) (xy 164.647632 87.316536) (xy 164.684351 87.516279) (xy 164.759332 87.705019) - (xy 164.773541 87.731601) (xy 164.792233 87.739634) (xy 164.71252 87.782242) (xy 164.635472 87.845474) (xy 164.619627 87.864781) - (xy 164.170419 88.31399) (xy 161.762681 88.31399) (xy 161.792113 88.269942) (xy 161.850987 88.127809) (xy 161.881 87.976922) - (xy 161.881 87.823078) (xy 161.850987 87.672191) (xy 161.792113 87.530058) (xy 161.706642 87.402141) (xy 161.597859 87.293358) - (xy 161.469942 87.207887) (xy 161.327809 87.149013) (xy 161.306168 87.144708) (xy 161.321601 87.136459) (xy 161.389311 86.978916) - (xy 160.82 86.409605) (xy 160.250689 86.978916) (xy 160.318399 87.136459) (xy 160.504879 87.2169) (xy 160.665202 87.251222) - (xy 160.602141 87.293358) (xy 160.501499 87.394) (xy 159.406 87.394) (xy 159.406 86.316536) (xy 159.787632 86.316536) - (xy 159.824351 86.516279) (xy 159.899332 86.705019) (xy 159.913541 86.731601) (xy 160.071084 86.799311) (xy 160.640395 86.23) - (xy 160.999605 86.23) (xy 161.568916 86.799311) (xy 161.726459 86.731601) (xy 161.8069 86.545121) (xy 161.820609 86.481084) - (xy 165.110689 86.481084) (xy 165.68 87.050395) (xy 166.249311 86.481084) (xy 166.181601 86.323541) (xy 165.995121 86.2431) - (xy 165.796532 86.200586) (xy 165.593464 86.197632) (xy 165.393721 86.234351) (xy 165.204981 86.309332) (xy 165.178399 86.323541) - (xy 165.110689 86.481084) (xy 161.820609 86.481084) (xy 161.849414 86.346532) (xy 161.852368 86.143464) (xy 161.815649 85.943721) - (xy 161.740668 85.754981) (xy 161.726459 85.728399) (xy 161.568916 85.660689) (xy 160.999605 86.23) (xy 160.640395 86.23) - (xy 160.071084 85.660689) (xy 159.913541 85.728399) (xy 159.8331 85.914879) (xy 159.790586 86.113468) (xy 159.787632 86.316536) - (xy 159.406 86.316536) (xy 159.406 86.060455) (xy 159.447143 86.038464) (xy 159.527509 85.972509) (xy 159.593464 85.892143) - (xy 159.642473 85.800453) (xy 159.672653 85.700965) (xy 159.682843 85.5975) (xy 159.682843 85.481084) (xy 160.250689 85.481084) - (xy 160.82 86.050395) (xy 161.389311 85.481084) (xy 161.321601 85.323541) (xy 161.135121 85.2431) (xy 160.936532 85.200586) - (xy 160.733464 85.197632) (xy 160.533721 85.234351) (xy 160.344981 85.309332) (xy 160.318399 85.323541) (xy 160.250689 85.481084) - (xy 159.682843 85.481084) (xy 159.682843 85.3025) (xy 159.672653 85.199035) (xy 159.642473 85.099547) (xy 159.593464 85.007857) - (xy 159.527509 84.927491) (xy 159.447143 84.861536) (xy 159.355453 84.812527) (xy 159.255965 84.782347) (xy 159.1525 84.772157) - (xy 158.6475 84.772157) (xy 158.544035 84.782347) (xy 158.444547 84.812527) (xy 158.352857 84.861536) (xy 158.272491 84.927491) - (xy 158.206536 85.007857) (xy 158.157527 85.099547) (xy 158.127347 85.199035) (xy 158.117157 85.3025) (xy 158.117157 85.5975) - (xy 158.127347 85.700965) (xy 158.157527 85.800453) (xy 158.206536 85.892143) (xy 158.272491 85.972509) (xy 158.352857 86.038464) - (xy 158.394001 86.060456) (xy 158.394 87.690408) (xy 158.032843 88.051565) (xy 158.032843 87.525) (xy 158.025487 87.450311) - (xy 158.003701 87.378492) (xy 157.968322 87.312304) (xy 157.920711 87.254289) (xy 157.862696 87.206678) (xy 157.833119 87.190869) - (xy 157.892873 87.150942) (xy 157.945942 87.097874) (xy 157.987638 87.035471) (xy 158.016358 86.966134) (xy 158.031 86.892525) - (xy 158.031 86.77725) (xy 157.93575 86.682) (xy 157.027 86.682) (xy 157.027 86.702) (xy 156.773 86.702) - (xy 156.773 86.682) (xy 155.86425 86.682) (xy 155.769 86.77725) (xy 155.769 86.892525) (xy 155.783642 86.966134) - (xy 155.812362 87.035471) (xy 155.854058 87.097874) (xy 155.907127 87.150942) (xy 155.966881 87.190869) (xy 155.937304 87.206678) - (xy 155.906261 87.232154) (xy 155.869942 87.207887) (xy 155.727809 87.149013) (xy 155.576922 87.119) (xy 155.423078 87.119) - (xy 155.272191 87.149013) (xy 155.130058 87.207887) (xy 155.002141 87.293358) (xy 154.893358 87.402141) (xy 154.807887 87.530058) - (xy 154.749013 87.672191) (xy 154.719 87.823078) (xy 154.719 87.976922) (xy 154.749013 88.127809) (xy 154.807887 88.269942) - (xy 154.893358 88.397859) (xy 155.002141 88.506642) (xy 155.130058 88.592113) (xy 155.272191 88.650987) (xy 155.423078 88.681) - (xy 155.576922 88.681) (xy 155.727809 88.650987) (xy 155.814063 88.615259) (xy 155.796299 88.648492) (xy 155.774513 88.720311) - (xy 155.767157 88.795) (xy 155.767157 89.214001) (xy 155.329593 89.214001) (xy 153.600376 87.484785) (xy 153.584527 87.465473) - (xy 153.507479 87.402241) (xy 153.419575 87.355255) (xy 153.324193 87.326322) (xy 153.249854 87.319) (xy 153.249846 87.319) - (xy 153.225 87.316553) (xy 153.200154 87.319) (xy 152.571901 87.319) (xy 152.568322 87.312304) (xy 152.520711 87.254289) - (xy 152.462696 87.206678) (xy 152.431494 87.19) (xy 152.462696 87.173322) (xy 152.520711 87.125711) (xy 152.568322 87.067696) - (xy 152.603701 87.001508) (xy 152.625487 86.929689) (xy 152.632843 86.855) (xy 152.632843 86.255) (xy 152.629148 86.217475) - (xy 155.769 86.217475) (xy 155.769 86.33275) (xy 155.86425 86.428) (xy 156.773 86.428) (xy 156.773 85.96925) - (xy 157.027 85.96925) (xy 157.027 86.428) (xy 157.93575 86.428) (xy 158.031 86.33275) (xy 158.031 86.217475) - (xy 158.016358 86.143866) (xy 157.987638 86.074529) (xy 157.945942 86.012126) (xy 157.892873 85.959058) (xy 157.830471 85.917362) - (xy 157.761133 85.888642) (xy 157.687525 85.874) (xy 157.12225 85.874) (xy 157.027 85.96925) (xy 156.773 85.96925) - (xy 156.67775 85.874) (xy 156.112475 85.874) (xy 156.038867 85.888642) (xy 155.969529 85.917362) (xy 155.907127 85.959058) - (xy 155.854058 86.012126) (xy 155.812362 86.074529) (xy 155.783642 86.143866) (xy 155.769 86.217475) (xy 152.629148 86.217475) - (xy 152.625487 86.180311) (xy 152.603701 86.108492) (xy 152.568322 86.042304) (xy 152.520711 85.984289) (xy 152.462696 85.936678) - (xy 152.396508 85.901299) (xy 152.324689 85.879513) (xy 152.25 85.872157) (xy 150.75 85.872157) (xy 150.675311 85.879513) - (xy 150.603492 85.901299) (xy 150.537304 85.936678) (xy 150.479289 85.984289) (xy 150.431678 86.042304) (xy 150.428099 86.049) - (xy 149.869845 86.049) (xy 149.844999 86.046553) (xy 149.820153 86.049) (xy 149.820146 86.049) (xy 149.745807 86.056322) - (xy 149.650425 86.085255) (xy 149.562521 86.132241) (xy 149.485473 86.195473) (xy 149.469628 86.21478) (xy 149.059785 86.624624) - (xy 149.040473 86.640473) (xy 148.977241 86.717521) (xy 148.930255 86.805426) (xy 148.901322 86.900808) (xy 148.894 86.975147) - (xy 148.894 86.975154) (xy 148.891553 87) (xy 148.894 87.024847) (xy 148.894 87.239545) (xy 148.852857 87.261536) - (xy 148.772491 87.327491) (xy 148.758942 87.344) (xy 147.424287 87.344) (xy 147.287216 87.231509) (xy 147.073363 87.117202) - (xy 146.841318 87.046812) (xy 146.660472 87.029) (xy 146.539528 87.029) (xy 146.358682 87.046812) (xy 146.126637 87.117202) - (xy 145.912784 87.231509) (xy 145.72534 87.38534) (xy 145.571509 87.572784) (xy 145.457202 87.786637) (xy 145.386812 88.018682) - (xy 145.363044 88.26) (xy 145.386812 88.501318) (xy 145.457202 88.733363) (xy 145.571509 88.947216) (xy 145.659711 89.05469) - (xy 145.617521 89.077241) (xy 145.540473 89.140473) (xy 145.524629 89.159779) (xy 144.85978 89.824629) (xy 144.840474 89.840473) - (xy 144.777242 89.917521) (xy 144.76 89.949778) (xy 144.730255 90.005426) (xy 144.701322 90.100808) (xy 144.691553 90.2) - (xy 144.127 90.2) (xy 144.127 86.03698) (xy 145.410511 86.03698) (xy 145.434866 86.117288) (xy 145.534761 86.336961) - (xy 145.675592 86.532924) (xy 145.851948 86.697647) (xy 146.057051 86.824799) (xy 146.283019 86.909495) (xy 146.473 86.849187) - (xy 146.473 85.847) (xy 146.727 85.847) (xy 146.727 86.849187) (xy 146.916981 86.909495) (xy 147.142949 86.824799) - (xy 147.348052 86.697647) (xy 147.524408 86.532924) (xy 147.665239 86.336961) (xy 147.765134 86.117288) (xy 147.789489 86.03698) - (xy 147.728627 85.847) (xy 146.727 85.847) (xy 146.473 85.847) (xy 145.471373 85.847) (xy 145.410511 86.03698) - (xy 144.127 86.03698) (xy 144.127 85.40302) (xy 145.410511 85.40302) (xy 145.471373 85.593) (xy 146.473 85.593) - (xy 146.473 84.590813) (xy 146.727 84.590813) (xy 146.727 85.593) (xy 147.728627 85.593) (xy 147.789489 85.40302) - (xy 147.765134 85.322712) (xy 147.665239 85.103039) (xy 147.524408 84.907076) (xy 147.348052 84.742353) (xy 147.142949 84.615201) - (xy 146.916981 84.530505) (xy 146.727 84.590813) (xy 146.473 84.590813) (xy 146.283019 84.530505) (xy 146.057051 84.615201) - (xy 145.851948 84.742353) (xy 145.675592 84.907076) (xy 145.534761 85.103039) (xy 145.434866 85.322712) (xy 145.410511 85.40302) - (xy 144.127 85.40302) (xy 144.127 83.8025) (xy 158.117157 83.8025) (xy 158.117157 84.0975) (xy 158.127347 84.200965) - (xy 158.157527 84.300453) (xy 158.206536 84.392143) (xy 158.272491 84.472509) (xy 158.352857 84.538464) (xy 158.444547 84.587473) - (xy 158.544035 84.617653) (xy 158.6475 84.627843) (xy 159.1525 84.627843) (xy 159.255965 84.617653) (xy 159.355453 84.587473) - (xy 159.447143 84.538464) (xy 159.527509 84.472509) (xy 159.541058 84.456) (xy 159.924806 84.456) (xy 160.01917 84.597224) - (xy 160.162776 84.74083) (xy 160.331638 84.853661) (xy 160.519268 84.93138) (xy 160.718455 84.971) (xy 160.921545 84.971) - (xy 161.120732 84.93138) (xy 161.308362 84.853661) (xy 161.477224 84.74083) (xy 161.62083 84.597224) (xy 161.733661 84.428362) - (xy 161.81138 84.240732) (xy 161.812403 84.235584) (xy 167.823 84.235584) (xy 167.823 84.664416) (xy 167.90666 85.085008) - (xy 168.070767 85.481196) (xy 168.309013 85.837757) (xy 168.612243 86.140987) (xy 168.968804 86.379233) (xy 169.364992 86.54334) - (xy 169.785584 86.627) (xy 170.214416 86.627) (xy 170.635008 86.54334) (xy 171.031196 86.379233) (xy 171.387757 86.140987) - (xy 171.690987 85.837757) (xy 171.929233 85.481196) (xy 172.09334 85.085008) (xy 172.177 84.664416) (xy 172.177 84.235584) - (xy 172.09334 83.814992) (xy 171.929233 83.418804) (xy 171.690987 83.062243) (xy 171.387757 82.759013) (xy 171.031196 82.520767) - (xy 170.635008 82.35666) (xy 170.214416 82.273) (xy 169.785584 82.273) (xy 169.364992 82.35666) (xy 168.968804 82.520767) - (xy 168.612243 82.759013) (xy 168.309013 83.062243) (xy 168.070767 83.418804) (xy 167.90666 83.814992) (xy 167.823 84.235584) - (xy 161.812403 84.235584) (xy 161.851 84.041545) (xy 161.851 83.838455) (xy 161.81138 83.639268) (xy 161.733661 83.451638) - (xy 161.62083 83.282776) (xy 161.477224 83.13917) (xy 161.308362 83.026339) (xy 161.120732 82.94862) (xy 160.921545 82.909) - (xy 160.718455 82.909) (xy 160.519268 82.94862) (xy 160.331638 83.026339) (xy 160.162776 83.13917) (xy 160.01917 83.282776) - (xy 159.911443 83.444) (xy 159.541058 83.444) (xy 159.527509 83.427491) (xy 159.447143 83.361536) (xy 159.355453 83.312527) - (xy 159.255965 83.282347) (xy 159.1525 83.272157) (xy 158.6475 83.272157) (xy 158.544035 83.282347) (xy 158.444547 83.312527) - (xy 158.352857 83.361536) (xy 158.272491 83.427491) (xy 158.206536 83.507857) (xy 158.157527 83.599547) (xy 158.127347 83.699035) - (xy 158.117157 83.8025) (xy 144.127 83.8025) (xy 144.127 82.418908) (xy 165.239 82.418908) (xy 165.239 82.681092) - (xy 165.29015 82.938238) (xy 165.390483 83.180465) (xy 165.536145 83.398463) (xy 165.721537 83.583855) (xy 165.939535 83.729517) - (xy 166.181762 83.82985) (xy 166.438908 83.881) (xy 166.701092 83.881) (xy 166.958238 83.82985) (xy 167.200465 83.729517) - (xy 167.418463 83.583855) (xy 167.603855 83.398463) (xy 167.749517 83.180465) (xy 167.84985 82.938238) (xy 167.901 82.681092) - (xy 167.901 82.418908) (xy 167.84985 82.161762) (xy 167.749517 81.919535) (xy 167.603855 81.701537) (xy 167.418463 81.516145) - (xy 167.200465 81.370483) (xy 166.958238 81.27015) (xy 166.701092 81.219) (xy 166.438908 81.219) (xy 166.181762 81.27015) - (xy 165.939535 81.370483) (xy 165.721537 81.516145) (xy 165.536145 81.701537) (xy 165.390483 81.919535) (xy 165.29015 82.161762) - (xy 165.239 82.418908) (xy 144.127 82.418908) (xy 144.127 81.127) (xy 174.594 81.127) - ) - ) - (filled_polygon - (pts - (xy 155.29963 95.78522) (xy 155.315475 95.804527) (xy 155.392523 95.867759) (xy 155.480427 95.914745) (xy 155.553609 95.936944) - (xy 155.575808 95.943678) (xy 155.585696 95.944652) (xy 155.650148 95.951) (xy 155.650155 95.951) (xy 155.675001 95.953447) - (xy 155.699847 95.951) (xy 155.828099 95.951) (xy 155.831678 95.957696) (xy 155.879289 96.015711) (xy 155.937304 96.063322) - (xy 156.003492 96.098701) (xy 156.075311 96.120487) (xy 156.15 96.127843) (xy 157.567656 96.127843) (xy 157.493358 96.202141) - (xy 157.407887 96.330058) (xy 157.349013 96.472191) (xy 157.328541 96.575112) (xy 157.326658 96.576657) (xy 157.3069 96.600732) - (xy 157.306897 96.600735) (xy 157.28941 96.622042) (xy 157.268095 96.600727) (xy 157.248333 96.576647) (xy 157.152251 96.497794) - (xy 157.042632 96.439201) (xy 156.923688 96.40312) (xy 156.830988 96.39399) (xy 156.83098 96.39399) (xy 156.79999 96.390938) - (xy 156.769 96.39399) (xy 152.556 96.39399) (xy 152.52501 96.390938) (xy 152.525009 96.390938) (xy 152.513919 96.39203) - (xy 152.49402 96.39399) (xy 152.494012 96.39399) (xy 152.401312 96.40312) (xy 152.318566 96.428221) (xy 152.292143 96.406536) - (xy 152.200453 96.357527) (xy 152.131 96.336458) (xy 152.131 96.127843) (xy 152.25 96.127843) (xy 152.324689 96.120487) - (xy 152.396508 96.098701) (xy 152.462696 96.063322) (xy 152.520711 96.015711) (xy 152.568322 95.957696) (xy 152.603701 95.891508) - (xy 152.625487 95.819689) (xy 152.632843 95.745) (xy 152.632843 95.145) (xy 152.625487 95.070311) (xy 152.603701 94.998492) - (xy 152.568322 94.932304) (xy 152.520711 94.874289) (xy 152.462696 94.826678) (xy 152.433119 94.810869) (xy 152.492873 94.770942) - (xy 152.545942 94.717874) (xy 152.587638 94.655471) (xy 152.616358 94.586134) (xy 152.631 94.512525) (xy 152.631 94.39725) - (xy 152.53575 94.302) (xy 151.627 94.302) (xy 151.627 94.322) (xy 151.373 94.322) (xy 151.373 94.302) - (xy 151.353 94.302) (xy 151.353 94.048) (xy 151.373 94.048) (xy 151.373 94.028) (xy 151.627 94.028) - (xy 151.627 94.048) (xy 152.53575 94.048) (xy 152.631 93.95275) (xy 152.631 93.837475) (xy 152.616358 93.763866) - (xy 152.587638 93.694529) (xy 152.545942 93.632126) (xy 152.492873 93.579058) (xy 152.433119 93.539131) (xy 152.462696 93.523322) - (xy 152.520711 93.475711) (xy 152.568322 93.417696) (xy 152.603701 93.351508) (xy 152.625487 93.279689) (xy 152.632843 93.205) - (xy 152.632843 93.118432) - ) - ) - (filled_polygon - (pts - (xy 150.431678 87.067696) (xy 150.479289 87.125711) (xy 150.537304 87.173322) (xy 150.568506 87.19) (xy 150.537304 87.206678) - (xy 150.479289 87.254289) (xy 150.431678 87.312304) (xy 150.396299 87.378492) (xy 150.374513 87.450311) (xy 150.367157 87.525) - (xy 150.367157 88.125) (xy 150.374513 88.199689) (xy 150.396299 88.271508) (xy 150.431678 88.337696) (xy 150.479289 88.395711) - (xy 150.537304 88.443322) (xy 150.568506 88.46) (xy 150.537304 88.476678) (xy 150.479289 88.524289) (xy 150.431678 88.582304) - (xy 150.396299 88.648492) (xy 150.374513 88.720311) (xy 150.367157 88.795) (xy 150.367157 89.395) (xy 150.374513 89.469689) - (xy 150.396299 89.541508) (xy 150.431678 89.607696) (xy 150.479289 89.665711) (xy 150.537304 89.713322) (xy 150.566881 89.729131) - (xy 150.507127 89.769058) (xy 150.454058 89.822126) (xy 150.412362 89.884529) (xy 150.383642 89.953866) (xy 150.369 90.027475) - (xy 150.369 90.14275) (xy 150.46425 90.238) (xy 151.373 90.238) (xy 151.373 90.218) (xy 151.627 90.218) - (xy 151.627 90.238) (xy 152.53575 90.238) (xy 152.631 90.14275) (xy 152.631 90.027475) (xy 152.616358 89.953866) - (xy 152.587638 89.884529) (xy 152.545942 89.822126) (xy 152.492873 89.769058) (xy 152.433119 89.729131) (xy 152.462696 89.713322) - (xy 152.520711 89.665711) (xy 152.568322 89.607696) (xy 152.571901 89.601) (xy 153.385409 89.601) (xy 155.134627 91.350219) - (xy 155.150472 91.369526) (xy 155.22752 91.432758) (xy 155.315424 91.479744) (xy 155.410806 91.508677) (xy 155.509999 91.518447) - (xy 155.534853 91.515999) (xy 155.767157 91.515999) (xy 155.767157 91.935) (xy 155.774513 92.009689) (xy 155.796299 92.081508) - (xy 155.831678 92.147696) (xy 155.879289 92.205711) (xy 155.937304 92.253322) (xy 155.968506 92.27) (xy 155.937304 92.286678) - (xy 155.879289 92.334289) (xy 155.831678 92.392304) (xy 155.796299 92.458492) (xy 155.774513 92.530311) (xy 155.767157 92.605) - (xy 155.767157 93.205) (xy 155.774513 93.279689) (xy 155.796299 93.351508) (xy 155.831678 93.417696) (xy 155.879289 93.475711) - (xy 155.937304 93.523322) (xy 155.968506 93.54) (xy 155.937304 93.556678) (xy 155.879289 93.604289) (xy 155.831678 93.662304) - (xy 155.796299 93.728492) (xy 155.774513 93.800311) (xy 155.767157 93.875) (xy 155.767157 94.475) (xy 155.774513 94.549689) - (xy 155.796299 94.621508) (xy 155.831678 94.687696) (xy 155.879289 94.745711) (xy 155.937304 94.793322) (xy 155.968506 94.81) - (xy 155.937304 94.826678) (xy 155.879289 94.874289) (xy 155.852512 94.906918) (xy 152.885377 91.939784) (xy 152.869528 91.920472) - (xy 152.79248 91.85724) (xy 152.704576 91.810254) (xy 152.632843 91.788495) (xy 152.632843 91.335) (xy 152.625487 91.260311) - (xy 152.603701 91.188492) (xy 152.568322 91.122304) (xy 152.520711 91.064289) (xy 152.462696 91.016678) (xy 152.433119 91.000869) - (xy 152.492873 90.960942) (xy 152.545942 90.907874) (xy 152.587638 90.845471) (xy 152.616358 90.776134) (xy 152.631 90.702525) - (xy 152.631 90.58725) (xy 152.53575 90.492) (xy 151.627 90.492) (xy 151.627 90.512) (xy 151.373 90.512) - (xy 151.373 90.492) (xy 150.46425 90.492) (xy 150.369 90.58725) (xy 150.369 90.702525) (xy 150.383642 90.776134) - (xy 150.412362 90.845471) (xy 150.454058 90.907874) (xy 150.507127 90.960942) (xy 150.566881 91.000869) (xy 150.537304 91.016678) - (xy 150.479289 91.064289) (xy 150.431678 91.122304) (xy 150.396299 91.188492) (xy 150.374513 91.260311) (xy 150.367157 91.335) - (xy 150.367157 91.441566) (xy 150.267268 91.341677) (xy 150.266694 91.335847) (xy 150.266694 91.33584) (xy 150.259372 91.261501) - (xy 150.258805 91.25963) (xy 150.24762 91.222759) (xy 150.230439 91.166119) (xy 150.183453 91.078215) (xy 150.182843 91.077472) - (xy 150.182843 90.8525) (xy 150.172653 90.749035) (xy 150.142473 90.649547) (xy 150.093464 90.557857) (xy 150.027509 90.477491) - (xy 149.947143 90.411536) (xy 149.855453 90.362527) (xy 149.755965 90.332347) (xy 149.6525 90.322157) (xy 149.367879 90.322157) - (xy 149.299193 90.301322) (xy 149.224854 90.294) (xy 149.224846 90.294) (xy 149.2 90.291553) (xy 149.175154 90.294) - (xy 147.725353 90.294) (xy 147.628491 90.112784) (xy 147.540856 90.006) (xy 148.725154 90.006) (xy 148.75 90.008447) - (xy 148.774846 90.006) (xy 148.774854 90.006) (xy 148.849193 89.998678) (xy 148.923398 89.976169) (xy 148.944547 89.987473) - (xy 149.044035 90.017653) (xy 149.1475 90.027843) (xy 149.6525 90.027843) (xy 149.755965 90.017653) (xy 149.855453 89.987473) - (xy 149.947143 89.938464) (xy 150.027509 89.872509) (xy 150.093464 89.792143) (xy 150.142473 89.700453) (xy 150.172653 89.600965) - (xy 150.182843 89.4975) (xy 150.182843 89.2025) (xy 150.172653 89.099035) (xy 150.142473 88.999547) (xy 150.093464 88.907857) - (xy 150.027509 88.827491) (xy 149.947143 88.761536) (xy 149.855453 88.712527) (xy 149.755965 88.682347) (xy 149.6525 88.672157) - (xy 149.1475 88.672157) (xy 149.044035 88.682347) (xy 148.944547 88.712527) (xy 148.852857 88.761536) (xy 148.772491 88.827491) - (xy 148.737065 88.870657) (xy 148.705425 88.880255) (xy 148.617521 88.927241) (xy 148.540473 88.990473) (xy 148.537578 88.994) - (xy 147.590096 88.994) (xy 147.628491 88.947216) (xy 147.742798 88.733363) (xy 147.813188 88.501318) (xy 147.827501 88.356) - (xy 148.758942 88.356) (xy 148.772491 88.372509) (xy 148.852857 88.438464) (xy 148.944547 88.487473) (xy 149.044035 88.517653) - (xy 149.1475 88.527843) (xy 149.6525 88.527843) (xy 149.755965 88.517653) (xy 149.855453 88.487473) (xy 149.947143 88.438464) - (xy 150.027509 88.372509) (xy 150.093464 88.292143) (xy 150.142473 88.200453) (xy 150.172653 88.100965) (xy 150.182843 87.9975) - (xy 150.182843 87.7025) (xy 150.172653 87.599035) (xy 150.142473 87.499547) (xy 150.093464 87.407857) (xy 150.027509 87.327491) - (xy 149.947143 87.261536) (xy 149.906 87.239545) (xy 149.906 87.209591) (xy 150.054592 87.061) (xy 150.428099 87.061) - ) - ) - (filled_polygon - (pts - (xy 164.87917 89.927224) (xy 165.022776 90.07083) (xy 165.191638 90.183661) (xy 165.379268 90.26138) (xy 165.523153 90.29) - (xy 165.379268 90.31862) (xy 165.191638 90.396339) (xy 165.022776 90.50917) (xy 164.87917 90.652776) (xy 164.778124 90.804) - (xy 159.876728 90.804) (xy 159.881 90.782525) (xy 159.881 90.67225) (xy 159.78575 90.577) (xy 159.227 90.577) - (xy 159.227 90.597) (xy 158.973 90.597) (xy 158.973 90.577) (xy 158.953 90.577) (xy 158.953 90.323) - (xy 158.973 90.323) (xy 158.973 90.303) (xy 159.227 90.303) (xy 159.227 90.323) (xy 159.78575 90.323) - (xy 159.881 90.22775) (xy 159.881 90.117475) (xy 159.866358 90.043867) (xy 159.837638 89.974529) (xy 159.795942 89.912127) - (xy 159.742874 89.859058) (xy 159.680471 89.817362) (xy 159.611134 89.788642) (xy 159.54758 89.776) (xy 164.778124 89.776) + (xy 158.230426 81.131487) (xy 158.223186 81.205) (xy 158.225 81.28125) (xy 158.31875 81.375) (xy 158.875 81.375) + (xy 158.875 81.355) (xy 159.125 81.355) (xy 159.125 81.375) (xy 159.68125 81.375) (xy 159.775 81.28125) + (xy 159.776814 81.205) (xy 159.769574 81.131487) (xy 159.767606 81.125) (xy 173.448224 81.125) (xy 173.875 81.551776) + (xy 173.875 100.448224) (xy 173.448224 100.875) (xy 144.551776 100.875) (xy 144.125 100.448224) (xy 144.125 98.519046) + (xy 145.475 98.519046) (xy 145.475 98.720954) (xy 145.51439 98.918982) (xy 145.591656 99.10552) (xy 145.70383 99.2734) + (xy 145.8466 99.41617) (xy 146.01448 99.528344) (xy 146.201018 99.60561) (xy 146.399046 99.645) (xy 146.600954 99.645) + (xy 146.798982 99.60561) (xy 146.98552 99.528344) (xy 147.1534 99.41617) (xy 147.29617 99.2734) (xy 147.399003 99.119499) + (xy 165.345 99.119499) (xy 165.345 99.380501) (xy 165.395919 99.636488) (xy 165.4958 99.877623) (xy 165.640805 100.094638) + (xy 165.825362 100.279195) (xy 166.042377 100.4242) (xy 166.283512 100.524081) (xy 166.539499 100.575) (xy 166.800501 100.575) + (xy 167.056488 100.524081) (xy 167.297623 100.4242) (xy 167.514638 100.279195) (xy 167.699195 100.094638) (xy 167.8442 99.877623) + (xy 167.944081 99.636488) (xy 167.995 99.380501) (xy 167.995 99.119499) (xy 167.944081 98.863512) (xy 167.8442 98.622377) + (xy 167.699195 98.405362) (xy 167.514638 98.220805) (xy 167.297623 98.0758) (xy 167.056488 97.975919) (xy 166.800501 97.925) + (xy 166.539499 97.925) (xy 166.283512 97.975919) (xy 166.042377 98.0758) (xy 165.825362 98.220805) (xy 165.640805 98.405362) + (xy 165.4958 98.622377) (xy 165.395919 98.863512) (xy 165.345 99.119499) (xy 147.399003 99.119499) (xy 147.408344 99.10552) + (xy 147.48561 98.918982) (xy 147.525 98.720954) (xy 147.525 98.519046) (xy 147.48561 98.321018) (xy 147.414773 98.15) + (xy 149.328186 98.15) (xy 149.335426 98.223513) (xy 149.356869 98.2942) (xy 149.391691 98.359347) (xy 149.438552 98.416448) + (xy 149.495653 98.463309) (xy 149.5608 98.498131) (xy 149.631487 98.519574) (xy 149.705 98.526814) (xy 149.78125 98.525) + (xy 149.875 98.43125) (xy 149.875 97.875) (xy 150.125 97.875) (xy 150.125 98.43125) (xy 150.21875 98.525) + (xy 150.295 98.526814) (xy 150.368513 98.519574) (xy 150.4392 98.498131) (xy 150.504347 98.463309) (xy 150.561448 98.416448) + (xy 150.608309 98.359347) (xy 150.643131 98.2942) (xy 150.664574 98.223513) (xy 150.671814 98.15) (xy 150.67 97.96875) + (xy 150.57625 97.875) (xy 150.125 97.875) (xy 149.875 97.875) (xy 149.42375 97.875) (xy 149.33 97.96875) + (xy 149.328186 98.15) (xy 147.414773 98.15) (xy 147.408344 98.13448) (xy 147.29617 97.9666) (xy 147.1534 97.82383) + (xy 146.98552 97.711656) (xy 146.798982 97.63439) (xy 146.600954 97.595) (xy 146.399046 97.595) (xy 146.201018 97.63439) + (xy 146.01448 97.711656) (xy 145.8466 97.82383) (xy 145.70383 97.9666) (xy 145.591656 98.13448) (xy 145.51439 98.321018) + (xy 145.475 98.519046) (xy 144.125 98.519046) (xy 144.125 97.35) (xy 149.328186 97.35) (xy 149.33 97.53125) + (xy 149.42375 97.625) (xy 149.875 97.625) (xy 149.875 97.06875) (xy 150.125 97.06875) (xy 150.125 97.625) + (xy 150.57625 97.625) (xy 150.67 97.53125) (xy 150.671814 97.35) (xy 150.664574 97.276487) (xy 150.643131 97.2058) + (xy 150.608309 97.140653) (xy 150.561448 97.083552) (xy 150.504347 97.036691) (xy 150.4392 97.001869) (xy 150.368513 96.980426) + (xy 150.295 96.973186) (xy 150.21875 96.975) (xy 150.125 97.06875) (xy 149.875 97.06875) (xy 149.78125 96.975) + (xy 149.705 96.973186) (xy 149.631487 96.980426) (xy 149.5608 97.001869) (xy 149.495653 97.036691) (xy 149.438552 97.083552) + (xy 149.391691 97.140653) (xy 149.356869 97.2058) (xy 149.335426 97.276487) (xy 149.328186 97.35) (xy 144.125 97.35) + (xy 144.125 95.979046) (xy 145.475 95.979046) (xy 145.475 96.180954) (xy 145.51439 96.378982) (xy 145.591656 96.56552) + (xy 145.70383 96.7334) (xy 145.8466 96.87617) (xy 146.01448 96.988344) (xy 146.201018 97.06561) (xy 146.399046 97.105) + (xy 146.600954 97.105) (xy 146.798982 97.06561) (xy 146.98552 96.988344) (xy 147.1534 96.87617) (xy 147.29617 96.7334) + (xy 147.408344 96.56552) (xy 147.435483 96.5) (xy 148.61178 96.5) (xy 148.626754 96.518246) (xy 148.706207 96.583451) + (xy 148.796854 96.631903) (xy 148.895211 96.661739) (xy 148.9975 96.671814) (xy 149.5025 96.671814) (xy 149.604789 96.661739) + (xy 149.703146 96.631903) (xy 149.793793 96.583451) (xy 149.873246 96.518246) (xy 149.938451 96.438793) (xy 149.986903 96.348146) + (xy 150.016739 96.249789) (xy 150.026814 96.1475) (xy 150.026814 95.8525) (xy 150.016739 95.750211) (xy 149.986903 95.651854) + (xy 149.938451 95.561207) (xy 149.873246 95.481754) (xy 149.793793 95.416549) (xy 149.703146 95.368097) (xy 149.604789 95.338261) + (xy 149.5025 95.328186) (xy 148.9975 95.328186) (xy 148.895211 95.338261) (xy 148.796854 95.368097) (xy 148.706207 95.416549) + (xy 148.626754 95.481754) (xy 148.61178 95.5) (xy 147.345214 95.5) (xy 147.29617 95.4266) (xy 147.1534 95.28383) + (xy 147.065355 95.225) (xy 150.423186 95.225) (xy 150.430426 95.298513) (xy 150.451869 95.3692) (xy 150.486691 95.434347) + (xy 150.533552 95.491448) (xy 150.590653 95.538309) (xy 150.6558 95.573131) (xy 150.697156 95.585676) (xy 150.657318 95.60697) + (xy 150.577486 95.672486) (xy 150.51197 95.752318) (xy 150.463287 95.843397) (xy 150.433309 95.942224) (xy 150.423186 96.045) + (xy 150.423186 96.345) (xy 150.433309 96.447776) (xy 150.463287 96.546603) (xy 150.51197 96.637682) (xy 150.577486 96.717514) + (xy 150.657318 96.78303) (xy 150.748397 96.831713) (xy 150.847224 96.861691) (xy 150.875001 96.864427) (xy 150.875 97.283939) + (xy 150.868097 97.296854) (xy 150.838261 97.395211) (xy 150.828186 97.4975) (xy 150.828186 98.0025) (xy 150.838261 98.104789) + (xy 150.868097 98.203146) (xy 150.916549 98.293793) (xy 150.981754 98.373246) (xy 151.061207 98.438451) (xy 151.151854 98.486903) + (xy 151.250211 98.516739) (xy 151.3525 98.526814) (xy 151.6475 98.526814) (xy 151.749789 98.516739) (xy 151.848146 98.486903) + (xy 151.938793 98.438451) (xy 152.016109 98.375) (xy 152.233891 98.375) (xy 152.311207 98.438451) (xy 152.401854 98.486903) + (xy 152.500211 98.516739) (xy 152.6025 98.526814) (xy 152.8975 98.526814) (xy 152.999789 98.516739) (xy 153.098146 98.486903) + (xy 153.188793 98.438451) (xy 153.268246 98.373246) (xy 153.333451 98.293793) (xy 153.381903 98.203146) (xy 153.398024 98.15) + (xy 153.578186 98.15) (xy 153.585426 98.223513) (xy 153.606869 98.2942) (xy 153.641691 98.359347) (xy 153.688552 98.416448) + (xy 153.745653 98.463309) (xy 153.8108 98.498131) (xy 153.881487 98.519574) (xy 153.955 98.526814) (xy 154.03125 98.525) + (xy 154.125 98.43125) (xy 154.125 97.875) (xy 154.375 97.875) (xy 154.375 98.43125) (xy 154.46875 98.525) + (xy 154.545 98.526814) (xy 154.618513 98.519574) (xy 154.6892 98.498131) (xy 154.754347 98.463309) (xy 154.811448 98.416448) + (xy 154.858309 98.359347) (xy 154.893131 98.2942) (xy 154.914574 98.223513) (xy 154.921814 98.15) (xy 154.92 97.96875) + (xy 154.874919 97.923669) (xy 158.225 97.923669) (xy 158.225 98.076331) (xy 158.254783 98.226059) (xy 158.313204 98.3671) + (xy 158.398018 98.494034) (xy 158.505966 98.601982) (xy 158.6329 98.686796) (xy 158.773941 98.745217) (xy 158.923669 98.775) + (xy 159.076331 98.775) (xy 159.226059 98.745217) (xy 159.3671 98.686796) (xy 159.490322 98.604462) (xy 160.352315 98.604462) + (xy 160.420206 98.760569) (xy 160.605502 98.84077) (xy 160.802883 98.88328) (xy 161.004765 98.886466) (xy 161.20339 98.850205) + (xy 161.391125 98.775892) (xy 161.419794 98.760569) (xy 161.487685 98.604462) (xy 160.92 98.036777) (xy 160.352315 98.604462) + (xy 159.490322 98.604462) (xy 159.494034 98.601982) (xy 159.601982 98.494034) (xy 159.686796 98.3671) (xy 159.745217 98.226059) + (xy 159.775 98.076331) (xy 159.775 97.944765) (xy 159.893534 97.944765) (xy 159.929795 98.14339) (xy 160.004108 98.331125) + (xy 160.019431 98.359794) (xy 160.175538 98.427685) (xy 160.743223 97.86) (xy 161.096777 97.86) (xy 161.664462 98.427685) + (xy 161.820569 98.359794) (xy 161.90077 98.174498) (xy 161.94328 97.977117) (xy 161.946466 97.775235) (xy 161.910205 97.57661) + (xy 161.835892 97.388875) (xy 161.820569 97.360206) (xy 161.664462 97.292315) (xy 161.096777 97.86) (xy 160.743223 97.86) + (xy 160.175538 97.292315) (xy 160.019431 97.360206) (xy 159.93923 97.545502) (xy 159.89672 97.742883) (xy 159.893534 97.944765) + (xy 159.775 97.944765) (xy 159.775 97.923669) (xy 159.745217 97.773941) (xy 159.686796 97.6329) (xy 159.650227 97.578171) + (xy 159.723246 97.518246) (xy 159.788451 97.438793) (xy 159.836903 97.348146) (xy 159.866739 97.249789) (xy 159.876814 97.1475) + (xy 159.876814 97.115538) (xy 160.352315 97.115538) (xy 160.92 97.683223) (xy 161.467442 97.135781) (xy 167.925 97.135781) + (xy 167.925 97.564219) (xy 168.008584 97.984424) (xy 168.17254 98.380249) (xy 168.410567 98.736482) (xy 168.713518 99.039433) + (xy 169.069751 99.27746) (xy 169.465576 99.441416) (xy 169.885781 99.525) (xy 170.314219 99.525) (xy 170.734424 99.441416) + (xy 171.130249 99.27746) (xy 171.486482 99.039433) (xy 171.789433 98.736482) (xy 172.02746 98.380249) (xy 172.191416 97.984424) + (xy 172.275 97.564219) (xy 172.275 97.135781) (xy 172.191416 96.715576) (xy 172.02746 96.319751) (xy 171.789433 95.963518) + (xy 171.486482 95.660567) (xy 171.130249 95.42254) (xy 170.734424 95.258584) (xy 170.314219 95.175) (xy 169.885781 95.175) + (xy 169.465576 95.258584) (xy 169.069751 95.42254) (xy 168.713518 95.660567) (xy 168.410567 95.963518) (xy 168.17254 96.319751) + (xy 168.008584 96.715576) (xy 167.925 97.135781) (xy 161.467442 97.135781) (xy 161.487685 97.115538) (xy 161.419794 96.959431) + (xy 161.234498 96.87923) (xy 161.037117 96.83672) (xy 160.835235 96.833534) (xy 160.63661 96.869795) (xy 160.448875 96.944108) + (xy 160.420206 96.959431) (xy 160.352315 97.115538) (xy 159.876814 97.115538) (xy 159.876814 96.8525) (xy 159.866739 96.750211) + (xy 159.836903 96.651854) (xy 159.788451 96.561207) (xy 159.723246 96.481754) (xy 159.643793 96.416549) (xy 159.553146 96.368097) + (xy 159.454789 96.338261) (xy 159.3525 96.328186) (xy 158.8475 96.328186) (xy 158.745211 96.338261) (xy 158.646854 96.368097) + (xy 158.556207 96.416549) (xy 158.476754 96.481754) (xy 158.411549 96.561207) (xy 158.363097 96.651854) (xy 158.333261 96.750211) + (xy 158.323186 96.8525) (xy 158.323186 97.1475) (xy 158.333261 97.249789) (xy 158.363097 97.348146) (xy 158.411549 97.438793) + (xy 158.435728 97.468256) (xy 158.398018 97.505966) (xy 158.313204 97.6329) (xy 158.254783 97.773941) (xy 158.225 97.923669) + (xy 154.874919 97.923669) (xy 154.82625 97.875) (xy 154.375 97.875) (xy 154.125 97.875) (xy 153.67375 97.875) + (xy 153.58 97.96875) (xy 153.578186 98.15) (xy 153.398024 98.15) (xy 153.411739 98.104789) (xy 153.421814 98.0025) + (xy 153.421814 97.4975) (xy 153.411739 97.395211) (xy 153.398025 97.35) (xy 153.578186 97.35) (xy 153.58 97.53125) + (xy 153.67375 97.625) (xy 154.125 97.625) (xy 154.125 97.06875) (xy 154.375 97.06875) (xy 154.375 97.625) + (xy 154.82625 97.625) (xy 154.92 97.53125) (xy 154.921814 97.35) (xy 154.914574 97.276487) (xy 154.893131 97.2058) + (xy 154.858309 97.140653) (xy 154.811448 97.083552) (xy 154.754347 97.036691) (xy 154.6892 97.001869) (xy 154.618513 96.980426) + (xy 154.545 96.973186) (xy 154.46875 96.975) (xy 154.375 97.06875) (xy 154.125 97.06875) (xy 154.03125 96.975) + (xy 153.955 96.973186) (xy 153.881487 96.980426) (xy 153.8108 97.001869) (xy 153.745653 97.036691) (xy 153.688552 97.083552) + (xy 153.641691 97.140653) (xy 153.606869 97.2058) (xy 153.585426 97.276487) (xy 153.578186 97.35) (xy 153.398025 97.35) + (xy 153.381903 97.296854) (xy 153.375 97.283939) (xy 153.375 96.709585) (xy 153.436796 96.6171) (xy 153.495217 96.476059) + (xy 153.525 96.326331) (xy 153.525 96.173669) (xy 153.495217 96.023941) (xy 153.436796 95.8829) (xy 153.351982 95.755966) + (xy 153.244034 95.648018) (xy 153.1171 95.563204) (xy 152.976059 95.504783) (xy 152.826331 95.475) (xy 152.673669 95.475) + (xy 152.5586 95.497889) (xy 152.566448 95.491448) (xy 152.613309 95.434347) (xy 152.648131 95.3692) (xy 152.669574 95.298513) + (xy 152.676814 95.225) (xy 152.675 95.14375) (xy 152.58125 95.05) (xy 151.675 95.05) (xy 151.675 95.07) + (xy 151.425 95.07) (xy 151.425 95.05) (xy 150.51875 95.05) (xy 150.425 95.14375) (xy 150.423186 95.225) + (xy 147.065355 95.225) (xy 146.98552 95.171656) (xy 146.798982 95.09439) (xy 146.600954 95.055) (xy 146.399046 95.055) + (xy 146.201018 95.09439) (xy 146.01448 95.171656) (xy 145.8466 95.28383) (xy 145.70383 95.4266) (xy 145.591656 95.59448) + (xy 145.51439 95.781018) (xy 145.475 95.979046) (xy 144.125 95.979046) (xy 144.125 88.359046) (xy 145.475 88.359046) + (xy 145.475 88.560954) (xy 145.51439 88.758982) (xy 145.591656 88.94552) (xy 145.70383 89.1134) (xy 145.8466 89.25617) + (xy 146.01448 89.368344) (xy 146.201018 89.44561) (xy 146.399046 89.485) (xy 146.600954 89.485) (xy 146.798982 89.44561) + (xy 146.98552 89.368344) (xy 147.1534 89.25617) (xy 147.29617 89.1134) (xy 147.408344 88.94552) (xy 147.48561 88.758982) + (xy 147.487397 88.75) (xy 148.61178 88.75) (xy 148.626754 88.768246) (xy 148.706207 88.833451) (xy 148.796854 88.881903) + (xy 148.895211 88.911739) (xy 148.9975 88.921814) (xy 149.5025 88.921814) (xy 149.604789 88.911739) (xy 149.703146 88.881903) + (xy 149.793793 88.833451) (xy 149.873246 88.768246) (xy 149.938451 88.688793) (xy 149.986903 88.598146) (xy 150.016739 88.499789) + (xy 150.026814 88.3975) (xy 150.026814 88.180291) (xy 150.457107 87.75) (xy 150.513872 87.75) (xy 150.577486 87.827514) + (xy 150.657318 87.89303) (xy 150.745192 87.94) (xy 150.657318 87.98697) (xy 150.577486 88.052486) (xy 150.51197 88.132318) + (xy 150.463287 88.223397) (xy 150.433309 88.322224) (xy 150.423186 88.425) (xy 150.423186 88.725) (xy 150.433309 88.827776) + (xy 150.463287 88.926603) (xy 150.51197 89.017682) (xy 150.577486 89.097514) (xy 150.657318 89.16303) (xy 150.745192 89.21) + (xy 150.657318 89.25697) (xy 150.577486 89.322486) (xy 150.51197 89.402318) (xy 150.463287 89.493397) (xy 150.433309 89.592224) + (xy 150.423186 89.695) (xy 150.423186 89.752811) (xy 150.392756 89.695881) (xy 150.330274 89.619746) (xy 150.311186 89.604081) + (xy 150.120929 89.413824) (xy 150.105264 89.394736) (xy 150.029129 89.332254) (xy 149.942267 89.285825) (xy 149.909451 89.275871) + (xy 149.873246 89.231754) (xy 149.793793 89.166549) (xy 149.703146 89.118097) (xy 149.604789 89.088261) (xy 149.5025 89.078186) + (xy 148.9975 89.078186) (xy 148.895211 89.088261) (xy 148.796854 89.118097) (xy 148.706207 89.166549) (xy 148.626754 89.231754) + (xy 148.561549 89.311207) (xy 148.513097 89.401854) (xy 148.483261 89.500211) (xy 148.473186 89.6025) (xy 148.473186 89.8975) + (xy 148.483261 89.999789) (xy 148.513097 90.098146) (xy 148.561549 90.188793) (xy 148.626754 90.268246) (xy 148.706207 90.333451) + (xy 148.783939 90.375) (xy 148.706207 90.416549) (xy 148.626754 90.481754) (xy 148.61178 90.5) (xy 147.398669 90.5) + (xy 147.29617 90.3466) (xy 147.1534 90.20383) (xy 146.98552 90.091656) (xy 146.798982 90.01439) (xy 146.600954 89.975) + (xy 146.399046 89.975) (xy 146.201018 90.01439) (xy 146.01448 90.091656) (xy 145.8466 90.20383) (xy 145.70383 90.3466) + (xy 145.591656 90.51448) (xy 145.51439 90.701018) (xy 145.475 90.899046) (xy 145.475 91.100954) (xy 145.51439 91.298982) + (xy 145.591656 91.48552) (xy 145.70383 91.6534) (xy 145.8466 91.79617) (xy 146.01448 91.908344) (xy 146.201018 91.98561) + (xy 146.399046 92.025) (xy 146.600954 92.025) (xy 146.798982 91.98561) (xy 146.98552 91.908344) (xy 147.1534 91.79617) + (xy 147.29617 91.6534) (xy 147.398669 91.5) (xy 148.61178 91.5) (xy 148.626754 91.518246) (xy 148.706207 91.583451) + (xy 148.796854 91.631903) (xy 148.895211 91.661739) (xy 148.9975 91.671814) (xy 149.475011 91.671814) (xy 149.475011 91.828186) + (xy 148.9975 91.828186) (xy 148.895211 91.838261) (xy 148.796854 91.868097) (xy 148.706207 91.916549) (xy 148.626754 91.981754) + (xy 148.561549 92.061207) (xy 148.513097 92.151854) (xy 148.483261 92.250211) (xy 148.473186 92.3525) (xy 148.473186 92.6475) + (xy 148.483261 92.749789) (xy 148.513097 92.848146) (xy 148.561549 92.938793) (xy 148.61178 93) (xy 147.371942 93) + (xy 147.29617 92.8866) (xy 147.1534 92.74383) (xy 146.98552 92.631656) (xy 146.798982 92.55439) (xy 146.600954 92.515) + (xy 146.399046 92.515) (xy 146.201018 92.55439) (xy 146.01448 92.631656) (xy 145.8466 92.74383) (xy 145.70383 92.8866) + (xy 145.591656 93.05448) (xy 145.51439 93.241018) (xy 145.475 93.439046) (xy 145.475 93.640954) (xy 145.51439 93.838982) + (xy 145.591656 94.02552) (xy 145.70383 94.1934) (xy 145.8466 94.33617) (xy 146.01448 94.448344) (xy 146.201018 94.52561) + (xy 146.399046 94.565) (xy 146.600954 94.565) (xy 146.798982 94.52561) (xy 146.98552 94.448344) (xy 147.1534 94.33617) + (xy 147.29617 94.1934) (xy 147.408344 94.02552) (xy 147.418915 94) (xy 148.61178 94) (xy 148.561549 94.061207) + (xy 148.513097 94.151854) (xy 148.483261 94.250211) (xy 148.473186 94.3525) (xy 148.473186 94.6475) (xy 148.483261 94.749789) + (xy 148.513097 94.848146) (xy 148.561549 94.938793) (xy 148.626754 95.018246) (xy 148.706207 95.083451) (xy 148.796854 95.131903) + (xy 148.895211 95.161739) (xy 148.9975 95.171814) (xy 149.5025 95.171814) (xy 149.604789 95.161739) (xy 149.703146 95.131903) + (xy 149.793793 95.083451) (xy 149.873246 95.018246) (xy 149.938451 94.938793) (xy 149.986903 94.848146) (xy 150.016739 94.749789) + (xy 150.026814 94.6475) (xy 150.026814 94.3525) (xy 150.016739 94.250211) (xy 149.986903 94.151854) (xy 149.938451 94.061207) + (xy 149.873246 93.981754) (xy 149.793793 93.916549) (xy 149.75 93.893141) (xy 149.75 93.52456) (xy 149.752419 93.5) + (xy 149.75 93.47544) (xy 149.75 93.106859) (xy 149.793793 93.083451) (xy 149.873246 93.018246) (xy 149.909451 92.974129) + (xy 149.942267 92.964175) (xy 150.029129 92.917746) (xy 150.105264 92.855264) (xy 150.120929 92.836176) (xy 150.311186 92.645919) + (xy 150.330274 92.630254) (xy 150.392756 92.554119) (xy 150.423186 92.497189) (xy 150.423186 92.535) (xy 150.433309 92.637776) + (xy 150.463287 92.736603) (xy 150.51197 92.827682) (xy 150.577486 92.907514) (xy 150.657318 92.97303) (xy 150.745192 93.02) + (xy 150.657318 93.06697) (xy 150.577486 93.132486) (xy 150.51197 93.212318) (xy 150.463287 93.303397) (xy 150.433309 93.402224) + (xy 150.423186 93.505) (xy 150.423186 93.805) (xy 150.433309 93.907776) (xy 150.463287 94.006603) (xy 150.51197 94.097682) + (xy 150.577486 94.177514) (xy 150.657318 94.24303) (xy 150.697156 94.264324) (xy 150.6558 94.276869) (xy 150.590653 94.311691) + (xy 150.533552 94.358552) (xy 150.486691 94.415653) (xy 150.451869 94.4808) (xy 150.430426 94.551487) (xy 150.423186 94.625) + (xy 150.425 94.70625) (xy 150.51875 94.8) (xy 151.425 94.8) (xy 151.425 94.78) (xy 151.675 94.78) + (xy 151.675 94.8) (xy 152.58125 94.8) (xy 152.675 94.70625) (xy 152.676814 94.625) (xy 152.669574 94.551487) + (xy 152.648131 94.4808) (xy 152.613309 94.415653) (xy 152.566448 94.358552) (xy 152.509347 94.311691) (xy 152.4442 94.276869) + (xy 152.402844 94.264324) (xy 152.442682 94.24303) (xy 152.522514 94.177514) (xy 152.58803 94.097682) (xy 152.636713 94.006603) + (xy 152.666691 93.907776) (xy 152.676814 93.805) (xy 152.676814 93.505) (xy 152.666691 93.402224) (xy 152.636713 93.303397) + (xy 152.58803 93.212318) (xy 152.522514 93.132486) (xy 152.442682 93.06697) (xy 152.354808 93.02) (xy 152.442682 92.97303) + (xy 152.522514 92.907514) (xy 152.58803 92.827682) (xy 152.636713 92.736603) (xy 152.666691 92.637776) (xy 152.676814 92.535) + (xy 152.676814 92.235) (xy 152.666691 92.132224) (xy 152.636713 92.033397) (xy 152.58803 91.942318) (xy 152.522514 91.862486) + (xy 152.442682 91.79697) (xy 152.402844 91.775676) (xy 152.4442 91.763131) (xy 152.509347 91.728309) (xy 152.566448 91.681448) + (xy 152.613309 91.624347) (xy 152.648131 91.5592) (xy 152.669574 91.488513) (xy 152.676814 91.415) (xy 152.675 91.33375) + (xy 152.58125 91.24) (xy 151.675 91.24) (xy 151.675 91.26) (xy 151.425 91.26) (xy 151.425 91.24) + (xy 151.405 91.24) (xy 151.405 90.99) (xy 151.425 90.99) (xy 151.425 90.97) (xy 151.675 90.97) + (xy 151.675 90.99) (xy 152.58125 90.99) (xy 152.647581 90.923669) (xy 153.725 90.923669) (xy 153.725 91.076331) + (xy 153.754783 91.226059) (xy 153.813204 91.3671) (xy 153.898018 91.494034) (xy 154.000001 91.596017) (xy 154 94.57044) + (xy 153.997581 94.595) (xy 154.004146 94.661656) (xy 154.007235 94.693016) (xy 154.035825 94.787266) (xy 154.082254 94.874129) + (xy 154.144736 94.950264) (xy 154.163824 94.965929) (xy 155.72908 96.531187) (xy 155.744736 96.550264) (xy 155.820871 96.612746) + (xy 155.907733 96.659175) (xy 155.93686 96.66801) (xy 155.977486 96.717514) (xy 156.057318 96.78303) (xy 156.148397 96.831713) + (xy 156.247224 96.861691) (xy 156.35 96.871814) (xy 157.55 96.871814) (xy 157.652776 96.861691) (xy 157.751603 96.831713) + (xy 157.842682 96.78303) (xy 157.922514 96.717514) (xy 157.98803 96.637682) (xy 158.036713 96.546603) (xy 158.066691 96.447776) + (xy 158.076814 96.345) (xy 158.076814 96.045) (xy 158.066691 95.942224) (xy 158.036713 95.843397) (xy 157.98803 95.752318) + (xy 157.922514 95.672486) (xy 157.842682 95.60697) (xy 157.754808 95.56) (xy 157.842682 95.51303) (xy 157.922514 95.447514) + (xy 157.940991 95.425) (xy 158.19044 95.425) (xy 158.215 95.427419) (xy 158.23956 95.425) (xy 158.313017 95.417765) + (xy 158.323186 95.41468) (xy 158.323186 95.6475) (xy 158.333261 95.749789) (xy 158.363097 95.848146) (xy 158.411549 95.938793) + (xy 158.476754 96.018246) (xy 158.556207 96.083451) (xy 158.646854 96.131903) (xy 158.745211 96.161739) (xy 158.8475 96.171814) + (xy 159.3525 96.171814) (xy 159.454789 96.161739) (xy 159.553146 96.131903) (xy 159.643793 96.083451) (xy 159.723246 96.018246) + (xy 159.73822 96) (xy 159.988659 96) (xy 160.011656 96.05552) (xy 160.12383 96.2234) (xy 160.2666 96.36617) + (xy 160.43448 96.478344) (xy 160.621018 96.55561) (xy 160.819046 96.595) (xy 161.020954 96.595) (xy 161.218982 96.55561) + (xy 161.40552 96.478344) (xy 161.5734 96.36617) (xy 161.71617 96.2234) (xy 161.828344 96.05552) (xy 161.90561 95.868982) + (xy 161.945 95.670954) (xy 161.945 95.469046) (xy 161.90561 95.271018) (xy 161.828344 95.08448) (xy 161.771896 95) + (xy 164.792894 95) (xy 164.879075 95.086181) (xy 164.894736 95.105264) (xy 164.970871 95.167746) (xy 165.057733 95.214175) + (xy 165.151983 95.242765) (xy 165.22544 95.25) (xy 165.225449 95.25) (xy 165.249999 95.252418) (xy 165.274549 95.25) + (xy 166.79043 95.25) (xy 166.9066 95.36617) (xy 167.07448 95.478344) (xy 167.261018 95.55561) (xy 167.459046 95.595) + (xy 167.660954 95.595) (xy 167.858982 95.55561) (xy 168.04552 95.478344) (xy 168.2134 95.36617) (xy 168.35617 95.2234) + (xy 168.468344 95.05552) (xy 168.54561 94.868982) (xy 168.585 94.670954) (xy 168.585 94.469046) (xy 168.54561 94.271018) + (xy 168.468344 94.08448) (xy 168.35617 93.9166) (xy 168.2134 93.77383) (xy 168.04552 93.661656) (xy 167.858982 93.58439) + (xy 167.686091 93.55) (xy 167.858982 93.51561) (xy 168.04552 93.438344) (xy 168.2134 93.32617) (xy 168.35617 93.1834) + (xy 168.468344 93.01552) (xy 168.54561 92.828982) (xy 168.585 92.630954) (xy 168.585 92.429046) (xy 168.54561 92.231018) + (xy 168.468344 92.04448) (xy 168.35617 91.8766) (xy 168.2134 91.73383) (xy 168.04552 91.621656) (xy 167.858982 91.54439) + (xy 167.686091 91.51) (xy 167.858982 91.47561) (xy 168.04552 91.398344) (xy 168.2134 91.28617) (xy 168.35617 91.1434) + (xy 168.468344 90.97552) (xy 168.54561 90.788982) (xy 168.585 90.590954) (xy 168.585 90.389046) (xy 168.54561 90.191018) + (xy 168.468344 90.00448) (xy 168.35617 89.8366) (xy 168.2134 89.69383) (xy 168.04552 89.581656) (xy 167.858982 89.50439) + (xy 167.686091 89.47) (xy 167.858982 89.43561) (xy 168.04552 89.358344) (xy 168.2134 89.24617) (xy 168.35617 89.1034) + (xy 168.468344 88.93552) (xy 168.54561 88.748982) (xy 168.585 88.550954) (xy 168.585 88.349046) (xy 168.54561 88.151018) + (xy 168.468344 87.96448) (xy 168.35617 87.7966) (xy 168.2134 87.65383) (xy 168.04552 87.541656) (xy 167.858982 87.46439) + (xy 167.660954 87.425) (xy 167.459046 87.425) (xy 167.261018 87.46439) (xy 167.07448 87.541656) (xy 166.9066 87.65383) + (xy 166.76383 87.7966) (xy 166.691119 87.90542) (xy 166.76077 87.744498) (xy 166.80328 87.547117) (xy 166.806466 87.345235) + (xy 166.770205 87.14661) (xy 166.695892 86.958875) (xy 166.680569 86.930206) (xy 166.524462 86.862315) (xy 165.956777 87.43) + (xy 166.524462 87.997685) (xy 166.672483 87.933311) (xy 166.651656 87.96448) (xy 166.57439 88.151018) (xy 166.535 88.349046) + (xy 166.535 88.550954) (xy 166.57439 88.748982) (xy 166.645175 88.919873) (xy 166.57617 88.8166) (xy 166.4334 88.67383) + (xy 166.26552 88.561656) (xy 166.078982 88.48439) (xy 165.903264 88.449438) (xy 166.06339 88.420205) (xy 166.251125 88.345892) + (xy 166.279794 88.330569) (xy 166.347685 88.174462) (xy 165.78 87.606777) (xy 165.212315 88.174462) (xy 165.280206 88.330569) + (xy 165.465502 88.41077) (xy 165.650657 88.450647) (xy 165.481018 88.48439) (xy 165.29448 88.561656) (xy 165.1266 88.67383) + (xy 164.98383 88.8166) (xy 164.871656 88.98448) (xy 164.79439 89.171018) (xy 164.755 89.369046) (xy 164.755 89.570954) + (xy 164.790992 89.751901) (xy 163.927895 90.615) (xy 157.940991 90.615) (xy 157.922514 90.592486) (xy 157.842682 90.52697) + (xy 157.754808 90.48) (xy 157.842682 90.43303) (xy 157.922514 90.367514) (xy 157.940991 90.345) (xy 157.998984 90.345) + (xy 158.005966 90.351982) (xy 158.1329 90.436796) (xy 158.273941 90.495217) (xy 158.423669 90.525) (xy 158.576331 90.525) + (xy 158.726059 90.495217) (xy 158.8671 90.436796) (xy 158.994034 90.351982) (xy 159.101982 90.244034) (xy 159.186796 90.1171) + (xy 159.245217 89.976059) (xy 159.275 89.826331) (xy 159.275 89.673669) (xy 159.245217 89.523941) (xy 159.186796 89.3829) + (xy 159.101982 89.255966) (xy 158.994034 89.148018) (xy 158.8671 89.063204) (xy 158.726059 89.004783) (xy 158.576331 88.975) + (xy 158.423669 88.975) (xy 158.273941 89.004783) (xy 158.1329 89.063204) (xy 158.005966 89.148018) (xy 157.898018 89.255966) + (xy 157.877987 89.285944) (xy 157.842682 89.25697) (xy 157.754808 89.21) (xy 157.842682 89.16303) (xy 157.922514 89.097514) + (xy 157.98803 89.017682) (xy 158.036713 88.926603) (xy 158.066691 88.827776) (xy 158.076814 88.725) (xy 158.076814 88.425) + (xy 158.066691 88.322224) (xy 158.036713 88.223397) (xy 157.98803 88.132318) (xy 157.922514 88.052486) (xy 157.842682 87.98697) + (xy 157.802844 87.965676) (xy 157.8442 87.953131) (xy 157.909347 87.918309) (xy 157.966448 87.871448) (xy 158.013309 87.814347) + (xy 158.048131 87.7492) (xy 158.069574 87.678513) (xy 158.076814 87.605) (xy 158.075 87.52375) (xy 157.98125 87.43) + (xy 157.075 87.43) (xy 157.075 87.45) (xy 156.825 87.45) (xy 156.825 87.43) (xy 155.91875 87.43) + (xy 155.825 87.52375) (xy 155.823186 87.605) (xy 155.830426 87.678513) (xy 155.851869 87.7492) (xy 155.886691 87.814347) + (xy 155.933552 87.871448) (xy 155.990653 87.918309) (xy 156.0558 87.953131) (xy 156.097156 87.965676) (xy 156.057318 87.98697) + (xy 155.977486 88.052486) (xy 155.93686 88.10199) (xy 155.907733 88.110825) (xy 155.820871 88.157254) (xy 155.744736 88.219736) + (xy 155.729075 88.238819) (xy 155.163824 88.804071) (xy 155.144736 88.819736) (xy 155.082254 88.895871) (xy 155.035825 88.982734) + (xy 155.025224 89.017682) (xy 155.007235 89.076983) (xy 154.997581 89.175) (xy 155 89.19956) (xy 155 89.403984) + (xy 154.898018 89.505966) (xy 154.813204 89.6329) (xy 154.754783 89.773941) (xy 154.725 89.923669) (xy 154.725 90.076331) + (xy 154.754783 90.226059) (xy 154.775094 90.275094) (xy 154.726059 90.254783) (xy 154.576331 90.225) (xy 154.423669 90.225) + (xy 154.273941 90.254783) (xy 154.1329 90.313204) (xy 154.005966 90.398018) (xy 153.898018 90.505966) (xy 153.813204 90.6329) + (xy 153.754783 90.773941) (xy 153.725 90.923669) (xy 152.647581 90.923669) (xy 152.675 90.89625) (xy 152.676814 90.815) + (xy 152.669574 90.741487) (xy 152.648131 90.6708) (xy 152.613309 90.605653) (xy 152.566448 90.548552) (xy 152.509347 90.501691) + (xy 152.4442 90.466869) (xy 152.402844 90.454324) (xy 152.442682 90.43303) (xy 152.522514 90.367514) (xy 152.524886 90.364624) + (xy 152.6329 90.436796) (xy 152.773941 90.495217) (xy 152.923669 90.525) (xy 153.076331 90.525) (xy 153.226059 90.495217) + (xy 153.3671 90.436796) (xy 153.494034 90.351982) (xy 153.601982 90.244034) (xy 153.686796 90.1171) (xy 153.745217 89.976059) + (xy 153.775 89.826331) (xy 153.775 89.673669) (xy 153.745217 89.523941) (xy 153.686796 89.3829) (xy 153.601982 89.255966) + (xy 153.494034 89.148018) (xy 153.459585 89.125) (xy 153.494034 89.101982) (xy 153.601982 88.994034) (xy 153.686796 88.8671) + (xy 153.745217 88.726059) (xy 153.775 88.576331) (xy 153.775 88.423669) (xy 153.745217 88.273941) (xy 153.686796 88.1329) + (xy 153.601982 88.005966) (xy 153.494034 87.898018) (xy 153.3671 87.813204) (xy 153.226059 87.754783) (xy 153.076331 87.725) + (xy 152.923669 87.725) (xy 152.773941 87.754783) (xy 152.6329 87.813204) (xy 152.505966 87.898018) (xy 152.425955 87.978029) + (xy 152.354808 87.94) (xy 152.442682 87.89303) (xy 152.522514 87.827514) (xy 152.58803 87.747682) (xy 152.636713 87.656603) + (xy 152.666691 87.557776) (xy 152.676814 87.455) (xy 152.676814 87.155) (xy 152.666691 87.052224) (xy 152.652367 87.005) + (xy 155.823186 87.005) (xy 155.825 87.08625) (xy 155.91875 87.18) (xy 156.825 87.18) (xy 156.825 86.72375) + (xy 157.075 86.72375) (xy 157.075 87.18) (xy 157.98125 87.18) (xy 158.075 87.08625) (xy 158.076814 87.005) + (xy 158.069574 86.931487) (xy 158.048131 86.8608) (xy 158.013309 86.795653) (xy 157.966448 86.738552) (xy 157.909347 86.691691) + (xy 157.8442 86.656869) (xy 157.773513 86.635426) (xy 157.7 86.628186) (xy 157.16875 86.63) (xy 157.075 86.72375) + (xy 156.825 86.72375) (xy 156.73125 86.63) (xy 156.2 86.628186) (xy 156.126487 86.635426) (xy 156.0558 86.656869) + (xy 155.990653 86.691691) (xy 155.933552 86.738552) (xy 155.886691 86.795653) (xy 155.851869 86.8608) (xy 155.830426 86.931487) + (xy 155.823186 87.005) (xy 152.652367 87.005) (xy 152.636713 86.953397) (xy 152.58803 86.862318) (xy 152.522514 86.782486) + (xy 152.442682 86.71697) (xy 152.351603 86.668287) (xy 152.252776 86.638309) (xy 152.15 86.628186) (xy 150.95 86.628186) + (xy 150.847224 86.638309) (xy 150.748397 86.668287) (xy 150.657318 86.71697) (xy 150.617071 86.75) (xy 150.274557 86.75) + (xy 150.249999 86.747581) (xy 150.225441 86.75) (xy 150.22544 86.75) (xy 150.151983 86.757235) (xy 150.057733 86.785825) + (xy 149.970871 86.832254) (xy 149.894736 86.894736) (xy 149.87908 86.913814) (xy 149.274517 87.518378) (xy 149.274506 87.518387) + (xy 149.214707 87.578186) (xy 148.9975 87.578186) (xy 148.895211 87.588261) (xy 148.796854 87.618097) (xy 148.706207 87.666549) + (xy 148.626754 87.731754) (xy 148.61178 87.75) (xy 147.23957 87.75) (xy 147.1534 87.66383) (xy 146.98552 87.551656) + (xy 146.798982 87.47439) (xy 146.600954 87.435) (xy 146.399046 87.435) (xy 146.201018 87.47439) (xy 146.01448 87.551656) + (xy 145.8466 87.66383) (xy 145.70383 87.8066) (xy 145.591656 87.97448) (xy 145.51439 88.161018) (xy 145.475 88.359046) + (xy 144.125 88.359046) (xy 144.125 86.664462) (xy 145.932315 86.664462) (xy 146.000206 86.820569) (xy 146.185502 86.90077) + (xy 146.382883 86.94328) (xy 146.584765 86.946466) (xy 146.78339 86.910205) (xy 146.971125 86.835892) (xy 146.999794 86.820569) + (xy 147.067685 86.664462) (xy 146.5 86.096777) (xy 145.932315 86.664462) (xy 144.125 86.664462) (xy 144.125 86.004765) + (xy 145.473534 86.004765) (xy 145.509795 86.20339) (xy 145.584108 86.391125) (xy 145.599431 86.419794) (xy 145.755538 86.487685) + (xy 146.323223 85.92) (xy 146.676777 85.92) (xy 147.244462 86.487685) (xy 147.400569 86.419794) (xy 147.48077 86.234498) + (xy 147.52328 86.037117) (xy 147.526466 85.835235) (xy 147.49265 85.65) (xy 149.078186 85.65) (xy 149.085426 85.723513) + (xy 149.106869 85.7942) (xy 149.141691 85.859347) (xy 149.188552 85.916448) (xy 149.245653 85.963309) (xy 149.3108 85.998131) + (xy 149.381487 86.019574) (xy 149.455 86.026814) (xy 149.53125 86.025) (xy 149.625 85.93125) (xy 149.625 85.375) + (xy 149.875 85.375) (xy 149.875 85.93125) (xy 149.96875 86.025) (xy 150.045 86.026814) (xy 150.118513 86.019574) + (xy 150.1892 85.998131) (xy 150.254347 85.963309) (xy 150.311448 85.916448) (xy 150.358309 85.859347) (xy 150.393131 85.7942) + (xy 150.414574 85.723513) (xy 150.421814 85.65) (xy 150.42 85.46875) (xy 150.32625 85.375) (xy 149.875 85.375) + (xy 149.625 85.375) (xy 149.17375 85.375) (xy 149.08 85.46875) (xy 149.078186 85.65) (xy 147.49265 85.65) + (xy 147.490205 85.63661) (xy 147.415892 85.448875) (xy 147.400569 85.420206) (xy 147.244462 85.352315) (xy 146.676777 85.92) + (xy 146.323223 85.92) (xy 145.755538 85.352315) (xy 145.599431 85.420206) (xy 145.51923 85.605502) (xy 145.47672 85.802883) + (xy 145.473534 86.004765) (xy 144.125 86.004765) (xy 144.125 85.175538) (xy 145.932315 85.175538) (xy 146.5 85.743223) + (xy 147.067685 85.175538) (xy 146.999794 85.019431) (xy 146.814498 84.93923) (xy 146.617117 84.89672) (xy 146.415235 84.893534) + (xy 146.21661 84.929795) (xy 146.028875 85.004108) (xy 146.000206 85.019431) (xy 145.932315 85.175538) (xy 144.125 85.175538) + (xy 144.125 84.85) (xy 149.078186 84.85) (xy 149.08 85.03125) (xy 149.17375 85.125) (xy 149.625 85.125) + (xy 149.625 84.56875) (xy 149.875 84.56875) (xy 149.875 85.125) (xy 150.32625 85.125) (xy 150.42 85.03125) + (xy 150.421814 84.85) (xy 150.414574 84.776487) (xy 150.393131 84.7058) (xy 150.358309 84.640653) (xy 150.311448 84.583552) + (xy 150.254347 84.536691) (xy 150.1892 84.501869) (xy 150.118513 84.480426) (xy 150.045 84.473186) (xy 149.96875 84.475) + (xy 149.875 84.56875) (xy 149.625 84.56875) (xy 149.53125 84.475) (xy 149.455 84.473186) (xy 149.381487 84.480426) + (xy 149.3108 84.501869) (xy 149.245653 84.536691) (xy 149.188552 84.583552) (xy 149.141691 84.640653) (xy 149.106869 84.7058) + (xy 149.085426 84.776487) (xy 149.078186 84.85) (xy 144.125 84.85) (xy 144.125 83.279046) (xy 145.475 83.279046) + (xy 145.475 83.480954) (xy 145.51439 83.678982) (xy 145.591656 83.86552) (xy 145.70383 84.0334) (xy 145.8466 84.17617) + (xy 146.01448 84.288344) (xy 146.201018 84.36561) (xy 146.399046 84.405) (xy 146.600954 84.405) (xy 146.780759 84.369235) + (xy 146.839296 84.375) (xy 146.839305 84.375) (xy 146.869999 84.378023) (xy 146.900693 84.375) (xy 150.625001 84.375) + (xy 150.625 84.783939) (xy 150.618097 84.796854) (xy 150.588261 84.895211) (xy 150.578186 84.9975) (xy 150.578186 85.5025) + (xy 150.588261 85.604789) (xy 150.618097 85.703146) (xy 150.666549 85.793793) (xy 150.731754 85.873246) (xy 150.811207 85.938451) + (xy 150.901854 85.986903) (xy 151.000211 86.016739) (xy 151.1025 86.026814) (xy 151.3975 86.026814) (xy 151.499789 86.016739) + (xy 151.598146 85.986903) (xy 151.688793 85.938451) (xy 151.766109 85.875) (xy 151.917285 85.875) (xy 151.973276 85.943224) + (xy 152.068261 86.021177) (xy 152.176629 86.079101) (xy 152.294215 86.11477) (xy 152.4165 86.126814) (xy 153.4165 86.126814) + (xy 153.538785 86.11477) (xy 153.656371 86.079101) (xy 153.764739 86.021177) (xy 153.859724 85.943224) (xy 153.937677 85.848239) + (xy 153.995601 85.739871) (xy 154.03127 85.622285) (xy 154.033218 85.6025) (xy 158.223186 85.6025) (xy 158.223186 85.8975) + (xy 158.233261 85.999789) (xy 158.263097 86.098146) (xy 158.311549 86.188793) (xy 158.376754 86.268246) (xy 158.456207 86.333451) + (xy 158.5 86.356859) (xy 158.500001 86.653983) (xy 158.398018 86.755966) (xy 158.313204 86.8829) (xy 158.254783 87.023941) + (xy 158.225 87.173669) (xy 158.225 87.326331) (xy 158.254783 87.476059) (xy 158.313204 87.6171) (xy 158.398018 87.744034) + (xy 158.505966 87.851982) (xy 158.6329 87.936796) (xy 158.773941 87.995217) (xy 158.923669 88.025) (xy 159.076331 88.025) + (xy 159.226059 87.995217) (xy 159.3671 87.936796) (xy 159.494034 87.851982) (xy 159.601982 87.744034) (xy 159.686796 87.6171) + (xy 159.729184 87.514765) (xy 164.753534 87.514765) (xy 164.789795 87.71339) (xy 164.864108 87.901125) (xy 164.879431 87.929794) + (xy 165.035538 87.997685) (xy 165.603223 87.43) (xy 165.035538 86.862315) (xy 164.879431 86.930206) (xy 164.79923 87.115502) + (xy 164.75672 87.312883) (xy 164.753534 87.514765) (xy 159.729184 87.514765) (xy 159.745217 87.476059) (xy 159.775 87.326331) + (xy 159.775 87.174462) (xy 160.352315 87.174462) (xy 160.420206 87.330569) (xy 160.605502 87.41077) (xy 160.802883 87.45328) + (xy 161.004765 87.456466) (xy 161.20339 87.420205) (xy 161.391125 87.345892) (xy 161.419794 87.330569) (xy 161.487685 87.174462) + (xy 160.92 86.606777) (xy 160.352315 87.174462) (xy 159.775 87.174462) (xy 159.775 87.173669) (xy 159.745217 87.023941) + (xy 159.686796 86.8829) (xy 159.601982 86.755966) (xy 159.5 86.653984) (xy 159.5 86.514765) (xy 159.893534 86.514765) + (xy 159.929795 86.71339) (xy 160.004108 86.901125) (xy 160.019431 86.929794) (xy 160.175538 86.997685) (xy 160.743223 86.43) + (xy 161.096777 86.43) (xy 161.664462 86.997685) (xy 161.820569 86.929794) (xy 161.90077 86.744498) (xy 161.913468 86.685538) + (xy 165.212315 86.685538) (xy 165.78 87.253223) (xy 166.347685 86.685538) (xy 166.279794 86.529431) (xy 166.094498 86.44923) + (xy 165.897117 86.40672) (xy 165.695235 86.403534) (xy 165.49661 86.439795) (xy 165.308875 86.514108) (xy 165.280206 86.529431) + (xy 165.212315 86.685538) (xy 161.913468 86.685538) (xy 161.94328 86.547117) (xy 161.946466 86.345235) (xy 161.910205 86.14661) + (xy 161.835892 85.958875) (xy 161.820569 85.930206) (xy 161.664462 85.862315) (xy 161.096777 86.43) (xy 160.743223 86.43) + (xy 160.175538 85.862315) (xy 160.019431 85.930206) (xy 159.93923 86.115502) (xy 159.89672 86.312883) (xy 159.893534 86.514765) + (xy 159.5 86.514765) (xy 159.5 86.356859) (xy 159.543793 86.333451) (xy 159.623246 86.268246) (xy 159.688451 86.188793) + (xy 159.736903 86.098146) (xy 159.766739 85.999789) (xy 159.776814 85.8975) (xy 159.776814 85.685538) (xy 160.352315 85.685538) + (xy 160.92 86.253223) (xy 161.487685 85.685538) (xy 161.419794 85.529431) (xy 161.234498 85.44923) (xy 161.037117 85.40672) + (xy 160.835235 85.403534) (xy 160.63661 85.439795) (xy 160.448875 85.514108) (xy 160.420206 85.529431) (xy 160.352315 85.685538) + (xy 159.776814 85.685538) (xy 159.776814 85.6025) (xy 159.766739 85.500211) (xy 159.736903 85.401854) (xy 159.688451 85.311207) + (xy 159.623246 85.231754) (xy 159.543793 85.166549) (xy 159.453146 85.118097) (xy 159.354789 85.088261) (xy 159.2525 85.078186) + (xy 158.7475 85.078186) (xy 158.645211 85.088261) (xy 158.546854 85.118097) (xy 158.456207 85.166549) (xy 158.376754 85.231754) + (xy 158.311549 85.311207) (xy 158.263097 85.401854) (xy 158.233261 85.500211) (xy 158.223186 85.6025) (xy 154.033218 85.6025) + (xy 154.043314 85.5) (xy 154.043314 85) (xy 154.03127 84.877715) (xy 153.995601 84.760129) (xy 153.960193 84.693885) + (xy 154.563144 85.115951) (xy 154.563552 85.116448) (xy 154.620653 85.163309) (xy 154.6858 85.198131) (xy 154.756487 85.219574) + (xy 154.83 85.226814) (xy 156.67 85.226814) (xy 156.743513 85.219574) (xy 156.8142 85.198131) (xy 156.879347 85.163309) + (xy 156.936448 85.116448) (xy 156.939202 85.113092) (xy 157.725802 84.557845) (xy 157.774948 84.516448) (xy 157.821809 84.459347) + (xy 157.856631 84.3942) (xy 157.864973 84.3667) (xy 157.872521 84.365957) (xy 157.990334 84.330219) (xy 158.098911 84.272183) + (xy 158.19408 84.19408) (xy 158.213658 84.170224) (xy 158.223186 84.160696) (xy 158.223186 84.3975) (xy 158.233261 84.499789) + (xy 158.263097 84.598146) (xy 158.311549 84.688793) (xy 158.376754 84.768246) (xy 158.456207 84.833451) (xy 158.546854 84.881903) + (xy 158.645211 84.911739) (xy 158.7475 84.921814) (xy 159.2525 84.921814) (xy 159.354789 84.911739) (xy 159.453146 84.881903) + (xy 159.543793 84.833451) (xy 159.623246 84.768246) (xy 159.63822 84.75) (xy 160.094831 84.75) (xy 160.12383 84.7934) + (xy 160.2666 84.93617) (xy 160.43448 85.048344) (xy 160.621018 85.12561) (xy 160.819046 85.165) (xy 161.020954 85.165) + (xy 161.218982 85.12561) (xy 161.40552 85.048344) (xy 161.5734 84.93617) (xy 161.71617 84.7934) (xy 161.828344 84.62552) + (xy 161.90561 84.438982) (xy 161.906246 84.435781) (xy 167.925 84.435781) (xy 167.925 84.864219) (xy 168.008584 85.284424) + (xy 168.17254 85.680249) (xy 168.410567 86.036482) (xy 168.713518 86.339433) (xy 169.069751 86.57746) (xy 169.465576 86.741416) + (xy 169.885781 86.825) (xy 170.314219 86.825) (xy 170.734424 86.741416) (xy 171.130249 86.57746) (xy 171.486482 86.339433) + (xy 171.789433 86.036482) (xy 172.02746 85.680249) (xy 172.191416 85.284424) (xy 172.275 84.864219) (xy 172.275 84.435781) + (xy 172.191416 84.015576) (xy 172.02746 83.619751) (xy 171.789433 83.263518) (xy 171.486482 82.960567) (xy 171.130249 82.72254) + (xy 170.734424 82.558584) (xy 170.314219 82.475) (xy 169.885781 82.475) (xy 169.465576 82.558584) (xy 169.069751 82.72254) + (xy 168.713518 82.960567) (xy 168.410567 83.263518) (xy 168.17254 83.619751) (xy 168.008584 84.015576) (xy 167.925 84.435781) + (xy 161.906246 84.435781) (xy 161.945 84.240954) (xy 161.945 84.039046) (xy 161.90561 83.841018) (xy 161.828344 83.65448) + (xy 161.71617 83.4866) (xy 161.5734 83.34383) (xy 161.40552 83.231656) (xy 161.218982 83.15439) (xy 161.020954 83.115) + (xy 160.819046 83.115) (xy 160.621018 83.15439) (xy 160.43448 83.231656) (xy 160.2666 83.34383) (xy 160.12383 83.4866) + (xy 160.011656 83.65448) (xy 159.972091 83.75) (xy 159.63822 83.75) (xy 159.623246 83.731754) (xy 159.543793 83.666549) + (xy 159.466061 83.625) (xy 159.543793 83.583451) (xy 159.623246 83.518246) (xy 159.688451 83.438793) (xy 159.736903 83.348146) + (xy 159.766739 83.249789) (xy 159.776814 83.1475) (xy 159.776814 82.8525) (xy 159.766739 82.750211) (xy 159.736903 82.651854) + (xy 159.719609 82.619499) (xy 165.345 82.619499) (xy 165.345 82.880501) (xy 165.395919 83.136488) (xy 165.4958 83.377623) + (xy 165.640805 83.594638) (xy 165.825362 83.779195) (xy 166.042377 83.9242) (xy 166.283512 84.024081) (xy 166.539499 84.075) + (xy 166.800501 84.075) (xy 167.056488 84.024081) (xy 167.297623 83.9242) (xy 167.514638 83.779195) (xy 167.699195 83.594638) + (xy 167.8442 83.377623) (xy 167.944081 83.136488) (xy 167.995 82.880501) (xy 167.995 82.619499) (xy 167.944081 82.363512) + (xy 167.8442 82.122377) (xy 167.699195 81.905362) (xy 167.514638 81.720805) (xy 167.297623 81.5758) (xy 167.056488 81.475919) + (xy 166.800501 81.425) (xy 166.539499 81.425) (xy 166.283512 81.475919) (xy 166.042377 81.5758) (xy 165.825362 81.720805) + (xy 165.640805 81.905362) (xy 165.4958 82.122377) (xy 165.395919 82.363512) (xy 165.345 82.619499) (xy 159.719609 82.619499) + (xy 159.688451 82.561207) (xy 159.623246 82.481754) (xy 159.543793 82.416549) (xy 159.453146 82.368097) (xy 159.354789 82.338261) + (xy 159.2525 82.328186) (xy 158.7475 82.328186) (xy 158.715246 82.331363) (xy 158.550857 82.166974) (xy 158.6 82.171814) + (xy 158.78125 82.17) (xy 158.875 82.07625) (xy 158.875 81.625) (xy 159.125 81.625) (xy 159.125 82.07625) + (xy 159.21875 82.17) (xy 159.4 82.171814) (xy 159.473513 82.164574) (xy 159.5442 82.143131) (xy 159.609347 82.108309) + (xy 159.666448 82.061448) (xy 159.713309 82.004347) (xy 159.748131 81.9392) (xy 159.769574 81.868513) (xy 159.776814 81.795) + (xy 159.775 81.71875) (xy 159.68125 81.625) (xy 159.125 81.625) (xy 158.875 81.625) (xy 158.31875 81.625) + (xy 158.269883 81.673867) (xy 158.244034 81.648018) (xy 158.1171 81.563204) (xy 157.976059 81.504783) (xy 157.826331 81.475) + (xy 157.673669 81.475) (xy 157.523941 81.504783) (xy 157.3829 81.563204) (xy 157.255966 81.648018) (xy 157.148018 81.755966) + (xy 157.063204 81.8829) (xy 157.004783 82.023941) (xy 156.975 82.173669) (xy 156.975 82.326331) (xy 156.994865 82.4262) + (xy 156.939202 82.386908) (xy 156.936448 82.383552) (xy 156.879347 82.336691) (xy 156.8142 82.301869) (xy 156.743513 82.280426) + (xy 156.67 82.273186) (xy 154.83 82.273186) (xy 154.756487 82.280426) (xy 154.6858 82.301869) (xy 154.620653 82.336691) + (xy 154.563552 82.383552) (xy 154.563144 82.384049) (xy 154.043301 82.747939) (xy 154.0415 82.46875) (xy 153.94775 82.375) + (xy 153.0415 82.375) (xy 153.0415 82.395) (xy 152.7915 82.395) (xy 152.7915 82.375) (xy 151.375 82.375) + (xy 151.375 82.82625) (xy 151.46875 82.92) (xy 151.65 82.921814) (xy 151.723513 82.914574) (xy 151.7942 82.893131) + (xy 151.814718 82.882164) (xy 151.818369 82.8942) (xy 151.853191 82.959347) (xy 151.900052 83.016448) (xy 151.957153 83.063309) + (xy 151.964633 83.067307) (xy 151.895323 83.151761) (xy 151.858871 83.219957) (xy 151.793793 83.166549) (xy 151.703146 83.118097) + (xy 151.604789 83.088261) (xy 151.5025 83.078186) (xy 150.9975 83.078186) (xy 150.895211 83.088261) (xy 150.796854 83.118097) + (xy 150.783939 83.125) (xy 147.494359 83.125) (xy 147.48561 83.081018) (xy 147.408344 82.89448) (xy 147.29617 82.7266) + (xy 147.1534 82.58383) (xy 147.095287 82.545) (xy 150.473186 82.545) (xy 150.480426 82.618513) (xy 150.501869 82.6892) + (xy 150.536691 82.754347) (xy 150.583552 82.811448) (xy 150.640653 82.858309) (xy 150.7058 82.893131) (xy 150.776487 82.914574) + (xy 150.85 82.921814) (xy 151.03125 82.92) (xy 151.125 82.82625) (xy 151.125 82.375) (xy 150.56875 82.375) + (xy 150.475 82.46875) (xy 150.473186 82.545) (xy 147.095287 82.545) (xy 146.98552 82.471656) (xy 146.798982 82.39439) + (xy 146.600954 82.355) (xy 146.399046 82.355) (xy 146.201018 82.39439) (xy 146.01448 82.471656) (xy 145.8466 82.58383) + (xy 145.70383 82.7266) (xy 145.591656 82.89448) (xy 145.51439 83.081018) (xy 145.475 83.279046) (xy 144.125 83.279046) + (xy 144.125 81.955) (xy 150.473186 81.955) (xy 150.475 82.03125) (xy 150.56875 82.125) (xy 151.125 82.125) + (xy 151.125 81.67375) (xy 151.375 81.67375) (xy 151.375 82.125) (xy 152.7915 82.125) (xy 152.7915 81.46875) + (xy 153.0415 81.46875) (xy 153.0415 82.125) (xy 153.94775 82.125) (xy 154.0415 82.03125) (xy 154.043314 81.75) + (xy 154.036074 81.676487) (xy 154.014631 81.6058) (xy 153.979809 81.540653) (xy 153.932948 81.483552) (xy 153.875847 81.436691) + (xy 153.8107 81.401869) (xy 153.740013 81.380426) (xy 153.6665 81.373186) (xy 153.13525 81.375) (xy 153.0415 81.46875) + (xy 152.7915 81.46875) (xy 152.69775 81.375) (xy 152.1665 81.373186) (xy 152.092987 81.380426) (xy 152.0223 81.401869) + (xy 151.957153 81.436691) (xy 151.900052 81.483552) (xy 151.853191 81.540653) (xy 151.818369 81.6058) (xy 151.814718 81.617836) + (xy 151.7942 81.606869) (xy 151.723513 81.585426) (xy 151.65 81.578186) (xy 151.46875 81.58) (xy 151.375 81.67375) + (xy 151.125 81.67375) (xy 151.03125 81.58) (xy 150.85 81.578186) (xy 150.776487 81.585426) (xy 150.7058 81.606869) + (xy 150.640653 81.641691) (xy 150.583552 81.688552) (xy 150.536691 81.745653) (xy 150.501869 81.8108) (xy 150.480426 81.881487) + (xy 150.473186 81.955) (xy 144.125 81.955) (xy 144.125 81.551776) (xy 144.551776 81.125) (xy 158.232394 81.125) ) ) ) - (zone (net 1) (net_name GND) (layer B.Cu) (tstamp 5C710F5E) (hatch edge 0.508) - (connect_pads (clearance 0.254)) - (min_thickness 0.254) - (fill yes (arc_segments 32) (thermal_gap 0.254) (thermal_bridge_width 0.508)) + (zone (net 2) (net_name +5V) (layer B.Cu) (tstamp 5C710F5E) (hatch edge 0.508) + (connect_pads (clearance 0.25)) + (min_thickness 0.25) + (fill yes (arc_segments 32) (thermal_gap 0.25) (thermal_bridge_width 0.5)) (polygon (pts - (xy 144 81) (xy 175 81) (xy 175 101) (xy 144 101) + (xy 144 81.5) (xy 144.5 81) (xy 173.5 81) (xy 174 81.499671) (xy 174 100.5) + (xy 173.5 101) (xy 144.49987 101) (xy 144 100.5) ) ) (filled_polygon (pts - (xy 174.594001 100.873) (xy 144.127 100.873) (xy 144.127 99.623078) (xy 157.019 99.623078) (xy 157.019 99.776922) - (xy 157.049013 99.927809) (xy 157.107887 100.069942) (xy 157.193358 100.197859) (xy 157.302141 100.306642) (xy 157.430058 100.392113) - (xy 157.572191 100.450987) (xy 157.723078 100.481) (xy 157.876922 100.481) (xy 158.027809 100.450987) (xy 158.169942 100.392113) - (xy 158.261405 100.331) (xy 160.377012 100.331) (xy 160.408002 100.334052) (xy 160.438992 100.331) (xy 160.439 100.331) - (xy 160.5317 100.32187) (xy 160.650644 100.285789) (xy 160.760263 100.227196) (xy 160.856345 100.148343) (xy 160.876107 100.124263) - (xy 162.719372 98.280999) (xy 165.48305 98.280999) (xy 165.390483 98.419535) (xy 165.29015 98.661762) (xy 165.239 98.918908) - (xy 165.239 99.181092) (xy 165.29015 99.438238) (xy 165.390483 99.680465) (xy 165.536145 99.898463) (xy 165.721537 100.083855) - (xy 165.939535 100.229517) (xy 166.181762 100.32985) (xy 166.438908 100.381) (xy 166.701092 100.381) (xy 166.958238 100.32985) - (xy 167.200465 100.229517) (xy 167.418463 100.083855) (xy 167.603855 99.898463) (xy 167.749517 99.680465) (xy 167.84985 99.438238) - (xy 167.901 99.181092) (xy 167.901 98.918908) (xy 167.84985 98.661762) (xy 167.749517 98.419535) (xy 167.603855 98.201537) - (xy 167.418463 98.016145) (xy 167.200465 97.870483) (xy 166.958238 97.77015) (xy 166.883152 97.755214) (xy 167.85285 96.785516) - (xy 167.823 96.935584) (xy 167.823 97.364416) (xy 167.90666 97.785008) (xy 168.070767 98.181196) (xy 168.309013 98.537757) - (xy 168.612243 98.840987) (xy 168.968804 99.079233) (xy 169.364992 99.24334) (xy 169.785584 99.327) (xy 170.214416 99.327) - (xy 170.635008 99.24334) (xy 171.031196 99.079233) (xy 171.387757 98.840987) (xy 171.690987 98.537757) (xy 171.929233 98.181196) - (xy 172.09334 97.785008) (xy 172.177 97.364416) (xy 172.177 96.935584) (xy 172.09334 96.514992) (xy 171.929233 96.118804) - (xy 171.690987 95.762243) (xy 171.387757 95.459013) (xy 171.031196 95.220767) (xy 170.635008 95.05666) (xy 170.214416 94.973) - (xy 169.785584 94.973) (xy 169.631785 95.003592) (xy 169.656892 94.973) (xy 169.677196 94.948259) (xy 169.735789 94.83864) - (xy 169.77187 94.719696) (xy 169.784053 94.595998) (xy 169.781 94.565) (xy 169.781 89.280998) (xy 169.784053 89.25) - (xy 169.77187 89.126302) (xy 169.735789 89.007358) (xy 169.677196 88.897739) (xy 169.618103 88.825734) (xy 169.618101 88.825732) - (xy 169.598343 88.801657) (xy 169.574269 88.7819) (xy 168.618105 87.825737) (xy 168.598343 87.801657) (xy 168.502261 87.722804) - (xy 168.392642 87.664211) (xy 168.287187 87.632222) (xy 168.26083 87.592776) (xy 168.117224 87.44917) (xy 167.948362 87.336339) - (xy 167.760732 87.25862) (xy 167.561545 87.219) (xy 167.358455 87.219) (xy 167.159268 87.25862) (xy 166.971638 87.336339) - (xy 166.802776 87.44917) (xy 166.65917 87.592776) (xy 166.622979 87.646938) (xy 166.6669 87.545121) (xy 166.709414 87.346532) - (xy 166.712368 87.143464) (xy 166.675649 86.943721) (xy 166.600668 86.754981) (xy 166.586459 86.728399) (xy 166.428916 86.660689) - (xy 165.859605 87.23) (xy 166.428916 87.799311) (xy 166.558332 87.74369) (xy 166.546339 87.761638) (xy 166.46862 87.949268) - (xy 166.429 88.148455) (xy 166.429 88.351545) (xy 166.46862 88.550732) (xy 166.51632 88.66589) (xy 166.48083 88.612776) - (xy 166.337224 88.46917) (xy 166.168362 88.356339) (xy 165.980732 88.27862) (xy 165.835391 88.24971) (xy 165.966279 88.225649) - (xy 166.155019 88.150668) (xy 166.181601 88.136459) (xy 166.249311 87.978916) (xy 165.68 87.409605) (xy 165.110689 87.978916) - (xy 165.178399 88.136459) (xy 165.364879 88.2169) (xy 165.521256 88.250377) (xy 165.379268 88.27862) (xy 165.191638 88.356339) - (xy 165.022776 88.46917) (xy 164.87917 88.612776) (xy 164.766339 88.781638) (xy 164.68862 88.969268) (xy 164.649 89.168455) - (xy 164.649 89.371545) (xy 164.68862 89.570732) (xy 164.766339 89.758362) (xy 164.87917 89.927224) (xy 165.022776 90.07083) - (xy 165.191638 90.183661) (xy 165.379268 90.26138) (xy 165.523153 90.29) (xy 165.379268 90.31862) (xy 165.191638 90.396339) - (xy 165.022776 90.50917) (xy 164.87917 90.652776) (xy 164.766339 90.821638) (xy 164.68862 91.009268) (xy 164.649 91.208455) - (xy 164.649 91.411545) (xy 164.68862 91.610732) (xy 164.766339 91.798362) (xy 164.78347 91.824) (xy 163.339592 91.824) - (xy 161.606 90.090409) (xy 161.606 88.498501) (xy 161.706642 88.397859) (xy 161.792113 88.269942) (xy 161.850987 88.127809) - (xy 161.881 87.976922) (xy 161.881 87.823078) (xy 161.850987 87.672191) (xy 161.792113 87.530058) (xy 161.706642 87.402141) - (xy 161.621037 87.316536) (xy 164.647632 87.316536) (xy 164.684351 87.516279) (xy 164.759332 87.705019) (xy 164.773541 87.731601) - (xy 164.931084 87.799311) (xy 165.500395 87.23) (xy 164.931084 86.660689) (xy 164.773541 86.728399) (xy 164.6931 86.914879) - (xy 164.650586 87.113468) (xy 164.647632 87.316536) (xy 161.621037 87.316536) (xy 161.597859 87.293358) (xy 161.469942 87.207887) - (xy 161.327809 87.149013) (xy 161.306168 87.144708) (xy 161.321601 87.136459) (xy 161.389311 86.978916) (xy 160.82 86.409605) - (xy 160.250689 86.978916) (xy 160.318399 87.136459) (xy 160.504879 87.2169) (xy 160.665202 87.251222) (xy 160.602141 87.293358) - (xy 160.493358 87.402141) (xy 160.407887 87.530058) (xy 160.349013 87.672191) (xy 160.319 87.823078) (xy 160.319 87.976922) - (xy 160.349013 88.127809) (xy 160.407887 88.269942) (xy 160.493358 88.397859) (xy 160.594001 88.498502) (xy 160.594 90.275154) - (xy 160.591553 90.3) (xy 160.594 90.324846) (xy 160.594 90.324853) (xy 160.601322 90.399192) (xy 160.630255 90.494574) - (xy 160.677241 90.582479) (xy 160.740473 90.659527) (xy 160.759785 90.675376) (xy 162.754628 92.67022) (xy 162.770473 92.689527) - (xy 162.847521 92.752759) (xy 162.921147 92.792113) (xy 162.935425 92.799745) (xy 163.030807 92.828678) (xy 163.13 92.838448) - (xy 163.154854 92.836) (xy 164.78347 92.836) (xy 164.766339 92.861638) (xy 164.68862 93.049268) (xy 164.649 93.248455) - (xy 164.649 93.451545) (xy 164.68862 93.650732) (xy 164.766339 93.838362) (xy 164.87917 94.007224) (xy 165.022776 94.15083) - (xy 165.191638 94.263661) (xy 165.379268 94.34138) (xy 165.578455 94.381) (xy 165.781545 94.381) (xy 165.980732 94.34138) - (xy 166.168362 94.263661) (xy 166.337224 94.15083) (xy 166.48083 94.007224) (xy 166.51632 93.95411) (xy 166.46862 94.069268) - (xy 166.429 94.268455) (xy 166.429 94.471545) (xy 166.46862 94.670732) (xy 166.546339 94.858362) (xy 166.65917 95.027224) - (xy 166.802776 95.17083) (xy 166.971638 95.283661) (xy 167.159268 95.36138) (xy 167.358455 95.401) (xy 167.452629 95.401) - (xy 165.834631 97.018999) (xy 162.48899 97.018999) (xy 162.458002 97.015947) (xy 162.427014 97.018999) (xy 162.427005 97.018999) - (xy 162.334305 97.028129) (xy 162.215361 97.06421) (xy 162.105742 97.122803) (xy 162.074622 97.148343) (xy 162.00966 97.201656) - (xy 161.989902 97.225731) (xy 161.819727 97.395906) (xy 161.815649 97.373721) (xy 161.740668 97.184981) (xy 161.726459 97.158399) - (xy 161.568916 97.090689) (xy 160.999605 97.66) (xy 161.013748 97.674143) (xy 160.834143 97.853748) (xy 160.82 97.839605) - (xy 160.250689 98.408916) (xy 160.318399 98.566459) (xy 160.504879 98.6469) (xy 160.557474 98.65816) (xy 160.146634 99.069) - (xy 158.261405 99.069) (xy 158.169942 99.007887) (xy 158.027809 98.949013) (xy 157.876922 98.919) (xy 157.723078 98.919) - (xy 157.572191 98.949013) (xy 157.430058 99.007887) (xy 157.302141 99.093358) (xy 157.193358 99.202141) (xy 157.107887 99.330058) - (xy 157.049013 99.472191) (xy 157.019 99.623078) (xy 144.127 99.623078) (xy 144.127 97.746536) (xy 159.787632 97.746536) - (xy 159.824351 97.946279) (xy 159.899332 98.135019) (xy 159.913541 98.161601) (xy 160.071084 98.229311) (xy 160.640395 97.66) - (xy 160.071084 97.090689) (xy 159.913541 97.158399) (xy 159.8331 97.344879) (xy 159.790586 97.543468) (xy 159.787632 97.746536) - (xy 144.127 97.746536) (xy 144.127 95.03) (xy 145.367157 95.03) (xy 145.367157 96.73) (xy 145.374513 96.804689) - (xy 145.396299 96.876508) (xy 145.431678 96.942696) (xy 145.479289 97.000711) (xy 145.537304 97.048322) (xy 145.603492 97.083701) - (xy 145.675311 97.105487) (xy 145.75 97.112843) (xy 147.45 97.112843) (xy 147.524689 97.105487) (xy 147.596508 97.083701) - (xy 147.662696 97.048322) (xy 147.720711 97.000711) (xy 147.768322 96.942696) (xy 147.803701 96.876508) (xy 147.825487 96.804689) - (xy 147.832843 96.73) (xy 147.832843 96.323078) (xy 148.619 96.323078) (xy 148.619 96.476922) (xy 148.649013 96.627809) - (xy 148.707887 96.769942) (xy 148.793358 96.897859) (xy 148.902141 97.006642) (xy 149.030058 97.092113) (xy 149.172191 97.150987) - (xy 149.323078 97.181) (xy 149.476922 97.181) (xy 149.627809 97.150987) (xy 149.769942 97.092113) (xy 149.897859 97.006642) - (xy 150.006642 96.897859) (xy 150.092113 96.769942) (xy 150.150987 96.627809) (xy 150.151928 96.623078) (xy 157.319 96.623078) - (xy 157.319 96.776922) (xy 157.349013 96.927809) (xy 157.407887 97.069942) (xy 157.493358 97.197859) (xy 157.602141 97.306642) - (xy 157.730058 97.392113) (xy 157.872191 97.450987) (xy 158.023078 97.481) (xy 158.176922 97.481) (xy 158.327809 97.450987) - (xy 158.469942 97.392113) (xy 158.597859 97.306642) (xy 158.706642 97.197859) (xy 158.792113 97.069942) (xy 158.850987 96.927809) - (xy 158.854313 96.911084) (xy 160.250689 96.911084) (xy 160.82 97.480395) (xy 161.389311 96.911084) (xy 161.321601 96.753541) - (xy 161.135121 96.6731) (xy 160.936532 96.630586) (xy 160.733464 96.627632) (xy 160.533721 96.664351) (xy 160.344981 96.739332) - (xy 160.318399 96.753541) (xy 160.250689 96.911084) (xy 158.854313 96.911084) (xy 158.881 96.776922) (xy 158.881 96.623078) - (xy 158.850987 96.472191) (xy 158.792113 96.330058) (xy 158.731 96.238595) (xy 158.731 95.268455) (xy 159.789 95.268455) - (xy 159.789 95.471545) (xy 159.82862 95.670732) (xy 159.906339 95.858362) (xy 160.01917 96.027224) (xy 160.162776 96.17083) - (xy 160.331638 96.283661) (xy 160.519268 96.36138) (xy 160.718455 96.401) (xy 160.921545 96.401) (xy 161.120732 96.36138) - (xy 161.308362 96.283661) (xy 161.477224 96.17083) (xy 161.62083 96.027224) (xy 161.733661 95.858362) (xy 161.81138 95.670732) - (xy 161.851 95.471545) (xy 161.851 95.268455) (xy 161.81138 95.069268) (xy 161.733661 94.881638) (xy 161.62083 94.712776) - (xy 161.477224 94.56917) (xy 161.308362 94.456339) (xy 161.120732 94.37862) (xy 160.921545 94.339) (xy 160.718455 94.339) - (xy 160.519268 94.37862) (xy 160.331638 94.456339) (xy 160.162776 94.56917) (xy 160.01917 94.712776) (xy 159.906339 94.881638) - (xy 159.82862 95.069268) (xy 159.789 95.268455) (xy 158.731 95.268455) (xy 158.731 94.761368) (xy 160.188102 93.304267) - (xy 160.188106 93.304262) (xy 160.619922 92.872447) (xy 160.727809 92.850987) (xy 160.869942 92.792113) (xy 160.997859 92.706642) - (xy 161.106642 92.597859) (xy 161.192113 92.469942) (xy 161.250987 92.327809) (xy 161.281 92.176922) (xy 161.281 92.023078) - (xy 161.250987 91.872191) (xy 161.192113 91.730058) (xy 161.106642 91.602141) (xy 160.997859 91.493358) (xy 160.869942 91.407887) - (xy 160.727809 91.349013) (xy 160.576922 91.319) (xy 160.423078 91.319) (xy 160.272191 91.349013) (xy 160.130058 91.407887) - (xy 160.002141 91.493358) (xy 159.893358 91.602141) (xy 159.807887 91.730058) (xy 159.749013 91.872191) (xy 159.727553 91.980078) - (xy 159.295738 92.411894) (xy 159.295733 92.411898) (xy 157.675733 94.031899) (xy 157.651658 94.051657) (xy 157.6319 94.075732) - (xy 157.631897 94.075735) (xy 157.572804 94.14774) (xy 157.514211 94.257359) (xy 157.47813 94.376303) (xy 157.465948 94.5) - (xy 157.469001 94.531) (xy 157.469 96.238595) (xy 157.407887 96.330058) (xy 157.349013 96.472191) (xy 157.319 96.623078) - (xy 150.151928 96.623078) (xy 150.181 96.476922) (xy 150.181 96.323078) (xy 150.150987 96.172191) (xy 150.092113 96.030058) - (xy 150.006642 95.902141) (xy 149.906 95.801499) (xy 149.906 94.209591) (xy 155.434592 88.681) (xy 155.576922 88.681) - (xy 155.727809 88.650987) (xy 155.869942 88.592113) (xy 155.997859 88.506642) (xy 156.106642 88.397859) (xy 156.192113 88.269942) - (xy 156.250987 88.127809) (xy 156.281 87.976922) (xy 156.281 87.823078) (xy 156.250987 87.672191) (xy 156.192113 87.530058) - (xy 156.106642 87.402141) (xy 155.997859 87.293358) (xy 155.869942 87.207887) (xy 155.727809 87.149013) (xy 155.576922 87.119) - (xy 155.423078 87.119) (xy 155.272191 87.149013) (xy 155.130058 87.207887) (xy 155.002141 87.293358) (xy 154.893358 87.402141) - (xy 154.807887 87.530058) (xy 154.749013 87.672191) (xy 154.719 87.823078) (xy 154.719 87.965408) (xy 149.059781 93.624628) - (xy 149.040474 93.640473) (xy 148.977242 93.717521) (xy 148.952127 93.764508) (xy 148.930255 93.805426) (xy 148.901322 93.900808) - (xy 148.891553 94) (xy 148.894001 94.024856) (xy 148.894 95.801499) (xy 148.793358 95.902141) (xy 148.707887 96.030058) - (xy 148.649013 96.172191) (xy 148.619 96.323078) (xy 147.832843 96.323078) (xy 147.832843 95.03) (xy 147.825487 94.955311) - (xy 147.803701 94.883492) (xy 147.768322 94.817304) (xy 147.720711 94.759289) (xy 147.662696 94.711678) (xy 147.596508 94.676299) - (xy 147.524689 94.654513) (xy 147.45 94.647157) (xy 145.75 94.647157) (xy 145.675311 94.654513) (xy 145.603492 94.676299) - (xy 145.537304 94.711678) (xy 145.479289 94.759289) (xy 145.431678 94.817304) (xy 145.396299 94.883492) (xy 145.374513 94.955311) - (xy 145.367157 95.03) (xy 144.127 95.03) (xy 144.127 93.34) (xy 145.363044 93.34) (xy 145.386812 93.581318) - (xy 145.457202 93.813363) (xy 145.571509 94.027216) (xy 145.72534 94.21466) (xy 145.912784 94.368491) (xy 146.126637 94.482798) - (xy 146.358682 94.553188) (xy 146.539528 94.571) (xy 146.660472 94.571) (xy 146.841318 94.553188) (xy 147.073363 94.482798) - (xy 147.287216 94.368491) (xy 147.47466 94.21466) (xy 147.628491 94.027216) (xy 147.742798 93.813363) (xy 147.813188 93.581318) - (xy 147.836956 93.34) (xy 147.813188 93.098682) (xy 147.742798 92.866637) (xy 147.628491 92.652784) (xy 147.47466 92.46534) - (xy 147.287216 92.311509) (xy 147.073363 92.197202) (xy 146.841318 92.126812) (xy 146.660472 92.109) (xy 146.539528 92.109) - (xy 146.358682 92.126812) (xy 146.126637 92.197202) (xy 145.912784 92.311509) (xy 145.72534 92.46534) (xy 145.571509 92.652784) - (xy 145.457202 92.866637) (xy 145.386812 93.098682) (xy 145.363044 93.34) (xy 144.127 93.34) (xy 144.127 90.8) - (xy 145.363044 90.8) (xy 145.386812 91.041318) (xy 145.457202 91.273363) (xy 145.571509 91.487216) (xy 145.72534 91.67466) - (xy 145.912784 91.828491) (xy 146.126637 91.942798) (xy 146.358682 92.013188) (xy 146.539528 92.031) (xy 146.660472 92.031) - (xy 146.841318 92.013188) (xy 147.073363 91.942798) (xy 147.287216 91.828491) (xy 147.47466 91.67466) (xy 147.628491 91.487216) - (xy 147.742798 91.273363) (xy 147.813188 91.041318) (xy 147.836956 90.8) (xy 147.813188 90.558682) (xy 147.742798 90.326637) - (xy 147.628491 90.112784) (xy 147.47466 89.92534) (xy 147.287216 89.771509) (xy 147.073363 89.657202) (xy 146.841318 89.586812) - (xy 146.660472 89.569) (xy 146.539528 89.569) (xy 146.358682 89.586812) (xy 146.126637 89.657202) (xy 145.912784 89.771509) - (xy 145.72534 89.92534) (xy 145.571509 90.112784) (xy 145.457202 90.326637) (xy 145.386812 90.558682) (xy 145.363044 90.8) - (xy 144.127 90.8) (xy 144.127 88.26) (xy 145.363044 88.26) (xy 145.386812 88.501318) (xy 145.457202 88.733363) - (xy 145.571509 88.947216) (xy 145.72534 89.13466) (xy 145.912784 89.288491) (xy 146.126637 89.402798) (xy 146.358682 89.473188) - (xy 146.539528 89.491) (xy 146.660472 89.491) (xy 146.841318 89.473188) (xy 147.073363 89.402798) (xy 147.287216 89.288491) - (xy 147.47466 89.13466) (xy 147.628491 88.947216) (xy 147.742798 88.733363) (xy 147.813188 88.501318) (xy 147.836956 88.26) - (xy 147.813188 88.018682) (xy 147.742798 87.786637) (xy 147.628491 87.572784) (xy 147.47466 87.38534) (xy 147.287216 87.231509) - (xy 147.073363 87.117202) (xy 146.841318 87.046812) (xy 146.660472 87.029) (xy 146.539528 87.029) (xy 146.358682 87.046812) - (xy 146.126637 87.117202) (xy 145.912784 87.231509) (xy 145.72534 87.38534) (xy 145.571509 87.572784) (xy 145.457202 87.786637) - (xy 145.386812 88.018682) (xy 145.363044 88.26) (xy 144.127 88.26) (xy 144.127 86.03698) (xy 145.410511 86.03698) - (xy 145.434866 86.117288) (xy 145.534761 86.336961) (xy 145.675592 86.532924) (xy 145.851948 86.697647) (xy 146.057051 86.824799) - (xy 146.283019 86.909495) (xy 146.473 86.849187) (xy 146.473 85.847) (xy 146.727 85.847) (xy 146.727 86.849187) - (xy 146.916981 86.909495) (xy 147.142949 86.824799) (xy 147.348052 86.697647) (xy 147.524408 86.532924) (xy 147.665239 86.336961) - (xy 147.674527 86.316536) (xy 159.787632 86.316536) (xy 159.824351 86.516279) (xy 159.899332 86.705019) (xy 159.913541 86.731601) - (xy 160.071084 86.799311) (xy 160.640395 86.23) (xy 160.999605 86.23) (xy 161.568916 86.799311) (xy 161.726459 86.731601) - (xy 161.8069 86.545121) (xy 161.820609 86.481084) (xy 165.110689 86.481084) (xy 165.68 87.050395) (xy 166.249311 86.481084) - (xy 166.181601 86.323541) (xy 165.995121 86.2431) (xy 165.796532 86.200586) (xy 165.593464 86.197632) (xy 165.393721 86.234351) - (xy 165.204981 86.309332) (xy 165.178399 86.323541) (xy 165.110689 86.481084) (xy 161.820609 86.481084) (xy 161.849414 86.346532) - (xy 161.852368 86.143464) (xy 161.815649 85.943721) (xy 161.740668 85.754981) (xy 161.726459 85.728399) (xy 161.568916 85.660689) - (xy 160.999605 86.23) (xy 160.640395 86.23) (xy 160.071084 85.660689) (xy 159.913541 85.728399) (xy 159.8331 85.914879) - (xy 159.790586 86.113468) (xy 159.787632 86.316536) (xy 147.674527 86.316536) (xy 147.765134 86.117288) (xy 147.789489 86.03698) - (xy 147.728627 85.847) (xy 146.727 85.847) (xy 146.473 85.847) (xy 145.471373 85.847) (xy 145.410511 86.03698) - (xy 144.127 86.03698) (xy 144.127 85.40302) (xy 145.410511 85.40302) (xy 145.471373 85.593) (xy 146.473 85.593) - (xy 146.473 84.590813) (xy 146.727 84.590813) (xy 146.727 85.593) (xy 147.728627 85.593) (xy 147.76448 85.481084) - (xy 160.250689 85.481084) (xy 160.82 86.050395) (xy 161.389311 85.481084) (xy 161.321601 85.323541) (xy 161.135121 85.2431) - (xy 160.936532 85.200586) (xy 160.733464 85.197632) (xy 160.533721 85.234351) (xy 160.344981 85.309332) (xy 160.318399 85.323541) - (xy 160.250689 85.481084) (xy 147.76448 85.481084) (xy 147.789489 85.40302) (xy 147.765134 85.322712) (xy 147.665239 85.103039) - (xy 147.524408 84.907076) (xy 147.348052 84.742353) (xy 147.142949 84.615201) (xy 146.916981 84.530505) (xy 146.727 84.590813) - (xy 146.473 84.590813) (xy 146.283019 84.530505) (xy 146.057051 84.615201) (xy 145.851948 84.742353) (xy 145.675592 84.907076) - (xy 145.534761 85.103039) (xy 145.434866 85.322712) (xy 145.410511 85.40302) (xy 144.127 85.40302) (xy 144.127 83.838455) - (xy 159.789 83.838455) (xy 159.789 84.041545) (xy 159.82862 84.240732) (xy 159.906339 84.428362) (xy 160.01917 84.597224) - (xy 160.162776 84.74083) (xy 160.331638 84.853661) (xy 160.519268 84.93138) (xy 160.718455 84.971) (xy 160.921545 84.971) - (xy 161.120732 84.93138) (xy 161.308362 84.853661) (xy 161.477224 84.74083) (xy 161.62083 84.597224) (xy 161.733661 84.428362) - (xy 161.81138 84.240732) (xy 161.812403 84.235584) (xy 167.823 84.235584) (xy 167.823 84.664416) (xy 167.90666 85.085008) - (xy 168.070767 85.481196) (xy 168.309013 85.837757) (xy 168.612243 86.140987) (xy 168.968804 86.379233) (xy 169.364992 86.54334) - (xy 169.785584 86.627) (xy 170.214416 86.627) (xy 170.635008 86.54334) (xy 171.031196 86.379233) (xy 171.387757 86.140987) - (xy 171.690987 85.837757) (xy 171.929233 85.481196) (xy 172.09334 85.085008) (xy 172.177 84.664416) (xy 172.177 84.235584) - (xy 172.09334 83.814992) (xy 171.929233 83.418804) (xy 171.690987 83.062243) (xy 171.387757 82.759013) (xy 171.031196 82.520767) - (xy 170.635008 82.35666) (xy 170.214416 82.273) (xy 169.785584 82.273) (xy 169.364992 82.35666) (xy 168.968804 82.520767) - (xy 168.612243 82.759013) (xy 168.309013 83.062243) (xy 168.070767 83.418804) (xy 167.90666 83.814992) (xy 167.823 84.235584) - (xy 161.812403 84.235584) (xy 161.851 84.041545) (xy 161.851 83.838455) (xy 161.81138 83.639268) (xy 161.733661 83.451638) - (xy 161.62083 83.282776) (xy 161.477224 83.13917) (xy 161.308362 83.026339) (xy 161.120732 82.94862) (xy 160.921545 82.909) - (xy 160.718455 82.909) (xy 160.519268 82.94862) (xy 160.331638 83.026339) (xy 160.162776 83.13917) (xy 160.01917 83.282776) - (xy 159.906339 83.451638) (xy 159.82862 83.639268) (xy 159.789 83.838455) (xy 144.127 83.838455) (xy 144.127 82.418908) - (xy 165.239 82.418908) (xy 165.239 82.681092) (xy 165.29015 82.938238) (xy 165.390483 83.180465) (xy 165.536145 83.398463) - (xy 165.721537 83.583855) (xy 165.939535 83.729517) (xy 166.181762 83.82985) (xy 166.438908 83.881) (xy 166.701092 83.881) - (xy 166.958238 83.82985) (xy 167.200465 83.729517) (xy 167.418463 83.583855) (xy 167.603855 83.398463) (xy 167.749517 83.180465) - (xy 167.84985 82.938238) (xy 167.901 82.681092) (xy 167.901 82.418908) (xy 167.84985 82.161762) (xy 167.749517 81.919535) - (xy 167.603855 81.701537) (xy 167.418463 81.516145) (xy 167.200465 81.370483) (xy 166.958238 81.27015) (xy 166.701092 81.219) - (xy 166.438908 81.219) (xy 166.181762 81.27015) (xy 165.939535 81.370483) (xy 165.721537 81.516145) (xy 165.536145 81.701537) - (xy 165.390483 81.919535) (xy 165.29015 82.161762) (xy 165.239 82.418908) (xy 144.127 82.418908) (xy 144.127 81.127) - (xy 174.594 81.127) + (xy 173.875 81.551471) (xy 173.875 100.448224) (xy 173.448224 100.875) (xy 144.551657 100.875) (xy 144.125 100.448233) + (xy 144.125 98.1825) (xy 145.248186 98.1825) (xy 145.248186 99.0575) (xy 145.263833 99.216365) (xy 145.310172 99.369124) + (xy 145.385423 99.509909) (xy 145.486693 99.633307) (xy 145.610091 99.734577) (xy 145.750876 99.809828) (xy 145.903635 99.856167) + (xy 146.0625 99.871814) (xy 146.936947 99.871814) (xy 146.969296 99.875) (xy 146.969298 99.875) (xy 147 99.878024) + (xy 147.030701 99.875) (xy 165.494714 99.875) (xy 165.4958 99.877623) (xy 165.640805 100.094638) (xy 165.825362 100.279195) + (xy 166.042377 100.4242) (xy 166.283512 100.524081) (xy 166.539499 100.575) (xy 166.800501 100.575) (xy 167.056488 100.524081) + (xy 167.297623 100.4242) (xy 167.514638 100.279195) (xy 167.699195 100.094638) (xy 167.8442 99.877623) (xy 167.944081 99.636488) + (xy 167.995 99.380501) (xy 167.995 99.119499) (xy 167.944081 98.863512) (xy 167.8442 98.622377) (xy 167.699195 98.405362) + (xy 167.514638 98.220805) (xy 167.297623 98.0758) (xy 167.056488 97.975919) (xy 166.800501 97.925) (xy 166.539499 97.925) + (xy 166.283512 97.975919) (xy 166.042377 98.0758) (xy 165.825362 98.220805) (xy 165.640805 98.405362) (xy 165.4958 98.622377) + (xy 165.494714 98.625) (xy 161.60457 98.625) (xy 161.71617 98.5134) (xy 161.828344 98.34552) (xy 161.90561 98.158982) + (xy 161.945 97.960954) (xy 161.945 97.759046) (xy 161.90561 97.561018) (xy 161.828344 97.37448) (xy 161.71617 97.2066) + (xy 161.645351 97.135781) (xy 167.925 97.135781) (xy 167.925 97.564219) (xy 168.008584 97.984424) (xy 168.17254 98.380249) + (xy 168.410567 98.736482) (xy 168.713518 99.039433) (xy 169.069751 99.27746) (xy 169.465576 99.441416) (xy 169.885781 99.525) + (xy 170.314219 99.525) (xy 170.734424 99.441416) (xy 171.130249 99.27746) (xy 171.486482 99.039433) (xy 171.789433 98.736482) + (xy 172.02746 98.380249) (xy 172.191416 97.984424) (xy 172.275 97.564219) (xy 172.275 97.135781) (xy 172.191416 96.715576) + (xy 172.02746 96.319751) (xy 171.789433 95.963518) (xy 171.486482 95.660567) (xy 171.130249 95.42254) (xy 170.734424 95.258584) + (xy 170.314219 95.175) (xy 169.885781 95.175) (xy 169.465576 95.258584) (xy 169.069751 95.42254) (xy 168.713518 95.660567) + (xy 168.410567 95.963518) (xy 168.17254 96.319751) (xy 168.008584 96.715576) (xy 167.925 97.135781) (xy 161.645351 97.135781) + (xy 161.5734 97.06383) (xy 161.40552 96.951656) (xy 161.218982 96.87439) (xy 161.020954 96.835) (xy 160.819046 96.835) + (xy 160.621018 96.87439) (xy 160.43448 96.951656) (xy 160.2666 97.06383) (xy 160.12383 97.2066) (xy 160.011656 97.37448) + (xy 159.93439 97.561018) (xy 159.895 97.759046) (xy 159.895 97.960954) (xy 159.93439 98.158982) (xy 160.011656 98.34552) + (xy 160.12383 98.5134) (xy 160.23543 98.625) (xy 147.751814 98.625) (xy 147.751814 98.1825) (xy 147.736167 98.023635) + (xy 147.689828 97.870876) (xy 147.614577 97.730091) (xy 147.513307 97.606693) (xy 147.389909 97.505423) (xy 147.249124 97.430172) + (xy 147.096365 97.383833) (xy 146.9375 97.368186) (xy 146.0625 97.368186) (xy 145.903635 97.383833) (xy 145.750876 97.430172) + (xy 145.610091 97.505423) (xy 145.486693 97.606693) (xy 145.385423 97.730091) (xy 145.310172 97.870876) (xy 145.263833 98.023635) + (xy 145.248186 98.1825) (xy 144.125 98.1825) (xy 144.125 94.445491) (xy 145.771286 94.445491) (xy 145.866506 94.624593) + (xy 146.090272 94.727342) (xy 146.329784 94.784461) (xy 146.575837 94.793757) (xy 146.818976 94.754872) (xy 147.049856 94.669299) + (xy 147.133494 94.624593) (xy 147.228714 94.445491) (xy 146.5 93.716777) (xy 145.771286 94.445491) (xy 144.125 94.445491) + (xy 144.125 93.615837) (xy 145.246243 93.615837) (xy 145.285128 93.858976) (xy 145.370701 94.089856) (xy 145.415407 94.173494) + (xy 145.594509 94.268714) (xy 146.323223 93.54) (xy 146.676777 93.54) (xy 147.405491 94.268714) (xy 147.584593 94.173494) + (xy 147.687342 93.949728) (xy 147.744461 93.710216) (xy 147.753757 93.464163) (xy 147.714872 93.221024) (xy 147.629299 92.990144) + (xy 147.584593 92.906506) (xy 147.405491 92.811286) (xy 146.676777 93.54) (xy 146.323223 93.54) (xy 145.594509 92.811286) + (xy 145.415407 92.906506) (xy 145.312658 93.130272) (xy 145.255539 93.369784) (xy 145.246243 93.615837) (xy 144.125 93.615837) + (xy 144.125 92.634509) (xy 145.771286 92.634509) (xy 146.5 93.363223) (xy 147.228714 92.634509) (xy 147.133494 92.455407) + (xy 146.909728 92.352658) (xy 146.670216 92.295539) (xy 146.424163 92.286243) (xy 146.181024 92.325128) (xy 145.950144 92.410701) + (xy 145.866506 92.455407) (xy 145.771286 92.634509) (xy 144.125 92.634509) (xy 144.125 90.876886) (xy 145.25 90.876886) + (xy 145.25 91.123114) (xy 145.298037 91.364611) (xy 145.392265 91.592097) (xy 145.529062 91.796828) (xy 145.703172 91.970938) + (xy 145.907903 92.107735) (xy 146.135389 92.201963) (xy 146.376886 92.25) (xy 146.623114 92.25) (xy 146.864611 92.201963) + (xy 147.092097 92.107735) (xy 147.296828 91.970938) (xy 147.470938 91.796828) (xy 147.607735 91.592097) (xy 147.645883 91.5) + (xy 153.903984 91.5) (xy 154.005966 91.601982) (xy 154.1329 91.686796) (xy 154.273941 91.745217) (xy 154.293738 91.749155) + (xy 150.542895 95.5) (xy 147.612746 95.5) (xy 147.607735 95.487903) (xy 147.470938 95.283172) (xy 147.296828 95.109062) + (xy 147.092097 94.972265) (xy 146.864611 94.878037) (xy 146.623114 94.83) (xy 146.376886 94.83) (xy 146.135389 94.878037) + (xy 145.907903 94.972265) (xy 145.703172 95.109062) (xy 145.529062 95.283172) (xy 145.392265 95.487903) (xy 145.298037 95.715389) + (xy 145.25 95.956886) (xy 145.25 96.203114) (xy 145.298037 96.444611) (xy 145.392265 96.672097) (xy 145.529062 96.876828) + (xy 145.703172 97.050938) (xy 145.907903 97.187735) (xy 146.135389 97.281963) (xy 146.376886 97.33) (xy 146.623114 97.33) + (xy 146.864611 97.281963) (xy 147.092097 97.187735) (xy 147.296828 97.050938) (xy 147.470938 96.876828) (xy 147.607735 96.672097) + (xy 147.67902 96.5) (xy 150.72544 96.5) (xy 150.75 96.502419) (xy 150.77456 96.5) (xy 150.848017 96.492765) + (xy 150.942267 96.464175) (xy 151.029129 96.417746) (xy 151.105264 96.355264) (xy 151.120929 96.336176) (xy 151.988059 95.469046) + (xy 159.895 95.469046) (xy 159.895 95.670954) (xy 159.93439 95.868982) (xy 160.011656 96.05552) (xy 160.12383 96.2234) + (xy 160.2666 96.36617) (xy 160.43448 96.478344) (xy 160.621018 96.55561) (xy 160.819046 96.595) (xy 161.020954 96.595) + (xy 161.218982 96.55561) (xy 161.40552 96.478344) (xy 161.5734 96.36617) (xy 161.71617 96.2234) (xy 161.828344 96.05552) + (xy 161.90561 95.868982) (xy 161.945 95.670954) (xy 161.945 95.469046) (xy 161.90561 95.271018) (xy 161.828344 95.08448) + (xy 161.71617 94.9166) (xy 161.5734 94.77383) (xy 161.40552 94.661656) (xy 161.218982 94.58439) (xy 161.020954 94.545) + (xy 160.819046 94.545) (xy 160.621018 94.58439) (xy 160.43448 94.661656) (xy 160.2666 94.77383) (xy 160.12383 94.9166) + (xy 160.011656 95.08448) (xy 159.93439 95.271018) (xy 159.895 95.469046) (xy 151.988059 95.469046) (xy 155.836187 91.62092) + (xy 155.855264 91.605264) (xy 155.917746 91.529129) (xy 155.964175 91.442267) (xy 155.992765 91.348017) (xy 156 91.27456) + (xy 156 91.274551) (xy 156.002418 91.250001) (xy 156 91.225451) (xy 156 90.596016) (xy 156.101982 90.494034) + (xy 156.186796 90.3671) (xy 156.245217 90.226059) (xy 156.275 90.076331) (xy 156.275 89.923669) (xy 156.245217 89.773941) + (xy 156.186796 89.6329) (xy 156.101982 89.505966) (xy 156.096016 89.5) (xy 157.7647 89.5) (xy 157.754783 89.523941) + (xy 157.725 89.673669) (xy 157.725 89.826331) (xy 157.754783 89.976059) (xy 157.813204 90.1171) (xy 157.898018 90.244034) + (xy 158.005966 90.351982) (xy 158.1329 90.436796) (xy 158.273941 90.495217) (xy 158.423669 90.525) (xy 158.576331 90.525) + (xy 158.726059 90.495217) (xy 158.8671 90.436796) (xy 158.994034 90.351982) (xy 159.096016 90.25) (xy 161.792895 90.25) + (xy 164.40908 92.866187) (xy 164.424736 92.885264) (xy 164.500871 92.947746) (xy 164.587733 92.994175) (xy 164.681983 93.022765) + (xy 164.78 93.032419) (xy 164.80456 93.03) (xy 164.894695 93.03) (xy 164.871656 93.06448) (xy 164.79439 93.251018) + (xy 164.755 93.449046) (xy 164.755 93.650954) (xy 164.79439 93.848982) (xy 164.871656 94.03552) (xy 164.98383 94.2034) + (xy 165.1266 94.34617) (xy 165.29448 94.458344) (xy 165.481018 94.53561) (xy 165.679046 94.575) (xy 165.880954 94.575) + (xy 166.078982 94.53561) (xy 166.26552 94.458344) (xy 166.4334 94.34617) (xy 166.57617 94.2034) (xy 166.645175 94.100127) + (xy 166.57439 94.271018) (xy 166.535 94.469046) (xy 166.535 94.670954) (xy 166.57439 94.868982) (xy 166.651656 95.05552) + (xy 166.76383 95.2234) (xy 166.9066 95.36617) (xy 167.07448 95.478344) (xy 167.261018 95.55561) (xy 167.459046 95.595) + (xy 167.660954 95.595) (xy 167.858982 95.55561) (xy 168.04552 95.478344) (xy 168.2134 95.36617) (xy 168.35617 95.2234) + (xy 168.468344 95.05552) (xy 168.54561 94.868982) (xy 168.585 94.670954) (xy 168.585 94.469046) (xy 168.54561 94.271018) + (xy 168.468344 94.08448) (xy 168.35617 93.9166) (xy 168.2134 93.77383) (xy 168.04552 93.661656) (xy 167.858982 93.58439) + (xy 167.686091 93.55) (xy 167.858982 93.51561) (xy 168.04552 93.438344) (xy 168.2134 93.32617) (xy 168.35617 93.1834) + (xy 168.468344 93.01552) (xy 168.54561 92.828982) (xy 168.585 92.630954) (xy 168.585 92.429046) (xy 168.54561 92.231018) + (xy 168.468344 92.04448) (xy 168.35617 91.8766) (xy 168.2134 91.73383) (xy 168.04552 91.621656) (xy 167.858982 91.54439) + (xy 167.686091 91.51) (xy 167.858982 91.47561) (xy 168.04552 91.398344) (xy 168.2134 91.28617) (xy 168.35617 91.1434) + (xy 168.468344 90.97552) (xy 168.54561 90.788982) (xy 168.585 90.590954) (xy 168.585 90.389046) (xy 168.54561 90.191018) + (xy 168.468344 90.00448) (xy 168.35617 89.8366) (xy 168.2134 89.69383) (xy 168.04552 89.581656) (xy 167.858982 89.50439) + (xy 167.683264 89.469438) (xy 167.84339 89.440205) (xy 168.031125 89.365892) (xy 168.059794 89.350569) (xy 168.127685 89.194462) + (xy 167.56 88.626777) (xy 166.992315 89.194462) (xy 167.060206 89.350569) (xy 167.245502 89.43077) (xy 167.430657 89.470647) + (xy 167.261018 89.50439) (xy 167.07448 89.581656) (xy 166.9066 89.69383) (xy 166.76383 89.8366) (xy 166.694825 89.939873) + (xy 166.76561 89.768982) (xy 166.805 89.570954) (xy 166.805 89.369046) (xy 166.76561 89.171018) (xy 166.688344 88.98448) + (xy 166.667517 88.953311) (xy 166.815538 89.017685) (xy 167.383223 88.45) (xy 167.736777 88.45) (xy 168.304462 89.017685) + (xy 168.460569 88.949794) (xy 168.54077 88.764498) (xy 168.58328 88.567117) (xy 168.586466 88.365235) (xy 168.550205 88.16661) + (xy 168.475892 87.978875) (xy 168.460569 87.950206) (xy 168.304462 87.882315) (xy 167.736777 88.45) (xy 167.383223 88.45) + (xy 166.815538 87.882315) (xy 166.667517 87.946689) (xy 166.688344 87.91552) (xy 166.76561 87.728982) (xy 166.770273 87.705538) + (xy 166.992315 87.705538) (xy 167.56 88.273223) (xy 168.127685 87.705538) (xy 168.059794 87.549431) (xy 167.874498 87.46923) + (xy 167.677117 87.42672) (xy 167.475235 87.423534) (xy 167.27661 87.459795) (xy 167.088875 87.534108) (xy 167.060206 87.549431) + (xy 166.992315 87.705538) (xy 166.770273 87.705538) (xy 166.805 87.530954) (xy 166.805 87.329046) (xy 166.76561 87.131018) + (xy 166.688344 86.94448) (xy 166.57617 86.7766) (xy 166.4334 86.63383) (xy 166.26552 86.521656) (xy 166.078982 86.44439) + (xy 165.880954 86.405) (xy 165.679046 86.405) (xy 165.481018 86.44439) (xy 165.29448 86.521656) (xy 165.1266 86.63383) + (xy 164.98383 86.7766) (xy 164.871656 86.94448) (xy 164.79439 87.131018) (xy 164.755 87.329046) (xy 164.755 87.530954) + (xy 164.79439 87.728982) (xy 164.871656 87.91552) (xy 164.98383 88.0834) (xy 165.1266 88.22617) (xy 165.29448 88.338344) + (xy 165.481018 88.41561) (xy 165.653909 88.45) (xy 165.481018 88.48439) (xy 165.29448 88.561656) (xy 165.1266 88.67383) + (xy 164.98383 88.8166) (xy 164.871656 88.98448) (xy 164.79439 89.171018) (xy 164.755 89.369046) (xy 164.755 89.570954) + (xy 164.79439 89.768982) (xy 164.842686 89.885579) (xy 162.870929 87.913824) (xy 162.855264 87.894736) (xy 162.779129 87.832254) + (xy 162.692267 87.785825) (xy 162.598017 87.757235) (xy 162.52456 87.75) (xy 162.5 87.747581) (xy 162.47544 87.75) + (xy 159.596016 87.75) (xy 159.601982 87.744034) (xy 159.686796 87.6171) (xy 159.745217 87.476059) (xy 159.775 87.326331) + (xy 159.775 87.173669) (xy 159.745217 87.023941) (xy 159.686796 86.8829) (xy 159.601982 86.755966) (xy 159.494034 86.648018) + (xy 159.3671 86.563204) (xy 159.226059 86.504783) (xy 159.076331 86.475) (xy 158.923669 86.475) (xy 158.773941 86.504783) + (xy 158.6329 86.563204) (xy 158.505966 86.648018) (xy 158.398018 86.755966) (xy 158.313204 86.8829) (xy 158.254783 87.023941) + (xy 158.225 87.173669) (xy 158.225 87.326331) (xy 158.254783 87.476059) (xy 158.313204 87.6171) (xy 158.398018 87.744034) + (xy 158.403984 87.75) (xy 153.274549 87.75) (xy 153.249999 87.747582) (xy 153.225449 87.75) (xy 153.22544 87.75) + (xy 153.209772 87.751543) (xy 153.076331 87.725) (xy 152.923669 87.725) (xy 152.773941 87.754783) (xy 152.6329 87.813204) + (xy 152.505966 87.898018) (xy 152.398018 88.005966) (xy 152.313204 88.1329) (xy 152.254783 88.273941) (xy 152.225 88.423669) + (xy 152.225 88.576331) (xy 152.254783 88.726059) (xy 152.313204 88.8671) (xy 152.398018 88.994034) (xy 152.505966 89.101982) + (xy 152.540415 89.125) (xy 152.505966 89.148018) (xy 152.398018 89.255966) (xy 152.313204 89.3829) (xy 152.254783 89.523941) + (xy 152.225 89.673669) (xy 152.225 89.826331) (xy 152.254783 89.976059) (xy 152.313204 90.1171) (xy 152.398018 90.244034) + (xy 152.505966 90.351982) (xy 152.6329 90.436796) (xy 152.773941 90.495217) (xy 152.797987 90.5) (xy 147.645883 90.5) + (xy 147.607735 90.407903) (xy 147.470938 90.203172) (xy 147.296828 90.029062) (xy 147.092097 89.892265) (xy 146.864611 89.798037) + (xy 146.623114 89.75) (xy 146.376886 89.75) (xy 146.135389 89.798037) (xy 145.907903 89.892265) (xy 145.703172 90.029062) + (xy 145.529062 90.203172) (xy 145.392265 90.407903) (xy 145.298037 90.635389) (xy 145.25 90.876886) (xy 144.125 90.876886) + (xy 144.125 88.336886) (xy 145.25 88.336886) (xy 145.25 88.583114) (xy 145.298037 88.824611) (xy 145.392265 89.052097) + (xy 145.529062 89.256828) (xy 145.703172 89.430938) (xy 145.907903 89.567735) (xy 146.135389 89.661963) (xy 146.376886 89.71) + (xy 146.623114 89.71) (xy 146.864611 89.661963) (xy 147.092097 89.567735) (xy 147.296828 89.430938) (xy 147.470938 89.256828) + (xy 147.607735 89.052097) (xy 147.701963 88.824611) (xy 147.75 88.583114) (xy 147.75 88.336886) (xy 147.701963 88.095389) + (xy 147.607735 87.867903) (xy 147.470938 87.663172) (xy 147.296828 87.489062) (xy 147.092097 87.352265) (xy 146.864611 87.258037) + (xy 146.623114 87.21) (xy 146.376886 87.21) (xy 146.135389 87.258037) (xy 145.907903 87.352265) (xy 145.703172 87.489062) + (xy 145.529062 87.663172) (xy 145.392265 87.867903) (xy 145.298037 88.095389) (xy 145.25 88.336886) (xy 144.125 88.336886) + (xy 144.125 85.796886) (xy 145.25 85.796886) (xy 145.25 86.043114) (xy 145.298037 86.284611) (xy 145.392265 86.512097) + (xy 145.529062 86.716828) (xy 145.703172 86.890938) (xy 145.907903 87.027735) (xy 146.135389 87.121963) (xy 146.376886 87.17) + (xy 146.623114 87.17) (xy 146.864611 87.121963) (xy 147.092097 87.027735) (xy 147.296828 86.890938) (xy 147.470938 86.716828) + (xy 147.607735 86.512097) (xy 147.683557 86.329046) (xy 159.895 86.329046) (xy 159.895 86.530954) (xy 159.93439 86.728982) + (xy 160.011656 86.91552) (xy 160.12383 87.0834) (xy 160.2666 87.22617) (xy 160.43448 87.338344) (xy 160.621018 87.41561) + (xy 160.819046 87.455) (xy 161.020954 87.455) (xy 161.218982 87.41561) (xy 161.40552 87.338344) (xy 161.5734 87.22617) + (xy 161.71617 87.0834) (xy 161.828344 86.91552) (xy 161.90561 86.728982) (xy 161.945 86.530954) (xy 161.945 86.329046) + (xy 161.90561 86.131018) (xy 161.828344 85.94448) (xy 161.71617 85.7766) (xy 161.5734 85.63383) (xy 161.40552 85.521656) + (xy 161.218982 85.44439) (xy 161.020954 85.405) (xy 160.819046 85.405) (xy 160.621018 85.44439) (xy 160.43448 85.521656) + (xy 160.2666 85.63383) (xy 160.12383 85.7766) (xy 160.011656 85.94448) (xy 159.93439 86.131018) (xy 159.895 86.329046) + (xy 147.683557 86.329046) (xy 147.701963 86.284611) (xy 147.75 86.043114) (xy 147.75 85.796886) (xy 147.701963 85.555389) + (xy 147.607735 85.327903) (xy 147.470938 85.123172) (xy 147.296828 84.949062) (xy 147.092097 84.812265) (xy 146.864611 84.718037) + (xy 146.623114 84.67) (xy 146.376886 84.67) (xy 146.135389 84.718037) (xy 145.907903 84.812265) (xy 145.703172 84.949062) + (xy 145.529062 85.123172) (xy 145.392265 85.327903) (xy 145.298037 85.555389) (xy 145.25 85.796886) (xy 144.125 85.796886) + (xy 144.125 83.256886) (xy 145.25 83.256886) (xy 145.25 83.503114) (xy 145.298037 83.744611) (xy 145.392265 83.972097) + (xy 145.529062 84.176828) (xy 145.703172 84.350938) (xy 145.907903 84.487735) (xy 146.135389 84.581963) (xy 146.376886 84.63) + (xy 146.623114 84.63) (xy 146.864611 84.581963) (xy 147.092097 84.487735) (xy 147.296828 84.350938) (xy 147.470938 84.176828) + (xy 147.563001 84.039046) (xy 159.895 84.039046) (xy 159.895 84.240954) (xy 159.93439 84.438982) (xy 160.011656 84.62552) + (xy 160.12383 84.7934) (xy 160.2666 84.93617) (xy 160.43448 85.048344) (xy 160.621018 85.12561) (xy 160.819046 85.165) + (xy 161.020954 85.165) (xy 161.218982 85.12561) (xy 161.40552 85.048344) (xy 161.5734 84.93617) (xy 161.71617 84.7934) + (xy 161.828344 84.62552) (xy 161.90561 84.438982) (xy 161.906246 84.435781) (xy 167.925 84.435781) (xy 167.925 84.864219) + (xy 168.008584 85.284424) (xy 168.17254 85.680249) (xy 168.410567 86.036482) (xy 168.713518 86.339433) (xy 169.069751 86.57746) + (xy 169.465576 86.741416) (xy 169.885781 86.825) (xy 170.314219 86.825) (xy 170.734424 86.741416) (xy 171.130249 86.57746) + (xy 171.486482 86.339433) (xy 171.789433 86.036482) (xy 172.02746 85.680249) (xy 172.191416 85.284424) (xy 172.275 84.864219) + (xy 172.275 84.435781) (xy 172.191416 84.015576) (xy 172.02746 83.619751) (xy 171.789433 83.263518) (xy 171.486482 82.960567) + (xy 171.130249 82.72254) (xy 170.734424 82.558584) (xy 170.314219 82.475) (xy 169.885781 82.475) (xy 169.465576 82.558584) + (xy 169.069751 82.72254) (xy 168.713518 82.960567) (xy 168.410567 83.263518) (xy 168.17254 83.619751) (xy 168.008584 84.015576) + (xy 167.925 84.435781) (xy 161.906246 84.435781) (xy 161.945 84.240954) (xy 161.945 84.039046) (xy 161.90561 83.841018) + (xy 161.828344 83.65448) (xy 161.71617 83.4866) (xy 161.5734 83.34383) (xy 161.40552 83.231656) (xy 161.218982 83.15439) + (xy 161.020954 83.115) (xy 160.819046 83.115) (xy 160.621018 83.15439) (xy 160.43448 83.231656) (xy 160.2666 83.34383) + (xy 160.12383 83.4866) (xy 160.011656 83.65448) (xy 159.93439 83.841018) (xy 159.895 84.039046) (xy 147.563001 84.039046) + (xy 147.607735 83.972097) (xy 147.701963 83.744611) (xy 147.75 83.503114) (xy 147.75 83.256886) (xy 147.701963 83.015389) + (xy 147.607735 82.787903) (xy 147.495211 82.619499) (xy 165.345 82.619499) (xy 165.345 82.880501) (xy 165.395919 83.136488) + (xy 165.4958 83.377623) (xy 165.640805 83.594638) (xy 165.825362 83.779195) (xy 166.042377 83.9242) (xy 166.283512 84.024081) + (xy 166.539499 84.075) (xy 166.800501 84.075) (xy 167.056488 84.024081) (xy 167.297623 83.9242) (xy 167.514638 83.779195) + (xy 167.699195 83.594638) (xy 167.8442 83.377623) (xy 167.944081 83.136488) (xy 167.995 82.880501) (xy 167.995 82.619499) + (xy 167.944081 82.363512) (xy 167.8442 82.122377) (xy 167.699195 81.905362) (xy 167.514638 81.720805) (xy 167.297623 81.5758) + (xy 167.056488 81.475919) (xy 166.800501 81.425) (xy 166.539499 81.425) (xy 166.283512 81.475919) (xy 166.042377 81.5758) + (xy 165.825362 81.720805) (xy 165.640805 81.905362) (xy 165.4958 82.122377) (xy 165.395919 82.363512) (xy 165.345 82.619499) + (xy 147.495211 82.619499) (xy 147.470938 82.583172) (xy 147.296828 82.409062) (xy 147.092097 82.272265) (xy 146.864611 82.178037) + (xy 146.623114 82.13) (xy 146.376886 82.13) (xy 146.135389 82.178037) (xy 145.907903 82.272265) (xy 145.703172 82.409062) + (xy 145.529062 82.583172) (xy 145.392265 82.787903) (xy 145.298037 83.015389) (xy 145.25 83.256886) (xy 144.125 83.256886) + (xy 144.125 81.551776) (xy 144.551776 81.125) (xy 173.448248 81.125) ) ) ) diff --git a/hw/kicad/diff_driver/diff_driver.sch b/hw/kicad/diff_driver/diff_driver.sch index 248f8eac..0ec82ac8 100644 --- a/hw/kicad/diff_driver/diff_driver.sch +++ b/hw/kicad/diff_driver/diff_driver.sch @@ -1,6 +1,5 @@ EESchema Schematic File Version 4 -LIBS:diff_driver-cache -EELAYER 29 0 +EELAYER 30 0 EELAYER END $Descr A4 11693 8268 encoding utf-8 @@ -15,17 +14,6 @@ Comment3 "" Comment4 "" $EndDescr $Comp -L Interface:LTC1688 U1 -U 1 1 5C78CB18 -P 5200 4050 -F 0 "U1" H 5200 5131 50 0000 C CNN -F 1 "LTC1688" H 5200 5040 50 0000 C CNN -F 2 "Package_SO:SOIC-16_3.9x9.9mm_P1.27mm" H 6200 3200 50 0001 C CNN -F 3 "http://cds.linear.com/docs/en/datasheet/16889fa.pdf" H 5200 3950 50 0001 C CNN - 1 5200 4050 - 1 0 0 -1 -$EndComp -$Comp L stmbl:RJ45_LED J2 U 1 1 5C78E60A P 7200 4150 @@ -37,12 +25,12 @@ F 3 "" H 7200 4100 60 0000 C CNN 0 1 1 0 $EndComp $Comp -L stmbl:CONN_01X05 J1 +L stmbl:CONN_01X07 J1 U 1 1 5C795FC3 P 3300 4000 -F 0 "J1" H 3218 3575 50 0000 C CNN -F 1 "CONN_01X05" H 3218 3666 50 0000 C CNN -F 2 "Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical" H 3300 4000 50 0001 C CNN +F 0 "J1" H 3300 4300 50 0000 C CNN +F 1 "CONN_01X07" H 3300 3600 50 0000 C CNN +F 2 "stmbl:Pin_Header_RM2.54_1x7_UP" H 3300 4000 50 0001 C CNN F 3 "" H 3300 4000 50 0001 C CNN 1 3300 4000 -1 0 0 1 @@ -50,23 +38,23 @@ $EndComp $Comp L stmbl:GND #PWR0101 U 1 1 5C796D5F -P 5300 5050 -F 0 "#PWR0101" H 5300 4800 50 0001 C CNN -F 1 "GND" H 5305 4877 50 0000 C CNN -F 2 "" H 5300 5050 50 0001 C CNN -F 3 "" H 5300 5050 50 0001 C CNN - 1 5300 5050 +P 5050 4850 +F 0 "#PWR0101" H 5050 4600 50 0001 C CNN +F 1 "GND" H 5055 4677 50 0000 C CNN +F 2 "" H 5050 4850 50 0001 C CNN +F 3 "" H 5050 4850 50 0001 C CNN + 1 5050 4850 1 0 0 -1 $EndComp $Comp L stmbl:+5V #PWR0102 U 1 1 5C79742A -P 5300 3050 -F 0 "#PWR0102" H 5300 2900 50 0001 C CNN -F 1 "+5V" H 5315 3223 50 0000 C CNN -F 2 "" H 5300 3050 50 0001 C CNN -F 3 "" H 5300 3050 50 0001 C CNN - 1 5300 3050 +P 5050 3100 +F 0 "#PWR0102" H 5050 2950 50 0001 C CNN +F 1 "+5V" H 5065 3273 50 0000 C CNN +F 2 "" H 5050 3100 50 0001 C CNN +F 3 "" H 5050 3100 50 0001 C CNN + 1 5050 3100 1 0 0 -1 $EndComp $Comp @@ -98,126 +86,88 @@ Wire Wire Line $Comp L stmbl:+5V #PWR0105 U 1 1 5C798CC3 -P 6700 5000 -F 0 "#PWR0105" H 6700 4850 50 0001 C CNN -F 1 "+5V" H 6715 5173 50 0000 C CNN -F 2 "" H 6700 5000 50 0001 C CNN -F 3 "" H 6700 5000 50 0001 C CNN - 1 6700 5000 +P 5150 5550 +F 0 "#PWR0105" H 5150 5400 50 0001 C CNN +F 1 "+5V" H 5165 5723 50 0000 C CNN +F 2 "" H 5150 5550 50 0001 C CNN +F 3 "" H 5150 5550 50 0001 C CNN + 1 5150 5550 1 0 0 -1 $EndComp $Comp L stmbl:GND #PWR0106 U 1 1 5C799047 -P 6700 5500 -F 0 "#PWR0106" H 6700 5250 50 0001 C CNN -F 1 "GND" H 6705 5327 50 0000 C CNN -F 2 "" H 6700 5500 50 0001 C CNN -F 3 "" H 6700 5500 50 0001 C CNN - 1 6700 5500 +P 5150 6050 +F 0 "#PWR0106" H 5150 5800 50 0001 C CNN +F 1 "GND" H 5155 5877 50 0000 C CNN +F 2 "" H 5150 6050 50 0001 C CNN +F 3 "" H 5150 6050 50 0001 C CNN + 1 5150 6050 1 0 0 -1 $EndComp $Comp -L Device:C C1 +L stmbl:C C1 U 1 1 5C799546 -P 6400 5250 -F 0 "C1" H 6515 5296 50 0000 L CNN -F 1 "C" H 6515 5205 50 0000 L CNN -F 2 "stmbl:C_0603" H 6438 5100 50 0001 C CNN -F 3 "~" H 6400 5250 50 0001 C CNN - 1 6400 5250 +P 4850 5800 +F 0 "C1" H 4965 5846 50 0000 L CNN +F 1 "100n" H 4965 5755 50 0000 L CNN +F 2 "stmbl:C_0603" H 4888 5650 50 0001 C CNN +F 3 "~" H 4850 5800 50 0001 C CNN + 1 4850 5800 1 0 0 -1 $EndComp $Comp -L Device:C C2 +L stmbl:C C2 U 1 1 5C79998F -P 6700 5250 -F 0 "C2" H 6815 5296 50 0000 L CNN -F 1 "C" H 6815 5205 50 0000 L CNN -F 2 "stmbl:C_0603" H 6738 5100 50 0001 C CNN -F 3 "~" H 6700 5250 50 0001 C CNN - 1 6700 5250 - 1 0 0 -1 -$EndComp -$Comp -L Device:CP C3 -U 1 1 5C799DAB -P 7000 5250 -F 0 "C3" H 7118 5296 50 0000 L CNN -F 1 "CP" H 7118 5205 50 0000 L CNN -F 2 "Capacitor_Tantalum_SMD:CP_EIA-2012-15_AVX-P" H 7038 5100 50 0001 C CNN -F 3 "~" H 7000 5250 50 0001 C CNN - 1 7000 5250 +P 5150 5800 +F 0 "C2" H 5265 5846 50 0000 L CNN +F 1 "100n" H 5265 5755 50 0000 L CNN +F 2 "stmbl:C_0603" H 5188 5650 50 0001 C CNN +F 3 "~" H 5150 5800 50 0001 C CNN + 1 5150 5800 1 0 0 -1 $EndComp Wire Wire Line - 6400 5100 6400 5050 + 4850 5650 4850 5600 Wire Wire Line - 6400 5050 6700 5050 + 4850 5600 5150 5600 Wire Wire Line - 7000 5050 7000 5100 + 5450 5600 5450 5650 Wire Wire Line - 6700 5000 6700 5050 + 5150 5550 5150 5600 Wire Wire Line - 6400 5400 6400 5450 + 4850 5950 4850 6000 Wire Wire Line - 6400 5450 6700 5450 + 4850 6000 5150 6000 Wire Wire Line - 7000 5450 7000 5400 + 5450 6000 5450 5950 Wire Wire Line - 6700 5400 6700 5450 + 5150 5950 5150 6000 Wire Wire Line - 5700 3350 5700 3400 + 5050 4750 5050 4850 Wire Wire Line - 6500 3950 6700 3950 + 5050 3100 5050 3200 Wire Wire Line - 5700 4450 6150 4450 -Wire Wire Line - 6500 3650 6500 3700 -Wire Wire Line - 6250 4350 6700 4350 -Wire Wire Line - 5700 4250 6700 4250 -Wire Wire Line - 6150 4450 6150 4050 -Wire Wire Line - 6150 4050 6700 4050 -Wire Wire Line - 5300 4950 5300 5050 -Wire Wire Line - 5300 3050 5300 3150 -$Comp -L stmbl:GND #PWR0107 -U 1 1 5C7AB1DB -P 4600 4150 -F 0 "#PWR0107" H 4600 3900 50 0001 C CNN -F 1 "GND" V 4605 4022 50 0000 R CNN -F 2 "" H 4600 4150 50 0001 C CNN -F 3 "" H 4600 4150 50 0001 C CNN - 1 4600 4150 - 0 1 1 0 -$EndComp -Wire Wire Line - 4600 4150 4700 4150 + 4550 4250 4650 4250 $Comp L stmbl:+5V #PWR0108 U 1 1 5C7AC2AF -P 4600 3950 -F 0 "#PWR0108" H 4600 3800 50 0001 C CNN -F 1 "+5V" V 4615 4078 50 0000 L CNN -F 2 "" H 4600 3950 50 0001 C CNN -F 3 "" H 4600 3950 50 0001 C CNN - 1 4600 3950 +P 4550 4400 +F 0 "#PWR0108" H 4550 4250 50 0001 C CNN +F 1 "+5V" V 4565 4528 50 0000 L CNN +F 2 "" H 4550 4400 50 0001 C CNN +F 3 "" H 4550 4400 50 0001 C CNN + 1 4550 4400 0 -1 -1 0 $EndComp Wire Wire Line - 4600 3950 4700 3950 + 4550 4400 4650 4400 $Comp L stmbl:R R4 U 1 1 5C7AD89A P 8050 3750 F 0 "R4" V 7843 3750 50 0000 C CNN -F 1 "R" V 7934 3750 50 0000 C CNN +F 1 "560" V 7934 3750 50 0000 C CNN F 2 "stmbl:R_0603" V 7980 3750 50 0001 C CNN F 3 "" H 8050 3750 50 0000 C CNN 1 8050 3750 @@ -228,7 +178,7 @@ L stmbl:R R5 U 1 1 5C7AE616 P 8050 4450 F 0 "R5" V 7843 4450 50 0000 C CNN -F 1 "R" V 7934 4450 50 0000 C CNN +F 1 "560" V 7934 4450 50 0000 C CNN F 2 "stmbl:R_0603" V 7980 4450 50 0001 C CNN F 3 "" H 8050 4450 50 0000 C CNN 1 8050 4450 @@ -272,55 +222,49 @@ Connection ~ 7800 4550 Wire Wire Line 7800 4550 7800 4650 Wire Wire Line - 8200 3750 8250 3750 + 8200 3750 8300 3750 Wire Wire Line - 8250 3750 8250 3400 + 8300 3750 8300 3650 Wire Wire Line - 8250 3400 6700 3400 -Wire Wire Line - 8200 4450 8400 4450 -Wire Wire Line - 8400 4450 8400 3650 -Wire Wire Line - 8400 3650 6500 3650 + 8200 4450 8300 4450 $Comp L stmbl:GND #PWR0111 U 1 1 5C7B66F4 -P 3550 3800 -F 0 "#PWR0111" H 3550 3550 50 0001 C CNN -F 1 "GND" V 3555 3672 50 0000 R CNN -F 2 "" H 3550 3800 50 0001 C CNN -F 3 "" H 3550 3800 50 0001 C CNN - 1 3550 3800 +P 3600 3800 +F 0 "#PWR0111" H 3600 3550 50 0001 C CNN +F 1 "GND" V 3605 3672 50 0000 R CNN +F 2 "" H 3600 3800 50 0001 C CNN +F 3 "" H 3600 3800 50 0001 C CNN + 1 3600 3800 0 -1 -1 0 $EndComp Wire Wire Line - 3500 3800 3550 3800 -Text GLabel 3550 3900 2 50 Input ~ 0 + 3500 3800 3600 3800 +Text GLabel 3600 3900 2 50 Input ~ 0 IDX -Text GLabel 3550 4000 2 50 Input ~ 0 +Text GLabel 3600 4000 2 50 Input ~ 0 A -Text GLabel 3550 4200 2 50 Input ~ 0 +Text GLabel 3600 4200 2 50 Input ~ 0 B $Comp L stmbl:+5V #PWR0112 U 1 1 5C7B78DE -P 3550 4100 -F 0 "#PWR0112" H 3550 3950 50 0001 C CNN -F 1 "+5V" V 3565 4228 50 0000 L CNN -F 2 "" H 3550 4100 50 0001 C CNN -F 3 "" H 3550 4100 50 0001 C CNN - 1 3550 4100 +P 3600 4100 +F 0 "#PWR0112" H 3600 3950 50 0001 C CNN +F 1 "+5V" V 3615 4228 50 0000 L CNN +F 2 "" H 3600 4100 50 0001 C CNN +F 3 "" H 3600 4100 50 0001 C CNN + 1 3600 4100 0 1 1 0 $EndComp Wire Wire Line - 3500 3900 3550 3900 + 3500 3900 3600 3900 Wire Wire Line - 3500 4000 3550 4000 + 3500 4000 3600 4000 Wire Wire Line - 3500 4100 3550 4100 + 3500 4100 3600 4100 Wire Wire Line - 3500 4200 3550 4200 + 3500 4200 3600 4200 Text GLabel 3300 3150 0 50 Input ~ 0 A Text GLabel 3300 3250 0 50 Input ~ 0 @@ -332,7 +276,7 @@ L stmbl:R R1 U 1 1 5C7BB4F1 P 3550 3150 F 0 "R1" V 3343 3150 50 0000 C CNN -F 1 "R" V 3434 3150 50 0000 C CNN +F 1 "3.9k" V 3434 3150 50 0000 C CNN F 2 "stmbl:R_0603" V 3480 3150 50 0001 C CNN F 3 "" H 3550 3150 50 0000 C CNN 1 3550 3150 @@ -343,7 +287,7 @@ L stmbl:R R2 U 1 1 5C7BBB0C P 3550 3250 F 0 "R2" V 3343 3250 50 0000 C CNN -F 1 "R" V 3434 3250 50 0000 C CNN +F 1 "3.9k" V 3434 3250 50 0000 C CNN F 2 "stmbl:R_0603" V 3480 3250 50 0001 C CNN F 3 "" H 3550 3250 50 0000 C CNN 1 3550 3250 @@ -354,7 +298,7 @@ L stmbl:R R3 U 1 1 5C7BBC89 P 3550 3350 F 0 "R3" V 3343 3350 50 0000 C CNN -F 1 "R" V 3434 3350 50 0000 C CNN +F 1 "3.9k" V 3434 3350 50 0000 C CNN F 2 "stmbl:R_0603" V 3480 3350 50 0001 C CNN F 3 "" H 3550 3350 50 0000 C CNN 1 3550 3350 @@ -391,63 +335,252 @@ F 3 "" H 3800 3050 50 0001 C CNN 1 3800 3050 1 0 0 -1 $EndComp -Text GLabel 4600 3450 0 50 Input ~ 0 +Text GLabel 4550 3500 0 50 Input ~ 0 A -Text GLabel 4600 3750 0 50 Input ~ 0 +Text GLabel 4550 3750 0 50 Input ~ 0 B Wire Wire Line - 4600 4350 4700 4350 + 4550 4000 4650 4000 Wire Wire Line - 4600 3750 4700 3750 + 4550 3750 4650 3750 Wire Wire Line - 4600 3450 4700 3450 + 4550 3500 4650 3500 $Comp L stmbl:GND #PWR0114 U 1 1 5C7C8CA5 -P 4600 4650 -F 0 "#PWR0114" H 4600 4400 50 0001 C CNN -F 1 "GND" V 4605 4522 50 0000 R CNN -F 2 "" H 4600 4650 50 0001 C CNN -F 3 "" H 4600 4650 50 0001 C CNN - 1 4600 4650 +P 4550 4500 +F 0 "#PWR0114" H 4550 4250 50 0001 C CNN +F 1 "GND" V 4555 4372 50 0000 R CNN +F 2 "" H 4550 4500 50 0001 C CNN +F 3 "" H 4550 4500 50 0001 C CNN + 1 4550 4500 0 1 1 0 $EndComp Wire Wire Line - 4600 4650 4700 4650 -Text GLabel 4600 4350 0 50 Input ~ 0 + 4550 4500 4650 4500 +Text GLabel 4550 4000 0 50 Input ~ 0 IDX -Connection ~ 6700 5050 +Connection ~ 5150 5600 Wire Wire Line - 6700 5050 7000 5050 + 5150 5600 5450 5600 Wire Wire Line - 6700 5050 6700 5100 -Connection ~ 6700 5450 + 5150 5600 5150 5650 +Connection ~ 5150 6000 Wire Wire Line - 6700 5450 7000 5450 + 5150 6000 5450 6000 Wire Wire Line - 6700 5450 6700 5500 + 5150 6000 5150 6050 +$Comp +L stmbl:am26ls31 U1 +U 1 1 5DD226B1 +P 5050 3850 +F 0 "U1" H 5050 4703 60 0000 C CNN +F 1 "am26ls31" H 5050 4597 60 0000 C CNN +F 2 "stmbl:SOIC-16" H 5050 3850 60 0001 C CNN +F 3 "" H 5050 3850 60 0001 C CNN + 1 5050 3850 + 1 0 0 -1 +$EndComp Wire Wire Line - 5700 3700 5700 3650 + 6700 3750 6100 3750 Wire Wire Line - 6250 3550 5700 3550 + 6100 3750 6100 3450 Wire Wire Line - 6700 3400 6700 3750 + 6100 3450 5450 3450 Wire Wire Line - 6700 3850 6250 3850 + 5450 3550 6000 3550 Wire Wire Line - 6250 3850 6250 3550 + 6000 3550 6000 3850 Wire Wire Line - 6700 3400 5700 3400 -Connection ~ 6700 3400 + 6000 3850 6700 3850 Wire Wire Line - 5700 3700 6500 3700 -Connection ~ 6500 3700 + 6700 3950 5900 3950 Wire Wire Line - 6500 3700 6500 3950 + 5900 3950 5900 3700 Wire Wire Line - 6250 4350 6250 3900 + 5900 3700 5450 3700 Wire Wire Line - 6250 3900 5700 3900 + 5450 3800 5800 3800 Wire Wire Line - 5700 3900 5700 3850 + 5800 3800 5800 4350 +Wire Wire Line + 5800 4350 6700 4350 +Wire Wire Line + 6700 4050 5450 4050 +Wire Wire Line + 5450 3950 5700 3950 +Wire Wire Line + 5700 3950 5700 4250 +Wire Wire Line + 5700 4250 6700 4250 +$Comp +L stmbl:+5V #PWR0107 +U 1 1 5DD53ACA +P 8300 3650 +F 0 "#PWR0107" H 8300 3500 50 0001 C CNN +F 1 "+5V" H 8315 3823 50 0000 C CNN +F 2 "" H 8300 3650 50 0001 C CNN +F 3 "" H 8300 3650 50 0001 C CNN + 1 8300 3650 + 1 0 0 -1 +$EndComp +$Comp +L stmbl:C C5 +U 1 1 5DD58169 +P 5450 5800 +F 0 "C5" H 5565 5846 50 0000 L CNN +F 1 "1u" H 5565 5755 50 0000 L CNN +F 2 "stmbl:C_0603" H 5488 5650 50 0001 C CNN +F 3 "~" H 5450 5800 50 0001 C CNN + 1 5450 5800 + 1 0 0 -1 +$EndComp +Wire Wire Line + 8300 4450 8300 5200 +$Comp +L stmbl:GND #PWR0115 +U 1 1 5DD62120 +P 5100 2450 +F 0 "#PWR0115" H 5100 2200 50 0001 C CNN +F 1 "GND" H 5105 2277 50 0000 C CNN +F 2 "" H 5100 2450 50 0001 C CNN +F 3 "" H 5100 2450 50 0001 C CNN + 1 5100 2450 + 1 0 0 -1 +$EndComp +$Comp +L stmbl:+5V #PWR0116 +U 1 1 5DD62643 +P 4650 2000 +F 0 "#PWR0116" H 4650 1850 50 0001 C CNN +F 1 "+5V" H 4665 2173 50 0000 C CNN +F 2 "" H 4650 2000 50 0001 C CNN +F 3 "" H 4650 2000 50 0001 C CNN + 1 4650 2000 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 4650 2000 4750 2000 +Wire Wire Line + 5100 2450 5100 2350 +$Comp +L stmbl:+3.3V #PWR0117 +U 1 1 5DD66098 +P 5550 2000 +F 0 "#PWR0117" H 5550 1850 50 0001 C CNN +F 1 "+3.3V" V 5565 2128 50 0000 L CNN +F 2 "" H 5550 2000 50 0001 C CNN +F 3 "" H 5550 2000 50 0001 C CNN + 1 5550 2000 + 0 1 1 0 +$EndComp +Wire Wire Line + 5450 2000 5550 2000 +$Comp +L stmbl:HT75XX-1 U2 +U 1 1 5DD6ED30 +P 5100 2000 +F 0 "U2" H 5100 2265 50 0000 C CNN +F 1 "HT7533-1" H 5100 2174 50 0000 C CNN +F 2 "stmbl:SOT-89-3" H 5100 2000 50 0001 C CNN +F 3 "" H 5100 2000 50 0001 C CNN + 1 5100 2000 + 1 0 0 -1 +$EndComp +$Comp +L stmbl:+3.3V #PWR0118 +U 1 1 5DD74786 +P 3600 3700 +F 0 "#PWR0118" H 3600 3550 50 0001 C CNN +F 1 "+3.3V" V 3615 3828 50 0000 L CNN +F 2 "" H 3600 3700 50 0001 C CNN +F 3 "" H 3600 3700 50 0001 C CNN + 1 3600 3700 + 0 1 1 0 +$EndComp +Wire Wire Line + 3600 3700 3500 3700 +$Comp +L stmbl:C C4 +U 1 1 5DD7DCEF +P 4550 5800 +F 0 "C4" H 4665 5846 50 0000 L CNN +F 1 "1u" H 4665 5755 50 0000 L CNN +F 2 "stmbl:C_0603" H 4588 5650 50 0001 C CNN +F 3 "~" H 4550 5800 50 0001 C CNN + 1 4550 5800 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4550 5950 4550 6000 +Wire Wire Line + 4550 6000 4850 6000 +Connection ~ 4850 6000 +$Comp +L stmbl:+3.3V #PWR0119 +U 1 1 5DD815EC +P 4400 5450 +F 0 "#PWR0119" H 4400 5300 50 0001 C CNN +F 1 "+3.3V" H 4415 5623 50 0000 C CNN +F 2 "" H 4400 5450 50 0001 C CNN +F 3 "" H 4400 5450 50 0001 C CNN + 1 4400 5450 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4550 5550 4550 5650 +$Comp +L stmbl:C C3 +U 1 1 5DD85645 +P 4250 5800 +F 0 "C3" H 4365 5846 50 0000 L CNN +F 1 "100n" H 4365 5755 50 0000 L CNN +F 2 "stmbl:C_0603" H 4288 5650 50 0001 C CNN +F 3 "~" H 4250 5800 50 0001 C CNN + 1 4250 5800 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4550 6000 4250 6000 +Wire Wire Line + 4250 6000 4250 5950 +Connection ~ 4550 6000 +Wire Wire Line + 4250 5650 4250 5550 +Wire Wire Line + 4250 5550 4400 5550 +Wire Wire Line + 4400 5450 4400 5550 +Connection ~ 4400 5550 +Wire Wire Line + 4400 5550 4550 5550 +Wire Wire Line + 5700 5200 5700 4250 +Wire Wire Line + 5700 5200 8300 5200 +Connection ~ 5700 4250 +$Comp +L stmbl:GND #PWR0120 +U 1 1 5DDCD2D9 +P 4550 4250 +F 0 "#PWR0120" H 4550 4000 50 0001 C CNN +F 1 "GND" V 4555 4122 50 0000 R CNN +F 2 "" H 4550 4250 50 0001 C CNN +F 3 "" H 4550 4250 50 0001 C CNN + 1 4550 4250 + 0 1 1 0 +$EndComp +$Comp +L stmbl:GNDA #PWR0121 +U 1 1 5DDD6E36 +P 3600 4300 +F 0 "#PWR0121" H 3600 4050 50 0001 C CNN +F 1 "GNDA" H 3605 4127 50 0000 C CNN +F 2 "" H 3600 4300 50 0001 C CNN +F 3 "" H 3600 4300 50 0001 C CNN + 1 3600 4300 + 0 -1 -1 0 +$EndComp +Wire Wire Line + 3600 4300 3500 4300 $EndSCHEMATC diff --git a/inc/hw/hw.h b/inc/hw/hw.h index 8ce63b53..3e6e6dc6 100644 --- a/inc/hw/hw.h +++ b/inc/hw/hw.h @@ -135,18 +135,6 @@ #define ADC_TIMER_FREQ 84000000 #define RES_TIMER_FREQ 20000 -#define FB0_SIN_ADC ADC1 -#define FB0_SIN_ADC_RCC RCC_APB2Periph_ADC1 -#define FB0_SIN_ADC_CHAN ADC_Channel_6 -#define FB0_SIN_PIN GPIO_Pin_6 -#define FB0_SIN_PORT GPIOA - -#define FB0_COS_ADC ADC2 -#define FB0_COS_ADC_RCC RCC_APB2Periph_ADC2 -#define FB0_COS_ADC_CHAN ADC_Channel_7 -#define FB0_COS_PIN GPIO_Pin_7 -#define FB0_COS_PORT GPIOA - #define FB1 #define FB1_SIN_ADC ADC1 @@ -170,7 +158,66 @@ #define OP_R_OUT_HIGH 22.0 //opamp out high #define OP_REF 1.83 //opamp reference voltage -//FB UART +// FB0 ADC +#define FB0_SIN_ADC ADC1 +#define FB0_SIN_ADC_RCC RCC_APB2Periph_ADC1 +#define FB0_SIN_ADC_CHAN ADC_Channel_6 +#define FB0_SIN_PIN GPIO_Pin_6 +#define FB0_SIN_PORT GPIOA + +#define FB0_COS_ADC ADC2 +#define FB0_COS_ADC_RCC RCC_APB2Periph_ADC2 +#define FB0_COS_ADC_CHAN ADC_Channel_7 +#define FB0_COS_PIN GPIO_Pin_7 +#define FB0_COS_PORT GPIOA + +// FB0 TX EN +#define FB0_A_EN_PIN GPIO_Pin_11 +#define FB0_A_EN_PORT GPIOD + +#define FB0_B_EN_PIN GPIO_Pin_10 +#define FB0_B_EN_PORT GPIOD + +#define FB0_Z_TXEN_PIN GPIO_Pin_15 +#define FB0_Z_TXEN_PORT GPIOD + +// FB0 TIM4 +#define FB0_A_PIN GPIO_Pin_12 +#define FB0_A_PIN_SOURCE GPIO_PinSource12 +#define FB0_A_PORT GPIOD + +#define FB0_B_PIN GPIO_Pin_13 +#define FB0_B_PIN_SOURCE GPIO_PinSource13 +#define FB0_B_PORT GPIOD + +#define FB0_Z_PIN GPIO_Pin_14 +#define FB0_Z_PIN_SOURCE GPIO_PinSource14 +#define FB0_Z_PORT GPIOD + +#define FB0_RES_REF_PIN GPIO_Pin_14 +#define FB0_RES_REF_PIN_SOURCE GPIO_PinSource14 +#define FB0_RES_REF_PORT GPIOD + +#define FB0_RES_REF_TIM_AF GPIO_AF_TIM4 +#define FB0_RES_REF_TIM TIM4 + +#define FB0_ENC_TIM TIM4 +#define FB0_ENC_TIM_AF GPIO_AF_TIM4 +#define FB0_ENC_TIM_RCC RCC_APB1Periph_TIM4 + +#define FB0_TIM_A_DMA DMA1_Stream0 +#define FB0_TIM_A_DMA_CHAN DMA_Channel_2 +#define FB0_TIM_A_DMA_TCIF DMA_FLAG_TCIF0 + +#define FB0_TIM_B_DMA DMA1_Stream3 +#define FB0_TIM_B_DMA_CHAN DMA_Channel_2 +#define FB0_TIM_B_DMA_TCIF DMA_FLAG_TCIF3 + +#define FB0_TIM_Z_DMA DMA1_Stream7 +#define FB0_TIM_Z_DMA_CHAN DMA_Channel_2 +#define FB0_TIM_Z_DMA_TCIF DMA_FLAG_TCIF7 + +// FB0 UART #define FB0_UART USART6 #define FB0_UART_RCC RCC_APB2Periph_USART6 #define FB0_UART_CLOCK_COMMAND RCC_APB2PeriphClockCmd @@ -183,17 +230,50 @@ #define FB0_UART_TX_DMA_CHAN DMA_Channel_5 #define FB0_UART_TX_DMA_TCIF DMA_FLAG_TCIF6 -//v4 does not have dedicated rx pin, use pc6 as rx and tx. -//#define FB0_UART_RX_PIN GPIO_Pin_11 -//#define FB0_UART_RX_PORT GPIOB -//#define FB0_UART_RX_PIN_SOURCE GPIO_PinSource11 -//#define FB0_UART_RX_AF_SOURCE GPIO_AF_USART3 +#define FB0_UART_RX_PIN GPIO_Pin_7 +#define FB0_UART_RX_PORT GPIOC +#define FB0_UART_RX_PIN_SOURCE GPIO_PinSource7 +#define FB0_UART_RX_AF_SOURCE GPIO_AF_USART6 #define FB0_UART_TX_PIN GPIO_Pin_6 #define FB0_UART_TX_PORT GPIOC #define FB0_UART_TX_PIN_SOURCE GPIO_PinSource6 #define FB0_UART_TX_AF_SOURCE GPIO_AF_USART6 +#define FB0_UART_CLK_PIN GPIO_Pin_8 +#define FB0_UART_CLK_PORT GPIOC +#define FB0_UART_CLK_PIN_SOURCE GPIO_PinSource8 +#define FB0_UART_CLK_AF_SOURCE GPIO_AF_USART6 + +// FB0 SPI +#define FB0_SPI SPI3 +#define FB0_SPI_RCC RCC_APB2Perip_SPI3 +#define FB0_SPI_CLOCK_COMMAND RCC_APB1PeriphClockCmd + +#define FB0_SPI_RX_DMA DMA1_Stream2 +#define FB0_SPI_RX_DMA_CHAN DMA_Channel_0 +#define FB0_SPI_RX_DMA_TCIF DMA_FLAG_TCIF2 + +#define FB0_SPI_TX_DMA DMA1_Stream7 +#define FB0_SPI_TX_DMA_CHAN DMA_Channel_0 +#define FB0_SPI_TX_DMA_TCIF DMA_FLAG_TCIF7 + +#define FB0_SPI_RX_PIN GPIO_Pin_11 +#define FB0_SPI_RX_PORT GPIOC +#define FB0_SPI_RX_PIN_SOURCE GPIO_PinSource11 +#define FB0_SPI_RX_AF_SOURCE GPIO_AF_SPI3 + +#define FB0_SPI_TX_PIN GPIO_Pin_12 +#define FB0_SPI_TX_PORT GPIOC +#define FB0_SPI_TX_PIN_SOURCE GPIO_PinSource12 +#define FB0_SPI_TX_AF_SOURCE GPIO_AF_SPI3 + +#define FB0_SPI_CLK_PIN GPIO_Pin_10 +#define FB0_SPI_CLK_PORT GPIOC +#define FB0_SPI_CLK_PIN_SOURCE GPIO_PinSource10 +#define FB0_SPI_CLK_AF_SOURCE GPIO_AF_SPI3 + + //HV UART #define UART_DRV USART2 #define UART_DRV_RCC RCC_APB1Periph_USART2 @@ -254,41 +334,6 @@ #define CMD_D_EN_PIN_SOURCE GPIO_PinSource2 #define CMD_D_EN_PORT GPIOB -//FB0 TIM4 -#define FB0_A_PIN GPIO_Pin_12 -#define FB0_A_PIN_SOURCE GPIO_PinSource12 -#define FB0_A_PORT GPIOD - -#define FB0_B_PIN GPIO_Pin_13 -#define FB0_B_PIN_SOURCE GPIO_PinSource13 -#define FB0_B_PORT GPIOD - -#define FB0_Z_PIN GPIO_Pin_14 -#define FB0_Z_PIN_SOURCE GPIO_PinSource14 -#define FB0_Z_PORT GPIOD - -#define FB0_RES_REF_PIN GPIO_Pin_14 -#define FB0_RES_REF_PIN_SOURCE GPIO_PinSource14 -#define FB0_RES_REF_PORT GPIOD - -#define FB0_RES_REF_TIM_AF GPIO_AF_TIM4 -#define FB0_RES_REF_TIM TIM4 - -#define FB0_A_EN_PIN GPIO_Pin_11 -#define FB0_A_EN_PIN_SOURCE GPIO_PinSource11 -#define FB0_A_EN_PORT GPIOD - -#define FB0_B_EN_PIN GPIO_Pin_10 -#define FB0_B_EN_PIN_SOURCE GPIO_PinSource10 -#define FB0_B_EN_PORT GPIOD - -#define FB0_Z_TXEN_PIN GPIO_Pin_15 -#define FB0_Z_TXEN_PORT GPIOD - -#define FB0_ENC_TIM TIM4 -#define FB0_ENC_TIM_AF GPIO_AF_TIM4 -#define FB0_ENC_TIM_RCC RCC_APB1Periph_TIM4 - //FB1, TIM1 #define FB1_A_PIN GPIO_Pin_9 #define FB1_A_PIN_SOURCE GPIO_PinSource9 diff --git a/shared/angle.c b/shared/angle.c index 466e1037..fa854846 100644 --- a/shared/angle.c +++ b/shared/angle.c @@ -114,6 +114,10 @@ inline float mod(float a) { } } +inline int modi(int v, int m){ + return(SIGN(v) * (ABS(v) % m)); +} + int quadrant(float a) { if(a >= 0) { if(a < M_PI / 2.0) { diff --git a/shared/angle.h b/shared/angle.h index bbbb17ee..f9e0b55d 100644 --- a/shared/angle.h +++ b/shared/angle.h @@ -2,6 +2,7 @@ float minus(float a, float b); float mod(float a); +int modi(int v, int m); int quadrant(float a); void sincos_fast(float x, float *sin, float *cos); float err_filter(float *ctx, float max, float dens, float err); \ No newline at end of file diff --git a/shared/common.h b/shared/common.h index 0fe4a66e..719a644e 100644 --- a/shared/common.h +++ b/shared/common.h @@ -51,13 +51,15 @@ _Static_assert(sizeof(packet_bootloader_t) == 24, "packet_bootloader_t size erro //process data from f3 to f4 typedef struct { stmbl_talk_header_t header; - float d_fb; - float q_fb; + float id_fb; + float iq_fb; + float ud_fb; + float uq_fb; uint8_t fault; uint8_t buf; uint16_t padding; } packet_from_hv_t; -_Static_assert(sizeof(packet_from_hv_t) == 24, "packet_from_hv_t size error"); +_Static_assert(sizeof(packet_from_hv_t) == 32, "packet_from_hv_t size error"); //process data from f4 to f3 typedef struct { diff --git a/shared/comps/ac.c b/shared/comps/ac.c index e5158047..c0907036 100644 --- a/shared/comps/ac.c +++ b/shared/comps/ac.c @@ -10,7 +10,7 @@ struct ac_ctx_t { float avg; }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct ac_ctx_t *ctx = (struct ac_ctx_t *)ctx_ptr; struct ac_pin_ctx_t *pins = (struct ac_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/acim_ttc.c b/shared/comps/acim_ttc.c index ef3524c9..13fef23e 100644 --- a/shared/comps/acim_ttc.c +++ b/shared/comps/acim_ttc.c @@ -6,67 +6,167 @@ HAL_COMP(acim_ttc); -HAL_PIN(mode); // 0 = u/f, 1 = mtpa +HAL_PIN(mode); // 0 = slip, 1 = mtpa, 2 = u/f +HAL_PIN(sensorless); // motor values HAL_PIN(torque_n); HAL_PIN(cur_n); HAL_PIN(slip_n); HAL_PIN(polecount); +HAL_PIN(freq_n); +HAL_PIN(vel_n); +HAL_PIN(u_n); +HAL_PIN(u_boost); +HAL_PIN(t_boost); +HAL_PIN(s_boost); // torque cmd in HAL_PIN(torque); -HAL_PIN(vel); +HAL_PIN(vel_m); // cur cmd out -HAL_PIN(id); -HAL_PIN(iq); -HAL_PIN(freq); -HAL_PIN(slip) +HAL_PIN(d_cmd); +HAL_PIN(q_cmd); +HAL_PIN(cmd_mode); HAL_PIN(pos); +HAL_PIN(vel_e); +HAL_PIN(slip); +HAL_PIN(t_min); +HAL_PIN(t_max); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +HAL_PIN(scale); +HAL_PIN(ki); +HAL_PIN(duty); +HAL_PIN(duty_setpoint); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct acim_ttc_pin_ctx_t *pins = (struct acim_ttc_pin_ctx_t *)pin_ptr; + PIN(polecount) = 2; + PIN(vel_n) = 1745.0 / 60.0 * 2.0 * M_PI; + PIN(torque_n) = 23.0; + PIN(cur_n) = 17.0; + PIN(freq_n) = 60.0; + PIN(u_n) = 80.0; + PIN(u_boost) = 7.0; + PIN(t_boost) = 1.3; + PIN(s_boost) = 2.5; + PIN(mode) = 0; + PIN(sensorless) = 0; + PIN(scale) = 1.0; + PIN(ki) = 50.0; + PIN(duty_setpoint) = 0.9; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct acim_ttc_ctx_t * ctx = (struct acim_ttc_ctx_t *)ctx_ptr; struct acim_ttc_pin_ctx_t *pins = (struct acim_ttc_pin_ctx_t *)pin_ptr; float poles = MAX(PIN(polecount), 1.0); - float torque = PIN(torque); - float vel = PIN(vel); - float slip_n = PIN(slip_n); - float torque_n = MAX(PIN(torque_n), 0.001); + float vel_n = PIN(vel_n) * poles; + float t_n = MAX(PIN(torque_n), 0.001); + float freq_n = MAX(PIN(freq_n), 1.0); + float slip_n = freq_n * 2.0 * M_PI - vel_n; float cur_n = PIN(cur_n); + float u_n = PIN(u_n); + float u_boost = PIN(u_boost); + float t_boost = PIN(t_boost); - float id = 0.0; - float iq = 0.0; - float freq = vel * poles / 2.0 / M_PI; - float slip = 0.0; + float torque = PIN(torque); + float vel = 0.0; + if(PIN(sensorless) > 0.0){ + vel = PIN(vel_e); + } + else{ + vel = PIN(vel_m) * poles; + } + + float d_cmd = 0.0; + float q_cmd = 0.0; + float slip = 0.0; + float cmd_mode = 0; + + float id_n = cur_n / sqrtf(2.0); + + PIN(scale) += (PIN(duty_setpoint) - PIN(duty)) * PIN(ki) * period; + PIN(scale) = CLAMP(PIN(scale), 0.01, 1); switch((int)PIN(mode)) { - case 0: // slip control - id = cur_n / sqrtf(2.0); // constant flux - iq = cur_n / sqrtf(2.0) / torque_n * torque; - slip = slip_n / torque_n * torque; + case 0: // slip control + cmd_mode = 1.0; // cur cmd + // d_cmd = MIN(id_n, id_n * freq_n * 2.0 * M_PI * v_boost / vel); // constant flux + d_cmd = id_n * PIN(scale); + q_cmd = id_n / t_n * torque / PIN(scale); + slip = slip_n * q_cmd / d_cmd; + + // id = id_n + // slip = slip_n * iq / id + // torque = 3/2 * p * K * iq * id + + // id = id_n * scale + // // iq = toruqe / t_n * id_n * id_n / id + // iq = toruqe / t_n * id_n / scale + // slip = slip_n * iq / id + + // torque = 3/2 * p * K * iq * id + // torque = t_n / id_n / id_n * id * iq + // iq = toruqe / t_n * id_n * id_n / id break; - case 1: // mtpa - id = 0.0; - iq = cur_n / torque_n * torque; + case 1: // mtpa + cmd_mode = 1.0; // cur cmd + d_cmd = 0.0; + q_cmd = cur_n / t_n * torque; slip = slip_n * SIGN(torque); // constant slip break; + case 2: // u/f slip + cmd_mode = 0; // volt cmd + slip = slip_n / t_n * torque; + d_cmd = MAX(u_n / freq_n * ABS(vel / 2.0 / M_PI), u_boost); + q_cmd = 0.0; + break; + default: - id = 0; - iq = 0; + cmd_mode = 1.0; // cur cmd + d_cmd = 0; + q_cmd = 0; slip = 0.0; } - freq += slip; + float t_min = 0; + float t_max = 0; - PIN(id) = id; - PIN(iq) = iq; - PIN(freq) = freq; + if(PIN(vel_m) > 0.0){ + t_max = t_n * t_boost * PIN(scale); + t_min = -t_max; + } + else{ + t_min = -t_n * t_boost * PIN(scale); + t_max = -t_min; + } + + slip = LIMIT(slip, slip_n * PIN(s_boost)); + + if(PIN(sensorless) > 0.0){ + vel -= slip; + PIN(vel_m) = vel * poles; + } + else{ + vel += slip; + PIN(vel_e) = vel; + } + + PIN(t_min) = t_min; + PIN(t_max) = t_max; + + PIN(cmd_mode) = cmd_mode; + PIN(d_cmd) = d_cmd; + PIN(q_cmd) = q_cmd; + + PIN(slip_n) = slip_n; PIN(slip) = slip; - PIN(pos) = mod(PIN(pos) + freq * period * 2.0 * M_PI); + PIN(pos) = mod(PIN(pos) + vel * period); } hal_comp_t acim_ttc_comp_struct = { @@ -74,7 +174,7 @@ hal_comp_t acim_ttc_comp_struct = { .nrt = 0, .rt = rt_func, .frt = 0, - .nrt_init = 0, + .nrt_init = nrt_init, .rt_start = 0, .frt_start = 0, .rt_stop = 0, diff --git a/shared/comps/and.c b/shared/comps/and.c index 316a160f..39553570 100644 --- a/shared/comps/and.c +++ b/shared/comps/and.c @@ -9,7 +9,7 @@ HAL_PIN(in3); HAL_PIN(out); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct and_pin_ctx_t *pins = (struct and_pin_ctx_t *)pin_ptr; PIN(out) = (PIN(in0) > 0.0) & (PIN(in1) > 0.0) & (PIN(in2) > 0.0) & (PIN(in3) > 0.0); diff --git a/shared/comps/auto_ac.c b/shared/comps/auto_ac.c index 4e04a331..19816c53 100644 --- a/shared/comps/auto_ac.c +++ b/shared/comps/auto_ac.c @@ -9,7 +9,7 @@ HAL_PIN(lpf); HAL_PIN(th); HAL_PIN(offset); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct auto_ac_ctx_t * ctx = (struct auto_ac_ctx_t *)ctx_ptr; struct auto_ac_pin_ctx_t *pins = (struct auto_ac_pin_ctx_t *)pin_ptr; PIN(lpf) = 1.0; @@ -18,7 +18,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct auto_ac_pin_ctx_t *pins = (struct auto_ac_pin_ctx_t *)pin_ptr; if(ABS(PIN(in)) <= PIN(th)){ diff --git a/shared/comps/avg.c b/shared/comps/avg.c index 49f6bbd2..1470ea28 100644 --- a/shared/comps/avg.c +++ b/shared/comps/avg.c @@ -9,7 +9,7 @@ HAL_PIN(lpf); HAL_PIN(mult); HAL_PIN(offset); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct avg_ctx_t * ctx = (struct avg_ctx_t *)ctx_ptr; struct avg_pin_ctx_t *pins = (struct avg_pin_ctx_t *)pin_ptr; PIN(lpf) = 100; @@ -18,7 +18,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct avg_pin_ctx_t *pins = (struct avg_pin_ctx_t *)pin_ptr; PIN(out) = (PIN(in) * PIN(mult) + PIN(offset)) * LP_HZ(PIN(lpf)) + (1.0 - LP_HZ(PIN(lpf))) * PIN(out); } diff --git a/shared/comps/curpid.c b/shared/comps/curpid.c index bd07c3af..c0f1bbce 100644 --- a/shared/comps/curpid.c +++ b/shared/comps/curpid.c @@ -30,8 +30,7 @@ HAL_PIN(max_cur); HAL_PIN(pwm_volt); // d, q resistance and inductance -HAL_PIN(rd); -HAL_PIN(rq); +HAL_PIN(r); HAL_PIN(ld); HAL_PIN(lq); @@ -41,7 +40,11 @@ HAL_PIN(psi); HAL_PIN(ff); // r feed forward HAL_PIN(kp); HAL_PIN(ki); +HAL_PIN(ksp); // predictor HAL_PIN(kind); // bemf feed forward +HAL_PIN(kci); + +HAL_PIN(scale); HAL_PIN(vel); // velocity input @@ -54,34 +57,35 @@ struct curpid_ctx_t { float iq_error_sum; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct curpid_ctx_t * ctx = (struct curpid_ctx_t *)ctx_ptr; struct curpid_pin_ctx_t *pins = (struct curpid_pin_ctx_t *)pin_ptr; - PIN(rd) = 0.5; - PIN(rq) = 0.5; + PIN(r) = 0.5; PIN(ld) = 0.01; PIN(lq) = 0.01; PIN(psi) = 0.05; PIN(kp) = 0.1; PIN(ki) = 0.005; + PIN(kci) = 500.0; + PIN(ksp) = 1.0; + PIN(scale) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct curpid_ctx_t *ctx = (struct curpid_ctx_t *)ctx_ptr; struct curpid_pin_ctx_t *pins = (struct curpid_pin_ctx_t *)pin_ptr; - float rd = MAX(PIN(rd), 0.1); - float rq = MAX(PIN(rq), 0.1); + float r = MAX(PIN(r), 0.1); float ld = MAX(PIN(ld), 0.001); float lq = MAX(PIN(lq), 0.001); float ff = PIN(ff); float kind = PIN(kind); float kpd = ld * PIN(kp) / period / 2.0; - float kid = rd * PIN(ki) / ld; + float kid = r * PIN(ki) / ld; float kpq = lq * PIN(kp) / period / 2.0; - float kiq = rq * PIN(ki) / lq; + float kiq = r * PIN(ki) / lq; float max_cur = MAX(PIN(max_cur), 0.01); float idc = PIN(id_cmd); @@ -95,26 +99,24 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ // float ac_current = id * id + iq * iq; //sqrtf(id * id + iq * iq); // PIN(ac_current) = ac_current; - float k; float abscur; - + float absvolt; + if(PIN(cmd_mode) == VOLT_MODE) { + absvolt = idc * idc + iqc * iqc; // clamp cmd + PIN(scale) *= sqrtf(CLAMP(max_volt * max_volt / MAX(absvolt, max_volt * 0.1), 0.0, 1.0)); + abscur = id * id + iq * iq; // clamp over fb - if(abscur > max_cur * max_cur) { - idc = 0; - iqc = 0; - } + PIN(scale) += (max_cur * max_cur - abscur) * PIN(kci) * period; } else{ abscur = idc * idc + iqc * iqc; // clamp cmd - if(abscur > max_cur * max_cur) { - k = max_cur * max_cur / abscur; - idc *= k; - iqc *= k; - } + PIN(scale) = sqrtf(max_cur * max_cur / MAX(abscur, max_cur * 0.1)); } - - + PIN(scale) = CLAMP(PIN(scale), 0.0, 1.0); + + idc *= PIN(scale); + iqc *= PIN(scale); float vel = PIN(vel); float psi_d = ld * id + PIN(psi); @@ -122,15 +124,19 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ float indd = vel * psi_q; float indq = vel * psi_d; + // predictor to cancel pwm delay + id += (PIN(ud) - r * id + indd) / ld * period * PIN(ksp); + iq += (PIN(uq) - r * iq - indq) / lq * period * PIN(ksp); + float id_error = idc - id; float iq_error = iqc - iq; - float ud = LIMIT(ff * rd * idc - kind * indd + kpd * id_error, max_volt); - float uq = LIMIT(ff * rq * iqc + kind * indq + kpq * iq_error, max_volt); + float ud = LIMIT(ff * r * idc - kind * indd + kpd * id_error, max_volt); + float uq = LIMIT(ff * r * iqc + kind * indq + kpq * iq_error, max_volt); if(kpd * kid > 0.0 && kpq * kiq > 0.0) { - ctx->id_error_sum = LIMIT(ctx->id_error_sum + kpd * kid * id_error, max_volt - ud); - ctx->iq_error_sum = LIMIT(ctx->iq_error_sum + kpq * kiq * iq_error, max_volt - uq); + ctx->id_error_sum = LIMIT(ctx->id_error_sum + kpd * kid * id_error * period, max_volt - ud); + ctx->iq_error_sum = LIMIT(ctx->iq_error_sum + kpq * kiq * iq_error * period, max_volt - uq); } else { ctx->id_error_sum = 0.0; ctx->iq_error_sum = 0.0; @@ -140,8 +146,8 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ uq += ctx->iq_error_sum; if(PIN(cmd_mode) == VOLT_MODE) { - ud = LIMIT(idc, max_volt); - uq = LIMIT(iqc, max_volt); + ud = idc; + uq = iqc; ctx->id_error_sum = 0.0; ctx->iq_error_sum = 0.0; id_error = 0.0; diff --git a/shared/comps/dc.c b/shared/comps/dc.c index 2c4f739d..4d23ab5a 100644 --- a/shared/comps/dc.c +++ b/shared/comps/dc.c @@ -13,7 +13,7 @@ HAL_PIN(u); HAL_PIN(v); HAL_PIN(w); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct hv_ctx_t * ctx = (struct hv_ctx_t *)ctx_ptr; struct dc_pin_ctx_t *pins = (struct dc_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/dc_limits.c b/shared/comps/dc_limits.c index 8b361c68..6f3ab01a 100644 --- a/shared/comps/dc_limits.c +++ b/shared/comps/dc_limits.c @@ -36,7 +36,7 @@ HAL_PIN(abs_max_vel); HAL_PIN(iq); HAL_PIN(vel); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct dc_limits_ctx_t * ctx = (struct dc_limits_ctx_t *)ctx_ptr; struct dc_limits_pin_ctx_t *pins = (struct dc_limits_pin_ctx_t *)pin_ptr; @@ -46,7 +46,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(lq) = 0.001; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct dc_limits_ctx_t * ctx = (struct dc_limits_ctx_t *)ctx_ptr; struct dc_limits_pin_ctx_t *pins = (struct dc_limits_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/dc_ttc.c b/shared/comps/dc_ttc.c index d43674f0..64872f93 100644 --- a/shared/comps/dc_ttc.c +++ b/shared/comps/dc_ttc.c @@ -15,7 +15,7 @@ HAL_PIN(torque); // cur cmd out HAL_PIN(cur); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct dc_ttc_ctx_t * ctx = (struct dc_ttc_ctx_t *)ctx_ptr; struct dc_ttc_pin_ctx_t *pins = (struct dc_ttc_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/debounce.c b/shared/comps/debounce.c index f1c90815..6aeef727 100644 --- a/shared/comps/debounce.c +++ b/shared/comps/debounce.c @@ -11,7 +11,7 @@ HAL_PIN(out); HAL_PIN(debounce_time); HAL_PIN(timer); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { //struct debounce_ctx_t *ctx = (struct debounce_ctx_t *)ctx_ptr; struct debounce_pin_ctx_t *pins = (struct debounce_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/dq.c b/shared/comps/dq.c index 4ed6ba86..48acdcc3 100644 --- a/shared/comps/dq.c +++ b/shared/comps/dq.c @@ -27,7 +27,7 @@ HAL_PIN(y); HAL_PIN(d); HAL_PIN(q); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct dq_ctx_t * ctx = (struct dq_ctx_t *)ctx_ptr; struct dq_pin_ctx_t *pins = (struct dq_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/en.c b/shared/comps/en.c new file mode 100644 index 00000000..a04fa921 --- /dev/null +++ b/shared/comps/en.c @@ -0,0 +1,65 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(en); + +HAL_PIN(en_in); +HAL_PIN(en_out0); +HAL_PIN(en_out1); +HAL_PIN(fault); + +HAL_PIN(time); +HAL_PIN(timer); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr){ + struct en_pin_ctx_t *pins = (struct en_pin_ctx_t *)pin_ptr; + PIN(time) = 5; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + //struct en_ctx_t *ctx = (struct en_ctx_t *)ctx_ptr; + struct en_pin_ctx_t *pins = (struct en_pin_ctx_t *)pin_ptr; + + if(PIN(en_in) <= 0.0){ + PIN(timer) = 0.0; + } + else{ + PIN(timer) += period; + } + + if(PIN(fault) > 0.0){ + PIN(timer) = 0.0; + } + + if(PIN(timer) > PIN(time) / 2.0){ + PIN(en_out0) = 1.0; + } + else{ + PIN(en_out0) = 0.0; + } + + if(PIN(timer) > PIN(time)){ + PIN(en_out1) = 1.0; + PIN(timer) = PIN(time); + } + else{ + PIN(en_out1) = 0.0; + } +} + +hal_comp_t en_comp_struct = { + .name = "en", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct en_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/fanuc.c b/shared/comps/fanuc.c index 63dcec76..0cd9663f 100644 --- a/shared/comps/fanuc.c +++ b/shared/comps/fanuc.c @@ -15,7 +15,7 @@ HAL_PIN(C8); //rotor position output HAL_PIN(pos); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct fanuc_ctx_t * ctx = (struct fanuc_ctx_t *)ctx_ptr; struct fanuc_pin_ctx_t *pins = (struct fanuc_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/fault.c b/shared/comps/fault.c index e9d26b07..61ff5895 100644 --- a/shared/comps/fault.c +++ b/shared/comps/fault.c @@ -95,7 +95,7 @@ struct fault_ctx_t { float mot_temp_error; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct fault_ctx_t *ctx = (struct fault_ctx_t *)ctx_ptr; struct fault_pin_ctx_t *pins = (struct fault_pin_ctx_t *)pin_ptr; @@ -113,7 +113,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(fan_mot_temp) = 60.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct fault_ctx_t *ctx = (struct fault_ctx_t *)ctx_ptr; struct fault_pin_ctx_t *pins = (struct fault_pin_ctx_t *)pin_ptr; @@ -278,7 +278,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct fault_ctx_t *ctx = (struct fault_ctx_t *)ctx_ptr; struct fault_pin_ctx_t *pins = (struct fault_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/fb_switch.c b/shared/comps/fb_switch.c index 6567fc22..6851b759 100644 --- a/shared/comps/fb_switch.c +++ b/shared/comps/fb_switch.c @@ -65,7 +65,7 @@ struct fb_switch_ctx_t { int32_t phase_state; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct fb_switch_ctx_t *ctx = (struct fb_switch_ctx_t *)ctx_ptr; struct fb_switch_pin_ctx_t *pins = (struct fb_switch_pin_ctx_t *)pin_ptr; @@ -78,7 +78,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(offset_first_enable) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct fb_switch_ctx_t *ctx = (struct fb_switch_ctx_t *)ctx_ptr; struct fb_switch_pin_ctx_t *pins = (struct fb_switch_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/field.c b/shared/comps/field.c new file mode 100644 index 00000000..028ba726 --- /dev/null +++ b/shared/comps/field.c @@ -0,0 +1,152 @@ +/* +* This file is part of the stmbl project. +* +* Copyright (C) 2013-2016 Rene Hopf +* Copyright (C) 2013-2016 Nico Stute +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You shou l have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + + +HAL_COMP(field); + +//in +HAL_PIN(vele_n); +HAL_PIN(velm_n); +HAL_PIN(i_n); +HAL_PIN(t_n); +HAL_PIN(vel_boost); +HAL_PIN(t_boost); + +HAL_PIN(vel); + +HAL_PIN(vel_mode); +HAL_PIN(in_mode); + +// inout +HAL_PIN(t); +HAL_PIN(iq); + +//out +HAL_PIN(id); + +HAL_PIN(iq_max); +HAL_PIN(iq_min); + +HAL_PIN(t_max); +HAL_PIN(t_min); + +HAL_PIN(slip); +HAL_PIN(velm); +HAL_PIN(vele); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct field_ctx_t *ctx = (struct field_ctx_t *)ctx_ptr; + struct field_pin_ctx_t *pins = (struct field_pin_ctx_t *)pin_ptr; + PIN(vele_n) = 60.0 * 2.0 * M_PI / 2.0; + PIN(velm_n) = 1745.0 / 60.0 * 2.0 * M_PI; + PIN(i_n) = 15.0; + PIN(t_n) = 23.0; + PIN(vel_boost) = 1.0; + PIN(t_boost) = 1.5; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct field_ctx_t *ctx = (struct field_ctx_t *)ctx_ptr; + struct field_pin_ctx_t *pins = (struct field_pin_ctx_t *)pin_ptr; + + float vel = MAX(ABS(PIN(vele)), 0.01); + float i_n = PIN(i_n); + float t_n = MAX(PIN(t_n), 0.01); + float vele_n = PIN(vele_n); + float velm_n = PIN(velm_n); + float t_boost = PIN(t_boost); + float vel_boost = PIN(vel_boost); + float slip_n = vele_n - velm_n; + float t = 0; + float iq = 0; + float slip = 0; + + + // float p_max = vel_n * t_n * vel_boost; + // float t_max = MIN(t_n * t_boost, p_max / vel); + + float id_n = i_n / sqrtf(2.0); + float id = MIN(id_n, id_n * vele_n * vel_boost / vel); + + float iq_max = 0; + float iq_min = 0; + + if(PIN(vel) > 0.0){ + iq_max = MIN(id_n * t_boost, id_n * vele_n * vel_boost / vel); + iq_min = -id_n * t_boost; + } + else{ + iq_max = id_n * t_boost; + iq_min = -MIN(id_n * t_boost, id_n * vele_n * vel_boost / vel); + } + + float t_max = iq_max * id / id_n / id_n * t_n; + float t_min = iq_min * id / id_n / id_n * t_n; + + if(PIN(in_mode) > 0){ // ipnut = torque + t = PIN(t); + t = CLAMP(t, t_min, t_max); + iq = t / t_n / id * id_n * id_n; + PIN(iq) = iq; + } + else{ // input = iq + iq = PIN(iq); + iq = CLAMP(iq, iq_min, iq_max); + t = iq * id / id_n / id_n * t_n; + PIN(t) = t; + } + slip = slip_n / t_n * t; + + if(PIN(vel_mode) > 0){ // input = velm + PIN(vele) = PIN(vel) + slip; + PIN(velm) = PIN(vel); + } + else{ // input = vele + PIN(vele) = PIN(vel); + PIN(velm) = PIN(vel) - slip; + } + + PIN(slip) = slip; + PIN(id) = id; + PIN(iq_max) = iq_max; + PIN(iq_min) = iq_min; + PIN(t_max) = t_max; + PIN(t_min) = t_min; +} + +hal_comp_t field_comp_struct = { + .name = "field", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct field_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/fmove.c b/shared/comps/fmove.c new file mode 100644 index 00000000..86a5ceff --- /dev/null +++ b/shared/comps/fmove.c @@ -0,0 +1,152 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(fmove); + +HAL_PIN(en); + +HAL_PIN(gravity); +HAL_PIN(real_mass); +HAL_PIN(virtual_mass); +HAL_PIN(damping); +HAL_PIN(friction); + +HAL_PIN(min_pos); +HAL_PIN(max_pos); +HAL_PIN(max_vel); +HAL_PIN(max_acc); +HAL_PIN(max_usr_vel); +HAL_PIN(max_usr_acc); +HAL_PIN(scale); + +HAL_PIN(force_in); +HAL_PIN(force); +HAL_PIN(force_offset); +HAL_PIN(force_offset_lpf); +HAL_PIN(pos); +HAL_PIN(mpos); +HAL_PIN(vel); +HAL_PIN(vel_old); +HAL_PIN(acc); +HAL_PIN(target); + +HAL_PIN(force_time); +HAL_PIN(force_timer); +HAL_PIN(force_th); + +HAL_PIN(print_freq); +HAL_PIN(print_timer); + +HAL_PIN(mode); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct fmove_pin_ctx_t *pins = (struct fmove_pin_ctx_t *)pin_ptr; + PIN(force_time) = 5.0; + PIN(max_acc) = 1; + PIN(max_vel) = 0.1; + PIN(max_usr_acc) = 2; + PIN(max_usr_vel) = 0.1; + PIN(min_pos) = 0.0; + PIN(max_pos) = 0.5; + PIN(real_mass) = 0.0; + PIN(virtual_mass) = 1.0; + PIN(damping) = 1.0; + PIN(friction) = 0.01; + PIN(scale) = 1000.0 / 25.0 * 2.0 * M_PI * 2.0; + PIN(force_th) = 0.1; + PIN(gravity) = 0.0; + PIN(force_offset_lpf) = 0.001; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct fmove_pin_ctx_t *pins = (struct fmove_pin_ctx_t *)pin_ptr; + + PIN(vel_old) = PIN(vel); + + PIN(force) = PIN(force_in) - PIN(gravity) * PIN(real_mass) - PIN(acc) * PIN(real_mass); + PIN(force) -= PIN(force_offset); + PIN(force_offset) += PIN(force) * PIN(force_offset_lpf) * period; + PIN(force) -= SIGN(PIN(vel)) * PIN(friction) + PIN(vel) * PIN(damping); + + PIN(force_timer) += period; + if(ABS(PIN(force)) > PIN(force_th)){ + PIN(force_timer) = 0.0; + PIN(mode) = 1; + } + else if(PIN(mode) > 0 && ABS(PIN(vel)) > PIN(max_usr_vel) * 0.05){ + PIN(force_timer) = 0.0; + } + else if(PIN(force_timer) > PIN(force_time)){ + PIN(force_timer) = PIN(force_time); + PIN(mode) = 0; + } + + PIN(target) = CLAMP(PIN(target), PIN(min_pos), PIN(max_pos)); + + switch((int) PIN(mode)){ + case 0: // auto move + PIN(vel) = SIGN(PIN(target) - PIN(pos)) * sqrtf(ABS(PIN(target) - PIN(pos)) * 2.0 * PIN(max_acc)); + PIN(vel) = CLAMP(PIN(vel), PIN(vel_old) - PIN(max_acc) * period, PIN(vel_old) + PIN(max_acc) * period); + PIN(vel) = LIMIT(PIN(vel), PIN(max_vel)); + break; + case 1: // force move + PIN(acc) = PIN(force) / PIN(virtual_mass); + PIN(acc) = LIMIT(PIN(acc), PIN(max_usr_acc)); + PIN(vel) += PIN(acc) * period; + PIN(vel) = CLAMP(PIN(vel), PIN(vel_old) - PIN(max_usr_acc) * period, PIN(vel_old) + PIN(max_usr_acc) * period); + PIN(vel) = LIMIT(PIN(vel), PIN(max_usr_vel)); + break; + } + + PIN(vel) = CLAMP(PIN(vel), -sqrtf(ABS(PIN(pos) - PIN(min_pos)) * 2.0 * MAX(PIN(max_acc), PIN(max_usr_acc))), sqrtf(ABS(PIN(pos) - PIN(max_pos)) * 2.0 * MAX(PIN(max_acc), PIN(max_usr_acc)))); + PIN(acc) = (PIN(vel) - PIN(vel_old)) / period; + + PIN(pos) += PIN(vel) * period; + PIN(pos) = CLAMP(PIN(pos), PIN(min_pos), PIN(max_pos)); + PIN(mpos) = mod(PIN(pos) * PIN(scale)); + PIN(print_timer) += period; + + if(PIN(en) <= 0.0){ + PIN(pos) = 0.0; + PIN(mpos) = 0.0; + PIN(vel) = 0.0; + } +} + +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct fmove_pin_ctx_t *pins = (struct fmove_pin_ctx_t *)pin_ptr; + if(PIN(print_freq) > 0.0){ + if(PIN(print_timer) > 1.0 / PIN(print_freq)){ + PIN(print_timer) = 0.0; + if(PIN(mode) > 0.0){ + printf("force_move %f\n", PIN(pos)); + } + else if(ABS(PIN(target) - PIN(pos)) < 0.01 & ABS(PIN(vel)) < PIN(max_vel) * 0.1){ + printf("on_target %f\n", PIN(pos)); + } + else{ + printf("moving %f\n", PIN(pos)); + } + } + } + else{ + PIN(print_timer) = 0.0; + } +} + +hal_comp_t fmove_comp_struct = { + .name = "fmove", + .nrt = nrt_func, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct fmove_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; \ No newline at end of file diff --git a/shared/comps/gain.c b/shared/comps/gain.c new file mode 100644 index 00000000..7acb8bbb --- /dev/null +++ b/shared/comps/gain.c @@ -0,0 +1,35 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(gain); + +HAL_PIN(vel); +HAL_PIN(max_vel); + +HAL_PIN(scale); + + + +static void rt_func(float gainriod, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct gain_ctx_t * ctx = (struct gain_ctx_t *)ctx_ptr; + struct gain_pin_ctx_t *pins = (struct gain_pin_ctx_t *)pin_ptr; + + PIN(scale) = CLAMP(ABS(PIN(vel) / MAX(PIN(max_vel), 0.1)), 0.0, 1.0); +} + +hal_comp_t gain_comp_struct = { + .name = "gain", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = 0, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct gain_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/hal_test.c b/shared/comps/hal_test.c index 6ff9ae09..41b29a89 100644 --- a/shared/comps/hal_test.c +++ b/shared/comps/hal_test.c @@ -5,7 +5,7 @@ HAL_COMP(hal_test); HAL_PIN(rt_wait); HAL_PIN(frt_wait); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct rev_ctx_t * ctx = (struct rev_ctx_t *)ctx_ptr; struct hal_test_pin_ctx_t *pins = (struct hal_test_pin_ctx_t *)pin_ptr; @@ -16,7 +16,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } } -static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct rev_ctx_t * ctx = (struct rev_ctx_t *)ctx_ptr; struct hal_test_pin_ctx_t *pins = (struct hal_test_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/home.c b/shared/comps/home.c index c3cb4d32..0cd8bf0f 100644 --- a/shared/comps/home.c +++ b/shared/comps/home.c @@ -6,57 +6,56 @@ HAL_COMP(home); -HAL_PIN(en); - HAL_PIN(home_vel); HAL_PIN(home_acc); -HAL_PIN(home_pos); HAL_PIN(pos_in); HAL_PIN(pos_out); -HAL_PIN(vel_cmd); +HAL_PIN(vel); HAL_PIN(home_in); HAL_PIN(home_polarity); -HAL_PIN(limit_in0); -HAL_PIN(limit_in1); -HAL_PIN(limit_polarity); - -HAL_PIN(state); -HAL_PIN(en_out); -HAL_PIN(target); +HAL_PIN(offset); HAL_PIN(home_offset); -HAL_PIN(re_home); -HAL_PIN(limit_fault); +HAL_PIN(state); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr){ +HAL_PIN(en_in); +HAL_PIN(en_out); + +HAL_PIN(re_home); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr){ struct home_pin_ctx_t *pins = (struct home_pin_ctx_t *)pin_ptr; PIN(state) = 0; PIN(re_home) = 1; PIN(home_polarity) = 1.0; + PIN(home_vel) = 2.0 * M_PI; + PIN(home_acc) = 2.0 * M_PI / 0.1; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { //struct home_ctx_t *ctx = (struct home_ctx_t *)ctx_ptr; struct home_pin_ctx_t *pins = (struct home_pin_ctx_t *)pin_ptr; float vel = 0.0; - if(PIN(en) <= 0.0){ + if(PIN(en_in) <= 0.0){ if(PIN(re_home) > 0.0){ PIN(state) = 0; } PIN(en_out) = 0; - PIN(limit_fault) = 0; } switch((int)PIN(state)){ case 0: // not homed - if(PIN(en) > 0.0){ + if(PIN(en_in) > 0.0){ PIN(state) = 1; PIN(en_out) = 0; + PIN(offset) = 0.0; + PIN(home_offset) = 0.0; + PIN(vel) = 0.0; } break; @@ -75,9 +74,11 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ case 2: // search home falling if(PIN(home_polarity) <= 0.0 && PIN(home_in) > 0.0){ PIN(state) = 3; + PIN(home_offset) = PIN(offset); } else if(PIN(home_polarity) > 0.0 && PIN(home_in) <= 0.0){ PIN(state) = 3; + PIN(home_offset) = PIN(offset); } else{ vel = -PIN(home_vel); @@ -85,47 +86,27 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ break; case 3: // set home pos - PIN(target) = PIN(home_pos); - PIN(state) = 4; - break; + vel = SIGN(PIN(home_offset) - PIN(offset)) * sqrtf(ABS(PIN(home_offset) - PIN(offset)) * 2.0 * PIN(home_acc)); - - case 4: // go to home pos - vel = PIN(target) * 10; - if(ABS(PIN(target)) < 0.0001){ - PIN(state) = 5; + if(ABS(PIN(offset) - PIN(home_offset)) < 0.0001 && PIN(vel) < PIN(home_vel) * 0.001){ + PIN(state) = 4; } break; - case 5: // homed + case 4: // homed PIN(en_out) = 1; - - if(PIN(limit_polarity) > 0.0 && (PIN(limit_in0) > 0.0 || PIN(limit_in1) > 0.0)){ - PIN(state) = 6; - PIN(en_out) = 0; - PIN(limit_fault) = 1; - } - else if(PIN(limit_polarity) <= 0.0 && (PIN(limit_in0) <= 0.0 || PIN(limit_in1) <= 0.0)){ - PIN(state) = 6; - PIN(en_out) = 0; - PIN(limit_fault) = 1; - } - break; - - case 6: // fault - PIN(en_out) = 0; - PIN(limit_fault) = 1; + PIN(offset) = PIN(home_offset); + PIN(vel) = 0.0; break; } vel = LIMIT(vel, ABS(PIN(home_vel))); - PIN(vel_cmd) = CLAMP(vel, PIN(vel_cmd) - PIN(home_acc) * period, PIN(vel_cmd) + PIN(home_acc) * period); + PIN(vel) = CLAMP(vel, PIN(vel) - PIN(home_acc) * period, PIN(vel) + PIN(home_acc) * period); - PIN(target) -= PIN(vel_cmd) * period; - PIN(home_offset) += PIN(vel_cmd) * period; - PIN(pos_out) = PIN(pos_in) + PIN(home_offset); - PIN(pos_out) = mod(PIN(pos_out)); - + PIN(offset) += PIN(vel) * period; + PIN(offset) = mod(PIN(offset)); + + PIN(pos_out) = mod(PIN(pos_in) + PIN(offset)); } hal_comp_t home_comp_struct = { diff --git a/shared/comps/idq.c b/shared/comps/idq.c index adb2ef33..e68f3c9c 100644 --- a/shared/comps/idq.c +++ b/shared/comps/idq.c @@ -26,7 +26,7 @@ HAL_PIN(u); HAL_PIN(v); HAL_PIN(w); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct idq_ctx_t * ctx = (struct idq_ctx_t *)ctx_ptr; struct idq_pin_ctx_t *pins = (struct idq_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/idx_home.c b/shared/comps/idx_home.c index b356f582..b8aaddb2 100644 --- a/shared/comps/idx_home.c +++ b/shared/comps/idx_home.c @@ -19,7 +19,7 @@ struct idx_home_ctx_t { int waitabs; }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct idx_home_ctx_t *ctx = (struct idx_home_ctx_t *)ctx_ptr; struct idx_home_pin_ctx_t *pins = (struct idx_home_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/iit.c b/shared/comps/iit.c index 47494cbb..1a870b77 100644 --- a/shared/comps/iit.c +++ b/shared/comps/iit.c @@ -22,7 +22,7 @@ struct iit_ctx_t { float e; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct iit_ctx_t *ctx = (struct iit_ctx_t *)ctx_ptr; struct iit_pin_ctx_t *pins = (struct iit_pin_ctx_t *)pin_ptr; PIN(amb_temp) = 30.0; @@ -33,7 +33,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->e = 0.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct iit_ctx_t *ctx = (struct iit_ctx_t *)ctx_ptr; struct iit_pin_ctx_t *pins = (struct iit_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/iit_old.c b/shared/comps/iit_old.c index 4ac14eb8..7f013c6f 100644 --- a/shared/comps/iit_old.c +++ b/shared/comps/iit_old.c @@ -27,7 +27,7 @@ struct iit_ctx_t { float mot_temp; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct iit_ctx_t *ctx = (struct iit_ctx_t *)ctx_ptr; struct iit_pin_ctx_t *pins = (struct iit_pin_ctx_t *)pin_ptr; ctx->mot_temp = 25.0; @@ -49,7 +49,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(flow) = 0.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct iit_ctx_t *ctx = (struct iit_ctx_t *)ctx_ptr; struct iit_pin_ctx_t *pins = (struct iit_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/jog.c b/shared/comps/jog.c index 57519ca8..9ffa7359 100644 --- a/shared/comps/jog.c +++ b/shared/comps/jog.c @@ -28,12 +28,12 @@ COMMAND("jogl", jog_left, "Jog left"); COMMAND("jogr", jog_right, "Jog right"); COMMAND("jogx", jog_stop, "Stop jog"); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { jog_timeout = 0.0; jog = 0.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct jog_pin_ctx_t *pins = (struct jog_pin_ctx_t *)pin_ptr; if(jog_timeout < 0.75) { diff --git a/shared/comps/linrev.c b/shared/comps/linrev.c index daed8983..cb2b1490 100644 --- a/shared/comps/linrev.c +++ b/shared/comps/linrev.c @@ -41,7 +41,7 @@ struct linrev_ctx_t { int32_t rev; //current multiturn }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct linrev_ctx_t *ctx = (struct linrev_ctx_t *)ctx_ptr; struct linrev_pin_ctx_t *pins = (struct linrev_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/mad.c b/shared/comps/mad.c new file mode 100644 index 00000000..0f772ab1 --- /dev/null +++ b/shared/comps/mad.c @@ -0,0 +1,30 @@ +#include "hal.h" + +HAL_COMP(mad); + +HAL_PIN(in); +HAL_PIN(mult); +HAL_PIN(add); + +HAL_PIN(out); + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct mad_pin_ctx_t *pins = (struct mad_pin_ctx_t *)pin_ptr; + + PIN(out) = PIN(in) * PIN(mult) + PIN(add); +} + +const hal_comp_t mad_comp_struct = { + .name = "mad", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = 0, + .hw_init = 0, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct mad_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/move.c b/shared/comps/move.c index 289c8799..ee445c29 100644 --- a/shared/comps/move.c +++ b/shared/comps/move.c @@ -11,7 +11,7 @@ HAL_PIN(rev); HAL_PIN(scale); HAL_PIN(out); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct move_pin_ctx_t *pins = (struct move_pin_ctx_t *)pin_ptr; PIN(out) = PIN(scale) * PIN(fwd) + PIN(scale) * PIN(rev) * -1; } diff --git a/shared/comps/mpid.c b/shared/comps/mpid.c new file mode 100644 index 00000000..d59e4e9b --- /dev/null +++ b/shared/comps/mpid.c @@ -0,0 +1,92 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(mpid); + +HAL_PIN(pos_ext_cmd); +HAL_PIN(pos_fb); +HAL_PIN(old_pos_ext_cmd); +HAL_PIN(old_pos_fb); +HAL_PIN(pos_error); + +HAL_PIN(vel_ext_cmd); +HAL_PIN(vel_fb); +HAL_PIN(vel_error); +HAL_PIN(vel_cmd); + +HAL_PIN(acc_cmd); + +HAL_PIN(torque_ext_cmd); +HAL_PIN(torque_sum); +HAL_PIN(torque_cmd); + +HAL_PIN(min_pos_error); +HAL_PIN(max_vel); +HAL_PIN(max_acc); +HAL_PIN(max_torque); + +HAL_PIN(pos_p); +HAL_PIN(vel_i); +HAL_PIN(vel_p); +HAL_PIN(j); +HAL_PIN(scale); + +HAL_PIN(en); + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct mpid_ctx_t *ctx = (struct mpid_ctx_t *)ctx_ptr; + struct mpid_pin_ctx_t *pins = (struct mpid_pin_ctx_t *)pin_ptr; + + if(PIN(en) > 0.0){ + PIN(pos_error) += minus(PIN(pos_ext_cmd), PIN(old_pos_ext_cmd)) * PIN(scale); + PIN(pos_error) -= minus(PIN(pos_fb), PIN(old_pos_fb)); + + PIN(vel_cmd) = LIMIT(PIN(pos_error) * PIN(pos_p), PIN(max_vel)); + + if(ABS(PIN(pos_error)) < PIN(min_pos_error)){ + PIN(vel_cmd) = 0.0; + } + + PIN(vel_cmd) += PIN(vel_ext_cmd); + + PIN(vel_error) = PIN(vel_cmd) - PIN(vel_fb); + + PIN(acc_cmd) = LIMIT(PIN(vel_error) * PIN(vel_p), PIN(max_acc)); + + PIN(torque_cmd) = LIMIT(PIN(acc_cmd) * PIN(j), PIN(max_torque)); + + PIN(torque_sum) += PIN(vel_error) * PIN(vel_i) * period; + PIN(torque_sum) = CLAMP(PIN(torque_sum), -PIN(max_torque) - PIN(torque_cmd), PIN(max_torque) - PIN(torque_cmd)); + + PIN(torque_cmd) += PIN(torque_ext_cmd); + PIN(torque_cmd) += PIN(torque_sum); + } + else{ + PIN(pos_error) = 0.0; + PIN(vel_cmd) = 0.0; + PIN(vel_error) = 0.0; + PIN(acc_cmd) = 0.0; + PIN(torque_sum) = 0.0; + PIN(torque_cmd) = 0.0; + } + + PIN(old_pos_fb) = PIN(pos_fb); + PIN(old_pos_ext_cmd) = PIN(pos_ext_cmd); +} + +hal_comp_t mpid_comp_struct = { + .name = "mpid", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = 0, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct mpid_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; \ No newline at end of file diff --git a/shared/comps/mux.c b/shared/comps/mux.c index 72db672b..51f9069d 100644 --- a/shared/comps/mux.c +++ b/shared/comps/mux.c @@ -9,10 +9,10 @@ HAL_PIN(mux); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct mux_pin_ctx_t *pins = (struct mux_pin_ctx_t *)pin_ptr; for(int i = 0; i < 10; i++){ - PINA(out, i) = PINA(in, i + (int)MIN(MAX(PIN(mux), 0.0), 8.0 - 1.0)); + PINA(out, i) = PINA(in, i + (int)MIN(MAX(PIN(mux), 0.0), 7.0) * 10); } } diff --git a/shared/comps/not.c b/shared/comps/not.c index 7c49a2b0..d5bd5375 100644 --- a/shared/comps/not.c +++ b/shared/comps/not.c @@ -5,7 +5,7 @@ HAL_COMP(not); HAL_PIN(in); HAL_PIN(out); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct not_pin_ctx_t *pins = (struct not_pin_ctx_t *)pin_ptr; PIN(out) = PIN(in) <= 0.0; diff --git a/shared/comps/or.c b/shared/comps/or.c index 76de38e7..56f55c74 100644 --- a/shared/comps/or.c +++ b/shared/comps/or.c @@ -9,7 +9,7 @@ HAL_PIN(in3); HAL_PIN(out); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct or_pin_ctx_t *pins = (struct or_pin_ctx_t *)pin_ptr; PIN(out) = (PIN(in0) > 0.0) | (PIN(in1) > 0.0) | (PIN(in2) > 0.0) | (PIN(in3) > 0.0); diff --git a/shared/comps/pe.c b/shared/comps/pe.c index 065200c7..11ebe976 100644 --- a/shared/comps/pe.c +++ b/shared/comps/pe.c @@ -25,7 +25,7 @@ HAL_PIN(p_el_ac); HAL_PIN(p_m); HAL_PIN(p_t); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct pe_ctx_t * ctx = (struct pe_ctx_t *)ctx_ptr; struct pe_pin_ctx_t *pins = (struct pe_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/pid.c b/shared/comps/pid.c index 2f965284..f3c45c4b 100644 --- a/shared/comps/pid.c +++ b/shared/comps/pid.c @@ -60,6 +60,11 @@ HAL_PIN(vel_p); // (1/s) HAL_PIN(vel_i); HAL_PIN(vel_g); +HAL_PIN(scale); +HAL_PIN(pos_p_scale); +HAL_PIN(vel_p_scale); +HAL_PIN(vel_i_scale); + HAL_PIN(j_lpf); HAL_PIN(acc_g); @@ -91,7 +96,7 @@ struct pid_ctx_t { float acc_cmd_lp; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct pid_ctx_t *ctx = (struct pid_ctx_t *)ctx_ptr; struct pid_pin_ctx_t *pins = (struct pid_pin_ctx_t *)pin_ptr; @@ -108,9 +113,14 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(vel_g) = 1.0; PIN(acc_g) = 1.0; PIN(g) = 0.99; // model limit scaling + + PIN(scale) = 1.0; + PIN(pos_p_scale) = 1.0; + PIN(vel_p_scale) = 1.0; + PIN(vel_i_scale) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct pid_ctx_t *ctx = (struct pid_ctx_t *)ctx_ptr; struct pid_pin_ctx_t *pins = (struct pid_pin_ctx_t *)pin_ptr; @@ -150,6 +160,10 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ float vel_g = CLAMP(PIN(vel_g), 0.0, 1.0); float acc_g = CLAMP(PIN(acc_g), 0.0, 1.0); + float scale = CLAMP(PIN(scale), 0, 1); + pos_p *= scale + (1 - scale) * PIN(pos_p_scale); + vel_p *= scale + (1 - scale) * PIN(vel_p_scale); + vel_i *= scale + (1 - scale) * PIN(vel_i_scale); float pos_en = PIN(pos_en); float vel_en = PIN(vel_en); @@ -241,6 +255,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ acc_sat = 0.0; torque_sat = 0.0; ctx->sat = 0.0; + PIN(torque_cmd) = 0.0; } PIN(pos_error) = pos_error; diff --git a/shared/comps/pmsm.c b/shared/comps/pmsm.c index 76a4ec84..8cd89cf8 100644 --- a/shared/comps/pmsm.c +++ b/shared/comps/pmsm.c @@ -47,47 +47,19 @@ HAL_PIN(iq); HAL_PIN(psi_d); HAL_PIN(psi_q); HAL_PIN(torque); -HAL_PIN(drop_q); -HAL_PIN(drop_d); -HAL_PIN(drop_v); -HAL_PIN(drop_exp); -struct pmsm_ctx_t { - float id; - float iq; -}; - - -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { - struct pmsm_ctx_t *ctx = (struct pmsm_ctx_t *)ctx_ptr; +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct pmsm_ctx_t *ctx = (struct pmsm_ctx_t *)ctx_ptr; struct pmsm_pin_ctx_t *pins = (struct pmsm_pin_ctx_t *)pin_ptr; - - ctx->id = 0.0; - ctx->iq = 0.0; - PIN(psi) = 0.01; PIN(r) = 1.0; PIN(ld) = 0.001; PIN(lq) = 0.001; PIN(polecount) = 1.0; - - PIN(drop_v) = 0.7; - PIN(drop_exp) = 0.04; } -// TODO: ifdef Troller, move to curpid -float drop(float i, float v) { - if(i < -v) { - return (-1.0); - } - if(i > v) { - return (1.0); - } - return (i / v); -} - -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { - struct pmsm_ctx_t *ctx = (struct pmsm_ctx_t *)ctx_ptr; +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct pmsm_ctx_t *ctx = (struct pmsm_ctx_t *)ctx_ptr; struct pmsm_pin_ctx_t *pins = (struct pmsm_pin_ctx_t *)pin_ptr; @@ -99,46 +71,36 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ float uq = PIN(uq); float psi_m = MAX(PIN(psi), 0.01); float r = MAX(PIN(r), 0.01); + float id = PIN(id); + float iq = PIN(iq); - float psi_d = ld * ctx->id + psi_m; - float psi_q = lq * ctx->iq; + float psi_d = ld * id + psi_m; + float psi_q = lq * iq; float indd = vel_e * psi_q; // todo redundant calculation float indq = vel_e * psi_d; - float dropv = PIN(drop_v); - float drope = PIN(drop_exp); - float dropq = dropv * drop(ctx->iq, drope); - float dropd = dropv * drop(ctx->id, drope); + id += (ud - r * id + indd) / ld * period / 4.0; + iq += (uq - r * iq - indq) / lq * period / 4.0; - uq -= dropq; - ud -= dropd; + id += (ud - r * id + indd) / ld * period / 4.0; + iq += (uq - r * iq - indq) / lq * period / 4.0; + id += (ud - r * id + indd) / ld * period / 4.0; + iq += (uq - r * iq - indq) / lq * period / 4.0; - ctx->id += (ud - r * ctx->id + indd) / ld * period / 4.0; - ctx->iq += (uq - r * ctx->iq - indq) / lq * period / 4.0; + id += (ud - r * id + indd) / ld * period / 4.0; + iq += (uq - r * iq - indq) / lq * period / 4.0; - ctx->id += (ud - r * ctx->id + indd) / ld * period / 4.0; - ctx->iq += (uq - r * ctx->iq - indq) / lq * period / 4.0; + float t = 3.0 / 2.0 * p * (psi_m * iq + (ld - lq) * id * iq); - ctx->id += (ud - r * ctx->id + indd) / ld * period / 4.0; - ctx->iq += (uq - r * ctx->iq - indq) / lq * period / 4.0; - - ctx->id += (ud - r * ctx->id + indd) / ld * period / 4.0; - ctx->iq += (uq - r * ctx->iq - indq) / lq * period / 4.0; - - float t = 3.0 / 2.0 * p * (psi_m * ctx->iq + (ld - lq) * ctx->id * ctx->iq); - - PIN(id) = ctx->id; - PIN(iq) = ctx->iq; + PIN(id) = id; + PIN(iq) = iq; PIN(indd) = indd; PIN(indq) = indq; PIN(psi_d) = psi_d; PIN(psi_q) = psi_q; PIN(torque) = t; - - PIN(drop_q) = dropq; - PIN(drop_d) = dropd; } hal_comp_t pmsm_comp_struct = { @@ -151,6 +113,6 @@ hal_comp_t pmsm_comp_struct = { .frt_start = 0, .rt_stop = 0, .frt_stop = 0, - .ctx_size = sizeof(struct pmsm_ctx_t), + .ctx_size = 0, .pin_count = sizeof(struct pmsm_pin_ctx_t) / sizeof(struct hal_pin_inst_t), }; diff --git a/shared/comps/pmsm_limits.c b/shared/comps/pmsm_limits.c index c32f32c6..1c2c3dd5 100644 --- a/shared/comps/pmsm_limits.c +++ b/shared/comps/pmsm_limits.c @@ -37,7 +37,7 @@ HAL_PIN(abs_max_vel); HAL_PIN(iq); HAL_PIN(indq); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct pmsm_limits_ctx_t * ctx = (struct pmsm_limits_ctx_t *)ctx_ptr; struct pmsm_limits_pin_ctx_t *pins = (struct pmsm_limits_pin_ctx_t *)pin_ptr; @@ -48,7 +48,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(polecount) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct pmsm_limits_ctx_t * ctx = (struct pmsm_limits_ctx_t *)ctx_ptr; struct pmsm_limits_pin_ctx_t *pins = (struct pmsm_limits_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/pmsm_ttc.c b/shared/comps/pmsm_ttc.c index 7532625e..80ac7f98 100644 --- a/shared/comps/pmsm_ttc.c +++ b/shared/comps/pmsm_ttc.c @@ -33,7 +33,7 @@ HAL_PIN(torque); // cur cmd out HAL_PIN(cur); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct sim_ctx_t * ctx = (struct sim_ctx_t *)ctx_ptr; struct pmsm_ttc_pin_ctx_t *pins = (struct pmsm_ttc_pin_ctx_t *)pin_ptr; @@ -42,7 +42,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(block_gain) = 0.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct pmsm_ttc_ctx_t * ctx = (struct pmsm_ttc_ctx_t *)ctx_ptr; struct pmsm_ttc_pin_ctx_t *pins = (struct pmsm_ttc_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/pos_filter.c b/shared/comps/pos_filter.c index cd837319..98c4aaea 100644 --- a/shared/comps/pos_filter.c +++ b/shared/comps/pos_filter.c @@ -15,7 +15,7 @@ HAL_PIN(bandwidth); HAL_PIN(en); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { //struct pos_filter_ctx_t *ctx = (struct pos_filter_ctx_t *)ctx_ptr; struct pos_filter_pin_ctx_t *pins = (struct pos_filter_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/psi.c b/shared/comps/psi.c index aaa8a2e3..970cf927 100644 --- a/shared/comps/psi.c +++ b/shared/comps/psi.c @@ -11,7 +11,6 @@ HAL_PIN(u); HAL_PIN(v); HAL_PIN(w); HAL_PIN(polecount); -HAL_PIN(drop); HAL_PIN(psi); HAL_PIN(max_psi); @@ -19,16 +18,14 @@ struct psi_ctx_t { float max_f; }; -//HALL_PIN(polecount) = 1.0; -//HALL_PIN(drop) = 0.8; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct psi_ctx_t *ctx = (struct psi_ctx_t *)ctx_ptr; struct psi_pin_ctx_t *pins = (struct psi_pin_ctx_t *)pin_ptr; float f = ABS(PIN(vel)) / 2.0 / M_PI * PIN(polecount); - float u = PIN(dc_volt) + PIN(drop); + float u = PIN(dc_volt); float u2 = MAX3(PIN(u), PIN(v), PIN(w)) - MIN3(PIN(u), PIN(v), PIN(w)); u = MIN(u, u2) / M_SQRT3; // TODO: fix if(f > 1.0) { diff --git a/shared/comps/ramp.c b/shared/comps/ramp.c index 41b1b5bc..cc058a51 100644 --- a/shared/comps/ramp.c +++ b/shared/comps/ramp.c @@ -9,7 +9,7 @@ HAL_PIN(vel_ext_cmd); HAL_PIN(en); -HAL_PIN(load); +HAL_PIN(scale); HAL_PIN(max_vel); HAL_PIN(max_acc); @@ -20,16 +20,19 @@ HAL_PIN(vel_cmd); HAL_PIN(at_speed); HAL_PIN(en_out); +HAL_PIN(en_timer); +HAL_PIN(en_delay); - -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct ramp_ctx_t *ctx = (struct ramp_ctx_t *)ctx_ptr; struct ramp_pin_ctx_t *pins = (struct ramp_pin_ctx_t *)pin_ptr; PIN(at_speed_th) = 0.01; + PIN(en_delay) = 0.25; + PIN(scale) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct ramp_ctx_t *ctx = (struct ramp_ctx_t *)ctx_ptr; struct ramp_pin_ctx_t *pins = (struct ramp_pin_ctx_t *)pin_ptr; @@ -40,8 +43,11 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } float vel_error = vel_ext_cmd - PIN(vel_cmd); - - PIN(vel_cmd) += LIMIT(vel_error, PIN(max_acc) * period * (1 - CLAMP(ABS(PIN(load)), 0, 1))); + float max_acc = PIN(max_acc) * PIN(scale); + + if(PIN(en_timer) >= PIN(en_delay) * 0.9){ + PIN(vel_cmd) += LIMIT(vel_error, max_acc * period); + } if(ABS(PIN(vel_ext_cmd) - PIN(vel_cmd)) < PIN(max_vel) * PIN(at_speed_th)){ PIN(at_speed) = 1; @@ -50,7 +56,13 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ PIN(at_speed) = 0; } - if(ABS(PIN(vel_cmd)) > 0.1){ + if((ABS(PIN(vel_cmd)) > 0.01) | (ABS(PIN(vel_ext_cmd)) > 0.01)){ + PIN(en_timer) = CLAMP(PIN(en_timer) + period, 0, PIN(en_delay)); + } + else{ + PIN(en_timer) = CLAMP(PIN(en_timer) - period, 0, PIN(en_delay)); + } + if(PIN(en_timer) > 0.0){ PIN(en_out) = 1; } else{ @@ -70,4 +82,4 @@ hal_comp_t ramp_comp_struct = { .frt_stop = 0, .ctx_size = 0, .pin_count = sizeof(struct ramp_pin_ctx_t) / sizeof(struct hal_pin_inst_t), -}; \ No newline at end of file +}; diff --git a/shared/comps/reslimit.c b/shared/comps/reslimit.c index 3fe457a6..3daf4822 100644 --- a/shared/comps/reslimit.c +++ b/shared/comps/reslimit.c @@ -11,7 +11,7 @@ HAL_PIN(pos_out); HAL_PIN(res); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct reslimit_ctx_t * ctx = (struct reslimit_ctx_t *)ctx_ptr; struct reslimit_pin_ctx_t *pins = (struct reslimit_pin_ctx_t *)pin_ptr; //TODO: offset at zerocross diff --git a/shared/comps/rev.c b/shared/comps/rev.c index 791ad33b..8ffd18fe 100644 --- a/shared/comps/rev.c +++ b/shared/comps/rev.c @@ -12,7 +12,7 @@ HAL_PIN(in_d); HAL_PIN(out_d); HAL_PIN(rev); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct rev_ctx_t * ctx = (struct rev_ctx_t *)ctx_ptr; struct rev_pin_ctx_t *pins = (struct rev_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/rl.c b/shared/comps/rl.c new file mode 100644 index 00000000..4280c28b --- /dev/null +++ b/shared/comps/rl.c @@ -0,0 +1,144 @@ +#include "hal.h" +#include "angle.h" +#include "defines.h" + +HAL_COMP(rl); + +HAL_PIN(r_test_cur); +HAL_PIN(l_test_volt); +HAL_PIN(r_test_time); +HAL_PIN(l_test_time); + +HAL_PIN(ud_cmd); +HAL_PIN(ud_fb); +HAL_PIN(id_fb); + +HAL_PIN(uq_cmd); +HAL_PIN(uq_fb); +HAL_PIN(iq_fb); + +HAL_PIN(ki); + +HAL_PIN(en); +HAL_PIN(en_out); + +HAL_PIN(state); + +HAL_PIN(timer); +HAL_PIN(counter); + +HAL_PIN(r); +HAL_PIN(ur); +HAL_PIN(ir); + +HAL_PIN(ld); +HAL_PIN(lq); +HAL_PIN(u0); +HAL_PIN(u1); +HAL_PIN(i0); +HAL_PIN(i1); + +HAL_PIN(et); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct rl_pin_ctx_t *pins = (struct rl_pin_ctx_t *)pin_ptr; + + PIN(r_test_cur) = 5; + PIN(r_test_time) = 0.5; + PIN(l_test_volt) = 10; + PIN(l_test_time) = 1.5; + PIN(ki) = 10; +} + + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + //struct rl_ctx_t *ctx = (struct rl_ctx_t *)ctx_ptr; + struct rl_pin_ctx_t *pins = (struct rl_pin_ctx_t *)pin_ptr; + + + if(PIN(en) <= 0.0){ + PIN(state) = 0; + } + + switch((int) PIN(state)){ + case 0: // off + PIN(ud_cmd) = 0.0; + PIN(uq_cmd) = 0.0; + PIN(en_out) = 0.0; + PIN(timer) = 0.0; + + if(PIN(en) > 0.0){ + PIN(state) = 1; + } + break; + + case 1: // ramp up ud_cmd + PIN(en_out) = 1; + PIN(ud_cmd) += PIN(ki) * period * (PIN(r_test_cur) - PIN(id_fb)); + + PIN(timer) += period; + + if(PIN(timer) > PIN(r_test_time)){ + if(ABS(PIN(id_fb)) > ABS(PIN(r_test_cur)) * 0.1){ + PIN(ur) = PIN(ur) * 0.99 + PIN(ud_fb) * 0.01; + PIN(ir) = PIN(ir) * 0.99 + PIN(id_fb) * 0.01; + PIN(r) = PIN(ur) / PIN(ir); + } + } + + if(PIN(timer) > PIN(r_test_time) * 2.0){ + PIN(state) = 2; + PIN(timer) = 0; + PIN(counter) = 1; + } + break; + + case 2: + PIN(timer) += period; + PIN(counter) *= -1; + + if(PIN(counter) > 0){ + PIN(ud_cmd) = PIN(l_test_volt) * 0.1; + PIN(u1) = PIN(u1) * 0.998 + PIN(ud_fb) * 0.002; + PIN(i1) = PIN(i1) * 0.998 + PIN(id_fb) * 0.002; + } + else{ + PIN(ud_cmd) = PIN(l_test_volt); + PIN(u0) = PIN(u0) * 0.998 + PIN(ud_fb) * 0.002; + PIN(i0) = PIN(i0) * 0.998 + PIN(id_fb) * 0.002; + } + + float dv = (PIN(u1) - PIN(u0)) / 2.0; + float di = PIN(i1) - PIN(i0); + + PIN(ld) = ABS(dv / di) * period; + + if(PIN(timer) > PIN(l_test_time)){ + PIN(state) = 3; + } + break; + + case 3: + PIN(ud_cmd) = 0.0; + PIN(uq_cmd) = 0.0; + PIN(en_out) = 0.0; + PIN(timer) = 0.0; + PIN(et) = PIN(ld) / PIN(r); + PIN(en) = 0; + } +} + +const hal_comp_t rl_comp_struct = { + .name = "rl", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .hw_init = 0, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct rl_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/rlpsij.c b/shared/comps/rlpsij.c new file mode 100644 index 00000000..1e1928fc --- /dev/null +++ b/shared/comps/rlpsij.c @@ -0,0 +1,227 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(rlpsij); + +HAL_PIN(r); +HAL_PIN(l); +HAL_PIN(psi); +HAL_PIN(j); +HAL_PIN(load); +HAL_PIN(friction); +HAL_PIN(damping); +HAL_PIN(polecount); +HAL_PIN(fb_offset); + +HAL_PIN(cmd_mode); +HAL_PIN(q_cmd); +HAL_PIN(d_cmd); +HAL_PIN(iq_fb); +HAL_PIN(id_fb); +HAL_PIN(uq_fb); +HAL_PIN(ud_fb); + +HAL_PIN(abs_pos_fb); +HAL_PIN(com_pos); +HAL_PIN(en_out); + +HAL_PIN(en); +HAL_PIN(test_cur); +HAL_PIN(test_vel); +HAL_PIN(rl_ki); +HAL_PIN(vel_ki); +HAL_PIN(vel_kp); +HAL_PIN(rl_time); +HAL_PIN(vel_time); +HAL_PIN(lpf); + +HAL_PIN(timer); +HAL_PIN(multi_pos); +HAL_PIN(state); +HAL_PIN(vel); +HAL_PIN(acc); +HAL_PIN(last_pos); +HAL_PIN(error_sum); +HAL_PINA(i, 4); + + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct rlpsij_pin_ctx_t *pins = (struct rlpsij_pin_ctx_t *)pin_ptr; + PIN(test_cur) = 1.0; + PIN(test_vel) = 2.0 * M_PI * 1.0; + PIN(rl_ki) = 10.0; + PIN(vel_ki) = 0.01; + PIN(vel_kp) = 0.1; + PIN(rl_time) = 1.0; + PIN(vel_time) = 4.0; + PIN(lpf) = 0.9955; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct rlpsij_ctx_t * ctx = (struct rlpsij_ctx_t *)ctx_ptr; + struct rlpsij_pin_ctx_t *pins = (struct rlpsij_pin_ctx_t *)pin_ptr; + + float vel = minus(PIN(abs_pos_fb), PIN(last_pos)) / period; + float acc = (vel - PIN(vel)) / period; + PIN(vel) = PIN(vel) * 0.99 + vel * (1.0 - 0.99); + PIN(acc) = PIN(acc) * 0.99 + acc * (1.0 - 0.99); + PIN(last_pos) = PIN(abs_pos_fb); + + PIN(timer) += period; + + float vel_cmd = 0.0; + float error = 0.0; + + switch((int)PIN(state)){ + case 0: // disabled + PIN(timer) = 0.0; + PIN(en_out) = 0.0; + + if(PIN(en) > 0.0){ + PIN(state) = 1; + } + break; + + case 1: // r, fb_offset + PIN(en_out) = 1.0; + PIN(com_pos) = 0.0; + PIN(cmd_mode) = 0.0; // volt mode + + PIN(d_cmd) += PIN(rl_ki) * period * (PIN(test_cur) - PIN(id_fb)); + + if(PIN(id_fb) > PIN(test_cur) * 0.5){ + PIN(r) = PIN(r) * PIN(lpf) + PIN(ud_fb) / PIN(id_fb) * (1.0 - PIN(lpf)); + } + + if(PIN(timer) > PIN(rl_time)){ + PIN(fb_offset) = PIN(abs_pos_fb); + PIN(timer) = 0.0; + PIN(state) = 2.0; + } + break; + + case 2: // l + PIN(timer) = 0.0; + PIN(state) = 3.0; + PIN(polecount) = 0.0; + PIN(d_cmd) = 0.0; + break; + + case 3: // polecount + PIN(cmd_mode) = 1.0; + PIN(d_cmd) = PIN(test_cur); + + PIN(com_pos) += 2.0 * M_PI * period; + + if(PIN(com_pos) >= M_PI){ + PIN(polecount) += 1.0; + PIN(com_pos) = -M_PI; + } + if(PIN(timer) > 1.0 && ABS(minus(PIN(abs_pos_fb), PIN(fb_offset))) < 2.0 * M_PI * 0.01){ + PIN(d_cmd) = 0.0; + PIN(com_pos) = 0.0; + PIN(error_sum) = 0.0; + PIN(timer) = 0.0; + PIN(state) = 4.0; + } + break; + + case 4: // psi, friction, damping, load + vel_cmd = PIN(test_vel) / 10.0; + int phase = 0; + if(PIN(timer) > PIN(vel_time) / 4.0){ + phase = 1; + vel_cmd = PIN(test_vel); + } + if(PIN(timer) > PIN(vel_time) / 4.0 * 2.0) + { + phase = 2; + vel_cmd = -PIN(test_vel) / 10.0; + } + if(PIN(timer) > PIN(vel_time) / 4.0 * 3.0) + { + phase = 3; + vel_cmd = -PIN(test_vel); + } + + PIN(com_pos) = mod(minus(PIN(abs_pos_fb), PIN(fb_offset)) * PIN(polecount)); + + error = vel_cmd - PIN(vel); + PIN(error_sum) += PIN(vel_ki) * period * (vel_cmd - PIN(vel)); + PIN(error_sum) = LIMIT(PIN(error_sum), PIN(test_cur)); + PIN(q_cmd) = PIN(vel_kp) * error + PIN(error_sum); + PIN(q_cmd) = LIMIT(PIN(q_cmd), PIN(test_cur)); + + if(ABS(vel_cmd - PIN(vel)) < PIN(test_vel) * 0.05){ + float bemf = PIN(uq_fb) - PIN(iq_fb) * PIN(r); + PIN(psi) = PIN(psi) * PIN(lpf) + bemf / PIN(vel) / PIN(polecount) * (1.0 - PIN(lpf)); + + PINA(i, phase) = PINA(i, phase) * PIN(lpf) + PIN(iq_fb) * (1.0 - PIN(lpf)); + } + + if(PIN(timer) > PIN(vel_time)){ + PIN(load) = (PINA(i, 0) + PINA(i, 1) + PINA(i, 2) + PINA(i, 3)) / 4.0; + PIN(damping) = (PINA(i, 1) - PINA(i, 0) - PINA(i, 3) + PINA(i, 2)) / 2.0 / (PIN(test_vel) * 0.9); + PIN(friction) = (PINA(i, 1) - PIN(damping) * PIN(test_vel) - PINA(i, 3) - PIN(damping) * PIN(test_vel)) / 2.0; + + PIN(load) *= 3.0 / 2.0 * PIN(polecount) * PIN(psi); + PIN(damping) *= 3.0 / 2.0 * PIN(polecount) * PIN(psi); + PIN(load) *= 3.0 / 2.0 * PIN(polecount) * PIN(psi); + + PIN(q_cmd) = 0.0; + PIN(timer) = 0.0; + PIN(state) = 5.0; + } + break; + + case 5: // j + if(PIN(timer) < PIN(vel_time) / 2.0){ + PIN(q_cmd) = PIN(test_cur); + } + else{ + PIN(q_cmd) = -PIN(test_cur); + } + + PIN(com_pos) = mod(minus(PIN(abs_pos_fb), PIN(fb_offset)) * PIN(polecount)); + + float t = 3.0 / 2.0 * PIN(polecount) * PIN(psi) * PIN(iq_fb); + t -= PIN(load); + t -= PIN(friction) * SIGN(PIN(vel)); + t -= PIN(damping) * PIN(vel); + + if(ABS(PIN(acc)) > PIN(test_vel)){ + PIN(j) = PIN(j) * PIN(lpf) + t / PIN(acc) * (1.0 - PIN(lpf)); + } + + if(PIN(timer) > PIN(vel_time)){ + PIN(state) = 6.0; + PIN(q_cmd) = 0.0; + PIN(d_cmd) = 0.0; + } + break; + + case 6: + PIN(com_pos) = mod(minus(PIN(abs_pos_fb), PIN(fb_offset)) * PIN(polecount)); + if(PIN(en) <= 0.0){ + PIN(state) = 0.0; + } + break; + } +} + +hal_comp_t rlpsij_comp_struct = { + .name = "rlpsij", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct rlpsij_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; diff --git a/shared/comps/scale.c b/shared/comps/scale.c index 4162e099..72d63c2e 100644 --- a/shared/comps/scale.c +++ b/shared/comps/scale.c @@ -12,7 +12,7 @@ HAL_PIN(in1); HAL_PIN(out1); HAL_PIN(scale); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct scale_ctx_t * ctx = (struct scale_ctx_t *)ctx_ptr; struct scale_pin_ctx_t *pins = (struct scale_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/sensorless.c b/shared/comps/sensorless.c new file mode 100644 index 00000000..31e26199 --- /dev/null +++ b/shared/comps/sensorless.c @@ -0,0 +1,141 @@ +/* +* This file is part of the stmbl project. +* +* Copyright (C) 2013-2016 Rene Hopf +* Copyright (C) 2013-2016 Nico Stute +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You shou l have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + + +HAL_COMP(sensorless); + +//in +HAL_PIN(r); +HAL_PIN(l); + +HAL_PIN(ki); +HAL_PIN(kb); +HAL_PIN(kl); +HAL_PIN(min_vel); +HAL_PIN(vel_boost); +HAL_PIN(max_vel); + +HAL_PIN(id); +HAL_PIN(iq); +HAL_PIN(ud); +HAL_PIN(uq); +HAL_PIN(ud1); +HAL_PIN(uq1); +HAL_PIN(ud2); +HAL_PIN(uq2); + + +//out +HAL_PIN(vel); +HAL_PIN(pos); + +HAL_PIN(ed); +HAL_PIN(eq); + +HAL_PIN(old_id); +HAL_PIN(old_iq); + +HAL_PIN(delta_id); +HAL_PIN(delta_iq); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct sensorless_ctx_t *ctx = (struct sensorless_ctx_t *)ctx_ptr; + struct sensorless_pin_ctx_t *pins = (struct sensorless_pin_ctx_t *)pin_ptr; + PIN(ki) = 1500.0; + PIN(kb) = 1; + PIN(kl) = 0.75; + PIN(min_vel) = 3.0 * 2.0 * M_PI; + PIN(vel_boost) = 0.2; + PIN(max_vel) = 500.0 * 2.0 * M_PI * 1.1; +} + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct sensorless_ctx_t *ctx = (struct sensorless_ctx_t *)ctx_ptr; + struct sensorless_pin_ctx_t *pins = (struct sensorless_pin_ctx_t *)pin_ptr; + + float l = MAX(PIN(l), 0.00001); + float r = MAX(PIN(r), 0.01); + + float ud = PIN(ud2); + float uq = PIN(uq2); + PIN(ud2) = PIN(ud1); + PIN(uq2) = PIN(uq1); + PIN(ud1) = PIN(ud); + PIN(uq1) = PIN(uq); + + float id = PIN(id); + float iq = PIN(iq); + + float kb = CLAMP(PIN(kb), 0, 1); + float ki = CLAMP(PIN(ki), 0, 1.0 / period); + float kl = CLAMP(PIN(kl), 0, 1); + + float vel = PIN(vel); + float pos = PIN(pos); + + // lowpass current change + PIN(delta_id) = PIN(delta_id) * kl + (id - PIN(old_id)) * (1 - kl); + PIN(delta_iq) = PIN(delta_iq) * kl + (iq - PIN(old_iq)) * (1 - kl); + + PIN(old_id) = id; + PIN(old_iq) = iq; + + // calc bemf + float ed = ud - r * id - PIN(delta_id) * l / period + vel * l * iq * kb; + float eq = uq - r * iq - PIN(delta_iq) * l / period - vel * l * id * kb; + + // velocity compensation, bemf_d -> 0 + vel -= SIGN2(eq, 1.0) * ed * ki * period; + + // startup boost + if(ABS(vel) < PIN(min_vel)){ + vel += SIGN2(id * iq, 0.1) * PIN(vel_boost); + } + + vel = LIMIT(vel, PIN(max_vel)); + + pos += vel * period; + + PIN(ed) = ed; + PIN(eq) = eq; + + PIN(vel) = vel; + PIN(pos) = mod(pos); +} + +hal_comp_t sensorless_comp_struct = { + .name = "sensorless", + .nrt = 0, + .rt = rt_func, + .frt = 0, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct sensorless_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; \ No newline at end of file diff --git a/shared/comps/sim.c b/shared/comps/sim.c index 544ef536..11a5d4f7 100644 --- a/shared/comps/sim.c +++ b/shared/comps/sim.c @@ -26,7 +26,7 @@ struct sim_ctx_t { float vel; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct sim_ctx_t * ctx = (struct sim_ctx_t *)ctx_ptr; struct sim_pin_ctx_t *pins = (struct sim_pin_ctx_t *)pin_ptr; @@ -35,7 +35,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(res) = 100000.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct sim_ctx_t *ctx = (struct sim_ctx_t *)ctx_ptr; struct sim_pin_ctx_t *pins = (struct sim_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/spid.c b/shared/comps/spid.c index a347d708..6fe5ebef 100644 --- a/shared/comps/spid.c +++ b/shared/comps/spid.c @@ -37,7 +37,7 @@ struct spid_ctx_t { float last_cmd; }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct spid_ctx_t *ctx = (struct spid_ctx_t *)ctx_ptr; struct spid_pin_ctx_t *pins = (struct spid_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/stp.c b/shared/comps/stp.c index 94ebfa3b..0b7e03be 100644 --- a/shared/comps/stp.c +++ b/shared/comps/stp.c @@ -24,7 +24,7 @@ HAL_PIN(dtg); HAL_PIN(ttg); HAL_PIN(at_target); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct stp_ctx_t *ctx = (struct stp_ctx_t *)ctx_ptr; struct stp_pin_ctx_t *pins = (struct stp_pin_ctx_t *)pin_ptr; PIN(target) = 0.0; @@ -34,7 +34,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(min_pos) = -10.0 * 2.0 * M_PI; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct stp_ctx_t *ctx = (struct stp_ctx_t *)ctx_ptr; struct stp_pin_ctx_t *pins = (struct stp_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/svm.c b/shared/comps/svm.c index 81994069..bb880f05 100644 --- a/shared/comps/svm.c +++ b/shared/comps/svm.c @@ -30,7 +30,7 @@ HAL_PIN(enu); HAL_PIN(env); HAL_PIN(enw); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct svm_ctx_t * ctx = (struct svm_ctx_t *)ctx_ptr; struct svm_pin_ctx_t *pins = (struct svm_pin_ctx_t *)pin_ptr; @@ -40,7 +40,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(enw) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct svm_ctx_t * ctx = (struct svm_ctx_t *)ctx_ptr; struct svm_pin_ctx_t *pins = (struct svm_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/term.c b/shared/comps/term.c index b8c01055..2794cff7 100644 --- a/shared/comps/term.c +++ b/shared/comps/term.c @@ -25,7 +25,7 @@ struct term_ctx_t { }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct term_ctx_t * ctx = (struct sim_ctx_t *)ctx_ptr; struct term_pin_ctx_t *pins = (struct term_pin_ctx_t *)pin_ptr; @@ -35,7 +35,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct term_ctx_t *ctx = (struct term_ctx_t *)ctx_ptr; struct term_pin_ctx_t *pins = (struct term_pin_ctx_t *)pin_ptr; @@ -50,7 +50,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct term_ctx_t *ctx = (struct term_ctx_t *)ctx_ptr; struct term_pin_ctx_t *pins = (struct term_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/uf.c b/shared/comps/uf.c index a2f8e193..fb92eb0e 100644 --- a/shared/comps/uf.c +++ b/shared/comps/uf.c @@ -15,7 +15,7 @@ HAL_PIN(ud); HAL_PIN(max_acc); HAL_PIN(min_acc); -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct uf_ctx_t * ctx = (struct uf_ctx_t *)ctx_ptr; struct uf_pin_ctx_t *pins = (struct uf_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/uf2.c b/shared/comps/uf2.c index 47ee3d4c..12805b9c 100644 --- a/shared/comps/uf2.c +++ b/shared/comps/uf2.c @@ -26,7 +26,7 @@ struct uf_ctx_t { float cur; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct uf_ctx_t *ctx = (struct uf_ctx_t *)ctx_ptr; struct uf_pin_ctx_t *pins = (struct uf_pin_ctx_t *)pin_ptr; @@ -37,7 +37,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->cur = 0.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct uf_ctx_t *ctx = (struct uf_ctx_t *)ctx_ptr; struct uf_pin_ctx_t *pins = (struct uf_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/uvw.c b/shared/comps/uvw.c index a4685415..53675c13 100644 --- a/shared/comps/uvw.c +++ b/shared/comps/uvw.c @@ -11,6 +11,11 @@ HAL_PIN(u); HAL_PIN(v); HAL_PIN(w); +HAL_PIN(amp); +HAL_PIN(timer); +HAL_PIN(en_time); +HAL_PIN(mode); // 0 = uvw, 1 = uvw line saving + HAL_PIN(led); HAL_PIN(p0); @@ -26,30 +31,31 @@ HAL_PIN(p7); HAL_PIN(pos); HAL_PIN(rpos); HAL_PIN(state); +HAL_PIN(error); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct uvw_ctx_t * ctx = (struct io_ctx_t *)ctx_ptr; struct uvw_pin_ctx_t *pins = (struct uvw_pin_ctx_t *)pin_ptr; - PIN(p0) = 0; //fault + PIN(p0) = -1; //fault PIN(p1) = 0; //u = 0 PIN(p2) = 2; //v = 2.094395 PIN(p3) = 1; //u + v = 1.047198 PIN(p4) = 4; //w = -2.094395 PIN(p5) = 5; //u + w = -1.047198 PIN(p6) = 3; //v + w = -3.141593 - PIN(p7) = 0; //fault - PIN(state) = 3.0; + PIN(p7) = -1; //fault + PIN(en_time) = 0.02; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct uvw_ctx_t * ctx = (struct uvw_ctx_t *)ctx_ptr; struct uvw_pin_ctx_t *pins = (struct uvw_pin_ctx_t *)pin_ptr; uint32_t rpos = (PIN(u) > 0.0) * 1.0 + (PIN(v) > 0.0) * 2.0 + (PIN(w) > 0.0) * 4.0; PIN(led) = (PIN(u) > 0.0) ^ (PIN(v) > 0.0) ^ (PIN(w) > 0.0); //TODO: make this const, fault output - uint32_t t[8]; + int32_t t[8]; t[0] = PIN(p0); t[1] = PIN(p1); t[2] = PIN(p2); @@ -59,7 +65,31 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ t[6] = PIN(p6); t[7] = PIN(p7); PIN(rpos) = rpos; - PIN(pos) = mod((float)t[rpos] / 6.0 * 2.0 * M_PI); + if(rpos < 0 | PIN(amp) < 0.5){ + PIN(error) = 1.0; + PIN(state) = 0.0; + PIN(timer) = 0.0; + } + else{ + switch((int) PIN(mode)){ + case 0: + PIN(state) = 3.0; + PIN(error) = 0.0; + PIN(pos) = mod((float)t[rpos] / 6.0 * 2.0 * M_PI); + break; + case 1: + if(PIN(timer) < PIN(en_time) / 2.0){ + PIN(pos) = mod((float)t[rpos] / 6.0 * 2.0 * M_PI); + } + if(PIN(timer) > PIN(en_time)){ + PIN(state) = 2.0; + PIN(error) = 0.0; + } + else{ + PIN(timer) += period; + } + } + } } hal_comp_t uvw_comp_struct = { diff --git a/shared/comps/vel.c b/shared/comps/vel.c index 504d8329..63adaf57 100644 --- a/shared/comps/vel.c +++ b/shared/comps/vel.c @@ -27,7 +27,7 @@ struct vel_ctx_t { float vel_sum; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct vel_ctx_t * ctx = (struct vel_ctx_t *)ctx_ptr; struct vel_pin_ctx_t *pins = (struct vel_pin_ctx_t *)pin_ptr; @@ -40,7 +40,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(en) = 1.0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct vel_ctx_t *ctx = (struct vel_ctx_t *)ctx_ptr; struct vel_pin_ctx_t *pins = (struct vel_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/vel_int.c b/shared/comps/vel_int.c index 1321c765..b895b49b 100644 --- a/shared/comps/vel_int.c +++ b/shared/comps/vel_int.c @@ -24,7 +24,7 @@ struct vel_int_ctx_t { float cmd_freq; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct vel_int_ctx_t *ctx = (struct vel_int_ctx_t *)ctx_ptr; struct vel_int_pin_ctx_t *pins = (struct vel_int_pin_ctx_t *)pin_ptr; @@ -43,7 +43,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->cmd_freq = PIN(cmd_freq); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct vel_int_ctx_t *ctx = (struct vel_int_ctx_t *)ctx_ptr; struct vel_int_pin_ctx_t *pins = (struct vel_int_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/velbuf.c b/shared/comps/velbuf.c index aa132758..a8896fe4 100644 --- a/shared/comps/velbuf.c +++ b/shared/comps/velbuf.c @@ -24,7 +24,7 @@ struct velbuf_ctx_t { float frt_period; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct velbuf_ctx_t *ctx = (struct velbuf_ctx_t *)ctx_ptr; struct velbuf_pin_ctx_t *pins = (struct velbuf_pin_ctx_t *)pin_ptr; @@ -38,7 +38,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct velbuf_ctx_t *ctx = (struct velbuf_ctx_t *)ctx_ptr; struct velbuf_pin_ctx_t *pins = (struct velbuf_pin_ctx_t *)pin_ptr; @@ -48,7 +48,7 @@ static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct velbuf_ctx_t *ctx = (struct velbuf_ctx_t *)ctx_ptr; struct velbuf_pin_ctx_t *pins = (struct velbuf_pin_ctx_t *)pin_ptr; @@ -68,13 +68,13 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ break; } } - - float diff_pos = minus(pos, old_pos); - PIN(diff_pos) = diff_pos; - PIN(diff_time) = diff_time; - PIN(vel) = diff_pos / diff_time; + + float diff_pos = minus(pos, old_pos); + PIN(diff_pos) = diff_pos; + PIN(diff_time) = diff_time; + PIN(vel) = diff_pos / diff_time; - PIN(vel_lp) = PIN(vel) * LP_HZ(PIN(lpf)) + PIN(vel_lp) * (1.0 - LP_HZ(PIN(lpf))); + PIN(vel_lp) = PIN(vel) * LP_HZ(PIN(lpf)) + PIN(vel_lp) * (1.0 - LP_HZ(PIN(lpf))); } hal_comp_t velbuf_comp_struct = { diff --git a/shared/comps/veltime.c b/shared/comps/veltime.c new file mode 100644 index 00000000..e4701867 --- /dev/null +++ b/shared/comps/veltime.c @@ -0,0 +1,62 @@ +#include "commands.h" +#include "hal.h" +#include "math.h" +#include "defines.h" +#include "angle.h" + +HAL_COMP(veltime); + +HAL_PIN(pos); +HAL_PIN(old_pos); +HAL_PIN(timer); +HAL_PIN(vel); +HAL_PIN(vel_lp); + +HAL_PIN(max_time); +HAL_PIN(lpf) + + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct veltime_ctx_t *ctx = (struct veltime_ctx_t *)ctx_ptr; + struct veltime_pin_ctx_t *pins = (struct veltime_pin_ctx_t *)pin_ptr; + + PIN(max_time) = 0.1; + + PIN(lpf) = 100.0; +} + + +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + // struct veltime_ctx_t *ctx = (struct veltime_ctx_t *)ctx_ptr; + struct veltime_pin_ctx_t *pins = (struct veltime_pin_ctx_t *)pin_ptr; + + PIN(timer) += period; + + if(PIN(pos) != PIN(old_pos)){ + PIN(vel) = minus(PIN(pos), PIN(old_pos)) / PIN(timer); + PIN(old_pos) = PIN(pos); + PIN(timer) = 0.0; + } + + if(PIN(timer) > PIN(max_time)){ + PIN(timer) = PIN(max_time); + PIN(vel) = 0.0; + } + + PIN(vel_lp) = PIN(vel) * LP_HZ(PIN(lpf)) + PIN(vel_lp) * (1.0 - LP_HZ(PIN(lpf))); + +} + +hal_comp_t veltime_comp_struct = { + .name = "veltime", + .nrt = 0, + .rt = 0, + .frt = frt_func, + .nrt_init = nrt_init, + .rt_start = 0, + .frt_start = 0, + .rt_stop = 0, + .frt_stop = 0, + .ctx_size = 0, + .pin_count = sizeof(struct veltime_pin_ctx_t) / sizeof(struct hal_pin_inst_t), +}; \ No newline at end of file diff --git a/shared/comps/veltopos.c b/shared/comps/veltopos.c index fc67fade..9b9af853 100644 --- a/shared/comps/veltopos.c +++ b/shared/comps/veltopos.c @@ -18,7 +18,7 @@ struct veltopos_ctx_t { float vel; }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct veltopos_ctx_t *ctx = (struct veltopos_ctx_t *)ctx_ptr; struct veltopos_pin_ctx_t *pins = (struct veltopos_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/wobl.c b/shared/comps/wobl.c index bd01631d..1a8b7e1c 100644 --- a/shared/comps/wobl.c +++ b/shared/comps/wobl.c @@ -22,7 +22,7 @@ struct wobl_ctx_t { float ang2; }; -static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct wobl_ctx_t *ctx = (struct wobl_ctx_t *)ctx_ptr; struct wobl_pin_ctx_t *pins = (struct wobl_pin_ctx_t *)pin_ptr; diff --git a/shared/comps/ypid.c b/shared/comps/ypid.c index b7cadd9c..50e048f5 100644 --- a/shared/comps/ypid.c +++ b/shared/comps/ypid.c @@ -59,7 +59,7 @@ struct ypid_ctx_t { float vel_error_sum; }; -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct ypid_ctx_t *ctx = (struct ypid_ctx_t *)ctx_ptr; struct ypid_pin_ctx_t *pins = (struct ypid_pin_ctx_t *)pin_ptr; diff --git a/shared/defines.h b/shared/defines.h index ad3ef33a..2a90c1c4 100644 --- a/shared/defines.h +++ b/shared/defines.h @@ -29,8 +29,8 @@ extern "C" { #define NO 0 #define YES 1 #define ABS(a) (((a) < 0.0) ? -(a) : (a)) -#define LIMIT(x, lowhigh) (((x) > (lowhigh)) ? (lowhigh) : (((x) < (-lowhigh)) ? (-lowhigh) : (x))) -#define SAT(x, lowhigh) (((x) > (lowhigh)) ? (1.0) : (((x) < (-lowhigh)) ? (-1.0) : (0.0))) +#define LIMIT(x, lowhigh) (((x) > (lowhigh)) ? (lowhigh) : (((x) < (-(lowhigh))) ? (-(lowhigh)) : (x))) +#define SAT(x, lowhigh) (((x) > (lowhigh)) ? (1.0) : (((x) < (-(lowhigh))) ? (-1.0) : (0.0))) #define SAT2(x, low, high) (((x) > (high)) ? (1.0) : (((x) < (low)) ? (-1.0) : (0.0))) #define STEP(from, to, step) (((from) < (to)) ? (MIN((from) + (step), (to))) : (MAX((from) - (step), (to)))) #define DEG(a) ((a)*M_PI / 180.0) @@ -43,6 +43,8 @@ extern "C" { #define MIN3(a, b, c) MIN(a, MIN(b, c)) #define MAX3(a, b, c) MAX(a, MAX(b, c)) +#define SIGN2(a, b) (CLAMP((a) / (b), -1, 1)) + #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #define FIELD_SIZEOF(t, f) (sizeof(((t *)0)->f)) diff --git a/shared/endat.c b/shared/endat.c new file mode 100644 index 00000000..cf8efd6e --- /dev/null +++ b/shared/endat.c @@ -0,0 +1,298 @@ +#include "endat.h" +#include "math.h" + +uint32_t endat_tx(endat_cmd_t cmd, uint8_t p1, uint16_t p2, uint8_t* buf, endat_data_t* data){ + uint32_t len = 0; + + buf[0] = flip8(cmd); + + buf[1] = flip8(p1); + + buf[2] = flip16(p2) & 0xff; + buf[3] = (flip16(p2) >> 8) & 0xff; + + data->current_cmd = cmd; + data->current_addr = p1; + data->current_value = p2; + + switch(cmd){ + case ENDAT_READ_POS: + len = 2 + 6; + break; + + case ENDAT_SELECT_MEM: + len = 2 + 6 + 8 + 16; + data->current_mem = p1; + break; + + case ENDAT_READ_ADDR: + len = 2 + 6 + 8 + 16; + break; + + case ENDAT_WRITE_ADDR: + + len = 2 + 6 + 8 + 16; + break; + + case ENDAT_RESET: + len = 2 + 6 + 8 + 16; + break; + + default: + len = 0; + } + + return(len); +} + +uint32_t endat_rx(uint8_t* buf, uint32_t max_len, endat_data_t* data){ + union{ + uint64_t data64; + uint32_t data32[2]; + uint16_t data16[4]; + uint8_t data8[8]; + }df; + + uint32_t len = 0; + + endat_cmd_t cmd = data->current_cmd; + data->current_cmd = 0; + + uint8_t addr = data->current_addr; + data->current_addr = 0; + + uint16_t value = data->current_value; + data->current_value = 0; + + switch(cmd){ + case ENDAT_READ_POS: + len = 1 + 1 + data->pos_bits + data->mpos_bits + 5; + break; + + case ENDAT_SELECT_MEM: + len = 1 + 8 + 16 + 5; + break; + + case ENDAT_READ_ADDR: + len = 1 + 8 + 16 + 5; + break; + + case ENDAT_WRITE_ADDR: + len = 1 + 8 + 16 + 5; + break; + + case ENDAT_RESET: + len = 1 + 8 + 16 + 5; + break; + + default: + return(0); + } + + if(max_len < len){ // too short + return(0); + } + + for(int i = 0; i < (len + 7) / 8; i++){ // local copy + df.data8[i] = buf[i]; + } + + uint8_t error_bit = 0; + uint64_t temp1 = 0; + uint64_t temp2 = 0; + uint8_t p1; + uint16_t p2; + + switch(cmd){ + case ENDAT_READ_POS: + error_bit = df.data8[0] & 0x10; + + df.data64 >>= 2; // remove start + error bit + temp1 = df.data64 & bitmask[data->pos_bits]; + df.data64 >>= data->pos_bits; // remove pos + temp2 = df.data64 & bitmask[data->mpos_bits]; + df.data64 >>= data->mpos_bits; // remove mutliturn pos + data->crc = df.data64 & bitmask[5]; + + //check crc + data->error_bit = 0; + if(error_bit){ + data->error_bit = 1; + //return(0); + } + data->pos = temp1; + data->mpos = temp2; + break; + + case ENDAT_SELECT_MEM: + p1 = (df.data16[0] >> 1) & 0xff; + data->crc = (df.data8[3] >> 1) & 0b11111; + p1 = flip8(p1); + + //check crc + if(data->current_mem != p1){ + data->current_mem = 0; + return(0); + } + break; + + case ENDAT_READ_ADDR: + p1 = (df.data16[0] >> 1) & 0xff; + p2 = (df.data32[0] >> (1 + 8)) & 0xffff; + data->crc = (df.data8[3] >> 1) & 0b11111; + p1 = flip8(p1); + p2 = flip16(p2); + + //check crc + if(addr != p1){ + return(0); + } + + switch(data->current_mem){ + case ENDAT_MEM_STATE: + switch(p1){ + case 0: // error register + // data->error = *((endat_state_error_t*) &p2); + data->error.reg = p2; + break; + + case 1: // warning register + // data->warning = *((endat_state_warning_t*) &p2); + data->warning.reg = p2; + break; + + default: + return(0); + } + break; + + case ENDAT_MEM_PARAM0: + switch(p1){ + case ENDAT_ADDR_POS_LEN: + data->pos_len = p2; + data->pos_bits = data->pos_len - data->mpos_bits; + break; + + case ENDAT_ADDR_TYPE: + data->fb_type = p2; + break; + + default: + return(0); + } + break; + + case ENDAT_MEM_PARAM1: + switch(p1){ + case ENDAT_ADDR_MULTITURN: + data->mpos_bits = log2f(p2) + 0.99; + data->pos_bits = data->pos_len - data->mpos_bits; + break; + + case ENDAT_ADDR_RES_LOW: + data->pos_res = (data->pos_res & 0xffff0000) | p2; + break; + + case ENDAT_ADDR_RES_HIGH: + data->pos_res = (data->pos_res & 0xffff) | (p2 << 16); + break; + + default: + return(0); + } + break; + + case ENDAT_MEM_PARAM2: + switch(p1){ + case ENDAT_ADDR_MAX_VEL: + data->max_vel = p2; + break; + + default: + return(0); + } + break; + + default: + return(0); + } + + break; + + case ENDAT_WRITE_ADDR: + p1 = (df.data16[0] >> 1) & 0xff; + p2 = (df.data32[0] >> (1 + 8)) & 0xffff; + data->crc = (df.data8[3] >> 1) & 0b11111; + p1 = flip8(p1); + p2 = flip16(p2); + + //check crc + if(addr != p1){ + return(0); + } + if(value != p2){ + return(0); + } + break; + + case ENDAT_RESET: + data->crc = (df.data8[3] >> 1) & 0b11111; + + //check crc + break; + } + + return(1); +} + +const uint64_t bitmask[] = { + 0b0, + 0b1, + 0b11, + 0b111, + 0b1111, + 0b11111, + 0b111111, + 0b1111111, + 0b11111111, + 0b111111111, + 0b1111111111, + 0b11111111111, + 0b111111111111, + 0b1111111111111, + 0b11111111111111, + 0b111111111111111, + 0b1111111111111111, + 0b11111111111111111, + 0b111111111111111111, + 0b1111111111111111111, + 0b11111111111111111111, + 0b111111111111111111111, + 0b1111111111111111111111, + 0b11111111111111111111111, + 0b111111111111111111111111, + 0b1111111111111111111111111, + 0b11111111111111111111111111, + 0b111111111111111111111111111, + 0b1111111111111111111111111111, + 0b11111111111111111111111111111, + 0b111111111111111111111111111111, + 0b1111111111111111111111111111111, + 0b11111111111111111111111111111111, + 0b111111111111111111111111111111111, + 0b1111111111111111111111111111111111, + 0b11111111111111111111111111111111111, + 0b111111111111111111111111111111111111, + 0b1111111111111111111111111111111111111, + 0b11111111111111111111111111111111111111, + 0b111111111111111111111111111111111111111, + 0b1111111111111111111111111111111111111111, + 0b11111111111111111111111111111111111111111, + 0b111111111111111111111111111111111111111111, + 0b1111111111111111111111111111111111111111111, + 0b11111111111111111111111111111111111111111111, + 0b111111111111111111111111111111111111111111111, + 0b1111111111111111111111111111111111111111111111, + 0b11111111111111111111111111111111111111111111111, + 0b111111111111111111111111111111111111111111111111, +}; \ No newline at end of file diff --git a/shared/endat.h b/shared/endat.h new file mode 100644 index 00000000..bd18fcb9 --- /dev/null +++ b/shared/endat.h @@ -0,0 +1,127 @@ +#include "stdint.h" + +#ifndef ENDAT_H +#define ENDAT_h + +typedef enum{ + ENDAT_READ_POS = 0b00000111, // 0b11100000,// 0b000111, + ENDAT_SELECT_MEM = 0b00001110, // 0b01110000,// 0b001110, + ENDAT_READ_ADDR = 0b00100011, // 0b11000100,// 0b100011, + ENDAT_WRITE_ADDR = 0b00011100, // 0b00111000,// 0b011100, + ENDAT_RESET = 0b00101010, // 0b01010100,// 0b101010, +} endat_cmd_t; + +typedef enum{ + ENDAT_MEM_STATE = 0b10111001, // 0b10011101,// 0b10111001, + ENDAT_MEM_PARAM0 = 0b10100001, // 0b10000101,// 0b10100001, + ENDAT_MEM_PARAM1 = 0b10100011, // 0b11000101,// 0b10100011, + ENDAT_MEM_PARAM2 = 0b10100101, // 0b10100101,// 0b10100101, + // ENDAT_MEM_PARAM_3 = 0b10100111, +} endat_mem_t; + +typedef enum{ + ENDAT_ADDR_ERROR = 0, + ENDAT_ADDR_WARNING = 1, + ENDAT_ADDR_POS_LEN = 13, + ENDAT_ADDR_TYPE = 14, + ENDAT_ADDR_MULTITURN = 1, + ENDAT_ADDR_RES_LOW = 4, + ENDAT_ADDR_RES_HIGH = 5, + ENDAT_ADDR_MAX_VEL = 0, +} endat_mem_addr_t; + +extern const uint64_t bitmask[]; + +typedef union{ + struct{ + uint16_t ilumination : 1; + uint16_t amplitude : 1; + uint16_t pos : 1; + uint16_t over_voltage : 1; + uint16_t under_voltage : 1; + uint16_t over_current : 1; + uint16_t battery : 1; + }; + uint16_t reg; +} endat_state_error_t; + +typedef union{ + struct{ + uint16_t freq : 1; + uint16_t temp : 1; + uint16_t ilumination : 1; + uint16_t battery : 1; + uint16_t ref : 1; + }; + uint16_t reg; +} endat_state_warning_t; + +typedef struct{ + uint64_t pos; + uint64_t mpos; + uint32_t pos_bits; + uint32_t pos_len; // param 13 + uint32_t mpos_bits; // param 17 + uint32_t fb_type; // param 14 + uint32_t pos_res; // param 20, 21 + uint32_t max_vel; // param 32 + uint32_t error_bit; // error bit + // state mem 0 + endat_state_error_t error; + // state mem 1 + endat_state_warning_t warning; + + endat_mem_t current_mem; + endat_cmd_t current_cmd; + uint8_t current_addr; + uint8_t crc; + uint16_t current_value; +} endat_data_t; + +uint32_t endat_tx(endat_cmd_t cmd, uint8_t p1, uint16_t p2, uint8_t* buf, endat_data_t* data); +uint32_t endat_rx(uint8_t* buf, uint32_t max_len, endat_data_t* data); + +inline uint8_t flip8(uint8_t d){ + uint8_t r = d & 1; + for(int i = 0; i < sizeof(r) * 8 - 1; i++){ + r <<= 1; + d >>= 1; + r |= d & 1; + } + + return(r); +} + +inline uint16_t flip16(uint16_t d){ + uint16_t r = d & 1; + for(int i = 0; i < sizeof(r) * 8 - 1; i++){ + r <<= 1; + d >>= 1; + r |= d & 1; + } + + return(r); +} + +inline uint32_t flip32(uint32_t d){ + uint32_t r = d & 1; + for(int i = 0; i < sizeof(r) * 8 - 1; i++){ + r <<= 1; + d >>= 1; + r |= d & 1; + } + + return(r); +} + +inline uint64_t flip64(uint64_t d){ + uint64_t r = d & 1; + for(int i = 0; i < sizeof(r) * 8 - 1; i++){ + r <<= 1; + d >>= 1; + r |= d & 1; + } + + return(r); +} +#endif \ No newline at end of file diff --git a/shared/hal.c b/shared/hal.c index fbc3fb13..9a43614a 100644 --- a/shared/hal.c +++ b/shared/hal.c @@ -37,7 +37,7 @@ hal_comp_t *comp_by_name(NAME name) { return (0); } -volatile hal_comp_inst_t *comp_inst_by_name(NAME name, uint32_t instance) { +hal_comp_inst_t *comp_inst_by_name(NAME name, uint32_t instance) { hal_comp_t *comp = comp_by_name(name); if(comp) { for(int i = 0; i < hal.comp_inst_count; i++) { @@ -63,8 +63,8 @@ pin_t *pin_by_name(NAME comp_name, NAME pin_name) { return (0); } -volatile hal_pin_inst_t *pin_inst_by_name(NAME comp_name, uint32_t instance, NAME pin_name) { - volatile hal_comp_inst_t *comp = comp_inst_by_name(comp_name, instance); +hal_pin_inst_t *pin_inst_by_name(NAME comp_name, uint32_t instance, NAME pin_name) { + hal_comp_inst_t *comp = comp_inst_by_name(comp_name, instance); if(comp) { for(int i = 0; i < comp->comp->pin_count; i++) { if(!strncmp(pin_name, comp->pins[i], sizeof(NAME))) { @@ -75,7 +75,7 @@ volatile hal_pin_inst_t *pin_inst_by_name(NAME comp_name, uint32_t instance, NAM return (0); } -pin_t *pin_by_pin_inst(volatile hal_pin_inst_t *p) { +pin_t *pin_by_pin_inst(hal_pin_inst_t *p) { for(int i = 0; i < hal.comp_inst_count; i++) { for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { if(&(hal.comp_insts[i].pin_insts[j]) == p) { @@ -86,7 +86,7 @@ pin_t *pin_by_pin_inst(volatile hal_pin_inst_t *p) { return (0); } -volatile hal_comp_inst_t *comp_inst_by_pin_inst(volatile hal_pin_inst_t *p) { +hal_comp_inst_t *comp_inst_by_pin_inst(hal_pin_inst_t *p) { for(int i = 0; i < hal.comp_inst_count; i++) { for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { if(&(hal.comp_insts[i].pin_insts[j]) == p) { @@ -554,7 +554,7 @@ void list(char *ptr) { printf("unknown\n"); } for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { - volatile hal_comp_inst_t *comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); + hal_comp_inst_t *comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); printf("- %s <= %s%lu.%s = %f\n", hal.comp_insts[i].pins[j], comp->comp->name, comp->instance, (char *)pin_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source), hal.comp_insts[i].pin_insts[j].source->source->value); } } @@ -564,7 +564,7 @@ COMMAND("list", list, "show comp instances"); void show_hal(char *ptr) { for(int i = 0; i < hal.comp_inst_count; i++) { for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { - volatile hal_comp_inst_t *comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); + hal_comp_inst_t *comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); printf("%s%lu.%s <= %s%lu.%s = %f\n", hal.comp_insts[i].comp->name, hal.comp_insts[i].instance, hal.comp_insts[i].pins[j], comp->comp->name, comp->instance, (char *)pin_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source), hal.comp_insts[i].pin_insts[j].source->source->value); } } @@ -736,14 +736,14 @@ void hal_init(float rt_period, float frt_period) { hal.nrt_max_ticks = 0.0; } -void hal_print_pin(volatile hal_pin_inst_t *p) { +void hal_print_pin(hal_pin_inst_t *p) { pin_t *pin = pin_by_pin_inst(p); - volatile hal_comp_inst_t *comp = comp_inst_by_pin_inst(p); + hal_comp_inst_t *comp = comp_inst_by_pin_inst(p); pin_t *pin2; - volatile hal_comp_inst_t *comp2; + hal_comp_inst_t *comp2; pin_t *pin3; - volatile hal_comp_inst_t *comp3; + hal_comp_inst_t *comp3; if(p && pin && comp) { if(p == p->source) { //if pin is not linked @@ -808,8 +808,8 @@ uint32_t hal_parse_(char *cmd) { int32_t sourcei = 0; char sourcep[64]; - volatile hal_pin_inst_t *sink; - volatile hal_pin_inst_t *source; + hal_pin_inst_t *sink; + hal_pin_inst_t *source; uint32_t found = 0; @@ -844,7 +844,7 @@ uint32_t hal_parse_(char *cmd) { for(int i = 0; i < hal.comp_inst_count; i++) { if(hal.comp_insts[i].instance == sinki && !strcmp(hal.comp_insts[i].comp->name, sinkc)) { for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { - //volatile hal_comp_inst_t * comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); + //hal_comp_inst_t * comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); //printf("%s%lu.%s <= %s%lu.%s = %f\n", hal.comp_insts[i].comp->name, hal.comp_insts[i].instance, hal.comp_insts[i].pins[j], comp->comp->name, comp->instance, (char *)pin_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source), hal.comp_insts[i].pin_insts[j].source->source->value); hal_print_pin(&(hal.comp_insts[i].pin_insts[j])); found = 1; @@ -895,7 +895,7 @@ uint32_t hal_parse_(char *cmd) { for(int i = 0; i < hal.comp_inst_count; i++) { if(hal.comp_insts[i].instance == sinki && !strcmp(hal.comp_insts[i].comp->name, sinkc)) { for(int j = 0; j < hal.comp_insts[i].comp->pin_count; j++) { - //volatile hal_comp_inst_t * comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); + //hal_comp_inst_t * comp = comp_inst_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source); if(!strncmp(hal.comp_insts[i].pins[j], sinkp, strlen(sinkp))) { hal_print_pin(&(hal.comp_insts[i].pin_insts[j])); //printf("%s%lu.%s <= %s%lu.%s = %f\n", hal.comp_insts[i].comp->name, hal.comp_insts[i].instance, hal.comp_insts[i].pins[j], comp->comp->name, comp->instance, (char *)pin_by_pin_inst(hal.comp_insts[i].pin_insts[j].source->source), hal.comp_insts[i].pin_insts[j].source->source->value); @@ -944,7 +944,7 @@ void hal_error(uint32_t error_handler) { void fault(char *ptr) { printf("trigger fault handler\n"); - volatile uint32_t *p = (uint32_t *)0x08010000; + uint32_t *p = (uint32_t *)0x08010000; p[0] = 1; } diff --git a/shared/hal.h b/shared/hal.h index ba84ae83..88e684f1 100644 --- a/shared/hal.h +++ b/shared/hal.h @@ -53,22 +53,22 @@ typedef char NAME[32]; typedef NAME const pin_t; typedef struct hal_pin_inst_t { - volatile float value; - volatile struct hal_pin_inst_t *source; + float value; + struct hal_pin_inst_t *source; } hal_pin_inst_t; typedef const struct { NAME name; - void (*nrt)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*rt)(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*frt)(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); + void (*nrt)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*rt)(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*frt)(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr); - void (*nrt_init)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*hw_init)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*rt_start)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*frt_start)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*rt_stop)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); - void (*frt_stop)(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr); + void (*nrt_init)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*hw_init)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*rt_start)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*frt_start)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*rt_stop)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); + void (*frt_stop)(void *ctx_ptr, hal_pin_inst_t *pin_ptr); uint32_t ctx_size; uint32_t pin_count; @@ -77,19 +77,19 @@ typedef const struct { typedef struct hal_comp_inst_t { hal_comp_t *comp; uint32_t instance; - volatile void *ctx; - volatile hal_pin_inst_t *pin_insts; + void *ctx; + hal_pin_inst_t *pin_insts; pin_t *pins; uint32_t ctx_size; - volatile int32_t rt_ticks; - volatile int32_t frt_ticks; - volatile int32_t nrt_ticks; + int32_t rt_ticks; + int32_t frt_ticks; + int32_t nrt_ticks; - volatile int32_t rt_max_ticks; - volatile int32_t frt_max_ticks; - volatile int32_t nrt_max_ticks; + int32_t rt_max_ticks; + int32_t frt_max_ticks; + int32_t nrt_max_ticks; - volatile enum { + enum { PRE_INIT, PRE_HW_INIT, STARTED, @@ -100,10 +100,10 @@ typedef struct hal_comp_inst_t { #define PINA(p, i) (pins->p[i].source->value) typedef struct { - volatile uint32_t active_rt_func; - volatile uint32_t active_frt_func; - volatile uint32_t active_nrt_func; - volatile enum { + uint32_t active_rt_func; + uint32_t active_frt_func; + uint32_t active_nrt_func; + enum { HardFault, NMI, MemManage, @@ -113,15 +113,15 @@ typedef struct { } hal_error_t; typedef struct { - volatile enum thread_state_t { + enum thread_state_t { RT_CALC, RT_SLEEP, RT_STOP } rt_state; - volatile enum thread_state_t frt_state; + enum thread_state_t frt_state; - volatile enum hal_state_t { + enum hal_state_t { FRT_TOO_LONG, RT_TOO_LONG, MISC_ERROR, @@ -132,36 +132,36 @@ typedef struct { HAL_OK2 } hal_state; - volatile struct hal_comp_inst_t *rt_comps[HAL_MAX_COMPS]; - volatile struct hal_comp_inst_t *frt_comps[HAL_MAX_COMPS]; + struct hal_comp_inst_t *rt_comps[HAL_MAX_COMPS]; + struct hal_comp_inst_t *frt_comps[HAL_MAX_COMPS]; - volatile int32_t active_rt_func; - volatile int32_t active_frt_func; - volatile int32_t active_nrt_func; + int32_t active_rt_func; + int32_t active_frt_func; + int32_t active_nrt_func; struct hal_comp_inst_t comp_insts[HAL_MAX_COMPS]; struct hal_pin_inst_t pin_insts[HAL_MAX_PINS]; - volatile uint8_t ctxs[HAL_MAX_CTX]; // create runtime ctx print in python based on COMP_ctx_t + uint8_t ctxs[HAL_MAX_CTX]; // create runtime ctx print in python based on COMP_ctx_t uint32_t comp_inst_count; uint32_t rt_comp_count; uint32_t frt_comp_count; uint32_t pin_inst_count; uint32_t ctx_count; - volatile uint32_t rt_ticks; - volatile uint32_t frt_ticks; - volatile uint32_t nrt_ticks; + uint32_t rt_ticks; + uint32_t frt_ticks; + uint32_t nrt_ticks; - volatile uint32_t rt_max_ticks; - volatile uint32_t frt_max_ticks; - volatile uint32_t nrt_max_ticks; + uint32_t rt_max_ticks; + uint32_t frt_max_ticks; + uint32_t nrt_max_ticks; - volatile float rt_period; - volatile float frt_period; + float rt_period; + float frt_period; hal_error_t error_info; - volatile enum { + enum { PRINT_ALL, PRINT_ERRORS, NO_PRINT, @@ -171,14 +171,14 @@ typedef struct { extern hal_t hal; hal_comp_t *comp_by_name(NAME name); -volatile hal_comp_inst_t *comp_inst_by_name(NAME name, uint32_t instance); +hal_comp_inst_t *comp_inst_by_name(NAME name, uint32_t instance); uint32_t pin_offset_by_comp_name(NAME name); pin_t *pin_by_name(NAME comp_name, NAME pin_name); -volatile hal_pin_inst_t *pin_inst_by_name(NAME comp_name, uint32_t instance, NAME pin_name); +hal_pin_inst_t *pin_inst_by_name(NAME comp_name, uint32_t instance, NAME pin_name); uint32_t load_comp(hal_comp_t *comp); -pin_t *pin_by_pin_inst(volatile hal_pin_inst_t *p); -volatile hal_comp_inst_t *comp_inst_by_pin_inst(volatile hal_pin_inst_t *p); -void hal_print_pin(volatile hal_pin_inst_t *p); +pin_t *pin_by_pin_inst(hal_pin_inst_t *p); +hal_comp_inst_t *comp_inst_by_pin_inst(hal_pin_inst_t *p); +void hal_print_pin(hal_pin_inst_t *p); void hal_init(float rt_period, float frt_period); // void hal_init_nrt(); diff --git a/src/comps/adc.c b/src/comps/adc.c index c2b7a251..584d56ff 100644 --- a/src/comps/adc.c +++ b/src/comps/adc.c @@ -48,7 +48,7 @@ struct adc_ctx_t { volatile uint32_t send; //send buffer state 0=filling, 1=sending }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct adc_ctx_t *ctx = (struct adc_ctx_t *)ctx_ptr; struct adc_pin_ctx_t *pins = (struct adc_pin_ctx_t *)pin_ptr; PINA(gain, 0) = 150; @@ -63,7 +63,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->send = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct adc_ctx_t *ctx = (struct adc_ctx_t *)ctx_ptr; struct adc_pin_ctx_t *pins = (struct adc_pin_ctx_t *)pin_ptr; @@ -177,7 +177,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct adc_ctx_t *ctx = (struct adc_ctx_t *)ctx_ptr; struct adc_pin_ctx_t *pins = (struct adc_pin_ctx_t *)pin_ptr; diff --git a/src/comps/enc_cmd.c b/src/comps/enc_cmd.c index a0abf93b..20c81266 100644 --- a/src/comps/enc_cmd.c +++ b/src/comps/enc_cmd.c @@ -24,7 +24,7 @@ struct enc_cmd_ctx_t { TIM_TypeDef *tim; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_cmd_ctx_t *ctx = (struct enc_cmd_ctx_t *)ctx_ptr; struct enc_cmd_pin_ctx_t *pins = (struct enc_cmd_pin_ctx_t *)pin_ptr; ctx->e_res = 0; @@ -32,7 +32,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(input_filter) = 3; } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_cmd_ctx_t *ctx = (struct enc_cmd_ctx_t *)ctx_ptr; struct enc_cmd_pin_ctx_t *pins = (struct enc_cmd_pin_ctx_t *)pin_ptr; @@ -160,7 +160,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { TIM_Cmd(ctx->tim, ENABLE); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_cmd_ctx_t *ctx = (struct enc_cmd_ctx_t *)ctx_ptr; struct enc_cmd_pin_ctx_t *pins = (struct enc_cmd_pin_ctx_t *)pin_ptr; diff --git a/src/comps/enc_fb.c b/src/comps/enc_fb.c index a5789ec8..37fee408 100644 --- a/src/comps/enc_fb.c +++ b/src/comps/enc_fb.c @@ -27,6 +27,7 @@ HAL_PIN(error); HAL_PIN(amp); HAL_PIN(vel); HAL_PIN(ccr3); +HAL_PIN(en_index); HAL_PIN(indexprint); @@ -38,7 +39,7 @@ struct enc_fb_ctx_t { int indexpos = 0; int indexprint = 0; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_fb_ctx_t *ctx = (struct enc_fb_ctx_t *)ctx_ptr; struct enc_fb_pin_ctx_t *pins = (struct enc_fb_pin_ctx_t *)pin_ptr; ctx->e_res = 0; @@ -47,7 +48,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(ires) = 1024.0; } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_fb_ctx_t *ctx = (struct enc_fb_ctx_t *)ctx_ptr; struct enc_fb_pin_ctx_t *pins = (struct enc_fb_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStructure; @@ -98,7 +99,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -// static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +// static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct enc_fb_ctx_t *ctx = (struct enc_fb_ctx_t *)ctx_ptr; // struct enc_fb_pin_ctx_t *pins = (struct enc_fb_pin_ctx_t *)pin_ptr; @@ -115,7 +116,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { // PIN(abs_pos) = mod(p + ctx->absoffset); // } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct enc_fb_ctx_t *ctx = (struct enc_fb_ctx_t *)ctx_ptr; struct enc_fb_pin_ctx_t *pins = (struct enc_fb_pin_ctx_t *)pin_ptr; @@ -186,7 +187,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ p = mod(tim * 2.0f * M_PI / (float)ctx->e_res); PIN(pos) = p; - if(FB0_ENC_TIM->SR & TIM_SR_CC3IF) { + if(PIN(en_index) > 0.0 & FB0_ENC_TIM->SR & TIM_SR_CC3IF) { int cc = FB0_ENC_TIM->CCR3; PIN(state) = 3.0; ctx->absoffset = mod(cc * 2.0f * M_PI / (float)ctx->e_res); @@ -213,7 +214,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct enc_fb_ctx_t *ctx = (struct enc_fb_ctx_t *)ctx_ptr; // struct enc_fb_pin_ctx_t *pins = (struct enc_fb_pin_ctx_t *)pin_ptr; if(indexprint == 1) { diff --git a/src/comps/encf.c b/src/comps/encf.c index 2755eceb..06374e1c 100644 --- a/src/comps/encf.c +++ b/src/comps/encf.c @@ -95,7 +95,7 @@ uint8_t print_buf[10]; int32_t pos_offset; uint32_t state_counter; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct encf_ctx_t *ctx = (struct encf_ctx_t *)ctx_ptr; struct encf_pin_ctx_t *pins = (struct encf_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStruct; @@ -177,7 +177,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { state_counter = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct encf_ctx_t *ctx = (struct encf_ctx_t *)ctx_ptr; struct encf_pin_ctx_t *pins = (struct encf_pin_ctx_t *)pin_ptr; @@ -282,7 +282,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ DMA_Cmd(DMA1_Stream0, ENABLE); } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct encf_ctx_t *ctx = (struct encf_ctx_t *)ctx_ptr; struct encf_pin_ctx_t *pins = (struct encf_pin_ctx_t *)pin_ptr; diff --git a/src/comps/encm.c b/src/comps/encm.c index a3ad4fb5..a8402150 100644 --- a/src/comps/encm.c +++ b/src/comps/encm.c @@ -18,7 +18,7 @@ struct encm_ctx_t { uint8_t rxbuf[15]; }; -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct encm_ctx_t *ctx = (struct encm_ctx_t *)ctx_ptr; // struct encm_pin_ctx_t * pins = (struct encm_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStruct; @@ -86,7 +86,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { USART_DMACmd(USART6, USART_DMAReq_Rx, ENABLE); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct encm_ctx_t *ctx = (struct encm_ctx_t *)ctx_ptr; struct encm_pin_ctx_t *pins = (struct encm_pin_ctx_t *)pin_ptr; PIN(dma) = DMA_GetCurrDataCounter(DMA2_Stream1); diff --git a/src/comps/encs.c b/src/comps/encs.c index 2848c921..22e11b2f 100644 --- a/src/comps/encs.c +++ b/src/comps/encs.c @@ -76,7 +76,7 @@ typedef union { sanyo_t data; -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct encs_ctx_t *ctx = (struct encs_ctx_t *)ctx_ptr; // struct encs_pin_ctx_t *pins = (struct encs_pin_ctx_t *)pin_ptr; @@ -200,7 +200,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { TIM_Cmd(TIM8, ENABLE); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct encs_ctx_t *ctx = (struct encs_ctx_t *)ctx_ptr; struct encs_pin_ctx_t *pins = (struct encs_pin_ctx_t *)pin_ptr; diff --git a/src/comps/endat.c b/src/comps/endat.c index 69552760..2b268d47 100644 --- a/src/comps/endat.c +++ b/src/comps/endat.c @@ -6,12 +6,40 @@ #include "stm32f4xx_conf.h" #include "hw/hw.h" #include +#include HAL_COMP(endat); -HAL_PINA(byte, 6); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { + +HAL_PIN(pos); +HAL_PIN(mpos); + +HAL_PIN(f1); +HAL_PIN(crc); +HAL_PIN(shift); +HAL_PIN(timer); +HAL_PIN(swap); +HAL_PIN(skip); +HAL_PIN(bytes); + +HAL_PIN(error); +HAL_PIN(state); + +HAL_PIN(endat_error); +HAL_PIN(endat_warning); +HAL_PIN(endat_state); +HAL_PIN(pos_len); +HAL_PIN(mpos_len); +HAL_PIN(pos_res); +HAL_PIN(type); +HAL_PIN(max_vel); + +HAL_PIN(req); + +HAL_PIN(print_time); + +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct endat_ctx_t *ctx = (struct endat_ctx_t *)ctx_ptr; struct endat_pin_ctx_t *pins = (struct endat_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStruct; @@ -57,34 +85,357 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { GPIO_SetBits(GPIOD, GPIO_Pin_10); //clock tx enable + // DMA_InitTypeDef dma_rx_config; + // dma_rx_config.DMA_Channel = DMA_Channel_0; + // dma_rx_config.DMA_PeripheralBaseAddr = (uint32_t)&FB0_SPI->DR; + // dma_rx_config.DMA_Memory0BaseAddr = (uint32_t)&tim_data; + // dma_rx_config.DMA_DIR = DMA_DIR_PeripheralToMemory; + // dma_rx_config.DMA_BufferSize = ARRAY_SIZE(tim_data); + // dma_rx_config.DMA_PeripheralInc = DMA_PeripheralInc_Disable; + // dma_rx_config.DMA_MemoryInc = DMA_MemoryInc_Enable; + // dma_rx_config.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; + // dma_rx_config.DMA_MemoryDataSize = DMA_PeripheralDataSize_HalfWord; + // dma_rx_config.DMA_Mode = DMA_Mode_Normal; + // dma_rx_config.DMA_Priority = DMA_Priority_VeryHigh; + // dma_rx_config.DMA_FIFOMode = DMA_FIFOMode_Disable; + // dma_rx_config.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; + // dma_rx_config.DMA_MemoryBurst = DMA_MemoryBurst_Single; + // dma_rx_config.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; + + // DMA_Cmd(DMA1_Stream2, DISABLE); + // DMA_DeInit(DMA1_Stream2); + // DMA_Init(DMA1_Stream2, &dma_rx_config); + + PIN(pos_len) = 18; // 17 + PIN(mpos_len) = 12; // 15 + PIN(endat_state) = 13; + PIN(swap) = 1; + PIN(skip) = 10; + PIN(bytes) = 7; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { - // struct endat_ctx_t *ctx = (struct endat_ctx_t *)ctx_ptr; +union{ + uint64_t data; + uint8_t dataa[8]; +} df, df1, df2; + +endat_cmd_t req; + +struct endat_ctx_t { + endat_data_t data; +}; + +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct endat_ctx_t *ctx = (struct endat_ctx_t *)ctx_ptr; struct endat_pin_ctx_t *pins = (struct endat_pin_ctx_t *)pin_ptr; + req = 0; + uint8_t addr = 0; + + ctx->data.pos_bits = PIN(pos_len); + ctx->data.mpos_bits = PIN(mpos_len); + + switch((int)PIN(endat_state)){ + case 0: // reset error + req = ENDAT_RESET; + break; + + case 1: // select mem state + req = ENDAT_SELECT_MEM; + addr = ENDAT_MEM_STATE; + break; + + case 2: // read error + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_ERROR; + break; + + case 3: // read warning + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_WARNING; + break; + + case 4: // select mem 0 + req = ENDAT_SELECT_MEM; + addr = ENDAT_MEM_PARAM0; + break; + + case 5: // read len + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_POS_LEN; + break; + + case 6: // read type + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_TYPE; + break; + + case 7: // select mem 1 + req = ENDAT_SELECT_MEM; + addr = ENDAT_MEM_PARAM1; + break; + + case 8: // read multi + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_MULTITURN; + break; + + case 9: // read res low + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_RES_LOW; + break; + + case 10: // read res high + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_RES_HIGH; + break; + + case 11: // select mem 2 + req = ENDAT_SELECT_MEM; + addr = ENDAT_MEM_PARAM2; + break; + + case 12: // read max vel + req = ENDAT_READ_ADDR; + addr = ENDAT_ADDR_MAX_VEL; + break; + + case 13: // read pos + req = ENDAT_READ_POS; + break; + } + + if(PIN(req) > 0){ + req = PIN(req); + } + + SPI3->CR1 &= ~SPI_CR1_SPE;//disable spi + SPI3->CR1 = SPI_CR1_LSBFIRST | SPI_CR1_MSTR | SPI_CR1_CPOL | SPI_CR1_CPHA | SPI_CR1_SSI | SPI_CR1_SSM | SPI_CR1_BIDIMODE | SPI_BaudRatePrescaler_32; + + uint32_t bits = endat_tx(req, addr, 0, df.dataa, &(ctx->data)); + df2.data = df.data; + GPIO_SetBits(GPIOD, GPIO_Pin_15);//tx enable SPI3->CR1 |= SPI_CR1_BIDIOE;//enable output SPI3->CR1 |= SPI_CR1_SPE;//enable spi - SPI3->DR = 0x07; - while(!(SPI3->SR & SPI_SR_TXE)); - while(SPI3->SR & SPI_SR_BSY); + for(int i = 0; i < (bits + 7) / 8; i++){ + SPI3->DR = df.dataa[i]; + while(!(SPI3->SR & SPI_SR_TXE)); + while(SPI3->SR & SPI_SR_BSY); + } + SPI3->CR1 &= ~SPI_CR1_BIDIOE;//disable output, this activates the clock GPIO_ResetBits(GPIOD, GPIO_Pin_15);//tx disable - - volatile uint32_t foo = SPI3->DR;//dummy read to clear flags - for(int i = 0;i<6;i++){ - while(!(SPI3->SR & SPI_SR_RXNE)); - PINA(byte,i) = SPI3->DR; + + SPI3->CR1 &= ~SPI_CR1_SPE;//disable spi + if(PIN(swap) > 0.0){ + SPI3->CR1 = SPI_CR1_LSBFIRST | SPI_CR1_MSTR | SPI_CR1_CPOL | SPI_CR1_SSI | SPI_CR1_SSM | SPI_CR1_BIDIMODE | SPI_BaudRatePrescaler_32; } + else{ + SPI3->CR1 = SPI_CR1_LSBFIRST | SPI_CR1_MSTR | SPI_CR1_SSI | SPI_CR1_SSM | SPI_CR1_BIDIMODE | SPI_BaudRatePrescaler_32; + } + SPI3->CR1 |= SPI_CR1_SPE;//enable spi + + df.data = 0; + for(int i = 0; i < MIN(sizeof(df.data), PIN(bytes)); i++){ + while(!(SPI3->SR & SPI_SR_RXNE)); + df.dataa[i] = SPI3->DR; + } + + df1.data = df.data >> (int)PIN(skip); + PIN(shift) = PIN(skip); + while((df1.data & 1) == 0 && PIN(shift) < 32.0){ + df1.data = df1.data >> 1; + PIN(shift)++; + } + + uint32_t ret = endat_rx(df1.dataa, MIN(sizeof(df1.data), PIN(bytes)) * 8, &(ctx->data)); + + switch((int) PIN(endat_state)){ + case 12: + if(ctx->data.error_bit){ + PIN(endat_state) = 0; + PIN(error) = 1; + PIN(state) = 0; + } + else{ + PIN(state) = 1; + PIN(error) = 0; + } + + if(ret == 0){ + PIN(endat_state) = 0; + PIN(error) = 1; + PIN(state) = 0; + } + break; + + default: + PIN(state) = 0; + if(ret == 0){ + PIN(endat_state) = 0; + } + else{ + PIN(endat_state)++; + } + } + + PIN(mpos) = ctx->data.mpos; + PIN(f1) = ctx->data.error_bit; + PIN(crc) = ctx->data.crc; + PIN(pos_len) = ctx->data.pos_bits; + PIN(mpos_len) = ctx->data.mpos_bits; + PIN(pos_res) = ctx->data.pos_res; + PIN(type) = ctx->data.fb_type; + PIN(endat_error) = ctx->data.error.reg; + PIN(endat_warning) = ctx->data.warning.reg; + PIN(max_vel) = ctx->data.max_vel; + + if(ctx->data.pos_bits){ + PIN(pos) = mod(ctx->data.pos * 2.0 * M_PI / (1 << ctx->data.pos_bits)); + } + //TODO: wait for busy flag? SPI3->CR1 &= ~SPI_CR1_SPE;//disable spi + + if(PIN(print_time) > 0.0){ + PIN(timer) += period; + } +} + +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { + struct endat_ctx_t *ctx = (struct endat_ctx_t *)ctx_ptr; + struct endat_pin_ctx_t *pins = (struct endat_pin_ctx_t *)pin_ptr; + + if(PIN(timer) > PIN(print_time)) { + PIN(timer) = 0.0; + + uint64_t data = df.data; + uint64_t reqdata = df2.data; + uint64_t pos1 = ctx->data.pos; + uint64_t pos2 = ctx->data.mpos; + uint64_t crc = ctx->data.crc; + uint32_t shift = PIN(shift); + + printf("req: "); + switch(req){ + case ENDAT_SELECT_MEM: + printf("ENDAT_SELECT_MEM\n"); + break; + + case ENDAT_READ_ADDR: + printf("ENDAT_READ_ADDR\n"); + break; + + case ENDAT_WRITE_ADDR: + printf("ENDAT_WRITE_ADDR\n"); + break; + + case ENDAT_READ_POS: + printf("ENDAT_READ_POS\n"); + break; + + default: + printf("unkonwn req\n"); + } + + printf("req data: "); + for(int i = 0; i < 64; i++){ + if(reqdata & 1){ + printf("1"); + } + else{ + printf("0"); + } + reqdata >>= 1; + if(i == 8 - 1){ + printf("-"); + } + if(i == 8 + 8 - 1){ + printf("-"); + } + if(i == 8 + 8 + 16 - 1){ + printf("-"); + } + if(i == 8 + 8 + 16 + 5 - 1){ + printf("-"); + } + } + printf("\n"); + + printf("data: "); + for(int i = 0; i < 32; i++){ + if(data & 1){ + printf("1"); + } + else{ + printf("0"); + } + data >>= 1; + if(i == shift - 1){ + printf("-"); + } + if(i == shift + 2 - 1){ + printf("-"); + } + if(i == shift + 2 + ctx->data.pos_bits - 1){ + printf("-"); + } + if(i == shift + 2 + ctx->data.pos_bits + ctx->data.mpos_bits - 1){ + printf("-"); + } + } + printf("\n"); + printf("pos1: "); + for(int i = 0; i < 64; i++){ + if(pos1 & 1){ + printf("1"); + } + else{ + printf("0"); + } + pos1 >>= 1; + if(i == ctx->data.pos_bits - 1){ + printf("-"); + } + } + printf("\n"); + printf("pos2: "); + for(int i = 0; i < 64; i++){ + if(pos2 & 1){ + printf("1"); + } + else{ + printf("0"); + } + pos2 >>= 1; + if(i == ctx->data.mpos_bits - 1){ + printf("-"); + } + } + printf("\n"); + + printf("crc: "); + for(int i = 0; i < 64; i++){ + if(crc & 1){ + printf("1"); + } + else{ + printf("0"); + } + crc >>= 1; + if(i == 5 - 1){ + printf("-"); + } + } + printf("\n\n"); + } } hal_comp_t endat_comp_struct = { .name = "endat", - .nrt = 0, + .nrt = nrt_func, .rt = rt_func, .frt = 0, .nrt_init = nrt_init, @@ -92,6 +443,6 @@ hal_comp_t endat_comp_struct = { .frt_start = 0, .rt_stop = 0, .frt_stop = 0, - .ctx_size = 0, + .ctx_size = sizeof(struct endat_ctx_t), .pin_count = sizeof(struct endat_pin_ctx_t) / sizeof(struct hal_pin_inst_t), }; diff --git a/src/comps/hv.c b/src/comps/hv.c index 51e79ac4..4474cee5 100644 --- a/src/comps/hv.c +++ b/src/comps/hv.c @@ -34,9 +34,13 @@ HAL_PIN(dac); // process data to LS HAL_PIN(dc_volt); -HAL_PIN(d_fb); -HAL_PIN(q_fb); +HAL_PIN(id_fb); +HAL_PIN(iq_fb); +HAL_PIN(ud_fb); +HAL_PIN(uq_fb); HAL_PIN(abs_cur); +HAL_PIN(abs_volt); +HAL_PIN(duty); // state data to LS HAL_PIN(hv_temp); @@ -107,7 +111,7 @@ void hv_send(char *ptr) { } COMMAND("hv", hv_send, "send command to hv board"); -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; @@ -208,12 +212,12 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(ignore_fault_pin) = 1; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; ctx->frt_slot = 0; } -static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; ctx->frt_slot++; @@ -249,10 +253,16 @@ static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst case SLAVE_IN_APP: if(ctx->from_hv.packet_from_hv.header.slave_addr == 0 && ctx->from_hv.packet_from_hv.header.len == (sizeof(packet_from_hv_t) - sizeof(stmbl_talk_header_t)) / 4) { // from f3 app - PIN(d_fb) = ctx->from_hv.packet_from_hv.d_fb; - PIN(q_fb) = ctx->from_hv.packet_from_hv.q_fb; + PIN(id_fb) = ctx->from_hv.packet_from_hv.id_fb; + PIN(iq_fb) = ctx->from_hv.packet_from_hv.iq_fb; + PIN(ud_fb) = ctx->from_hv.packet_from_hv.ud_fb; + PIN(uq_fb) = ctx->from_hv.packet_from_hv.uq_fb; PIN(fault) = ctx->from_hv.packet_from_hv.fault; - PIN(abs_cur) = sqrtf(PIN(d_fb) * PIN(d_fb) + PIN(q_fb) * PIN(q_fb)); + PIN(abs_cur) = sqrtf(PIN(id_fb) * PIN(id_fb) + PIN(iq_fb) * PIN(iq_fb)); + PIN(abs_volt) = sqrtf(PIN(ud_fb) * PIN(ud_fb) + PIN(uq_fb) * PIN(uq_fb)); + if(PIN(pwm_volt) > 0.0){ + PIN(duty) = PIN(abs_volt) / PIN(pwm_volt); + } uint16_t a = ctx->from_hv.packet_from_hv.header.conf_addr; a = CLAMP(a, 0, sizeof(f3_state_data_t) / 4); @@ -524,7 +534,7 @@ void send_boot(char *ptr) { } COMMAND("hv_update", send_boot, "try hv update"); -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; // struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; char c; diff --git a/src/comps/hvf1.c b/src/comps/hvf1.c index 910273b1..8143c687 100644 --- a/src/comps/hvf1.c +++ b/src/comps/hvf1.c @@ -36,7 +36,7 @@ struct hv_ctx_t { volatile packet_from_hv_t packet_from_hv; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; // struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; @@ -129,7 +129,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->packet_from_hv.head.key = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; diff --git a/src/comps/hw/io3.c b/src/comps/hw/io3.c index f7637502..9cc55c7c 100644 --- a/src/comps/hw/io3.c +++ b/src/comps/hw/io3.c @@ -15,7 +15,7 @@ HAL_PIN(state); HAL_PIN(fault); HAL_PIN(brake); -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct io_ctx_t * ctx = (struct io_ctx_t *)ctx_ptr; // struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; @@ -63,7 +63,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { TIM_CtrlPWMOutputs(TIM8, ENABLE); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct io_ctx_t * ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; if(PIN(fan) > 0) diff --git a/src/comps/hw/io4.c b/src/comps/hw/io4.c index c039a07c..1831018a 100644 --- a/src/comps/hw/io4.c +++ b/src/comps/hw/io4.c @@ -76,7 +76,7 @@ HAL_PIN(fb1z); HAL_PIN(fbsd); //fb shutdown -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; PIN(th0) = 12.0; PIN(th1) = 12.0; @@ -85,7 +85,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(out_freq) = 15000; } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct io_ctx_t * ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; @@ -253,7 +253,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { #define ARES 4096.0 #define AREF 3.3 -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct io_ctx_t * ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; uint32_t red = 0; diff --git a/src/comps/hx711.c b/src/comps/hx711.c index fc8d858f..efd302e9 100644 --- a/src/comps/hx711.c +++ b/src/comps/hx711.c @@ -43,7 +43,7 @@ static void nopsleep(uint32_t t){ } } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { //struct hx_ctx_t *ctx = (struct hx_ctx_t *)ctx_ptr; struct hx_pin_ctx_t * pins = (struct hx_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStruct; @@ -70,7 +70,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { //TODO: plausibility, saturation, channel/gain config, 2 chips -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { //struct hx_ctx_t *ctx = (struct hx_ctx_t *)ctx_ptr; struct hx_pin_ctx_t *pins = (struct hx_pin_ctx_t *)pin_ptr; uint32_t value = 0; diff --git a/src/comps/o_fb.c b/src/comps/o_fb.c index 1bbb82d4..1744dad9 100644 --- a/src/comps/o_fb.c +++ b/src/comps/o_fb.c @@ -11,7 +11,7 @@ HAL_COMP(o_fb); HAL_PIN(a); HAL_PIN(b); -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct o_fb_ctx_t * ctx = (struct o_fb_ctx_t *)ctx_ptr; // struct o_fb_pin_ctx_t * pins = (struct o_fb_pin_ctx_t *)pin_ptr; @@ -38,7 +38,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct o_fb_ctx_t * ctx = (struct o_fb_ctx_t *)ctx_ptr; struct o_fb_pin_ctx_t *pins = (struct o_fb_pin_ctx_t *)pin_ptr; diff --git a/src/comps/res.c b/src/comps/res.c index 65f211c8..94690ce3 100644 --- a/src/comps/res.c +++ b/src/comps/res.c @@ -33,7 +33,7 @@ struct res_ctx_t { int abspos; // multiturn position }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct res_ctx_t *ctx = (struct res_ctx_t *)ctx_ptr; struct res_pin_ctx_t *pins = (struct res_pin_ctx_t *)pin_ptr; PIN(poles) = 1.0; @@ -41,7 +41,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(min_amp) = 0.15; PIN(freq) = 10000; } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct res_ctx_t *ctx = (struct res_ctx_t *)ctx_ptr; // struct res_pin_ctx_t *pins = (struct res_pin_ctx_t *)pin_ptr; @@ -113,7 +113,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { GPIO_SetBits(FB0_Z_TXEN_PORT, FB0_Z_TXEN_PIN); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct res_ctx_t *ctx = (struct res_ctx_t *)ctx_ptr; struct res_pin_ctx_t *pins = (struct res_pin_ctx_t *)pin_ptr; //TODO: arr can change! diff --git a/src/comps/smartabs.c b/src/comps/smartabs.c index 8793d60a..67791bb2 100644 --- a/src/comps/smartabs.c +++ b/src/comps/smartabs.c @@ -25,7 +25,7 @@ struct smartabs_ctx_t { uint8_t rxbuf[15]; }; -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct smartabs_ctx_t *ctx = (struct smartabs_ctx_t *)ctx_ptr; // struct smartabs_pin_ctx_t * pins = (struct smartabs_pin_ctx_t *)pin_ptr; GPIO_InitTypeDef GPIO_InitStruct; @@ -93,7 +93,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { USART_DMACmd(USART6, USART_DMAReq_Rx, ENABLE); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct smartabs_ctx_t *ctx = (struct smartabs_ctx_t *)ctx_ptr; struct smartabs_pin_ctx_t *pins = (struct smartabs_pin_ctx_t *)pin_ptr; PIN(dma) = DMA_GetCurrDataCounter(DMA2_Stream1); diff --git a/src/comps/sserial.c b/src/comps/sserial.c index 102b3651..bd597e0a 100644 --- a/src/comps/sserial.c +++ b/src/comps/sserial.c @@ -217,7 +217,7 @@ static void send(uint8_t len, uint8_t docrc) { //TODO: lbp command 0xe6 to set mode -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct sserial_ctx_t * ctx = (struct sserial_ctx_t *)ctx_ptr; struct sserial_pin_ctx_t *pins = (struct sserial_pin_ctx_t *)pin_ptr; @@ -330,7 +330,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { } -static void frt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void frt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct sserial_pin_ctx_t *pins = (struct sserial_pin_ctx_t *)pin_ptr; //next received packet will be written to bufferpos uint32_t bufferpos = sizeof(rxbuf) - DMA_GetCurrDataCounter(DMA2_Stream5); diff --git a/src/comps/yaskawa.c b/src/comps/yaskawa.c index fda0b791..aa092791 100644 --- a/src/comps/yaskawa.c +++ b/src/comps/yaskawa.c @@ -44,7 +44,7 @@ DMA_InitTypeDef DMA_InitStructurerx; uint8_t yaskawa_reply[14]; //uint8_t yaskara_reply_len; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct yaskawa_ctx_t *ctx = (struct yaskawa_ctx_t *)ctx_ptr; struct yaskawa_pin_ctx_t *pins = (struct yaskawa_pin_ctx_t *)pin_ptr; @@ -55,7 +55,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(len5) = 59; } -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct yaskawa_ctx_t *ctx = (struct yaskawa_ctx_t *)ctx_ptr; // struct yaskawa_pin_ctx_t *pins = (struct yaskawa_pin_ctx_t *)pin_ptr; @@ -179,7 +179,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { dfdf = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct yaskawa_ctx_t *ctx = (struct yaskawa_ctx_t *)ctx_ptr; struct yaskawa_pin_ctx_t *pins = (struct yaskawa_pin_ctx_t *)pin_ptr; @@ -339,7 +339,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ } } -static void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct yaskawa_ctx_t *ctx = (struct yaskawa_ctx_t *)ctx_ptr; struct yaskawa_pin_ctx_t *pins = (struct yaskawa_pin_ctx_t *)pin_ptr; if(RISING_EDGE(PIN(dump))) { diff --git a/stm32f303/Makefile b/stm32f303/Makefile index 623f05a2..9c884abe 100644 --- a/stm32f303/Makefile +++ b/stm32f303/Makefile @@ -38,7 +38,7 @@ COMPS += shared/comps/curpid.c COMPS += shared/comps/svm.c COMPS += shared/comps/dq.c COMPS += shared/comps/idq.c -# COMPS += shared/comps/rev.c +COMPS += shared/comps/sensorless.c # COMPS += shared/comps/vel.c # COMPS += shared/comps/hal_test.c # COMPS += shared/comps/dc.c diff --git a/stm32f303/src/comps/enc.c b/stm32f303/src/comps/enc.c index 912edb2c..1dbd2b7d 100644 --- a/stm32f303/src/comps/enc.c +++ b/stm32f303/src/comps/enc.c @@ -13,7 +13,7 @@ HAL_PIN(b); TIM_HandleTypeDef htim1; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct enc_ctx_t * ctx = (struct enc_ctx_t *)ctx_ptr; // struct enc_pin_ctx_t * pins = (struct enc_pin_ctx_t *)pin_ptr; __HAL_RCC_TIM1_CLK_ENABLE(); @@ -59,7 +59,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { HAL_TIM_Encoder_Start(&htim1, TIM_CHANNEL_1 | TIM_CHANNEL_2); } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct enc_ctx_t * ctx = (struct enc_ctx_t *)ctx_ptr; struct enc_pin_ctx_t *pins = (struct enc_pin_ctx_t *)pin_ptr; diff --git a/stm32f303/src/comps/hv.c b/stm32f303/src/comps/hv.c index 5358f609..ca1319c0 100644 --- a/stm32f303/src/comps/hv.c +++ b/stm32f303/src/comps/hv.c @@ -8,6 +8,13 @@ HAL_COMP(hv); +HAL_PIN(drop); + +//IU IV IW input in amp +HAL_PIN(iu); +HAL_PIN(iv); +HAL_PIN(iw); + //U V W input in Volt HAL_PIN(u); HAL_PIN(v); @@ -30,7 +37,7 @@ struct hv_ctx_t { int32_t pwm_res; }; -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { // struct hv_ctx_t * ctx = (struct hv_ctx_t *)ctx_ptr; struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; @@ -40,9 +47,10 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(min_on) = 0.000005; PIN(min_off) = 0.000005; PIN(arr) = PWM_RES; + PIN(drop) = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct hv_ctx_t *ctx = (struct hv_ctx_t *)ctx_ptr; struct hv_pin_ctx_t *pins = (struct hv_pin_ctx_t *)pin_ptr; @@ -50,10 +58,15 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ TIM8->ARR = ctx->pwm_res; float udc = MAX(PIN(udc), 0.1); + + // drop compensation + float uu = PIN(u) + PIN(drop) * SIGN2(PIN(iu), 0.1); + float uv = PIN(v) + PIN(drop) * SIGN2(PIN(iv), 0.1); + float uw = PIN(w) + PIN(drop) * SIGN2(PIN(iw), 0.1); //convert voltages to PWM output compare values - int32_t u = (int32_t)(CLAMP(PIN(u), 0.0, udc) / udc * (float)(ctx->pwm_res)); - int32_t v = (int32_t)(CLAMP(PIN(v), 0.0, udc) / udc * (float)(ctx->pwm_res)); - int32_t w = (int32_t)(CLAMP(PIN(w), 0.0, udc) / udc * (float)(ctx->pwm_res)); + int32_t u = (int32_t)(CLAMP(uu, 0.0, udc) / udc * (float)(ctx->pwm_res)); + int32_t v = (int32_t)(CLAMP(uv, 0.0, udc) / udc * (float)(ctx->pwm_res)); + int32_t w = (int32_t)(CLAMP(uw, 0.0, udc) / udc * (float)(ctx->pwm_res)); //convert on and off times to PWM output compare values int32_t min_on = (int32_t)((float)(ctx->pwm_res) * 15000.0 * PIN(min_on) + 0.5); int32_t min_off = (int32_t)((float)(ctx->pwm_res) * 15000.0 * PIN(min_off) + 0.5); diff --git a/stm32f303/src/comps/io.c b/stm32f303/src/comps/io.c index c275980d..430d0fb4 100644 --- a/stm32f303/src/comps/io.c +++ b/stm32f303/src/comps/io.c @@ -110,7 +110,7 @@ float r2temp(float r) { return (temp[ARRAY_SIZE(temp) - 1] + step); // TODO fix } -static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct io_ctx_t *ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; @@ -189,7 +189,7 @@ static void nrt_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(dac) = 0; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct io_ctx_t *ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; @@ -304,7 +304,7 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ PIN(cw) = (COMP4->CSR & COMP_CSR_COMPxOUT) > 0; } -void nrt_func(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +void nrt_func(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct io_ctx_t *ctx = (struct io_ctx_t *)ctx_ptr; struct io_pin_ctx_t *pins = (struct io_pin_ctx_t *)pin_ptr; diff --git a/stm32f303/src/comps/ls.c b/stm32f303/src/comps/ls.c index b5beae6f..2690a501 100644 --- a/stm32f303/src/comps/ls.c +++ b/stm32f303/src/comps/ls.c @@ -35,8 +35,10 @@ HAL_PIN(dac); // process data to LS HAL_PIN(dc_volt); -HAL_PIN(d_fb); -HAL_PIN(q_fb); +HAL_PIN(id_fb); +HAL_PIN(iq_fb); +HAL_PIN(ud_fb); +HAL_PIN(uq_fb); // state data to LS HAL_PIN(hv_temp); @@ -79,7 +81,7 @@ struct ls_ctx_t { f3_config_data_t config; f3_state_data_t state; -static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void hw_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct ls_ctx_t *ctx = (struct ls_ctx_t *)ctx_ptr; // struct ls_pin_ctx_t * pins = (struct ls_pin_ctx_t *)pin_ptr; @@ -152,7 +154,7 @@ static void hw_init(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { ctx->packet_from_hv.header.slave_addr = 0; } -static void rt_start(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_start(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct ls_ctx_t *ctx = (struct ls_ctx_t *)ctx_ptr; struct ls_pin_ctx_t *pins = (struct ls_pin_ctx_t *)pin_ptr; @@ -168,7 +170,7 @@ static void rt_start(volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { PIN(window) = 1; } -static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_t *pin_ptr) { +static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { struct ls_ctx_t *ctx = (struct ls_ctx_t *)ctx_ptr; struct ls_pin_ctx_t *pins = (struct ls_pin_ctx_t *)pin_ptr; @@ -290,8 +292,10 @@ static void rt_func(float period, volatile void *ctx_ptr, volatile hal_pin_inst_ // fill tx struct ctx->packet_from_hv.fault = (uint8_t)PIN(fault_in); - ctx->packet_from_hv.d_fb = PIN(d_fb); - ctx->packet_from_hv.q_fb = PIN(q_fb); + ctx->packet_from_hv.id_fb = PIN(id_fb); + ctx->packet_from_hv.iq_fb = PIN(iq_fb); + ctx->packet_from_hv.ud_fb = PIN(ud_fb); + ctx->packet_from_hv.uq_fb = PIN(uq_fb); ctx->packet_from_hv.header.conf_addr = ctx->tx_addr; ctx->packet_from_hv.header.config.f32 = state.data[ctx->tx_addr++]; ctx->tx_addr %= sizeof(state) / 4; diff --git a/stm32f303/src/main.c b/stm32f303/src/main.c index 9edc9070..5a499777 100644 --- a/stm32f303/src/main.c +++ b/stm32f303/src/main.c @@ -315,16 +315,17 @@ int main(void) { hal_parse("svm0.udc = io0.udc"); hal_parse("curpid0.id_fb = dq0.d"); hal_parse("curpid0.iq_fb = dq0.q"); - hal_parse("ls0.d_fb = dq0.d"); - hal_parse("ls0.q_fb = dq0.q"); + hal_parse("ls0.id_fb = dq0.d"); + hal_parse("ls0.iq_fb = dq0.q"); + hal_parse("ls0.ud_fb = curpid0.ud"); + hal_parse("ls0.uq_fb = curpid0.uq"); hal_parse("ls0.y = dq0.y"); hal_parse("ls0.u_fb = io0.u"); hal_parse("ls0.v_fb = io0.v"); hal_parse("ls0.w_fb = io0.w"); hal_parse("idq0.d = curpid0.ud"); hal_parse("idq0.q = curpid0.uq"); - hal_parse("curpid0.rd = ls0.r"); - hal_parse("curpid0.rq = ls0.r"); + hal_parse("curpid0.r = ls0.r"); hal_parse("curpid0.ld = ls0.l"); hal_parse("curpid0.lq = ls0.l"); hal_parse("curpid0.psi = ls0.psi"); @@ -339,6 +340,18 @@ int main(void) { hal_parse("curpid0.cmd_mode = ls0.cmd_mode"); hal_parse("hv0.arr = ls0.arr"); hal_parse("io0.ignore_fault_pin = ls0.ignore_fault_pin"); + // hal_parse("load sensorless"); + // hal_parse("sensorless0.rt_prio = 7"); + // hal_parse("sensorless0.r = ls0.r"); + // hal_parse("sensorless0.l = ls0.l"); + // hal_parse("sensorless0.id = dq0.d"); + // hal_parse("sensorless0.iq = dq0.q"); + // hal_parse("sensorless0.ud = curpid0.ud"); + // hal_parse("sensorless0.uq = curpid0.uq"); + hal_parse("hv0.iu = io0.iu"); + hal_parse("hv0.iv = io0.iv"); + hal_parse("hv0.iw = io0.iw"); + hal_parse("debug_level 0"); // hal parse config