Skip to content

Commit 90129a4

Browse files
Merge pull request #87 from nasa-jpl/apb-rename-actuator-classes
Rename actuator classes
2 parents c2e769e + 16bc99b commit 90129a4

21 files changed

+452
-342
lines changed

doc/fastcat_device_config_parameters.md

Lines changed: 98 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44

55
For every `JSD Device` there is an `Offline Device` to emulate the behavior of the hardware.
66

7-
| Name | Manufacturer | Description |
8-
| -------- | ------------ | ----------------------------------- |
9-
| Actuator | Elmo | EGD with extra features |
10-
| Egd | Elmo | Elmo Gold Drive line of controllers |
11-
| El3208 | Beckhoff | 8-channel RTD Input |
12-
| El3162 | Beckhoff | 2-channel 0-10v SE Analog Input |
13-
| El3602 | Beckhoff | 2-channel +/-10v Diff. Analog Input |
14-
| El2124 | Beckhoff | 4-channel 5v Digital Output |
15-
| El4102 | Beckhoff | 2-channel 0-10v Analog Output |
16-
| Ild1900 | Micro-Epsilon | Distance Laser Sensor |
17-
| AtiFts | ATI | Force-Torque Sensor |
18-
| JED0101 | JPL | JPL EtherCAT Device 0101 - EELS |
19-
| JED0200 | JPL | JPL EtherCAT Device 0200 - SAEL |
7+
| Name | Manufacturer | Description |
8+
| ---------------- | ------------- | ----------------------------------------- |
9+
| PlatinumActuator | Elmo | Elmo Platinum derived Actuator controller |
10+
| GoldActuator | Elmo | Elmo Gold derived Actuator controller |
11+
| Egd | Elmo | Elmo Gold Drive |
12+
| El3208 | Beckhoff | 8-channel RTD Input |
13+
| El3162 | Beckhoff | 2-channel 0-10v SE Analog Input |
14+
| El3602 | Beckhoff | 2-channel +/-10v Diff. Analog Input |
15+
| El2124 | Beckhoff | 4-channel 5v Digital Output |
16+
| El4102 | Beckhoff | 2-channel 0-10v Analog Output |
17+
| Ild1900 | Micro-Epsilon | Distance Laser Sensor |
18+
| AtiFts | ATI | Force-Torque Sensor |
19+
| JED0101 | JPL | JPL EtherCAT Device 0101 - EELS |
20+
| JED0200 | JPL | JPL EtherCAT Device 0200 - SAEL |
2021

2122
**Fastcat Devices**
2223

@@ -164,7 +165,11 @@ These two parameters, `device_class` and `name`, are not explicitly covered in t
164165

165166
## JSD and Offline Device Parameters
166167

167-
## Actuator
168+
## GoldActuator and PlatinumActuator
169+
170+
Care was taken to ensure the Gold and Platinum device configuration parameters are shared between these two device drivers.
171+
172+
Note: the `egd_` suffix was changed to `elmo_` in `v0.12.0`
168173

169174
Engineering Units (EU) are radians for revolute actuators and meters for linear actuators.
170175

@@ -187,10 +192,10 @@ Engineering Units (EU) are radians for revolute actuators and meters for linear
187192
| `high_pos_cal_limit_eu` | Upper Position Limit typically corresponding to a hardstop. Used for Calibration Command |
188193
| `high_pos_cmd_limit_eu` | Highest allowable command position value |
189194
| `holding_duration_sec` | Duration to hold position after reset or after a motion command before re-engaging brakes |
190-
| `egd_brake_engage_msec` | How long it takes to re-engage the brakes |
191-
| `egd_brake_disengage_msec` | How long it takes to disengaged the brakes |
192-
| `egd_crc` | CRC of the flashed Elmo parameter set |
193-
| `egd_drive_max_current_limit` | The Maximum drive current for the Elmo Gold Drive |
195+
| `elmo_brake_engage_msec` | How long it takes to re-engage the brakes |
196+
| `elmo_brake_disengage_msec` | How long it takes to disengaged the brakes |
197+
| `elmo_crc` | CRC of the flashed Elmo parameter set |
198+
| `elmo_drive_max_current_limit` | The fixed, maximum drive current for the Elmo Drive |
194199
| `smooth_factor` | Affects controller smoothing, defaults to `0` |
195200
| `winding_resistance` | OPTIONAL: Winding resistance of motor for optional power calculation |
196201
| `torque_constant` | OPTIONAL: Torque constant of motor for optional power calculation |
@@ -212,7 +217,7 @@ Engineering Units (EU) are radians for revolute actuators and meters for linear
212217
### Example
213218

