@synapticon/motion-master-client 6.0.0-alpha.100 → 6.0.0-alpha.111

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.
@@ -1,4 +1,4 @@
1
- import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, CaptureSummary, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
1
+ import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, CaptureSummary, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IdentifiedPlantModel, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
2
2
  import { HttpClient, RequestParams } from "./http-client.js";
3
3
  export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
4
  /**
@@ -1112,6 +1112,14 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1112
1112
  * @request GET:/api/devices/{slavePosition}/variant
1113
1113
  */
1114
1114
  getDeviceIntegroVariant: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<IntegroVariant, void>>;
1115
+ /**
1116
+ * @description Reads and decodes the drive's `plant_model.csv` over FoE: the transfer function from torque in Nm to velocity in rad/s that the `plant-identification` procedure fitted, and the chirp it was identified with. Controller and notch filter auto-tuning compute from this model. **A 404 is the answer for a drive that was never identified.** The file is written by the procedure and by nothing else, so its absence is a state rather than a problem. The Bode data is not in the file; it is in the result of the run that produced the model.
1117
+ *
1118
+ * @name GetDevicePlantModel
1119
+ * @summary Read the plant model stored on a drive
1120
+ * @request GET:/api/devices/{slavePosition}/plant-model
1121
+ */
1122
+ getDevicePlantModel: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<IdentifiedPlantModel, void>>;
1115
1123
  /**
1116
1124
  * @description Reads the device's `.hardware_description` and `.variant`, assembles the full firmware descriptors it accepts, and compares them against the descriptor in `filename`. **A mismatch is a `200` carrying `compatible: false`**, not an error status: the client asked a question and got an answer, and the body names both descriptors so it can say which hardware the package was for. A `4xx` means the question could not be asked — the filename is not a package name, or the hardware description could not be read. **Nothing acts on the answer.** The firmware installation procedure writes whatever it is given, on purpose, so this exists to tell a user before they start.
1117
1125
  *
@@ -1508,6 +1516,90 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1508
1516
  */
1509
1517
  error: string;
1510
1518
  }>>;
