sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
current_controller_conf.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 """
3 Created on Mon Feb 9 13:55:16 2015
4 @author: adelpret
5 """
6 import numpy as np
7 
8 NJ = 32
9 CURRENT_OFFSET_ITERS = 200
10 # Number of itertion while control is disabled to calibrate current sensors
11 CURRENT_MAX = 8.0
12 # max motor current (security check of ControlManager)
13 CTRL_MAX = 10.0
14 # max desired current (security check of ControlManager)
15 CTRL_SATURATION = 2047
16 # saturation of the control signal
17 IN_OUT_GAIN = 102.4
18 # factor to convert from a [-20.0 ; 20.0] Ampers value to the [-2048 ; 2048] 12bit DAC
19 # register
20 percentage_dead_zone_compensation = NJ * [0.0]
21 # percentage of dead zone to compensate (used by ControlManager)
22 i_max_dz_comp = NJ * [0.05]
23 # value of current tracking error at which deadzone is completely compensated
24 percentage_bemf_compensation = NJ * [0.0]
25 current_sensor_offsets_low_level = NJ * [0.0]
26 kp_current = NJ * [0.0]
27 ki_current = np.array(NJ * [0.0])
28 
29 percentage_bemf_compensation[0] = 0.9
30 percentage_bemf_compensation[1] = 0.9 # a bit unstable
31 percentage_bemf_compensation[2] = 0.9
32 percentage_bemf_compensation[3] = 0.9
33 percentage_bemf_compensation[4] = 1.0
34 percentage_bemf_compensation[5] = 0.9
35 percentage_bemf_compensation[6] = 0.9
36 percentage_bemf_compensation[7] = 0.9
37 percentage_bemf_compensation[8] = 0.9
38 percentage_bemf_compensation[9] = 0.9
39 percentage_bemf_compensation[10] = 0.9
40 percentage_bemf_compensation[11] = 0.9
41 
42 percentage_dead_zone_compensation[0] = 0.8
43 percentage_dead_zone_compensation[1] = 0.8
44 percentage_dead_zone_compensation[2] = 0.8 # could go up to 1.2
45 percentage_dead_zone_compensation[3] = 0.8
46 percentage_dead_zone_compensation[4] = 0.8 # a bit unstable
47 percentage_dead_zone_compensation[5] = 0.8
48 percentage_dead_zone_compensation[6] = 0.8
49 percentage_dead_zone_compensation[7] = 0.8
50 percentage_dead_zone_compensation[8] = 0.8
51 percentage_dead_zone_compensation[9] = 0.8
52 percentage_dead_zone_compensation[10] = 0.8
53 # very asymettric error, a bit unstable on negative currents, may need investigation
54 percentage_dead_zone_compensation[11] = 0.8
55 # getting some vibrations for negative errors, may need investigation
56 
57 i_max_dz_comp[0] = 0.03
58 
59 current_sensor_offsets_low_level[0] = 0.04
60 current_sensor_offsets_low_level[2] = -0.05
61 current_sensor_offsets_low_level[5] = 0.02
62 current_sensor_offsets_low_level[6] = 0.01
63 current_sensor_offsets_low_level[7] = 0.01
64 current_sensor_offsets_low_level[8] = -0.01
65 current_sensor_offsets_low_level[10] = -0.11
66 current_sensor_offsets_low_level[11] = -0.04
67 
68 ki_current[0] = 3e-3 # could go higher
69 ki_current[1] = 3e-3 # could go higher
70 ki_current[2] = 1e-3 # could probably go higher
71 ki_current[3] = 3e-3
72 ki_current[4] = 1e-3 # could probably go higher
73 ki_current[5] = 3e-3 # could probably go higher
74 ki_current[6] = 1e-3
75 ki_current[7] = 1e-3
76 ki_current[8] = 1e-3
77 ki_current[9] = 1e-3
78 ki_current[10] = 1e-3
79 ki_current[11] = 1e-3
80 # ki_current[:] = 0.0