214219
``` yaml
215-
- device_class: Actuator
220+
- device_class: PlatinumActuator #or GoldActuator
216221
name: tool
217222
actuator_type: revolute # eu = radians
218223
gear_ratio: 19
@@ -231,16 +236,85 @@ Engineering Units (EU) are radians for revolute actuators and meters for linear
231236
high_pos_cmd_limit_eu: 1e15
232237
high_pos_cal_limit_eu: 1e15
233238
holding_duration_sec: 5.0
234-
egd_brake_engage_msec: 10
235-
egd_brake_disengage_msec: 10
236-
egd_crc: -3260
237-
egd_drive_max_current_limit: 10
239+
elmo_brake_engage_msec: 10
240+
elmo_brake_disengage_msec: 10
241+
elmo_crc: -3260
242+
elmo_drive_max_current_limit: 10
238243
smooth_factor: 0
239244
```
240245

241246

242247

243-
## Egd (Elmo Gold Drive) TODO
248+
## Egd (Elmo Gold Drive)
249+
250+
This is a thin wrapper around the JSD EGD device. This does not have fastcat-side profiling nor any notion of gear ratio so the drive must be commanded in encoder counts.
251+
252+
| Parameter | Description |
253+
| -------------------------------- | ------------------------------------------------------------ |
254+
| `cs_cmd_freq_hz` | The Target loop rate to command the drive in {CSP, CSV, CST} modes |
255+
| `drive_cmd_mode` | Either `CS` or `PROFILED` see notes below for more details |
256+
| `max_motor_speed` | Maximum speed this drive may be commanded in counts/sec |
257+
| `torque_slope` | Rate to apply torque in certain profiled torque command modes |
258+
| `max_profile_accel` | ELMO-side profiler acceleration in counts/sec |
259+
| `max_profile_decel` | ELMO-side profiler deceleration in counts/sec |
260+
| `velocity_tracking_error` | ELMO-side velocity tracking error in counts/sec |
261+
| `position_tracking_error` | ELMO-side position tracking error in counts |
262+
| `peak_current_limit` | Peak instantaneous current in Amp |
263+
| `peak_current_time` | Max apply duration of Peak current before dropping down to Max Continuous current |
264+
| `continuous_current_limit` | Max continuously supplied current permitted to actuator |
265+
| `motor_stuck_current_level_pct` | See Elmo docs for details on this feature, `0` disables|
266+
| `motor_stuck_velocity_threshold` | See Elmo docs for details on this feature, `0` disables|
267+
| `motor_stuck_timeout` | See Elmo docs for details on this feature |
268+
| `over_speed_threshold` | High motor speed used for overspeed violations in counts/sec |
269+
| `low_position_limit` | Lower position the drive can move to in position mode, in counts |
270+
| `high_position_limit` | Upper position the drive can move to in position mode, in counts|
271+
| `brake_enage_msec` | How long it takes to re-engage the brake |
272+
| `brake_disengage_msec` | How long it takes to disengage the brake |
273+
| `crc` | CRC of the flashed parameter set |
274+
| `drive_max_current_limit` | The fixed, Maximum drive current for the EGD |
275+
276+
`drive_cmd_mode` controls the structure of the Process Data Objects (PDO) exchanged with the device during nominal runtime. The Gold Drive has a fixed limit on the size of the PDO which means that it cannot support all DS-402 commands in the same configuration (in the preferred manner we like to use the drive anyways).
277+
The Elmo Platinum Drive does not have this PDO limitation so it will accept all 6 command modes.
278+
279+
`drive_cmd_mode: PROFILED` means that ONLY profiled commands are accepted:
280+
- `egd_prof_pos`
281+
- `egd_prof_vel`
282+
- `egd_prof_torque`
283+
284+
`drive_cmd_mode: CS` means that ONLY Cyclic-Synchronous commands are accepted:
285+
- `egd_csp`
286+
- `egd_csv`
287+
- `egd_cst`
288+
289+
Note: the `GoldActuator` device uses the `Egd` device in `CS` mode. Profiled commands like `ACTUATOR_PROF_POS` are implemented with fastcat-side profiling.
290+
291+
292+
293+
``` yaml
294+
- device_class: Egd
295+
name: egd_1
296+
cs_cmd_freq_hz: 100
297+
drive_cmd_mode: PROFILED
298+
max_motor_speed: 50000
299+
torque_slope: 0.25
300+
max_profile_accel: 50000
301+
max_profile_decel: 50000
302+
velocity_tracking_error: 10000000
303+
position_tracking_error: 100000000
304+
peak_current_limit: 1.5
305+
peak_current_time: 0.5
306+
continuous_current_limit: 1.0
307+
motor_stuck_current_level_pct: 0
308+
motor_stuck_velocity_threshold: 0
309+
motor_stuck_timeout: 1.0
310+
over_speed_threshold: 100000
311+
low_position_limit: 0
312+
high_position_limit: 0
313+
brake_engage_msec: 0
314+
brake_disengage_msec: 0
315+
crc: 0
316+
drive_max_current_limit: 5
317+
```
244318