1519
+ /**
1520
+ * @description Commands one or more devices to INIT and then up to `target` one EtherCAT Application Layer state at a time: PRE-OP, SAFE-OP, OP. A `target` of BOOT is INIT and then BOOT. Each step blocks until every targeted device arrives or the timeout elapses, and the walk stops at the first step a device does not reach. `step` is the last state commanded, and `devices` holds the settled state of every targeted device after it, each with a `reached` flag. `ok` is true only when `step` is `target` and every device reached it. A restart drops every targeted device out of process data exchange, so a drive that was enabled is disabled, and a monitoring reports null for it until it exchanges again. The body is optional: no body restarts every discovered device to OP (8). State values are the standard AL state register encodings from ETG.1000.6: 1 (Init), 2 (PreOp), 3 (Boot), 4 (SafeOp), 8 (Op).
1521
+ *
1522
+ * @name RestartDevices
1523
+ * @summary Restart devices through INIT up to an AL state
1524
+ * @request POST:/api/devices/restart
1525
+ */
1526
+ restartDevices: (data?: {
1527
+ /**
1528
+ * 1-based slave positions to restart. Omit or pass an empty array to restart all discovered devices.
1529
+ * @example [1,2]
1530
+ */
1531
+ positions?: number[];
1532
+ /**
1533
+ * The EtherCAT AL state to end in (ETG.1000.6 AL control register encoding): 1 = Init, 2 = PreOp, 3 = Boot, 4 = SafeOp, 8 = Op.
1534
+ * @default 8
1535
+ * @example 8
1536
+ */
1537
+ target?: 1 | 2 | 3 | 4 | 8;
1538
+ /**
1539
+ * Maximum time to wait for all devices, in milliseconds, for each step
1540
+ * @default 5000
1541
+ * @example 5000
1542
+ */
1543
+ timeout?: number;
1544
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
1545
+ /**
1546
+ * True only when every targeted device reached `target`.
1547
+ * @example true
1548
+ */
1549
+ ok: boolean;
1550
+ /**
1551
+ * The last AL state the restart commanded. It is `target` when every device arrived, and the state a device fell short of otherwise.
1552
+ * @example 8
1553
+ */
1554
+ step: 1 | 2 | 3 | 4 | 8;
1555
+ /** Settled state of each targeted device, in the order targeted. */
1556
+ devices: {
1557
+ /**
1558
+ * 1-based position on the fieldbus
1559
+ * @example 1
1560
+ */
1561
+ slavePosition: number;
1562
+ /**
1563
+ * Raw AL Status register value (ETG.1000.6 §6.4.1). Bits 3:0 encode the state; bit 4 is the error indicator.
1564
+ * @example 2
1565
+ */
1566
+ alStatus: number;
1567
+ /**
1568
+ * Current AL state decoded from alStatus (ETG.1000.6 encoding): 1 = Init, 2 = PreOp, 3 = Boot, 4 = SafeOp, 8 = Op. 0 when the device does not answer (see `reachability`).
1569
+ * @example 2
1570
+ */
1571
+ alState: 0 | 1 | 2 | 3 | 4 | 8;
1572
+ /**
1573
+ * True when the AL Status error indicator bit (bit 4) is set
1574
+ * @example false
1575
+ */
1576
+ error: boolean;
1577
+ /**
1578
+ * AL Status Code register (ETG.1000.6 §6.4.1). Non-zero when error is true; identifies the error cause (e.g. 0x0014 = No valid firmware).
1579
+ * @example 0
1580
+ */
1581
+ alStatusCode: number;
1582
+ /**
1583
+ * Whether the device answers at the station address the master gave it. `addressLost`: nothing answers at that address, but a device answers at its wire position. A reset, such as a power cycle, clears the address. Run `POST /api/scan` to command it again. `notAnswering`: nothing answers at that address or at its wire position. Check the cabling and the power. If devices were removed from the chain, run a scan. The wire position is checked by position only, so after a change to the chain the device that answers there can be a different one. When the value is not `answering`, the state of the device is unknown, and `alStatus`, `alState` and `alStatusCode` are 0.
1584
+ * @example "answering"
1585
+ */
1586
+ reachability: "answering" | "addressLost" | "notAnswering";
1587
+ /**
1588
+ * True when this device reached `step` (error clear and alState equal to `step`).
1589
+ * @example true
1590
+ */
1591
+ reached: boolean;
1592
+ }[];
1593
+ }, void | {
1594
+ /** Why the driver refuses state changes */
1595
+ error: string;
1596
+ } | {
1597
+ /**
1598
+ * Human-readable error message from the driver
1599
+ * @example "FPRD slave 1: wkc=0"
1600
+ */
1601
+ error: string;
1602
+ }>>;
1511
1603
  /**
1512
1604
  * No description
1513
1605
  *
@@ -765,6 +765,19 @@ export class Api extends HttpClient {
765
765
  format: "json",
766
766
  ...params,
767
767
  });
768
+ /**
769
+ * @description Reads and decodes the drive's `plant_model.csv` over FoE: the transfer function from torque in Nm to velocity in rad/s that the `plant-identification` procedure fitted, and the chirp it was identified with. Controller and notch filter auto-tuning compute from this model. **A 404 is the answer for a drive that was never identified.** The file is written by the procedure and by nothing else, so its absence is a state rather than a problem. The Bode data is not in the file; it is in the result of the run that produced the model.
770
+ *
771
+ * @name GetDevicePlantModel
772
+ * @summary Read the plant model stored on a drive
773
+ * @request GET:/api/devices/{slavePosition}/plant-model
774
+ */
775
+ getDevicePlantModel = (slavePosition, params = {}) => this.request({
776
+ path: `/api/devices/${slavePosition}/plant-model`,
777
+ method: "GET",
778
+ format: "json",
779
+ ...params,
780
+ });
768
781
  /**
769
782
  * @description Reads the device's `.hardware_description` and `.variant`, assembles the full firmware descriptors it accepts, and compares them against the descriptor in `filename`. **A mismatch is a `200` carrying `compatible: false`**, not an error status: the client asked a question and got an answer, and the body names both descriptors so it can say which hardware the package was for. A `4xx` means the question could not be asked — the filename is not a package name, or the hardware description could not be read. **Nothing acts on the answer.** The firmware installation procedure writes whatever it is given, on purpose, so this exists to tell a user before they start.
770
783
  *
@@ -1029,6 +1042,21 @@ export class Api extends HttpClient {
1029
1042
  format: "json",
1030
1043
  ...params,
1031
1044
  });
1045
+ /**
1046
+ * @description Commands one or more devices to INIT and then up to `target` one EtherCAT Application Layer state at a time: PRE-OP, SAFE-OP, OP. A `target` of BOOT is INIT and then BOOT. Each step blocks until every targeted device arrives or the timeout elapses, and the walk stops at the first step a device does not reach. `step` is the last state commanded, and `devices` holds the settled state of every targeted device after it, each with a `reached` flag. `ok` is true only when `step` is `target` and every device reached it. A restart drops every targeted device out of process data exchange, so a drive that was enabled is disabled, and a monitoring reports null for it until it exchanges again. The body is optional: no body restarts every discovered device to OP (8). State values are the standard AL state register encodings from ETG.1000.6: 1 (Init), 2 (PreOp), 3 (Boot), 4 (SafeOp), 8 (Op).
1047
+ *
1048
+ * @name RestartDevices
1049
+ * @summary Restart devices through INIT up to an AL state
1050
+ * @request POST:/api/devices/restart
1051
+ */
1052
+ restartDevices = (data, params = {}) => this.request({
1053
+ path: `/api/devices/restart`,
1054
+ method: "POST",
1055
+ body: data,
1056
+ type: ContentType.Json,
1057
+ format: "json",
1058
+ ...params,
1059
+ });
1032
1060
  /**
1033
1061
  * No description
1034
1062
  *
@@ -878,6 +878,36 @@ export interface IntegroVariantOption {
878
878
  }
879
879
  /** One option code from a decoded file, expanded into its catalogue entry. Everything but `id` is absent for a code the catalogue does not name, so "we do not know what this is" is missing properties rather than the string `unknown`. */
880
880
  export type IntegroVariantFileOption = UtilRequiredKeys<IntegroVariantOption, "id">;
881
+ /**
882
+ * A plant model as plant identification stored it on the drive: the transfer function from torque in Nm to velocity in rad/s, coefficients highest order first and normalised so that the numerator's last coefficient is 1, and the chirp it was identified with. The last two denominator coefficients are the effective inertia and the effective viscous friction of the reduced model, which is how auto-tuning reads them.
883
+ * @example {"numerator":[1],"denominator":[0.000123,0.0456],"inertia":0.000123,"friction":0.0456,"chirp":{"startFrequencyHz":1,"endFrequencyHz":100,"amplitudePermil":300,"durationMs":3000,"signalType":"logarithmic"}}
884
+ */
885
+ export interface IdentifiedPlantModel {
886
+ numerator: number[];
887
+ denominator: number[];
888
+ /**
889
+ * The denominator coefficient before the last; null when there are fewer than two
890
+ * @format double
891
+ */
892
+ inertia: number | null;
893
+ /**
894
+ * The last denominator coefficient; null when the denominator is empty
895
+ * @format double
896
+ */
897
+ friction: number | null;
898
+ /** What excited the plant. A file written without a chirp row reads back with zeros and the logarithmic type. */
899
+ chirp: {
900
+ /** @format double */
901
+ startFrequencyHz: number;
902
+ /** @format double */
903
+ endFrequencyHz: number;
904
+ /** Peak excitation, in per mille of rated torque */
905
+ amplitudePermil: number;
906
+ /** How long the sweep took */
907
+ durationMs: number;
908
+ signalType: "logarithmic" | "linear";
909
+ };
910
+ }
881
911
  /**
882
912
  * A decoded `.variant` file: which features a SOMANET Integro was licensed with.
883
913
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.100",
3
+ "version": "6.0.0-alpha.111",
4
4
  "description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
5
5
  "license": "MIT",
6
6
  "repository": {