Skip to content

Commit f923b3f

Browse files
committed
pbio/control: remove actuation_scale setting
This is no longer being used, so remove it.
1 parent 0dfcc32 commit f923b3f

File tree

4 files changed

+0
-17
lines changed

4 files changed

+0
-17
lines changed

lib/pbio/include/pbio/control.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ typedef struct _pbio_control_settings_t {
3737
int32_t pid_ki; /**< Integral position control constant */
3838
int32_t pid_kd; /**< Derivative position control constant (and proportional speed control constant) */
3939
int32_t max_control; /**< Upper limit on control output */
40-
int32_t actuation_scale; /**< Number of "duty steps" per "%" user-specified raw actuation value */
4140
int32_t integral_range; /**< Region around the target count in which integral errors are accumulated */
4241
int32_t integral_rate; /**< Maximum rate at which the integrator is allowed to increase */
4342
bool use_estimated_rate; /**< Whether to use the estimated speed (true) or the reported/measured speed (false) for feedback control */

lib/pbio/platform/motors/settings.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ static const pbio_control_settings_t settings_servo_ev3_m = {
3535
.integral_range = 45,
3636
.integral_rate = 10,
3737
.max_control = 150000,
38-
.actuation_scale = 100,
3938
.use_estimated_rate = false,
4039
.use_estimated_count = false,
4140
};
@@ -65,7 +64,6 @@ static const pbio_control_settings_t settings_servo_ev3_l = {
6564
.integral_range = 45,
6665
.integral_rate = 10,
6766
.max_control = 430000,
68-
.actuation_scale = 100,
6967
.use_estimated_rate = false,
7068
.use_estimated_count = false,
7169
};
@@ -99,7 +97,6 @@ static const pbio_control_settings_t settings_servo_technic_m_angular = {
9997
.integral_range = 45,
10098
.integral_rate = 5,
10199
.max_control = 160000,
102-
.actuation_scale = 100,
103100
.use_estimated_rate = true,
104101
.use_estimated_count = false,
105102
};
@@ -129,7 +126,6 @@ static const pbio_control_settings_t settings_servo_technic_l_angular = {
129126
.integral_range = 45,
130127
.integral_rate = 5,
131128
.max_control = 330000,
132-
.actuation_scale = 100,
133129
.use_estimated_rate = true,
134130
.use_estimated_count = false,
135131
};
@@ -159,7 +155,6 @@ static const pbio_control_settings_t settings_servo_interactive = {
159155
.integral_range = 45,
160156
.integral_rate = 3,
161157
.max_control = 100000,
162-
.actuation_scale = 100,
163158
.use_estimated_rate = true,
164159
.use_estimated_count = false,
165160
};
@@ -191,7 +186,6 @@ static const pbio_control_settings_t settings_servo_movehub = {
191186
.integral_range = 45,
192187
.integral_rate = 5,
193188
.max_control = 150000,
194-
.actuation_scale = 100,
195189
.use_estimated_rate = true,
196190
.use_estimated_count = false,
197191
};
@@ -223,7 +217,6 @@ static const pbio_control_settings_t settings_servo_technic_l = {
223217
.integral_range = 45,
224218
.integral_rate = 5,
225219
.max_control = 260000,
226-
.actuation_scale = 100,
227220
.use_estimated_rate = true,
228221
.use_estimated_count = false,
229222
};
@@ -253,7 +246,6 @@ static const pbio_control_settings_t settings_servo_technic_xl = {
253246
.integral_range = 45,
254247
.integral_rate = 5,
255248
.max_control = 260000,
256-
.actuation_scale = 100,
257249
.use_estimated_rate = true,
258250
.use_estimated_count = false,
259251
};

lib/pbio/src/control.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ int32_t pbio_control_user_to_counts(pbio_control_settings_t *s, int32_t user) {
329329
void pbio_control_settings_get_limits(pbio_control_settings_t *s, int32_t *speed, int32_t *acceleration, int32_t *actuation) {
330330
*speed = pbio_control_counts_to_user(s, s->max_rate);
331331
*acceleration = pbio_control_counts_to_user(s, s->abs_acceleration);
332-
*actuation = s->max_control / s->actuation_scale;
333332
}
334333

335334
pbio_error_t pbio_control_settings_set_limits(pbio_control_settings_t *s, int32_t speed, int32_t acceleration, int32_t actuation) {
@@ -338,7 +337,6 @@ pbio_error_t pbio_control_settings_set_limits(pbio_control_settings_t *s, int32_
338337
}
339338
s->max_rate = pbio_control_user_to_counts(s, speed);
340339
s->abs_acceleration = pbio_control_user_to_counts(s, acceleration);
341-
s->max_control = actuation * s->actuation_scale;
342340
return PBIO_SUCCESS;
343341
}
344342

lib/pbio/src/drivebase.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ static pbio_error_t drivebase_adopt_settings(pbio_control_settings_t *s_distance
3535
s_distance->max_control = min(s_left->max_control, s_right->max_control);
3636
s_distance->stall_time = min(s_left->stall_time, s_right->stall_time);
3737

38-
// We require that actuation scale and offsets are the same for either motor, and use as-is for drivebase
39-
if (s_left->actuation_scale != s_right->actuation_scale) {
40-
return PBIO_ERROR_INVALID_ARG;
41-
}
42-
s_distance->actuation_scale = s_left->actuation_scale;
43-
4438
// Copy rate estimator usage, required to be the same on both motors
4539
if (s_left->use_estimated_rate != s_right->use_estimated_rate || s_left->use_estimated_count != s_right->use_estimated_count) {
4640
return PBIO_ERROR_INVALID_ARG;

0 commit comments

Comments
 (0)