245319

246320

example_configs/one_of_every_device_offline.yaml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ buses:
3434
crc: 0
3535
drive_max_current_limit: 5
3636

37-
- device_class: Actuator
38-
name: act_1
37+
- device_class: GoldActuator
38+
name: gold_act_1
3939
actuator_type: revolute # revolute: eu = radians
4040
gear_ratio: 100
4141
counts_per_rev: 500
@@ -53,10 +53,35 @@ buses:
5353
high_pos_cmd_limit_eu: 3.14159
5454
high_pos_cal_limit_eu: 3.2
5555
holding_duration_sec: 3.0 # chosen arbitrarily
56-
egd_brake_engage_msec: 500
57-
egd_brake_disengage_msec: 1000
58-
egd_crc: 12345
59-
egd_drive_max_current_limit: 10 # amps
56+
elmo_brake_engage_msec: 500
57+
elmo_brake_disengage_msec: 1000
58+
elmo_crc: 12345
59+
elmo_drive_max_current_limit: 10 # amps
60+
smooth_factor: 0 # default value is 0
61+
62+
- device_class: PlatinumActuator
63+
name: plat_act_1
64+
actuator_type: revolute # revolute: eu = radians
65+
gear_ratio: 100
66+
counts_per_rev: 500
67+
max_speed_eu_per_sec: 10 #rad/sec
68+
max_accel_eu_per_sec2: 30 #rad/sec/sec
69+
over_speed_multiplier: 2
70+
vel_tracking_error_eu_per_sec: 1000 # chosen arbitrarily
71+
pos_tracking_error_eu: 1000 # chosen arbitrarily
72+
peak_current_limit_amps: 10
73+
peak_current_time_sec: 3.0 # chosen arbitrarily
74+
continuous_current_limit_amps: 5
75+
torque_slope_amps_per_sec: 0.5 # amps/sec; chosen arbitrarily
76+
low_pos_cal_limit_eu: -3.2
77+
low_pos_cmd_limit_eu: -3.14159
78+
high_pos_cmd_limit_eu: 3.14159
79+
high_pos_cal_limit_eu: 3.2
80+
holding_duration_sec: 3.0 # chosen arbitrarily
81+
elmo_brake_engage_msec: 500
82+
elmo_brake_disengage_msec: 1000
83+
elmo_crc: 12345
84+
elmo_drive_max_current_limit: 10 # amps
6085
smooth_factor: 0 # default value is 0
6186

6287
- device_class: El2124

