1
0
mirror of https://github.com/rene-dev/stmbl.git synced 2024-12-20 07:32:10 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
crinq
71ec816a7f Merge branch 'sys_id' of github.com:rene-dev/stmbl into sys_id 2021-09-01 00:54:35 +02:00
crinq
6a9d1ffd1e fix dc phasing 2021-09-01 00:54:16 +02:00
crinq
4253302764 fix pid torque ff 2021-09-01 00:51:20 +02:00
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
load conf
conf0.r = 1
conf0.l = 0.01
conf0.l_ratio = 1
conf0.j = 0.000025
conf0.j_sys = 0.0
conf0.j_lpf = 100.0

View File

@ -7,3 +7,5 @@ hv0.pos = 0
hv0.phase_mode = 3
hv0.q_cmd = dc_ttc0.cur
hv0.cmd_mode = 1
conf0.phase_time = 0
conf0.phase_cur = 0

View File

@ -154,8 +154,7 @@ static void rt_func(float period, void *ctx_ptr, hal_pin_inst_t *pin_ptr) {
PIN(torque_sat) = MAX(PIN(torque_sat) - period, 0.0);
}
PIN(ff_torque_cmd) = PIN(torque_ext_cmd);
PIN(ff_torque_cmd) += PIN(acc_ext_cmd) * (PIN(j_mot) + PIN(j_sys));
PIN(ff_torque_cmd) = PIN(acc_ext_cmd) * (PIN(j_mot) + PIN(j_sys));
PIN(ff_torque_cmd) += PIN(d) * PIN(vel_cmd);
PIN(ff_torque_cmd) += PIN(f) * SIGN2(PIN(vel_cmd), PIN(max_vel) * 0.001);
PIN(ff_torque_cmd) += PIN(l);