Skip to content

Commit

Permalink
Merge branch 'no_volatile'
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-dev committed Jan 16, 2020
2 parents 988bb1f + ced26cb commit 422a952
Show file tree
Hide file tree
Showing 115 changed files with 4,314 additions and 1,450 deletions.
26 changes: 20 additions & 6 deletions Makefile
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down
45 changes: 45 additions & 0 deletions 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
68 changes: 68 additions & 0 deletions 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
60 changes: 60 additions & 0 deletions 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
38 changes: 38 additions & 0 deletions 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
81 changes: 81 additions & 0 deletions 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

0 comments on commit 422a952

Please sign in to comment.