src/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ add_library(fastcat STATIC
6767
transform_utils.cc
6868

6969
jsd/jsd_device_base.cc
70-
7170
jsd/actuator.cc
7271
jsd/actuator_fsm_helpers.cc
73-
jsd/egd_actuator.cc
74-
jsd/epd_actuator.cc
72+
73+
jsd/ati_fts.cc
7574
jsd/egd.cc
7675
jsd/el3208.cc
7776
jsd/el3602.cc
@@ -81,12 +80,13 @@ add_library(fastcat STATIC
8180
jsd/el3104.cc
8281
jsd/el3202.cc
8382
jsd/el3318.cc
83+
jsd/gold_actuator.cc
8484
jsd/ild1900.cc
8585
jsd/jed0101.cc
8686
jsd/jed0200.cc
87-
jsd/ati_fts.cc
87+
jsd/platinum_actuator.cc
8888

89-
jsd/egd_actuator_offline.cc
89+
jsd/ati_fts_offline.cc
9090
jsd/egd_offline.cc
9191
jsd/el2124_offline.cc
9292
jsd/el4102_offline.cc
@@ -96,11 +96,11 @@ add_library(fastcat STATIC
9696
jsd/el3104_offline.cc
9797
jsd/el3202_offline.cc
9898
jsd/el3318_offline.cc
99-
jsd/epd_actuator_offline.cc
10099
jsd/ild1900_offline.cc
100+
jsd/gold_actuator_offline.cc
101101
jsd/jed0101_offline.cc
102102
jsd/jed0200_offline.cc
103-
jsd/ati_fts_offline.cc
103+
jsd/platinum_actuator_offline.cc
104104

105105
${CMAKE_BINARY_DIR}/fastcat/autogen/fastcat_devices/commander.cc
106106
fastcat_devices/signal_generator.cc

src/fcgen/fastcat_types.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ states:
7676
- name: tared_tz
7777
type: double
7878

79-
- name: egd_actuator
79+
- name: gold_actuator
8080
fields:
8181
- name: actual_position
8282
type: double
@@ -130,7 +130,7 @@ states:
130130
- name: power
131131
type: double
132132

133-
- name: epd_actuator
133+
- name: platinum_actuator
134134
fields:
135135
- name: actual_position
136136
type: double

src/jsd/actuator.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,14 @@ std::string fastcat::Actuator::GetFastcatFaultCodeAsString(
673673
{
674674
std::string fault_str;
675675

676-
if (state.type == EGD_ACTUATOR_STATE || state.type == EPD_ACTUATOR_STATE) {
676+
if (state.type == GOLD_ACTUATOR_STATE || state.type == PLATINUM_ACTUATOR_STATE) {
677677
ActuatorFastcatFault fault;
678-
if (state.type == EGD_ACTUATOR_STATE) {
678+
if (state.type == GOLD_ACTUATOR_STATE) {
679679
fault = static_cast<ActuatorFastcatFault>(
680-
state.egd_actuator_state.fastcat_fault_code);
680+
state.gold_actuator_state.fastcat_fault_code);
681681
} else {
682682
fault = static_cast<ActuatorFastcatFault>(
683-
state.epd_actuator_state.fastcat_fault_code);
683+
state.platinum_actuator_state.fastcat_fault_code);
684684
}
685685

686686
switch (fault) {
@@ -731,13 +731,13 @@ std::string fastcat::Actuator::GetJSDFaultCodeAsString(const DeviceState& state)
731731
{
732732
std::string fault_str;
733733

734-
if (state.type == EGD_ACTUATOR_STATE) {
734+
if (state.type == GOLD_ACTUATOR_STATE) {
735735
auto fault = static_cast<jsd_egd_fault_code_t>(
736-
state.egd_actuator_state.jsd_fault_code);
736+
state.gold_actuator_state.jsd_fault_code);
737737
fault_str = std::string(jsd_egd_fault_code_to_string(fault));
738-
} else if (state.type == EPD_ACTUATOR_STATE) {
738+
} else if (state.type == PLATINUM_ACTUATOR_STATE) {
739739
auto fault = static_cast<jsd_epd_fault_code_t>(
740-
state.epd_actuator_state.jsd_fault_code);
740+
state.platinum_actuator_state.jsd_fault_code);
741741
fault_str = std::string(jsd_epd_fault_code_to_string(fault));
742742
} else {
743743
fault_str = "State is not an Elmo actuator type.";
@@ -750,12 +750,12 @@ bool fastcat::Actuator::IsJsdFaultCodePresent(const DeviceState& state)
750750
{
751751
bool fault_present = false;
752752

753-
if (state.type == EGD_ACTUATOR_STATE) {
754-
if (state.egd_actuator_state.jsd_fault_code != JSD_EGD_FAULT_OKAY) {
753+
if (state.type == GOLD_ACTUATOR_STATE) {
754+
if (state.gold_actuator_state.jsd_fault_code != JSD_EGD_FAULT_OKAY) {
755755
fault_present = true;
756756
}
757-
} else if (state.type == EPD_ACTUATOR_STATE) {
758-
if (state.epd_actuator_state.jsd_fault_code != JSD_EPD_FAULT_OKAY) {
757+
} else if (state.type == PLATINUM_ACTUATOR_STATE) {
758+
if (state.platinum_actuator_state.jsd_fault_code != JSD_EPD_FAULT_OKAY) {
759759
fault_present = true;
760760
}
761761
} else {
@@ -771,10 +771,10 @@ bool fastcat::Actuator::IsJsdFaultCodePresent(const DeviceState& state)
771771
double fastcat::Actuator::GetActualPosition(const DeviceState& state)
772772
{
773773
double actual_position;
774-
if (state.type == EGD_ACTUATOR_STATE) {
775-
actual_position = state.egd_actuator_state.actual_position;
776-
} else if (state.type == EPD_ACTUATOR_STATE) {
777-
actual_position = state.epd_actuator_state.actual_position;
774+
if (state.type == GOLD_ACTUATOR_STATE) {
775+
actual_position = state.gold_actuator_state.actual_position;
776+
} else if (state.type == PLATINUM_ACTUATOR_STATE) {
777+
actual_position = state.platinum_actuator_state.actual_position;
778778
} else {
779779
ERROR(
780780
"GetActualPosition must be called on states of Elmo actuator "

0 commit comments

Comments
 (0)