From 81bdaa9d2af65211d7e5cd17e1cc494ffdd9ea55 Mon Sep 17 00:00:00 2001 From: crinq Date: Wed, 1 May 2019 23:13:22 +0200 Subject: [PATCH] rl conf --- conf/template/rl.txt | 22 ++++++++++++++++++++++ shared/comps/rl.c | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 conf/template/rl.txt 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/shared/comps/rl.c b/shared/comps/rl.c index 599dd558..20380ad2 100644 --- a/shared/comps/rl.c +++ b/shared/comps/rl.c @@ -49,7 +49,7 @@ static void nrt_init(void *ctx_ptr, hal_pin_inst_t *pin_ptr) { PIN(r_test_cur) = 5; PIN(r_test_time) = 0.5; PIN(l_test_volt) = 10; - PIN(l_test_time) = 1; + PIN(l_test_time) = 1.5; PIN(ki) = 10; } @@ -127,6 +127,7 @@ static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) { PIN(en_out) = 0.0; PIN(timer) = 0.0; PIN(et) = PIN(ld) / PIN(r); + PIN(en) = 0; } }