motion-master-client 0.0.64 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -244,7 +244,7 @@ class MotionMasterReqResClient {
244
244
  /**
245
245
  * Get device file list.
246
246
  *
247
- * Motion Master will use Filetransfer over EtherCAT (FoE) to get the list of files from a device.
247
+ * Motion Master will use Filetransfer over EtherCAT (FoE) to obtain the list of files from a device.
248
248
  * There isn't an actual command for getting the list, but rather the content of a specially named file "fs-getlist" is the file list.
249
249
  * The list can be read like any other file from a device using the IgH EtherCAT Master for Linux CLI program:
250
250
  *
@@ -252,10 +252,10 @@ class MotionMasterReqResClient {
252
252
  * $ ethercat foe_read fs-getlist
253
253
  * ```
254
254
  *
255
- * At the time of writing this document "fs-getlist" can return a maximum of 32 files (subject to change) in the list. This is a firmware limitation.
256
- * However, more than 32 files can be stored on device flash memory, but they won't appear in the list.
257
- * Also note that FoE can behave differently in the bootstrap firmware which runs in the BOOT EtherCAT state and
258
- * SOMANET firmware which runs in other EtherCAT states like PREOP/OP. Bootstrap tends to be buggier since it cannot be updated easily, so
255
+ * At the time of writing this document, "fs-getlist" can return a maximum of 32 files (subject to change) in the list. This is a firmware limitation.
256
+ * However, more than 32 files can be stored on the device flash memory, but they won't appear in the list.
257
+ * Also, note that FoE can behave differently in the bootstrap firmware, which runs in the BOOT EtherCAT state, and
258
+ * SOMANET firmware, which runs in other EtherCAT states like PREOP/OP. Bootstrap tends to be buggier since it cannot be updated easily, so
259
259
  * Motion Master has certain workarounds to overcome these FoE differences and bugs.
260
260
  */
261
261
  getDeviceFileList(props, requestTimeout, messageId) {
@@ -268,24 +268,24 @@ class MotionMasterReqResClient {
268
268
  /**
269
269
  * Get device file.
270
270
  *
271
- * Motion Master uses the Filetransfer over EtherCAT (FoE) to read and send back the content of a file from the device flash memory.
271
+ * Motion Master uses Filetransfer over EtherCAT (FoE) to read and send back the content of a file from the device flash memory.
272
272
  *
273
273
  * The IgH EtherCAT Master library used by Motion Master limits the file read buffer to 9KB, so any file written to flash that is larger than 9KB
274
274
  * needs to be split into parts of max 9KB. Motion Master does this automatically on request to {@link setDeviceFile}.
275
275
  *
276
- * Upon receiving this request Motion Master will first read the list of files on a device, see {@link getDeviceFileList}.
277
- * It does that in order to determine if the requested file, for example "SOMANET_CiA_402.xml", has been stored in multiple parts.
278
- * The parts are named like "SOMANET_CiA_402.xml.zip.part000", "SOMANET_CiA_402.xml.zip.part001" and so on.
279
- * Motion Master will read all parts of the requested file, unzip it and send the content back to a client.
280
- * Since the number of items in the list of files is limited to 32 (based on the firmware version) Motion Master might not see the file,
281
- * but in any case it will try to read the content of it.
282
- * If the file exists it will return its content, otherwise it will return the file not found error.
276
+ * Upon receiving this request, Motion Master will first read the list of files on a device, see {@link getDeviceFileList}.
277
+ * It does that in order to determine if the requested file, for example, "SOMANET_CiA_402.xml," has been stored in multiple parts.
278
+ * The parts are named like "SOMANET_CiA_402.xml.zip.part000," "SOMANET_CiA_402.xml.zip.part001," and so on.
279
+ * Motion Master will read all parts of the requested file, unzip it, and send the content back to a client.
280
+ * Since the number of items in the list of files is limited to 32 (based on the firmware version), Motion Master might not see the file,
281
+ * but in any case, it will try to read the content of it.
282
+ * If the file exists, it will return its content; otherwise, it will return the file not found error.
283
283
  *
284
- * Zipped files will be automatically unzipped and their content returned, for example: stack_image.svg.zip can be stored
285
- * in one or multiple files depending on the size. No matter how its stored it will be unzipped and its content returned as
284
+ * Zipped files will be automatically unzipped, and their content returned; for example, "stack_image.svg.zip" can be stored
285
+ * in one or multiple files depending on the size. No matter how it's stored, it will be unzipped, and its content returned as
286
286
  * text (SVG) instead of zipped content (binary).
287
287
  *
288
- * In BOOT EtherCAT state it's only allowed to read the .hardware_description file. This was done because
288
+ * In BOOT EtherCAT state, it's only allowed to read the .hardware_description file. This was done because
289
289
  * the bootloader firmware would hang when trying to read a corrupted or missing file.
290
290
  *
291
291
  * If the requested file content is empty, Motion Master will return a not found error. This is subject to change now that Motion Master reads the file error codes.
@@ -300,11 +300,11 @@ class MotionMasterReqResClient {
300
300
  /**
301
301
  * Set device file.
302
302
  *
303
- * Motion Master uses the Filetransfer over EtherCAT (FoE) to write files to the device flash memory.
303
+ * Motion Master uses Filetransfer over EtherCAT (FoE) to write files to the device flash memory.
304
304
  *
305
305
  * The IgH EtherCAT Master library used by Motion Master limits the file read buffer to 9KB, so any file written to flash that is larger than 9KB
306
306
  * needs to be split into parts of max 9KB. Motion Master does this automatically by first zipping the content and then writing the parts.
307
- * The parts are named in the following manner: "SOMANET_CiA_402.xml.zip.part000", "SOMANET_CiA_402.xml.zip.part001" and so on.
307
+ * The parts are named in the following manner: "SOMANET_CiA_402.xml.zip.part000," "SOMANET_CiA_402.xml.zip.part001," and so on.
308
308
  */
309
309
  setDeviceFile(props, requestTimeout, messageId) {
310
310
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -316,12 +316,12 @@ class MotionMasterReqResClient {
316
316
  /**
317
317
  * Delete device file.
318
318
  *
319
- * Motion Master uses the Filetransfer over EtherCAT (FoE) to delete files from the device flash memory.
319
+ * Motion Master uses Filetransfer over EtherCAT (FoE) to delete files from the device flash memory.
320
320
  *
321
321
  * If the file to delete is written in parts, Motion Master will ensure that all parts are deleted.
322
- * It does that by reading the list of files on a device, see {@link getDeviceFileList}, removing all parts from that list and then
323
- * it re-reading the list again to ensure that there are no leftovers if there were more than 32 files in the list. If there are still
324
- * more than 32 files in the list, Motion Master will blindly try to make sure there are no file parts left in the memory (may, or may not work).
322
+ * It does this by reading the list of files on a device, see {@link getDeviceFileList}, removing all parts from that list, and then
323
+ * re-reading the list again to ensure that there are no leftovers if there were more than 32 files in the list. If there are still
324
+ * more than 32 files in the list, Motion Master will blindly try to make sure there are no file parts left in the memory (may or may not work).
325
325
  */
326
326
  deleteDeviceFile(props, requestTimeout, messageId) {
327
327
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -333,19 +333,19 @@ class MotionMasterReqResClient {
333
333
  /**
334
334
  * Reset device fault.
335
335
  *
336
- * When an error occurs on a device, the device will go into Fault reaction active state (transition 13) and then automatically to Fault state (transition 14).
337
- * The CiA402 state of a device can be derived from the value of Statusword object (0x6041:00).
338
- * In order to go out of Fault and into Switch on disabled state (transition 15) master must send Fault reset command via Controlword object (0x6040:00).
336
+ * When an error occurs on a device, the device will go into the Fault reaction active state (transition 13) and then automatically to the Fault state (transition 14).
337
+ * The CiA402 state of a device can be derived from the value of the Statusword object (0x6041:00).
338
+ * In order to exit the Fault state and enter the Switch on disabled state (transition 15), the master must send a Fault reset command via the Controlword object (0x6040:00).
339
339
  *
340
- * When this request is sent to Motion Master, it will try to reset the fault. Resetting the fault can succeed or fail.
341
- * While resetting the fault, Motion Master will use the current Controlword value and set the Reset fault bit to 1,
342
- * but when it completes (either success or error), it will set it back to 0.
340
+ * When this request is sent to Motion Master, it will attempt to reset the fault. Resetting the fault can either succeed or fail.
341
+ * While resetting the fault, Motion Master will use the current Controlword value and set the Reset fault bit to 1.
342
+ * However, upon completion, whether successful or encountering an error, Motion Master will set it back to 0.
343
343
  *
344
- * Motion Master will return "No Fault" warning when this request is sent and device is not in Fault or Fault reaction active state.
345
- * If this request is sent when device is in Fault reaction active state, then Motion Master will
346
- * wait for the automatic transition (14) to Fault state before trying to reset fault.
347
- * When Motion Master sets the Controlword Fault bit to 1, it will also occasionally check if the device is no longer in Fault state.
348
- * After a couple of seconds, if the device is still in Fault state, it will give up and return the timeout error.
344
+ * Motion Master will return a "No Fault" warning when this request is sent, and the device is not in the Fault or Fault reaction active state.
345
+ * If this request is sent when the device is in the Fault reaction active state, Motion Master will
346
+ * wait for the automatic transition (14) to the Fault state before attempting to reset the fault.
347
+ * When Motion Master sets the Controlword Fault bit to 1, it will also periodically check if the device is no longer in the Fault state.
348
+ * After a few seconds, if the device is still in the Fault state, Motion Master will give up and return a timeout error.
349
349
  */
350
350
  resetDeviceFault(props, requestTimeout, messageId) {
351
351
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -358,8 +358,8 @@ class MotionMasterReqResClient {
358
358
  * Stop device.
359
359
  *
360
360
  * Motion Master will use the current value of the Controlword object and set the command on it to Quick stop.
361
- * It will then wait for up to 2 seconds for a device to get into one of the following CiA402 states: Switch on disabled, Operation enabled, Fault.
362
- * It does that by periodically checking the value of the Statusword object. If the device doesn't go into one of those states,
361
+ * It will then wait for up to 2 seconds for a device to enter one of the following CiA402 states: Switch on disabled, Operation enabled, Fault.
362
+ * This is achieved by periodically checking the value of the Statusword object. If the device fails to enter one of those states within the specified time,
363
363
  * Motion Master will return a timeout or a quick stop failed error.
364
364
  */
365
365
  stopDevice(props, requestTimeout, messageId) {
@@ -372,16 +372,16 @@ class MotionMasterReqResClient {
372
372
  /**
373
373
  * Start device firmware installation.
374
374
  *
375
- * When Motion Master receives this request for a device, it will do the following:
376
- * - switch the device to the BOOT EtherCAT state - the device will then run the bootloader instead of the firmware
377
- * - validate the firmware package
378
- * - delete files the files found in the package from the device flash memory (SOMANET_CiA_402.xml and stack_image.svg)
379
- * - write files other than the firmware binaries and SII from package to the device (SOMANET_CiA_402.xml and stack_image.svg)
380
- * - (optional) install the SII file using the IgH EtherCAT Master library write SII function
381
- * - write the firmware binaries to the device using predefined names like app_firmware.bin and com_firmware.bin
375
+ * When Motion Master receives this request for a device, it will perform the following steps:
376
+ * - Switch the device to the BOOT EtherCAT state; the device will then run the bootloader instead of the firmware.
377
+ * - Validate the firmware package.
378
+ * - Delete files found in the package from the device flash memory (SOMANET_CiA_402.xml and stack_image.svg).
379
+ * - Write files other than the firmware binaries and SII from the package to the device (SOMANET_CiA_402.xml and stack_image.svg).
380
+ * - (Optional) Install the SII file using the IgH EtherCAT Master library write SII function, or SOEM EEPROM tool.
381
+ * - Write the firmware binaries to the device using predefined names like app_firmware.bin and com_firmware.bin.
382
382
  *
383
383
  * During the firmware installation, Motion Master will send progress messages back to clients.
384
- * If Motion Master fails in any step other than SII write, it will send an error. If SII write fails, only a warning will be sent.
384
+ * If Motion Master encounters a failure in any step other than SII write, it will send an error. If SII write fails, only a warning will be sent.
385
385
  */
386
386
  startDeviceFirmwareInstallation(props, requestTimeout, messageId) {
387
387
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -393,8 +393,8 @@ class MotionMasterReqResClient {
393
393
  /**
394
394
  * Get device log.
395
395
  *
396
- * The device log is stored in two files due to IgH EtherCAT Master library 9KB file size limitation, see {@link getDeviceFile}.
397
- * A device automatically writes the log to logging_curr.log and copies that file to logging_prev.log once it reaches 9KB.
396
+ * The device log is stored in two files due to the IgH EtherCAT Master library 9KB file size limitation, as explained in {@link getDeviceFile}.
397
+ * The device automatically writes the log to logging_curr.log and copies that file to logging_prev.log once it reaches 9KB.
398
398
  * When Motion Master receives this request, it will read both of these files and return their combined contents.
399
399
  */
400
400
  getDeviceLog(props, requestTimeout, messageId) {
@@ -407,27 +407,27 @@ class MotionMasterReqResClient {
407
407
  /**
408
408
  * Start cogging torque recording.
409
409
  *
410
- * Cogging torque compensation (CTC) recording can be started with or without auto-config.
411
- * In the proto file skipping the auto-config is currently named skip_auto_tuning. The field name is deprecated and will be renamed.
410
+ * Cogging torque compensation (CTC) recording can be initiated with or without auto-config.
411
+ * In the proto file, skipping the auto-config is currently named skip_auto_tuning. The field name is deprecated and will be renamed.
412
412
  *
413
- * If CTC recording is started without auto-config, the users must ensure that the encoder on the motor shaft is used for all functions: commutation, position, and velocity.
414
- * If this is not the case, then Motion Master will return an invalid encoder configuration error.
413
+ * If CTC recording is started without auto-config, users must ensure that the encoder on the motor shaft is used for all functions: commutation, position, and velocity.
414
+ * If this is not the case, Motion Master will return an invalid encoder configuration error.
415
415
  * Recording can also fail if the position controller is not tuned.
416
416
  *
417
- * If CTC recording is started with auto-config then Motion Master will:
418
- * - change the encoder configuration to have all encoder functions on the motor shaft
419
- * - disable CTC
420
- * - change the velocity feed forward value
421
- * - change the position and velocity filter types and cutoff frequencies
422
- * - run iterative sharpening position controller auto-tuning in order to compute the optimal PID values (gains) for CTC recording
417
+ * If CTC recording is started with auto-config, Motion Master will:
418
+ * - Change the encoder configuration to have all encoder functions on the motor shaft.
419
+ * - Disable CTC.
420
+ * - Change the velocity feed forward value.
421
+ * - Change the position and velocity filter types and cutoff frequencies.
422
+ * - Run iterative sharpening position controller auto-tuning to compute the optimal PID values (gains) for CTC recording.
423
423
  *
424
- * All parameter values that Motion Master changes as part of the auto-config are first stored in memory and once the CTC recording is done are reverted back.
424
+ * All parameter values that Motion Master changes as part of the auto-config are first stored in memory and once the CTC recording is done, they are reverted back.
425
425
  *
426
- * CTC recording is started by changing the Modes of operation (0x6060) parameter value to -1 (Cogging compensation recording mode).
427
- * During the operation Motion Master will monitor the Cogging torque compensation state parameter (0x2008:01) to know when the recording is in progress and when it's done.
426
+ * CTC recording is initiated by changing the Modes of operation (0x6060) parameter value to -1 (Cogging compensation recording mode).
427
+ * During the operation, Motion Master will monitor the Cogging torque compensation state parameter (0x2008:01) to know when the recording is in progress and when it's done.
428
428
  *
429
- * The result of CTC recording is the cogging_torque.bin file written to device flash memory. The size of this file is 2048 bytes.
430
- * Each pair of bytes represents a 16-bit signed integer value in mNm (millinewton meter).
429
+ * The result of CTC recording is the cogging_torque.bin file written to the device flash memory. The size of this file is 2048 bytes.
430
+ * Each pair of bytes represents a 16-bit signed integer value in mNm (millinewton-meter).
431
431
  *
432
432
  * This request will turn the motor.
433
433
  */
@@ -441,10 +441,10 @@ class MotionMasterReqResClient {
441
441
  /**
442
442
  * Get cogging torque data.
443
443
  *
444
- * The cogging_torque.bin file is the result of cogging torque compensation recording, see {@link startCoggingTorqueRecording}.
445
- * The size of this file is 2048 bytes where each pair of bytes represents a 16-bit signed integer value in mNm (millinewton meter).
444
+ * The cogging_torque.bin file is the result of cogging torque compensation recording, as explained in {@link startCoggingTorqueRecording}.
445
+ * The size of this file is 2048 bytes, where each pair of bytes represents a 16-bit signed integer value in mNm (millinewton-meter).
446
446
  *
447
- * Motion Master will read the cogging_torque.bin file, convert bytes to 16-bit signed integer values and return that as an array of values.
447
+ * Motion Master will read the cogging_torque.bin file, convert the bytes to 16-bit signed integer values, and return them as an array of numbers.
448
448
  */
449
449
  getCoggingTorqueData(props, requestTimeout, messageId) {
450
450
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -456,17 +456,17 @@ class MotionMasterReqResClient {
456
456
  /**
457
457
  * Start offset detection.
458
458
  *
459
- * Running offset detection is different for firmwares <v5 and >=v5.
459
+ * Running offset detection differs for firmwares <v5 and >=v5.
460
460
  *
461
- * For devices that run firmware >=v5, Motion Master will run multiple OS commands.
462
- * Before starting any command, device is switched to Modes of operation -2 (Diagnostics mode) and
463
- * it's put into operation enabled CiA402 state. The OS commands are then run in the following order:
464
- * - open phase detection
465
- * - phase resistance measurement
466
- * - phase inductance measurement
467
- * - pole pair detection
468
- * - motor phase order detection
469
- * - commutation offset measurement
461
+ * For devices running firmware >=v5, Motion Master will execute multiple OS commands.
462
+ * Before initiating any command, the device is switched to Modes of operation -2 (Diagnostics mode), and
463
+ * it's put into the operation-enabled CiA402 state. The OS commands are then executed in the following order:
464
+ * - Open phase detection
465
+ * - Phase resistance measurement
466
+ * - Phase inductance measurement
467
+ * - Pole pair detection
468
+ * - Motor phase order detection
469
+ * - Commutation offset measurement
470
470
  *
471
471
  * Motion Master will return an error if any of the following OS commands fail: open phase detection,
472
472
  * phase order detection, commutation offset measurement.
@@ -475,10 +475,11 @@ class MotionMasterReqResClient {
475
475
  * Once the commutation offset measurement command completes, it will update the following parameter values:
476
476
  * - 0x2001:00 Commutation angle offset to the computed offset value
477
477
  * - 0x2009:01 Commutation offset State to 2 (OFFSET_VALID)
478
+ * - 0x2003:05 Motor phases inverted will be changed by the firmware
478
479
  *
479
- * For devices that run firmware <5 the same Modes of operation -2 is used, but it's named Commutation offset detection mode
480
- * and it will run as a single procedure as soon as the device is switched to CiA402 operation enabled state.
481
- * The end result is the same, the procedure will update 0x2001:00 and 0x2009:01 parameter values.
480
+ * For devices running firmware <5, the same Modes of operation -2 is used, but it's named Commutation offset detection mode,
481
+ * and it will run as a single procedure as soon as the device is switched to CiA402 operation-enabled state.
482
+ * The end result is the same; the procedure will update 0x2001:00 and 0x2009:01 parameter values.
482
483
  *
483
484
  * This request will turn the motor.
484
485
  */
@@ -500,13 +501,13 @@ class MotionMasterReqResClient {
500
501
  }));
501
502
  }
502
503
  /**
503
- * Compute auto tuning gains.
504
+ * Compute auto-tuning gains.
504
505
  *
505
- * Auto tuning gains can be computed for the position or the velocity controller.
506
+ * Auto-tuning gains can be computed for the position or the velocity controller.
506
507
  *
507
508
  * The prerequisites for running this procedure are a configured motor and the existence of
508
- * plant_model.csv file created by previously running the system identification {@link startSystemIdentification}.
509
- * Motion Master will return error if the plant_model.csv file is not found.
509
+ * the plant_model.csv file created by previously running the system identification {@link startSystemIdentification}.
510
+ * Motion Master will return an error if the plant_model.csv file is not found.
510
511
  *
511
512
  * In OBLAC Drives, this request is called when the tuning sliders (damping ratio, bandwidth) are moved and
512
513
  * during the CTC recording {@link startCoggingTorqueRecording} when auto-config is not skipped.
@@ -539,7 +540,7 @@ class MotionMasterReqResClient {
539
540
  *
540
541
  * This request will set the mode of operation to CSP, CSV, or CST and optionally enable filtering.
541
542
  *
542
- * If filtering is enabled Motion Master will compute an intermediate target value in each cycle and, depending on the active mode of operation,
543
+ * If filtering is enabled, Motion Master will compute an intermediate target value in each cycle, and depending on the active mode of operation,
543
544
  * set the value of one of 0x607A Target position, 0x60FF Target velocity, 0x6071 Target torque to that value.
544
545
  *
545
546
  * The target value can be updated with {@link setMotionControllerParameters}.
@@ -554,9 +555,9 @@ class MotionMasterReqResClient {
554
555
  /**
555
556
  * Disable motion controller.
556
557
  *
557
- * Depending on the current CiA402 state this request will do the following:
558
- * - if device is in Quick stop active it will transition to Switch on disabled state
559
- * - if device is in Operation enabled it will transition to Switched on state
558
+ * Depending on the current CiA402 state, this request will do the following:
559
+ * - If the device is in Quick stop active, it will transition to Switch on disabled state.
560
+ * - If the device is in Operation enabled, it will transition to Switched on state.
560
561
  */
561
562
  disableMotionController(props, requestTimeout, messageId) {
562
563
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -570,7 +571,7 @@ class MotionMasterReqResClient {
570
571
  *
571
572
  * This request will update the signal generator parameter values for a device on Motion Master.
572
573
  * The selected signal generator is then started by {@link startSignalGenerator}.
573
- * Signal generator must be started within the next 60 seconds before Motion Master invalidates the previously set parameters.
574
+ * The signal generator must be started within the next 60 seconds before Motion Master invalidates the previously set parameters.
574
575
  */
575
576
  setSignalGeneratorParameters(props, requestTimeout, messageId) {
576
577
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -586,7 +587,7 @@ class MotionMasterReqResClient {
586
587
  * previously set parameters with {@link setSignalGeneratorParameters}.
587
588
  *
588
589
  * Signal generators are started by changing the mode of operation, putting the device into Operation enabled CiA402 state,
589
- * and setting the target value. What mode of operation is set depends on the type of signal generator and the selected controller:
590
+ * and setting the target value. The mode of operation set depends on the type of signal generator and the selected controller:
590
591
  * - For the simple & advanced step response and the sine wave, one of CSP, CSV, or CST is set.
591
592
  * - For the ramp, trapezoidal, and bidirectional signal generators, also called profiles, one of the PP, PV, TQ is set.
592
593
  *
@@ -596,29 +597,29 @@ class MotionMasterReqResClient {
596
597
  * Firmwares >=5.2 will support generating and running sine wave profiles on devices themselves. This will enable lossless profile
597
598
  * execution on possibly higher frequencies. Future Motion Master versions will switch to this method.
598
599
  *
599
- * For the simple step response, Motion Master will only set the target value,
600
- * wait for the specified holding duration, and then send a Quick Stop command.
600
+ * For the simple step response, Motion Master will only set the target value, wait for the specified holding duration,
601
+ * and then send a Quick Stop command.
601
602
  *
602
603
  * The advanced step response is similar to the simple one, but, after the holding duration, it will set the new target
603
604
  * multiple times depending on the shape, and then send a Quick Stop if the repeat option is set to NO. If repeat is set to YES,
604
- * then the signal generator will run indefinitely and the users must stop it manually.
605
+ * then the signal generator will run indefinitely, and the users must stop it manually.
605
606
  *
606
- * Before running a profile, Motion Master will check if device supports the profile modes by looking at 0x6502 Supported drives modes.
607
- * If profile modes are not supported, then the profiles will be generated on Motion Master. This means the targets will be computed up-front.
608
- * If profiles are supported, then ramp, trapezoidal, and bidirectional signal generators are run in profile mode of operation.
609
- * To prepare the signal generator foe execution, Motion Master will set the following parameters:
610
- * - 0x6081:00 Profile velocity (only for position controller)
607
+ * Before running a profile, Motion Master will check if the device supports the profile modes by looking at 0x6502 Supported drive modes.
608
+ * If profile modes are not supported, then the profiles will be generated on Motion Master. This means the targets will be computed upfront.
609
+ * If profiles are supported, then the ramp, trapezoidal, and bidirectional signal generators are run in profile mode of operation.
610
+ * To prepare the signal generator for execution, Motion Master will set the following parameters:
611
+ * - 0x6081:00 Profile velocity (only for the position controller)
611
612
  * - 0x6083:00 Profile acceleration
612
613
  * - 0x6084:00 Profile deceleration
613
614
  * Motion Master knows when the profile has completed by comparing the demand with the actual value, taking into account the
614
615
  * holding duration and the shape of the profile. Once the profile is considered complete, Motion Master will send a Quick Stop, but
615
616
  * only if repeat is set to NO.
616
617
  *
617
- * The sine wave profile is generated up-front on Motion Master. Targets are computed for each master cycle (millisecond).
618
+ * The sine wave profile is generated upfront on Motion Master. Targets are computed for each master cycle (millisecond).
618
619
  * Once the last computed target has been set, Motion Master will send a Quick Stop if repeat is set to NO.
619
620
  *
620
621
  * For all signal generators, Motion Master will check the requested target against the currently set software position limits
621
- * and, if necessary, alter it whilst returning a warning.
622
+ * and, if necessary, alter it while returning a warning.
622
623
  *
623
624
  * This request will turn the motor.
624
625
  */
@@ -632,7 +633,7 @@ class MotionMasterReqResClient {
632
633
  /**
633
634
  * Stop signal generator.
634
635
  *
635
- * This request will send a Quick Stop to the device.
636
+ * This request will send a Quick Stop command to the device.
636
637
  */
637
638
  stopSignalGenerator(props, requestTimeout, messageId) {
638
639
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -645,23 +646,23 @@ class MotionMasterReqResClient {
645
646
  * Start monitoring device parameter values.
646
647
  *
647
648
  * When monitoring is started, Motion Master will begin and continue reading values from the device
648
- * and send them back to a client in the specified interval on the given topic.
649
+ * and send them back to a client at the specified interval on the given topic.
649
650
  *
650
651
  * The request is made through the req/res socket {@link MotionMasterReqResSocket},
651
652
  * but the status messages will arrive on the pub/sub socket {@link MotionMasterPubSubSocket}.
652
653
  *
653
654
  * The same monitoring can read both PDO and SDO values. PDO values will be updated on every Motion Master cycle (1ms).
654
- * How fast will SDO values update depends on the number of SDOs being monitored. Motion Master reads the SDO values in a sequence
655
- * so, for example, if there are 10 SDOs and it takes 20ms to read a single SDO it will take approximately 200ms for each SDO to get updated.
655
+ * How fast SDO values will update depends on the number of SDOs being monitored. Motion Master reads the SDO values in a sequence,
656
+ * so, for example, if there are 10 SDOs and it takes 20ms to read a single SDO, it will take approximately 200ms for each SDO to get updated.
656
657
  * IgH EtherCAT Master supports non-blocking SDO reading with a request to read and check the state of the request (one of not used, busy, failed, succeeded).
657
- * Future version of Motion Master will likely leverage this and update SDO values out of order as each of the requests to update SDO succeeds.
658
+ * A future version of Motion Master will likely leverage this and update SDO values out of order as each of the requests to update SDO succeeds.
658
659
  * This should decrease the time it takes to read multiple SDOs.
659
660
  * If a parameter is required to be updated more frequently, it should be mapped as a PDO.
660
661
  *
661
- * Firmware versions >=5.2 supports SDO complete access, but it is currently not being supported in Motion Master.
662
- * With SDO complete access RECORD and ARRAY subitems can be read with a single request.
662
+ * Firmware versions >=5.2 support SDO complete access, but it is currently not being supported in Motion Master.
663
+ * With SDO complete access, RECORD and ARRAY subitems can be read with a single request.
663
664
  *
664
- * Interval is given in microseconds.
665
+ * The interval is given in microseconds.
665
666
  *
666
667
  * The topic should be unique. The previous monitoring will stop if the given topic is reused.
667
668
  * Clients can easily stop one another's monitoring by using the same topic.
@@ -670,7 +671,7 @@ class MotionMasterReqResClient {
670
671
  * When the monitoring request is received, Motion Master will mark all requested parameters as stale.
671
672
  * The first time a parameter gets refreshed from a device, it'll be marked as not stale.
672
673
  * Motion Master won't start publishing parameter values until all parameters are marked as not stale.
673
- * This was done in order to satisfy the firmware test client applications.
674
+ * This was done to satisfy the firmware test client applications.
674
675
  *
675
676
  * Stopping the ongoing monitoring is done through the req/res socket using
676
677
  * the request message ID of the initial start monitoring message {@link stopMonitoringDeviceParameterValues}.
@@ -683,7 +684,7 @@ class MotionMasterReqResClient {
683
684
  /**
684
685
  * Stop monitoring device parameter values.
685
686
  *
686
- * Message ID used for {@link startMonitoringDeviceParameterValues} uniquely identifies a monitoring and is used for stopping it.
687
+ * The Message ID used for {@link startMonitoringDeviceParameterValues} uniquely identifies a monitoring and is used for stopping it.
687
688
  */
688
689
  stopMonitoringDeviceParameterValues(props, messageId) {
689
690
  const stopMonitoringDeviceParameterValues = types_1.MotionMasterMessage.Request.StopMonitoringDeviceParameterValues.create(props);
@@ -709,7 +710,7 @@ class MotionMasterReqResClient {
709
710
  * Set the EtherCAT network state to one of: BOOT, INIT, PRE-OP, SAFE-OP, OP.
710
711
  * The state is set by an enum value: INIT: 1, PREOP: 2, BOOT: 3, SAFEOP: 4, OP: 5.
711
712
  *
712
- * When switching from PRE-OP to OP, MM will reinitialize slaves in order to update the PDO mapping.
713
+ * When switching from PRE-OP to OP, MM will reinitialize slaves to update the PDO mapping.
713
714
  */
714
715
  setEthercatNetworkState(props, requestTimeout, messageId) {
715
716
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -733,12 +734,12 @@ class MotionMasterReqResClient {
733
734
  *
734
735
  * This request will update the client timeout.
735
736
  *
736
- * Client timeout specifies how long Motion Master will wait for the client to send a ping or any other message before
737
+ * The client timeout specifies how long Motion Master will wait for the client to send a ping or any other message before
737
738
  * considering it gone and clearing the resources (stopping procedures and monitorings) related to that client.
738
739
  *
739
- * Default client timeout is 1000ms.
740
+ * The default client timeout is 1000ms.
740
741
  *
741
- * Client will typically change this once the socket connection is established.
742
+ * Clients will typically change this once the socket connection is established.
742
743
  */
743
744
  setSystemClientTimeout(props, messageId) {
744
745
  const setSystemClientTimeout = types_1.MotionMasterMessage.Request.SetSystemClientTimeout.create(props);
@@ -748,27 +749,27 @@ class MotionMasterReqResClient {
748
749
  /**
749
750
  * Start system identification.
750
751
  *
751
- * This request will run the system identification procedure which identifies the plant model.
752
+ * This request will run the system identification procedure, which identifies the plant model.
752
753
  *
753
754
  * Pre-conditions: a configured motor and configured encoders.
754
755
  *
755
- * The chirp signal that the procedure does only uses the torque controller.
756
- * The chirp signal is generated on Motion Master and then, on every master cycle (1ms), the target torque value is set on a device.
756
+ * The chirp signal that the procedure generates only uses the torque controller.
757
+ * The chirp signal is generated on Motion Master, and then, on every master cycle (1ms), the target torque value is set on a device.
757
758
  * Motion Master will send a Quick Stop to a device after the last target value is set.
758
759
  *
759
- * The request can fail for multiple reasons: device is in the fault state, cannot set the op mode state,
760
+ * The request can fail for multiple reasons: the device is in the fault state, cannot set the op mode state,
760
761
  * or the system identification fails because not enough data points have been collected.
761
- * While running the chirp signal, the data points are collected, but due to potential communication lag it can happen
762
- * that master doesn't collect enough data points. If more than 80% of data points are missing, the procedure will fail.
763
- * If between 20%-80% of data points are missing, only a warning will be returned.
762
+ * While running the chirp signal, the data points are collected, but due to potential communication lag, it can happen
763
+ * that the master doesn't collect enough data points. If more than 80% of data points are missing, the procedure will fail.
764
+ * If between 20%-80% of data points are missing, only a warning will be returned. The exact thresholds are subject to change.
764
765
  *
765
766
  * Before computing the plant model data based on the collected data points, Motion Master will interpolate the missing data points.
766
- * Plant model data is then computed and written to plant_model.csv file on the device flash memory.
767
+ * Plant model data is then computed and written to the plant_model.csv file on the device flash memory.
767
768
  * The plant model file is later used to compute the PID values using {@link computeAutoTuningGains} and {@link startFullAutoTuning}.
768
769
  * It's also used indirectly in {@link startCoggingTorqueRecording} when auto-config is turned on.
769
770
  * Motion Master will also update the integral limit values in 0x2011: Velocity controller and 0x2012: Position controller during this procedure.
770
771
  *
771
- * In future versions of firmware, the chirp signal would be executed on the devices themselves, so no data points will be missing
772
+ * In future versions of the firmware, the chirp signal would be executed on the devices themselves, so no data points will be missing,
772
773
  * and the system identification will be able to run at higher frequencies and with higher precision.
773
774
  *
774
775
  * This request will turn the motor.
@@ -785,8 +786,8 @@ class MotionMasterReqResClient {
785
786
  *
786
787
  * This feature is only available for firmwares >=v5. For older firmwares, Motion Master will return an error.
787
788
  *
788
- * Motion Master will read registers 0x2B and 0x2F on the specified encoder (by encoder ordinal) and then it will compute the magnet distance.
789
- * The computation depends on the Circulo type, encoder port and ring revision.
789
+ * Motion Master will read registers 0x2B and 0x2F on the specified encoder (by encoder ordinal), and then it will compute the magnet distance.
790
+ * The computation depends on the Circulo type, encoder port, and ring revision.
790
791
  */
791
792
  getCirculoEncoderMagnetDistance(props, requestTimeout, messageId) {
792
793
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -796,7 +797,7 @@ class MotionMasterReqResClient {
796
797
  }));
797
798
  }
798
799
  /**
799
- * Start the Circulo encoder narrow angle calibration procedure.
800
+ * Start the Circulo encoder narrow-angle calibration procedure.
800
801
  *
801
802
  * This feature is only available on firmwares >=v5.
802
803
  *
@@ -804,7 +805,7 @@ class MotionMasterReqResClient {
804
805
  * - the firmware version is not >=v5
805
806
  * - software position limits are set so that the required motor rotation is not possible
806
807
  * - for SMM devices, the encoder source type is not set to None
807
- * - the velocity resolution determined by the gear ratio, SI unit velocity and feed constant is not high enough
808
+ * - the velocity resolution determined by the gear ratio, SI unit velocity, and feed constant is not high enough
808
809
  *
809
810
  * Before starting the procedure, Motion Master will do the following:
810
811
  * - send OS command 14 (Ignore BiSS status bits) so that no firmware warnings or errors are raised during the procedure.
@@ -813,29 +814,27 @@ class MotionMasterReqResClient {
813
814
  * - change the values of some device parameters: profile acceleration, deceleration, max motor speed, etc.
814
815
  *
815
816
  * The parameter values Motion Master sets depend on the type of the device (fetched from the hardware description file).
816
- * Once the operation has completed, Motion Master will rollback all of the above parameters to their initial values.
817
+ * Once the operation has completed, Motion Master will roll back all of the above parameters to their initial values.
817
818
  *
818
819
  * Procedure:
819
820
  * - The procedure is run in velocity profile mode of operation.
820
821
  * - The procedure will do multiple iterations until the encoder data is satisfactory.
821
822
  * - The procedure can fail for various reasons: data out of range, motor too slow, bad data, internal error, etc.
822
823
  * - The procedure will run a maximum of 13 calibration iterations, up to 2 mins in total.
823
- * - One iteration turns the motor in one direction and then the next one reverses the direction.
824
+ * - One iteration turns the motor in one direction, and then the next one reverses the direction.
824
825
  * - Each iteration will record encoder data into HRD files (4kHz) that contain the raw data from the specified encoder.
825
- * - Motion Master will remove previous high resolution data (HRD) files after each iteration. HRD streaming is configured/started using OS commands.
826
+ * - Motion Master will remove previous high-resolution data (HRD) files after each iteration. HRD streaming is configured/started using OS commands.
826
827
  * - After each iteration, which lasts ~6 seconds, the recorded data in HRD files is read and passed to the iC House library.
827
- * - The recorded data is sliced into 32-bit pair of values of master and nonius track data. Motion Master creates two arrays out of this data and
828
+ * - The recorded data is sliced into 32-bit pairs of values of master and nonius track data. Motion Master creates two arrays out of this data and
828
829
  * passes that to the iC House library which computes the new calibration parameters depending on encoder type sine and cosine offset, gain, etc.
829
830
  * - The iterations are being repeated until the encoder (raw) data satisfies a certain threshold.
830
831
  *
831
832
  * The result of a successful calibration is setting multiple parameters into registers of the specified encoder.
832
833
  *
833
834
  * At the end of the procedure Motion Master will rotate the motor back to the starting position and run commutation offset detection.
834
- * There will also be a final iteration which only measures the values of a (now) calibrated encoder for display.
835
+ * There will also be a final iteration that only measures the values of a (now) calibrated encoder for display.
835
836
  *
836
837
  * This request will turn the motor.
837
- *
838
- * @todo improve documentation
839
838
  */
840
839
  startCirculoEncoderNarrowAngleCalibrationProcedure(props, requestTimeout, messageId) {
841
840
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -845,7 +844,7 @@ class MotionMasterReqResClient {
845
844
  }));
846
845
  }
847
846
  /**
848
- * Get device cia402 state.
847
+ * Get device CiA402 state.
849
848
  */
850
849
  getDeviceCia402State(props, requestTimeout, messageId) {
851
850
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -855,7 +854,7 @@ class MotionMasterReqResClient {
855
854
  }));
856
855
  }
857
856
  /**
858
- * Set device cia402 state.
857
+ * Set device CiA402 state.
859
858
  */
860
859
  setDeviceCia402State(props, requestTimeout, messageId) {
861
860
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -867,9 +866,9 @@ class MotionMasterReqResClient {
867
866
  /**
868
867
  * Get system log.
869
868
  *
870
- * The system log represents the collected standard output from Motion Master process.
869
+ * The system log represents the collected standard output from the Motion Master process.
871
870
  *
872
- * This request will return the whole system log which can be max ~2MB.
871
+ * This request will return the entire system log, which can be a maximum of approximately 2MB.
873
872
  *
874
873
  * The log level can be set as an environmental variable when the Motion Master process is started.
875
874
  * The log level can be selected in the OBLAC Drives Update Service expert mode before installing a release.
@@ -893,17 +892,17 @@ class MotionMasterReqResClient {
893
892
  /**
894
893
  * Start device SII restore.
895
894
  *
896
- * This request uses the EEPROM tool from SOEM to overwrite the SII portion of EEPROM on a device.
895
+ * This request uses the EEPROM tool from SOEM to overwrite the SII portion of the EEPROM on a device.
897
896
  *
898
897
  * Motion Master will verify the provided SII file before writing it to EEPROM. It will:
899
- * - check the file content length,
900
- * - compute CRC from a part of the SII file content and compare it to the CRC inside the file,
901
- * - check the SII category types in the category header.
898
+ * - Check the file content length,
899
+ * - Compute CRC from a part of the SII file content and compare it to the CRC inside the file,
900
+ * - Check the SII category types in the category header.
902
901
  *
903
- * Unlike IgH EtherCAT Master which identifies interfaces by MAC address, the SOEM tool requires an adapter name.
904
- * Before calling SOEM tool Motion Master will find the adapter name by looking into /sys/class/net.
902
+ * Unlike IgH EtherCAT Master, which identifies interfaces by MAC address, the SOEM tool requires an adapter name.
903
+ * Before calling the SOEM tool, Motion Master will find the adapter name by looking into /sys/class/net.
905
904
  *
906
- * The SOEM tool binary is being delivered as a part of the Motion Master Docker image.
905
+ * The SOEM tool binary is delivered as a part of the Motion Master Docker image.
907
906
  */
908
907
  startDeviceSiiRestore(props, requestTimeout, messageId) {
909
908
  const startDeviceSiiRestore = types_1.MotionMasterMessage.Request.StartDeviceSiiRestore.create(props);
@@ -911,28 +910,28 @@ class MotionMasterReqResClient {
911
910
  return this.socket.message$.pipe((0, operators_2.transformMotionMasterMessageToStatus)('deviceSiiRestore', requestTimeout, id));
912
911
  }
913
912
  /**
914
- * Start open loop field control.
913
+ * Start open-loop field control.
915
914
  *
916
- * The precondition for running the open loop field control is to have a configured motor.
915
+ * The precondition for running the open-loop field control is to have a configured motor.
917
916
  * No encoder configuration or offset detection is required.
918
917
  *
919
- * Open loop field control is started by changing the Modes of operation (0x6060) parameter value to -3 (Open loop field mode) and
918
+ * Open-loop field control is started by changing the Modes of operation (0x6060) parameter value to -3 (Open-loop field mode) and
920
919
  * setting the CiA402 state to Ready to switch on.
921
- * After that, Motion Master will run several OS commands that configure the open loop field control parameters:
922
- * - start angle [milliradian]
923
- * - end angle [milliradian]
924
- * - max rotational speed [radian/s]
925
- * - rotational acceleration [radian/s^2]
926
- * - start length [permille of rated torque]
927
- * - end length [permille of rated torque]
928
- * - length speed [permille of rated torque]
929
- *
930
- * After the configuration Motion Master will switch device to Operation enabled CiA402 state and the profile will start.
931
- *
932
- * While the open loop field control is running Motion Master will monitor the target reached bit in the statusword.
920
+ * After that, Motion Master will run several OS commands that configure the open-loop field control parameters:
921
+ * - Start angle [milliradian]
922
+ * - End angle [milliradian]
923
+ * - Max rotational speed [radian/s]
924
+ * - Rotational acceleration [radian/s^2]
925
+ * - Start length [permille of rated torque]
926
+ * - End length [permille of rated torque]
927
+ * - Length speed [permille of rated torque]
928
+ *
929
+ * After the configuration, Motion Master will switch the device to Operation enabled CiA402 state, and the profile will start.
930
+ *
931
+ * While the open-loop field control is running, Motion Master will monitor the target reached bit in the statusword.
933
932
  * When the target reached bit becomes 1, Motion Master will stop the procedure by changing the CiA402 state to Switched on.
934
933
  *
935
- * Motion Master will return an error if the device goes out of Operation enabled state before target reached bit becomes 1.
934
+ * Motion Master will return an error if the device goes out of the Operation enabled state before the target reached bit becomes 1.
936
935
  * There is no timeout on the Motion Master side.
937
936
  *
938
937
  * This request will turn the motor.
@@ -955,21 +954,21 @@ class MotionMasterReqResClient {
955
954
  }));
956
955
  }
957
956
  /**
958
- * Start full auto tuning.
957
+ * Start full auto-tuning.
959
958
  *
960
- * The preconditions for running the full auto tuning are properly configured motor, brake and encoders,
961
- * and to have executed the offset detection and the system identification procedures.
959
+ * The preconditions for running the full auto-tuning are a properly configured motor, brake, and encoders,
960
+ * and having executed the offset detection and the system identification procedures.
962
961
  *
963
- * In order to successfully run the full auto tuning procedure, the motor must not rotate and the device must not be in CiA402 Operation enabled.
962
+ * In order to successfully run the full auto-tuning procedure, the motor must not rotate, and the device must not be in CiA402 Operation enabled.
964
963
  *
965
- * Motion Master will try to read the plant_model.csv file and if doesn't exist it will return an error.
964
+ * Motion Master will try to read the plant_model.csv file, and if it doesn't exist, it will return an error.
966
965
  *
967
- * Before the operation starts, Motion Master will measure the actual velocity for 500ms at a standstill in order to determine the encoder noise.
968
- * The noise is then sent, along with some other parameters (velocity feedback filter, feed forward, dc link voltage, firmware version and similar)
966
+ * Before the operation starts, Motion Master will measure the actual velocity for 500ms at a standstill to determine the encoder noise.
967
+ * The noise is then sent, along with some other parameters (velocity feedback filter, feed forward, DC link voltage, firmware version, and similar)
969
968
  * and data to a proprietary computation algorithm.
970
- * ADC current ratio which is used in the computation script is determined by the firmware version and the device hardware) ID (e.g. 9500, 9501, 8501...).
969
+ * ADC current ratio, which is used in the computation script, is determined by the firmware version and the device hardware ID (e.g., 9500, 9501, 8501...).
971
970
  *
972
- * Full auto tuning will compute the PID gains and Motion Master will update the parameter values in the velocity or position controller depending on the request.
971
+ * Full auto-tuning will compute the PID gains, and Motion Master will update the parameter values in the velocity or position controller, depending on the request.
973
972
  *
974
973
  * Motion Master will return the damping ratio, settling time, and bandwidth values when the procedure completes. UI will use these values to update the sliders in the Tuning screen.
975
974
  *
@@ -983,11 +982,11 @@ class MotionMasterReqResClient {
983
982
  }));
984
983
  }
985
984
  /**
986
- * Stop full auto tuning.
985
+ * Stop full auto-tuning.
987
986
  *
988
987
  * Motion Master has only one exit point for this procedure, which is after the computation algorithm ends.
989
988
  * This means that, once stopped, the procedure will compute the gains, but Motion Master will not update the controller parameters.
990
- * Previously started full auto tuning request will complete with an aborted error.
989
+ * A previously started full auto-tuning request will complete with an aborted error.
991
990
  */
992
991
  stopFullAutoTuning(props, requestTimeout, messageId) {
993
992
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -1008,17 +1007,19 @@ class MotionMasterReqResClient {
1008
1007
  /**
1009
1008
  * Start Circulo encoder configuration.
1010
1009
  *
1011
- * The preconditions for this procedure are to have Circulo device with internal encoders and a firmware >=v5.
1010
+ * The preconditions for this procedure are to have a Circulo device with internal encoders and firmware >=v5.
1012
1011
  *
1013
- * This procedure will set various internal encoder registers based on the hardware description, Circulo device type and the encoder ordinal.
1012
+ * This procedure will set various internal encoder registers based on the hardware description, Circulo device type, and the encoder ordinal.
1014
1013
  *
1015
- * Before updating the registers, Motion Master will send an OS command to ignore the BiSS status bits. Once the procedure is done the value of this register will be reverted.
1014
+ * Before updating the registers, Motion Master will send an OS command to ignore the BiSS status bits.
1015
+ * Once the procedure is done, the value of this register will be reverted.
1016
1016
  *
1017
1017
  * Depending on the setup, this procedure can take up to 30 seconds.
1018
1018
  *
1019
- * This procedure can fail if it's already running, if it's not supported because of the firmware version, or if the hardware description file is missing.
1019
+ * This procedure can fail if it's already running, if it's not supported because of the firmware version,
1020
+ * or if the hardware description file is missing.
1020
1021
  *
1021
- * While this procedure runs, Motion Master will return its progress.
1022
+ * While this procedure runs, Motion Master will report its progress.
1022
1023
  */
1023
1024
  startCirculoEncoderConfiguration(props, requestTimeout, messageId) {
1024
1025
  return this.resolveDeviceAddress(props).pipe((0, operators_1.mergeMap)((deviceAddress) => {
@@ -1040,7 +1041,7 @@ class MotionMasterReqResClient {
1040
1041
  /**
1041
1042
  * Start OS command.
1042
1043
  *
1043
- * This request will execute an OS command and return a result as a bytearray.
1044
+ * This request will execute an OS command and return the result as a byte array.
1044
1045
  *
1045
1046
  * Motion Master will check if an OS command is already running and use a mutex to ensure only one OS command runs at a time.
1046
1047
  *
@@ -1057,6 +1058,14 @@ class MotionMasterReqResClient {
1057
1058
  return this.socket.message$.pipe((0, operators_2.transformMotionMasterMessageToStatus)('osCommand', requestTimeout, id));
1058
1059
  }));
1059
1060
  }
1061
+ /**
1062
+ * Send request.
1063
+ *
1064
+ * Create a Motion Master message with the provided request, optionally generate a unique message ID,
1065
+ * and then send the message through the socket.
1066
+ *
1067
+ * @returns the message ID
1068
+ */
1060
1069
  sendRequest(request, messageId) {
1061
1070
  const id = messageId !== null && messageId !== void 0 ? messageId : (0, uuid_1.v4)();
1062
1071
  const message = types_1.MotionMasterMessage.create({ request, id });
@@ -1066,6 +1075,11 @@ class MotionMasterReqResClient {
1066
1075
  //
1067
1076
  // Helpers
1068
1077
  //
1078
+ /**
1079
+ * Get the device serial number by device address.
1080
+ *
1081
+ * This function does not make any requests; instead, it utilizes the previously mapped device serial number to an instance of a device.
1082
+ */
1069
1083
  getSerialNumberByDeviceAddress(deviceAddress) {
1070
1084
  for (let [serialNumber, device] of this.deviceMap.entries()) {
1071
1085
  if (device.deviceAddress === deviceAddress) {
@@ -1074,6 +1088,16 @@ class MotionMasterReqResClient {
1074
1088
  }
1075
1089
  return;
1076
1090
  }
1091
+ /**
1092
+ * Resolve a device.
1093
+ *
1094
+ * Resolves the device object by its reference, which can be a position, serial number, or device address.
1095
+ *
1096
+ * This function will make requests to retrieve the list of devices and the .hardware_description file for each device,
1097
+ * but only if it has not been previously retrieved for this session.
1098
+ *
1099
+ * @throws errors if the device reference is invalid
1100
+ */
1077
1101
  resolveDevice(deviceRef, requestTimeout = 5000) {
1078
1102
  const deviceRefObj = (typeof deviceRef === 'object') ? deviceRef : (0, util_1.makeDeviceRefObj)(deviceRef);
1079
1103
  if (!(0, util_1.isValidDeviceRefObj)(deviceRefObj)) {
@@ -1105,10 +1129,10 @@ class MotionMasterReqResClient {
1105
1129
  /**
1106
1130
  * Resolve device address.
1107
1131
  *
1108
- * This method should return device address by device reference object,
1109
- * or throw an Error if device address cannot be found.
1132
+ * This method should return the device address by a device reference object,
1133
+ * or throw an error if the device address cannot be found.
1110
1134
  *
1111
- * Read the description of this class for more info.
1135
+ * Refer to the description of this class for more information.
1112
1136
  */
1113
1137
  resolveDeviceAddress(deviceRef, requestTimeout = 5000) {
1114
1138
  const deviceRefObj = (typeof deviceRef === 'object') ? deviceRef : (0, util_1.makeDeviceRefObj)(deviceRef);
@@ -1117,8 +1141,9 @@ class MotionMasterReqResClient {
1117
1141
  /**
1118
1142
  * Get devices.
1119
1143
  *
1120
- * Get device info from Motion Master and for each device in the list
1121
- * read its .hardware_description file and assign its content to the device.
1144
+ * Retrieve device information from Motion Master.
1145
+ *
1146
+ * For each device in the list, read its .hardware_description file and assign its content to the device.
1122
1147
  */
1123
1148
  getDevices(requestTimeout = 5000) {
1124
1149
  return this.getDeviceInfo(requestTimeout).pipe((0, operators_1.mergeMap)((deviceInfo) => {
@@ -1714,6 +1739,62 @@ class MotionMasterReqResClient {
1714
1739
  yield this.download(deviceRef, 0x6040, 0, controlword);
1715
1740
  });
1716
1741
  }
1742
+ /**
1743
+ * Run OS command.
1744
+ *
1745
+ * The OS command is a standard way of triggering actions or services that cannot be accommodated through a single SDO upload/download.
1746
+ *
1747
+ * The Dictionary object 0x1023 is used for executing OS commands. The following is the subindex list and their meanings:
1748
+ *
1749
+ * - 1: Command (OCTET_STRING), 8 bytes
1750
+ * - Byte 0: OS command ID, OS commands are identified by number, and here we specify which OS command to run, for example, 0 is encoder register communication
1751
+ * - Byte 1-7: Service request data, the remaining 7 bytes serve as arguments to the OS command, specifying details such as what register to read the value from
1752
+ * - 2: Status (UNSIGNED8), 1 byte
1753
+ * - 0: last command completed, no errors, no response data
1754
+ * - 1: last command completed, no errors, response data available
1755
+ * - 2: last command completed, error, no response data
1756
+ * - 3: last command completed, error, response data available
1757
+ * - 100-200: command executing with percentage (100 = 0%, 200 = 100%)
1758
+ * - 255: command executing (if percentage display is not supported)
1759
+ * - 3: Response (OCTET_STRING), 8 bytes
1760
+ * - Byte 0: Same as subindex 2
1761
+ * - Byte 1: unused
1762
+ * - Byte 2-7: Service response data, if the last command completed with response data, it will be available in these 6 bytes, for example, the value of the BiSS register
1763
+ *
1764
+ * Note that:
1765
+ * - As soon as the value of 1: Command Byte 0 changes, the OS command will start to execute.
1766
+ * - If the last command completed with response data, it will be available in bytes 2-7 of 3: Response subindex.
1767
+ * - The value of subindex 2: Status will be the same as that of 3: Response Byte 0.
1768
+ *
1769
+ * All possible cases of 0x1023:03 Response subindex:
1770
+ *
1771
+ * | Description | Byte 0 | Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 |
1772
+ * |-------------------------------------------------------|:-------:|:------:|:-------------:|:------:|:------:|:------:|:------:|:------:|
1773
+ * | Command in progress with percentage | 100-200 | - | - | - | - | - | - | - |
1774
+ * | Command in progress without percentage | 255 | - | - | - | - | - | - | - |
1775
+ * | Command completed without errors and without response | 0 | - | - | - | - | - | - | - |
1776
+ * | Command completed without errors and with response | 1 | - | Data | Data | Data | Data | Data | Data |
1777
+ * | Command completed with error and without response | 2 | - | - | - | - | - | - | - |
1778
+ * | Command completed with error and with response | 3 | - | OS error code | Data | Data | Data | Data | Data |
1779
+ *
1780
+ * Note that in the case of "Command completed without errors and with response," 6 bytes can be used for data.
1781
+ * However, only 5 bytes are available in the case of "Command completed with error and with response."
1782
+ * This limitation arises because Byte 2 in the latter response is allocated for the OS error code.
1783
+ * The OS error code serves to indicate the reason behind the error occurrence.
1784
+ *
1785
+ * 0x1023: OS command is used in combination with 0x1024: OS command mode object.
1786
+ * In our firmware, only the values 0 and 3 from the 0x1024 command mode object (USINT) are handled, and their meanings are as follows:
1787
+ * - 0: Execute the next command immediatelly (default)
1788
+ * - 3: Abort the current command and all commands in the buffer
1789
+ *
1790
+ * Note that if
1791
+ * TODO: ensure that command was aborted, must switch to 0 after the OS command was aborted
1792
+ *
1793
+ * @returns
1794
+ */
1795
+ runOsCommand() {
1796
+ return;
1797
+ }
1717
1798
  /**
1718
1799
  * Set halt bit.
1719
1800
  *