@synapticon/motion-master-client 6.0.0-alpha.78 → 6.0.0-alpha.82
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.
- package/dist/generated/Api.d.ts +90 -2
- package/dist/generated/Api.js +54 -1
- package/dist/generated/data-contracts.d.ts +272 -1
- package/package.json +1 -1
package/dist/generated/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlStatusCode, BrakeState, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
|
|
1
|
+
import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, 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
|
/**
|
|
@@ -336,7 +336,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
336
336
|
error: string;
|
|
337
337
|
}>>;
|
|
338
338
|
/**
|
|
339
|
-
* @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised).
|
|
339
|
+
* @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
|
|
340
340
|
*
|
|
341
341
|
* @name Scan
|
|
342
342
|
* @summary Scan the bus for slaves
|
|
@@ -374,6 +374,34 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
374
374
|
* @request GET:/api/log
|
|
375
375
|
*/
|
|
376
376
|
getLog: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<string, any>>;
|
|
377
|
+
/**
|
|
378
|
+
* @description Reports what Motion Master knows about the auto-tuning process. The tuning calculations run in a separate executable, which Motion Master starts at startup and reaches over loopback. That executable is downloaded by the install scripts rather than shipped in a release, so a machine may not have it — this endpoint is how a client tells the four cases apart: switched off in the configuration, not installed, installed but would not start, or running. The values are a startup snapshot. `started` says the process answered when Motion Master waited for it, not that it is alive now. Nothing polls it: a call is the honest test, and `POST /api/auto-tuning/run` makes one.
|
|
379
|
+
*
|
|
380
|
+
* @name GetAutoTuning
|
|
381
|
+
* @summary Auto-tuning process status
|
|
382
|
+
* @request GET:/api/auto-tuning
|
|
383
|
+
*/
|
|
384
|
+
getAutoTuning: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<AutoTuningStatus, any>>;
|
|
385
|
+
/**
|
|
386
|
+
* @description Forwards the request to the auto-tuning process and returns its reply unchanged. The body is a JSON object with `run`, naming the function, and `data`, holding that function's inputs — the same shape the auto-tuning program takes on its own API. **A rejected input is reported with 200 and an `error` property**, not with a 4xx. The auto-tuning program keeps 4xx and 5xx for a malformed request, an unknown function name, and a routine that threw, so a client tests for `error` in the body rather than relying on the status alone. Motion Master passes both through untouched; only 400, 502 and 503 below are its own. Measurement data travels in the body. `identify_plant_model` takes the chirp measurements as `data.csv` text, and the bode data comes back inline as `bode`, so no file is written and nothing needs a shared filesystem view. The schemas here are a copy of the auto-tuning program's own, taken from version 3.1.1, and they exist so that the generated clients are typed. That program's current description is served verbatim at `GET /api/auto-tuning/swagger.yml`, which is the authority if the two ever disagree.
|
|
387
|
+
*
|
|
388
|
+
* @name RunAutoTuning
|
|
389
|
+
* @summary Run an auto-tuning function
|
|
390
|
+
* @request POST:/api/auto-tuning/run
|
|
391
|
+
*/
|
|
392
|
+
runAutoTuning: (data: AutoTuningRunRequest, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<AutoTuningRunResponse, AutoTuningError | {
|
|
393
|
+
error: string;
|
|
394
|
+
}>>;
|
|
395
|
+
/**
|
|
396
|
+
* @description Serves the OpenAPI document the auto-tuning process carries, fetched from it on each request. The schemas under `/api/auto-tuning/run` above are a copy of these, so this is where to look when a version of the program disagrees with them.
|
|
397
|
+
*
|
|
398
|
+
* @name GetAutoTuningSpec
|
|
399
|
+
* @summary The auto-tuning program's own API description
|
|
400
|
+
* @request GET:/api/auto-tuning/swagger.yml
|
|
401
|
+
*/
|
|
402
|
+
getAutoTuningSpec: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<string, {
|
|
403
|
+
error: string;
|
|
404
|
+
}>>;
|
|
377
405
|
/**
|
|
378
406
|
* @description Returns the static catalogue of EtherCAT AL Status Codes defined in ETG.1000.6 §6.4.1. These codes appear in the alStatusCode field of the device state response when an error is present and identify the cause of the state transition failure.
|
|
379
407
|
*
|
|
@@ -406,6 +434,66 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
406
434
|
* @request GET:/api/meta/sdo-abort-codes
|
|
407
435
|
*/
|
|
408
436
|
getSdoAbortCodes: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<SdoAbortCode[], any>>;
|
|
437
|
+
/**
|
|
438
|
+
* @description The register maps of the two iC-Haus chips inside a Circulo's internal encoder — the reference tables for POST /api/devices/{slavePosition}/procedures/encoder-register-communication, and documentation in their own right. Static: they describe the chips, not any connected device, so no bus and no scan are needed. Two chips, and the iC-MU is the one in charge. The iC-MU is the position encoder proper, a magnetic off-axis absolute chip speaking BiSS-C to the drive. The iC-PVL is a battery-buffered Hall multiturn counter behind it, reached over I2C through the iC-MU rather than directly. The response is a list of register *spaces*, not of registers, because an address alone names nothing: the same iC-PVL address 0x00 is a configuration register in one space and the status register in another, depending on which I2C device id addressed it. Each space says which chip it belongs to and how it is reached. A row is one address, or the range the datasheet prints as one row — `address` and `lastAddress` are equal in the ordinary case. `fields` lists the named pieces of the register, most significant bit first, each with the datasheet's own one-line description; it is empty exactly when `reserved` is true. `layout` is those same fields rendered as the datasheet prints the row, e.g. `GC_M(1:0) | GF_M(5:0)`, derived rather than stored so it cannot disagree with them. `spiOnly` marks the iC-MU's 0x80-0xAF, which is reachable over SPI only and so beyond the drive's register communication service. A field's `bits` is its own bit slice as the register map prints it, not its position within the byte: `GC_M(1:0)` occupies bits 7:6 of address 0x00 and reads "1:0" because those are the field's two bits. A value wider than one register is spread across several, which is why `RESABZ` reads "7:0" at 0x13 and "15:8" at 0x14. Granularity follows each datasheet's own register map. The iC-PVL prints its status registers bit by bit, so those arrive as eight fields; the iC-MU prints its own as `STATUS0(7:0)`, so that is one field. Transcribed from the vendors' datasheets: iC-MU Series Rev B1 (Tables 90 and 91) and iC-PVL Rev F2 (Tables 5, 6 and 7), with descriptions from their CONFIGURATION PARAMETERS indexes and, for the iC-PVL status bytes, its status tables. The prose behind those one-liners is not reproduced.
|
|
439
|
+
*
|
|
440
|
+
* @name GetIcHausRegisters
|
|
441
|
+
* @summary The Circulo internal encoder's register maps
|
|
442
|
+
* @request GET:/api/meta/ic-haus-registers
|
|
443
|
+
*/
|
|
444
|
+
getIcHausRegisters: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
|
|
445
|
+
/** @example "iC-MU" */
|
|
446
|
+
chip: "iC-MU" | "iC-PVL";
|
|
447
|
+
/**
|
|
448
|
+
* The datasheet's own name for the space.
|
|
449
|
+
* @example "CONF, bank 0, addresses 0x00-0x3F"
|
|
450
|
+
*/
|
|
451
|
+
name: string;
|
|
452
|
+
/** How the space is reached, which is what decides whether the register communication service can read it at all. */
|
|
453
|
+
addressing: string;
|
|
454
|
+
registers: {
|
|
455
|
+
/**
|
|
456
|
+
* The address, or the first of a printed range.
|
|
457
|
+
* @example 15
|
|
458
|
+
*/
|
|
459
|
+
address: number;
|
|
460
|
+
/**
|
|
461
|
+
* The last address of the range; equal to address for a single-address row.
|
|
462
|
+
* @example 15
|
|
463
|
+
*/
|
|
464
|
+
lastAddress: number;
|
|
465
|
+
/**
|
|
466
|
+
* The fields rendered as the datasheet prints the row. "RESERVED" for a reserved row.
|
|
467
|
+
* @example "SPO_MT(3:0) | MPC(3:0)"
|
|
468
|
+
*/
|
|
469
|
+
layout: string;
|
|
470
|
+
/** The named pieces of this register, most significant bit first. Empty when reserved. */
|
|
471
|
+
fields: {
|
|
472
|
+
/**
|
|
473
|
+
* The datasheet's own name for the field.
|
|
474
|
+
* @example "SPO_MT"
|
|
475
|
+
*/
|
|
476
|
+
name: string;
|
|
477
|
+
/**
|
|
478
|
+
* The field's own bit slice as the register map prints it, empty where it prints a bare name. Not the position within the byte.
|
|
479
|
+
* @example "3:0"
|
|
480
|
+
*/
|
|
481
|
+
bits: string;
|
|
482
|
+
/**
|
|
483
|
+
* The datasheet's one-line description of the field.
|
|
484
|
+
* @example "Offset external multiturn"
|
|
485
|
+
*/
|
|
486
|
+
description: string;
|
|
487
|
+
}[];
|
|
488
|
+
/** @example false */
|
|
489
|
+
reserved: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Reachable over SPI only, so the register communication service cannot touch it.
|
|
492
|
+
* @example false
|
|
493
|
+
*/
|
|
494
|
+
spiOnly: boolean;
|
|
495
|
+
}[];
|
|
496
|
+
}[], any>>;
|
|
409
497
|
/**
|
|
410
498
|
* @description The register map of the Integro's internal (Kübler) encoder — the reference table for POST /api/devices/{slavePosition}/procedures/kuebler-register-communication, and documentation in its own right. Static: it describes the encoder type, not any connected device, so it needs no bus and no scan. Transcribed from the vendor's own draft table. Each entry carries the width, the access type, whether the encoder actually implements it — seven are documented but not implemented — and the vendor's bit definitions verbatim, which for a bit-field register is the only place its meaning is recorded. `format` says how to read the assembled value, because signedness is not uniform and one register is not a single number at all: `unsigned`, `signed`, `bitField` (the number means nothing on its own), or `signedHalves` — two signed 16-bit values packed into 32 bits, which register 0x3C is the only case of. `readableInOneCommand` is false for the one 64-bit register, since the command's length byte caps at 4 bytes.
|
|
411
499
|
*
|
package/dist/generated/Api.js
CHANGED
|
@@ -130,7 +130,7 @@ export class Api extends HttpClient {
|
|
|
130
130
|
...params,
|
|
131
131
|
});
|
|
132
132
|
/**
|
|
133
|
-
* @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised).
|
|
133
|
+
* @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
|
|
134
134
|
*
|
|
135
135
|
* @name Scan
|
|
136
136
|
* @summary Scan the bus for slaves
|
|
@@ -167,6 +167,46 @@ export class Api extends HttpClient {
|
|
|
167
167
|
method: "GET",
|
|
168
168
|
...params,
|
|
169
169
|
});
|
|
170
|
+
/**
|
|
171
|
+
* @description Reports what Motion Master knows about the auto-tuning process. The tuning calculations run in a separate executable, which Motion Master starts at startup and reaches over loopback. That executable is downloaded by the install scripts rather than shipped in a release, so a machine may not have it — this endpoint is how a client tells the four cases apart: switched off in the configuration, not installed, installed but would not start, or running. The values are a startup snapshot. `started` says the process answered when Motion Master waited for it, not that it is alive now. Nothing polls it: a call is the honest test, and `POST /api/auto-tuning/run` makes one.
|
|
172
|
+
*
|
|
173
|
+
* @name GetAutoTuning
|
|
174
|
+
* @summary Auto-tuning process status
|
|
175
|
+
* @request GET:/api/auto-tuning
|
|
176
|
+
*/
|
|
177
|
+
getAutoTuning = (params = {}) => this.request({
|
|
178
|
+
path: `/api/auto-tuning`,
|
|
179
|
+
method: "GET",
|
|
180
|
+
format: "json",
|
|
181
|
+
...params,
|
|
182
|
+
});
|
|
183
|
+
/**
|
|
184
|
+
* @description Forwards the request to the auto-tuning process and returns its reply unchanged. The body is a JSON object with `run`, naming the function, and `data`, holding that function's inputs — the same shape the auto-tuning program takes on its own API. **A rejected input is reported with 200 and an `error` property**, not with a 4xx. The auto-tuning program keeps 4xx and 5xx for a malformed request, an unknown function name, and a routine that threw, so a client tests for `error` in the body rather than relying on the status alone. Motion Master passes both through untouched; only 400, 502 and 503 below are its own. Measurement data travels in the body. `identify_plant_model` takes the chirp measurements as `data.csv` text, and the bode data comes back inline as `bode`, so no file is written and nothing needs a shared filesystem view. The schemas here are a copy of the auto-tuning program's own, taken from version 3.1.1, and they exist so that the generated clients are typed. That program's current description is served verbatim at `GET /api/auto-tuning/swagger.yml`, which is the authority if the two ever disagree.
|
|
185
|
+
*
|
|
186
|
+
* @name RunAutoTuning
|
|
187
|
+
* @summary Run an auto-tuning function
|
|
188
|
+
* @request POST:/api/auto-tuning/run
|
|
189
|
+
*/
|
|
190
|
+
runAutoTuning = (data, params = {}) => this.request({
|
|
191
|
+
path: `/api/auto-tuning/run`,
|
|
192
|
+
method: "POST",
|
|
193
|
+
body: data,
|
|
194
|
+
type: ContentType.Json,
|
|
195
|
+
format: "json",
|
|
196
|
+
...params,
|
|
197
|
+
});
|
|
198
|
+
/**
|
|
199
|
+
* @description Serves the OpenAPI document the auto-tuning process carries, fetched from it on each request. The schemas under `/api/auto-tuning/run` above are a copy of these, so this is where to look when a version of the program disagrees with them.
|
|
200
|
+
*
|
|
201
|
+
* @name GetAutoTuningSpec
|
|
202
|
+
* @summary The auto-tuning program's own API description
|
|
203
|
+
* @request GET:/api/auto-tuning/swagger.yml
|
|
204
|
+
*/
|
|
205
|
+
getAutoTuningSpec = (params = {}) => this.request({
|
|
206
|
+
path: `/api/auto-tuning/swagger.yml`,
|
|
207
|
+
method: "GET",
|
|
208
|
+
...params,
|
|
209
|
+
});
|
|
170
210
|
/**
|
|
171
211
|
* @description Returns the static catalogue of EtherCAT AL Status Codes defined in ETG.1000.6 §6.4.1. These codes appear in the alStatusCode field of the device state response when an error is present and identify the cause of the state transition failure.
|
|
172
212
|
*
|
|
@@ -219,6 +259,19 @@ export class Api extends HttpClient {
|
|
|
219
259
|
format: "json",
|
|
220
260
|
...params,
|
|
221
261
|
});
|
|
262
|
+
/**
|
|
263
|
+
* @description The register maps of the two iC-Haus chips inside a Circulo's internal encoder — the reference tables for POST /api/devices/{slavePosition}/procedures/encoder-register-communication, and documentation in their own right. Static: they describe the chips, not any connected device, so no bus and no scan are needed. Two chips, and the iC-MU is the one in charge. The iC-MU is the position encoder proper, a magnetic off-axis absolute chip speaking BiSS-C to the drive. The iC-PVL is a battery-buffered Hall multiturn counter behind it, reached over I2C through the iC-MU rather than directly. The response is a list of register *spaces*, not of registers, because an address alone names nothing: the same iC-PVL address 0x00 is a configuration register in one space and the status register in another, depending on which I2C device id addressed it. Each space says which chip it belongs to and how it is reached. A row is one address, or the range the datasheet prints as one row — `address` and `lastAddress` are equal in the ordinary case. `fields` lists the named pieces of the register, most significant bit first, each with the datasheet's own one-line description; it is empty exactly when `reserved` is true. `layout` is those same fields rendered as the datasheet prints the row, e.g. `GC_M(1:0) | GF_M(5:0)`, derived rather than stored so it cannot disagree with them. `spiOnly` marks the iC-MU's 0x80-0xAF, which is reachable over SPI only and so beyond the drive's register communication service. A field's `bits` is its own bit slice as the register map prints it, not its position within the byte: `GC_M(1:0)` occupies bits 7:6 of address 0x00 and reads "1:0" because those are the field's two bits. A value wider than one register is spread across several, which is why `RESABZ` reads "7:0" at 0x13 and "15:8" at 0x14. Granularity follows each datasheet's own register map. The iC-PVL prints its status registers bit by bit, so those arrive as eight fields; the iC-MU prints its own as `STATUS0(7:0)`, so that is one field. Transcribed from the vendors' datasheets: iC-MU Series Rev B1 (Tables 90 and 91) and iC-PVL Rev F2 (Tables 5, 6 and 7), with descriptions from their CONFIGURATION PARAMETERS indexes and, for the iC-PVL status bytes, its status tables. The prose behind those one-liners is not reproduced.
|
|
264
|
+
*
|
|
265
|
+
* @name GetIcHausRegisters
|
|
266
|
+
* @summary The Circulo internal encoder's register maps
|
|
267
|
+
* @request GET:/api/meta/ic-haus-registers
|
|
268
|
+
*/
|
|
269
|
+
getIcHausRegisters = (params = {}) => this.request({
|
|
270
|
+
path: `/api/meta/ic-haus-registers`,
|
|
271
|
+
method: "GET",
|
|
272
|
+
format: "json",
|
|
273
|
+
...params,
|
|
274
|
+
});
|
|
222
275
|
/**
|
|
223
276
|
* @description The register map of the Integro's internal (Kübler) encoder — the reference table for POST /api/devices/{slavePosition}/procedures/kuebler-register-communication, and documentation in its own right. Static: it describes the encoder type, not any connected device, so it needs no bus and no scan. Transcribed from the vendor's own draft table. Each entry carries the width, the access type, whether the encoder actually implements it — seven are documented but not implemented — and the vendor's bit definitions verbatim, which for a bit-field register is the only place its meaning is recorded. `format` says how to read the assembled value, because signedness is not uniform and one register is not a single number at all: `unsigned`, `signed`, `bitField` (the number means nothing on its own), or `signedHalves` — two signed 16-bit values packed into 32 bits, which register 0x3C is the only case of. `readableInOneCommand` is false for the one 64-bit register, since the command's length byte caps at 4 bytes.
|
|
224
277
|
*
|
|
@@ -898,7 +898,7 @@ export interface ProcedureRequest {
|
|
|
898
898
|
*/
|
|
899
899
|
pollIntervalMs?: number;
|
|
900
900
|
/**
|
|
901
|
-
* `encoder-register-communication` and `ic-mu-calibration-mode`: which of the drive's encoders to address. Encoder 1 is
|
|
901
|
+
* `encoder-register-communication` and `ic-mu-calibration-mode`: which of the drive's encoders to address. Encoder 1 is the encoder configured in 0x2110 and encoder 2 the one configured in 0x2112, so the ordinal picks a configuration object rather than a kind of encoder.
|
|
902
902
|
* @default 1
|
|
903
903
|
* @example 1
|
|
904
904
|
*/
|
|
@@ -1724,4 +1724,275 @@ export interface EsiParseResult {
|
|
|
1724
1724
|
/** Recoverable problems in the document itself — a skipped malformed object, an unparsable value. A file with warnings still parses. Per-device assembly problems are reported on the device instead. */
|
|
1725
1725
|
warnings?: string[];
|
|
1726
1726
|
}
|
|
1727
|
+
/** What Motion Master knows about the auto-tuning process, as a startup snapshot. */
|
|
1728
|
+
export interface AutoTuningStatus {
|
|
1729
|
+
/**
|
|
1730
|
+
* The `autoTuning.enabled` setting from the configuration file.
|
|
1731
|
+
* @example true
|
|
1732
|
+
*/
|
|
1733
|
+
enabled: boolean;
|
|
1734
|
+
/**
|
|
1735
|
+
* The executable Motion Master looked for, as an absolute path.
|
|
1736
|
+
* @example "/opt/motion-master/auto-tuning"
|
|
1737
|
+
*/
|
|
1738
|
+
binaryPath: string;
|
|
1739
|
+
/**
|
|
1740
|
+
* Whether a file exists at that path.
|
|
1741
|
+
* @example true
|
|
1742
|
+
*/
|
|
1743
|
+
installed: boolean;
|
|
1744
|
+
/**
|
|
1745
|
+
* Whether the process started and answered its health endpoint. Not a liveness check: nothing polls the process after startup.
|
|
1746
|
+
* @example true
|
|
1747
|
+
*/
|
|
1748
|
+
started: boolean;
|
|
1749
|
+
/**
|
|
1750
|
+
* The version the process reported, empty unless it started. A build older than that program's version reporting starts and reports nothing, which is why an empty string here does not mean it failed.
|
|
1751
|
+
* @example "3.1.1"
|
|
1752
|
+
*/
|
|
1753
|
+
version: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* The loopback port the process was told to serve on.
|
|
1756
|
+
* @example 63528
|
|
1757
|
+
*/
|
|
1758
|
+
port: number;
|
|
1759
|
+
/**
|
|
1760
|
+
* Why it is not running. Empty when it is.
|
|
1761
|
+
* @example ""
|
|
1762
|
+
*/
|
|
1763
|
+
error: string;
|
|
1764
|
+
}
|
|
1765
|
+
/** The auto-tuning program's error shape. Returned with 200 when a function rejected its inputs, and with 404 or 500 for an unknown function or an unhandled exception. */
|
|
1766
|
+
export interface AutoTuningError {
|
|
1767
|
+
error: {
|
|
1768
|
+
/** @example "A linear model can't be fit in the recorded data." */
|
|
1769
|
+
message: string;
|
|
1770
|
+
};
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* Transfer function coefficients, highest order first.
|
|
1774
|
+
* @example {"numerator":[1],"denominator":[0.00015,0.000206]}
|
|
1775
|
+
*/
|
|
1776
|
+
export interface PlantModel {
|
|
1777
|
+
numerator: number[];
|
|
1778
|
+
denominator: number[];
|
|
1779
|
+
}
|
|
1780
|
+
/** One controller's gains. */
|
|
1781
|
+
export interface Pid {
|
|
1782
|
+
kp?: number;
|
|
1783
|
+
ki?: number;
|
|
1784
|
+
kd?: number;
|
|
1785
|
+
}
|
|
1786
|
+
/** Controller gains. A function that tunes only the velocity loop leaves the position gains at zero. */
|
|
1787
|
+
export interface Gains {
|
|
1788
|
+
/** One controller's gains. */
|
|
1789
|
+
position?: Pid;
|
|
1790
|
+
/** One controller's gains. */
|
|
1791
|
+
velocity?: Pid;
|
|
1792
|
+
}
|
|
1793
|
+
/**
|
|
1794
|
+
* Bode diagram data, keyed by column name, every array the same length. This comes back in the response body instead of a written CSV, which is why no auto-tuning call needs a shared filesystem. A non-finite value is null.
|
|
1795
|
+
* @example {"Frequency_Hz":[0.5,1],"Plant_Mag_dB":[65.77570877159437,59.79191013147556],"Plant_Phase_deg":[-66.38766900151838,-76.55997369096534]}
|
|
1796
|
+
*/
|
|
1797
|
+
export type Bode = Record<string, (number | null)[]>;
|
|
1798
|
+
/** Drive configuration, as read from the drive. */
|
|
1799
|
+
export interface DriveConfig {
|
|
1800
|
+
vel_lp_type?: number;
|
|
1801
|
+
vel_lp_fc?: number;
|
|
1802
|
+
pos_lp_type?: number;
|
|
1803
|
+
pos_lp_fc?: number;
|
|
1804
|
+
notch_en?: number;
|
|
1805
|
+
notch_fw?: number;
|
|
1806
|
+
notch_fc?: number;
|
|
1807
|
+
notch_dp?: number;
|
|
1808
|
+
vel_ff_gain?: number;
|
|
1809
|
+
vel_ff_fc?: number;
|
|
1810
|
+
/** Winding inductance. */
|
|
1811
|
+
L?: number;
|
|
1812
|
+
/** Winding resistance. */
|
|
1813
|
+
R?: number;
|
|
1814
|
+
/** DC link voltage. */
|
|
1815
|
+
vdc?: number;
|
|
1816
|
+
current_ratio?: number;
|
|
1817
|
+
tc_kp?: number;
|
|
1818
|
+
tc_ki?: number;
|
|
1819
|
+
switch_F?: number;
|
|
1820
|
+
tc_st?: number;
|
|
1821
|
+
tc_damping?: number;
|
|
1822
|
+
software_version?: string;
|
|
1823
|
+
rated_torque?: number;
|
|
1824
|
+
max_vel_noise?: number;
|
|
1825
|
+
}
|
|
1826
|
+
/** The `data` schema depends on the value of `run`. Each variant pairs one `run` value with the inputs that function reads. `run: exit` is deliberately absent: it shuts the process down, and this endpoint refuses it with 400. */
|
|
1827
|
+
export type AutoTuningRunRequest = AutoTuneVelocityController | AutoTunePositionController | FullAutoTuneVelocityController | FullAutoTunePositionController | AutoTuneNotch | AutoTuneFeedbackFilters | ComputePositionControllerGains | IdentifyPlantModel | GeneratePlantBode;
|
|
1828
|
+
export interface AutoTuneVelocityController {
|
|
1829
|
+
run: "auto_tune_velocity_controller";
|
|
1830
|
+
data: {
|
|
1831
|
+
/** Transfer function coefficients, highest order first. */
|
|
1832
|
+
plant_model: PlantModel;
|
|
1833
|
+
/** Damping ratio. */
|
|
1834
|
+
zeta: number;
|
|
1835
|
+
/** Demanded bandwidth in Hz. */
|
|
1836
|
+
demanded_bw: number;
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
export interface AutoTunePositionController {
|
|
1840
|
+
run: "auto_tune_position_controller";
|
|
1841
|
+
data: {
|
|
1842
|
+
/** Transfer function coefficients, highest order first. */
|
|
1843
|
+
plant_model: PlantModel;
|
|
1844
|
+
/** @example "PI-P" */
|
|
1845
|
+
controller_type: string;
|
|
1846
|
+
zeta: number;
|
|
1847
|
+
/** Demanded settling time in seconds. */
|
|
1848
|
+
demanded_st: number;
|
|
1849
|
+
/** Optional. Absent means the standard tuning rule. */
|
|
1850
|
+
highFrictionGain?: number;
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
export interface FullAutoTuneVelocityController {
|
|
1854
|
+
run: "full_auto_tune_velocity_controller";
|
|
1855
|
+
data: {
|
|
1856
|
+
/** Transfer function coefficients, highest order first. */
|
|
1857
|
+
plant_model: PlantModel;
|
|
1858
|
+
/** Drive configuration, as read from the drive. */
|
|
1859
|
+
drive_config: DriveConfig;
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
export interface FullAutoTunePositionController {
|
|
1863
|
+
run: "full_auto_tune_position_controller";
|
|
1864
|
+
data: {
|
|
1865
|
+
/** Transfer function coefficients, highest order first. */
|
|
1866
|
+
plant_model: PlantModel;
|
|
1867
|
+
/** @example "PI-P" */
|
|
1868
|
+
controller_type: string;
|
|
1869
|
+
/** Drive configuration, as read from the drive. */
|
|
1870
|
+
drive_config: DriveConfig;
|
|
1871
|
+
highFriction: 0 | 1;
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
export interface AutoTuneNotch {
|
|
1875
|
+
run: "auto_tune_notch";
|
|
1876
|
+
data: {
|
|
1877
|
+
/** Transfer function coefficients, highest order first. */
|
|
1878
|
+
plant_model: PlantModel;
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
export interface AutoTuneFeedbackFilters {
|
|
1882
|
+
run: "auto_tune_feedback_filters";
|
|
1883
|
+
data: {
|
|
1884
|
+
sigma_v: number;
|
|
1885
|
+
sigma_p: number;
|
|
1886
|
+
resVel: number;
|
|
1887
|
+
resPos: number;
|
|
1888
|
+
gearRatio: number;
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
export interface ComputePositionControllerGains {
|
|
1892
|
+
run: "compute_position_controller_gains";
|
|
1893
|
+
data: {
|
|
1894
|
+
pk: number;
|
|
1895
|
+
pt: number;
|
|
1896
|
+
omega: number;
|
|
1897
|
+
alpha: number;
|
|
1898
|
+
zeta: number;
|
|
1899
|
+
/** @example "PI-P" */
|
|
1900
|
+
controller_type: string;
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
/** Identifies a plant model from chirp measurements. The measurements are uploaded in `data.csv`; `data.filepath` names a file on the auto-tuning process's own machine instead, and is a fallback that Motion Master has no use for. */
|
|
1904
|
+
export interface IdentifyPlantModel {
|
|
1905
|
+
run: "identify_plant_model" | "identify_plant_model_inline";
|
|
1906
|
+
data: {
|
|
1907
|
+
/** Contents of the measurement CSV. Three columns, no header: time, torque in Nm, velocity in rad/s, sampled at 1000 Hz. */
|
|
1908
|
+
csv?: string;
|
|
1909
|
+
/** Path to that CSV instead of its contents. */
|
|
1910
|
+
filepath?: string;
|
|
1911
|
+
/** Chirp start frequency in Hz. */
|
|
1912
|
+
f0: number;
|
|
1913
|
+
/** Chirp end frequency in Hz. */
|
|
1914
|
+
f1: number;
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
/** Computes the bode data of a plant model and returns it inline. */
|
|
1918
|
+
export interface GeneratePlantBode {
|
|
1919
|
+
run: "generate_plant_bode_file" | "generate_plant_bode";
|
|
1920
|
+
data: {
|
|
1921
|
+
/** Transfer function coefficients, highest order first. */
|
|
1922
|
+
plant_model: PlantModel;
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
/** Which variant comes back depends on the request's `run`. Every result carries `duration`, the function's execution time in seconds. A function that rejected its inputs answers with `AutoTuningError` and status 200. */
|
|
1926
|
+
export type AutoTuningRunResponse = GainsResult | FullVelocityResult | FullPositionResult | NotchResult | FeedbackFiltersResult | IdentifyPlantModelResult | BodeResult | AutoTuningError;
|
|
1927
|
+
export interface GainsResult {
|
|
1928
|
+
/** Controller gains. A function that tunes only the velocity loop leaves the position gains at zero. */
|
|
1929
|
+
gains?: Gains;
|
|
1930
|
+
duration?: number;
|
|
1931
|
+
}
|
|
1932
|
+
export interface FullVelocityResult {
|
|
1933
|
+
/** Controller gains. A function that tunes only the velocity loop leaves the position gains at zero. */
|
|
1934
|
+
gains?: Gains;
|
|
1935
|
+
demanded_bw?: number;
|
|
1936
|
+
demanded_zeta?: number;
|
|
1937
|
+
/** Stability margins and closed-loop metrics. */
|
|
1938
|
+
state?: {
|
|
1939
|
+
gm?: number;
|
|
1940
|
+
pm?: number;
|
|
1941
|
+
msens?: number;
|
|
1942
|
+
act_bw?: number;
|
|
1943
|
+
vel_cl?: number;
|
|
1944
|
+
noise_resp?: number;
|
|
1945
|
+
max_KS?: number;
|
|
1946
|
+
};
|
|
1947
|
+
duration?: number;
|
|
1948
|
+
}
|
|
1949
|
+
export interface FullPositionResult {
|
|
1950
|
+
/** Controller gains. A function that tunes only the velocity loop leaves the position gains at zero. */
|
|
1951
|
+
gains?: Gains;
|
|
1952
|
+
demanded_st?: number;
|
|
1953
|
+
demanded_zeta?: number;
|
|
1954
|
+
highFrictionGain?: number;
|
|
1955
|
+
/** Stability margins and closed-loop metrics, position and velocity loop. */
|
|
1956
|
+
state?: {
|
|
1957
|
+
gm_p?: number;
|
|
1958
|
+
pm_p?: number;
|
|
1959
|
+
msens_p?: number;
|
|
1960
|
+
gm_v?: number;
|
|
1961
|
+
pm_v?: number;
|
|
1962
|
+
msens_v?: number;
|
|
1963
|
+
noise_resp?: number;
|
|
1964
|
+
max_KS?: number;
|
|
1965
|
+
bw_p?: number;
|
|
1966
|
+
bw_v?: number;
|
|
1967
|
+
act_st?: number;
|
|
1968
|
+
pos_cl?: number;
|
|
1969
|
+
};
|
|
1970
|
+
duration?: number;
|
|
1971
|
+
}
|
|
1972
|
+
export interface NotchResult {
|
|
1973
|
+
notch_en?: boolean;
|
|
1974
|
+
notch_fc?: number | null;
|
|
1975
|
+
notch_fw?: number | null;
|
|
1976
|
+
notch_dp?: number | null;
|
|
1977
|
+
duration?: number;
|
|
1978
|
+
}
|
|
1979
|
+
export interface FeedbackFiltersResult {
|
|
1980
|
+
/** Velocity feedback filter cut-off in Hz. */
|
|
1981
|
+
fcv?: number;
|
|
1982
|
+
/** Position feedback filter cut-off in Hz. */
|
|
1983
|
+
fcp?: number;
|
|
1984
|
+
duration?: number;
|
|
1985
|
+
}
|
|
1986
|
+
export interface IdentifyPlantModelResult {
|
|
1987
|
+
numerators?: number[];
|
|
1988
|
+
denominators?: number[];
|
|
1989
|
+
/** Bode diagram data, keyed by column name, every array the same length. This comes back in the response body instead of a written CSV, which is why no auto-tuning call needs a shared filesystem. A non-finite value is null. */
|
|
1990
|
+
bode?: Bode;
|
|
1991
|
+
duration?: number;
|
|
1992
|
+
}
|
|
1993
|
+
export interface BodeResult {
|
|
1994
|
+
/** Bode diagram data, keyed by column name, every array the same length. This comes back in the response body instead of a written CSV, which is why no auto-tuning call needs a shared filesystem. A non-finite value is null. */
|
|
1995
|
+
bode?: Bode;
|
|
1996
|
+
duration?: number;
|
|
1997
|
+
}
|
|
1727
1998
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapticon/motion-master-client",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.82",
|
|
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": {
|