motion-master-client 0.0.76 → 0.0.85
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/README.md +227 -138
- package/package.json +1 -1
- package/src/cli.d.ts +1 -1
- package/src/cli.js +160 -160
- package/src/index.d.ts +30 -28
- package/src/index.js +33 -31
- package/src/index.js.map +1 -1
- package/src/lib/cia402.d.ts +184 -182
- package/src/lib/cia402.js +393 -391
- package/src/lib/cia402.js.map +1 -1
- package/src/lib/config-file.d.ts +13 -13
- package/src/lib/config-file.js +49 -49
- package/src/lib/data-monitoring.d.ts +12 -12
- package/src/lib/data-monitoring.js +33 -33
- package/src/lib/device-log-line.d.ts +5 -5
- package/src/lib/device-log-line.js +2 -2
- package/src/lib/device-parameter.d.ts +56 -56
- package/src/lib/device-parameter.js +38 -38
- package/src/lib/device.d.ts +46 -9
- package/src/lib/device.js +166 -2
- package/src/lib/device.js.map +1 -1
- package/src/lib/encoder-register.d.ts +16 -16
- package/src/lib/encoder-register.js +116 -116
- package/src/lib/hardware-description.d.ts +46 -46
- package/src/lib/hardware-description.js +109 -109
- package/src/lib/integro-encoder-calibration.d.ts +31 -0
- package/src/lib/integro-encoder-calibration.js +196 -0
- package/src/lib/integro-encoder-calibration.js.map +1 -0
- package/src/lib/logger.d.ts +1 -1
- package/src/lib/logger.js +7 -7
- package/src/lib/monitoring-config.d.ts +31 -31
- package/src/lib/monitoring-config.js +2 -2
- package/src/lib/monitoring-entry.d.ts +9 -9
- package/src/lib/monitoring-entry.js +2 -2
- package/src/lib/motion-master-client.d.ts +77 -77
- package/src/lib/motion-master-client.js +196 -196
- package/src/lib/motion-master-pub-sub-client.d.ts +17 -17
- package/src/lib/motion-master-pub-sub-client.js +72 -72
- package/src/lib/motion-master-pub-sub-client.js.map +1 -1
- package/src/lib/motion-master-pub-sub-socket.d.ts +42 -42
- package/src/lib/motion-master-pub-sub-socket.js +2 -2
- package/src/lib/motion-master-pub-sub-web-socket.d.ts +18 -18
- package/src/lib/motion-master-pub-sub-web-socket.js +65 -65
- package/src/lib/motion-master-pub-sub-worker-socket.d.ts +18 -18
- package/src/lib/motion-master-pub-sub-worker-socket.js +47 -47
- package/src/lib/motion-master-req-res-client.d.ts +1104 -1062
- package/src/lib/motion-master-req-res-client.js +2137 -1992
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/motion-master-req-res-socket.d.ts +60 -60
- package/src/lib/motion-master-req-res-socket.js +2 -2
- package/src/lib/motion-master-req-res-web-socket.d.ts +28 -28
- package/src/lib/motion-master-req-res-web-socket.js +97 -97
- package/src/lib/motion-master-req-res-worker-socket.d.ts +24 -24
- package/src/lib/motion-master-req-res-worker-socket.js +71 -71
- package/src/lib/motion-master.proto.d.ts +5183 -5183
- package/src/lib/motion-master.proto.js +53218 -53218
- package/src/lib/operators.d.ts +20 -20
- package/src/lib/operators.js +82 -83
- package/src/lib/operators.js.map +1 -1
- package/src/lib/options.d.ts +10 -10
- package/src/lib/options.js +13 -13
- package/src/lib/os-command.d.ts +387 -173
- package/src/lib/os-command.js +555 -269
- package/src/lib/os-command.js.map +1 -1
- package/src/lib/parameter.d.ts +156 -138
- package/src/lib/parameter.js +377 -152
- package/src/lib/parameter.js.map +1 -1
- package/src/lib/product-id-range.d.ts +7 -7
- package/src/lib/product-id-range.js +11 -11
- package/src/lib/request-status-resolver.d.ts +4 -4
- package/src/lib/request-status-resolver.js +344 -344
- package/src/lib/somanet-product.d.ts +37 -0
- package/src/lib/somanet-product.js +126 -0
- package/src/lib/somanet-product.js.map +1 -0
- package/src/lib/system-log-line.d.ts +9 -9
- package/src/lib/system-log-line.js +2 -2
- package/src/lib/types.d.ts +141 -141
- package/src/lib/types.js +28 -28
- package/src/lib/urls.d.ts +3 -3
- package/src/lib/urls.js +9 -9
- package/src/lib/util.d.ts +21 -45
- package/src/lib/util.js +113 -379
- package/src/lib/util.js.map +1 -1
- package/src/lib/web-socket-connection-close-codes.d.ts +8 -8
- package/src/lib/web-socket-connection-close-codes.js +88 -88
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dummyHardwareDescriptionFileContentTemplate = exports.getApiIdentifierFromPackageFilename = exports.getVersionFromPackageFilename = exports.getHardwareComponentsFromPackageFilename = exports.isHardwareDescriptionCompatibleWithPackageFilename = exports.hardwareComponentsMatch = exports.getAllComponentsFromHardwareDescription = exports.getSerialNumberFromHardwareDescription = exports.getNameFromHardwareDescription = exports.getApiIdentifierFromHardwareDescription = exports.getIdFromHardwareDescription = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const semver_1 = require("semver");
|
|
6
|
-
function getIdFromHardwareDescription(hd) {
|
|
7
|
-
return hd.assembly
|
|
8
|
-
? hd.assembly.id
|
|
9
|
-
: hd.device.id;
|
|
10
|
-
}
|
|
11
|
-
exports.getIdFromHardwareDescription = getIdFromHardwareDescription;
|
|
12
|
-
function getApiIdentifierFromHardwareDescription(hd, skipKeyId = false) {
|
|
13
|
-
let apiId = hd.assembly
|
|
14
|
-
? `${hd.assembly.id}-${hd.assembly.version}`
|
|
15
|
-
: `${hd.device.id}-${hd.device.version}`;
|
|
16
|
-
if (!skipKeyId && hd.device.keyId) {
|
|
17
|
-
apiId += `-${hd.device.keyId}`;
|
|
18
|
-
}
|
|
19
|
-
return apiId;
|
|
20
|
-
}
|
|
21
|
-
exports.getApiIdentifierFromHardwareDescription = getApiIdentifierFromHardwareDescription;
|
|
22
|
-
function getNameFromHardwareDescription(hd) {
|
|
23
|
-
return hd.assembly
|
|
24
|
-
? hd.assembly.name
|
|
25
|
-
: hd.device.name;
|
|
26
|
-
}
|
|
27
|
-
exports.getNameFromHardwareDescription = getNameFromHardwareDescription;
|
|
28
|
-
function getSerialNumberFromHardwareDescription(hd) {
|
|
29
|
-
return hd.assembly
|
|
30
|
-
? hd.assembly.serialNumber
|
|
31
|
-
: hd.device.serialNumber;
|
|
32
|
-
}
|
|
33
|
-
exports.getSerialNumberFromHardwareDescription = getSerialNumberFromHardwareDescription;
|
|
34
|
-
function getAllComponentsFromHardwareDescription(hd) {
|
|
35
|
-
return hd.assembly
|
|
36
|
-
? [...hd.assembly.components, ...hd.device.components]
|
|
37
|
-
: hd.device.components;
|
|
38
|
-
}
|
|
39
|
-
exports.getAllComponentsFromHardwareDescription = getAllComponentsFromHardwareDescription;
|
|
40
|
-
function hardwareComponentsMatch(a, b) {
|
|
41
|
-
if (a.length === 0 && b.length === 0) {
|
|
42
|
-
return false; // edge case: when both components are empty they don't match since there are no components to compare
|
|
43
|
-
}
|
|
44
|
-
const ac = a.map((c) => `${c.name}-${c.version[0]}`.replace(/\s/g, '').toLocaleLowerCase()).sort();
|
|
45
|
-
const bc = b.map((c) => `${c.name}-${c.version[0]}`.replace(/\s/g, '').toLocaleLowerCase()).sort();
|
|
46
|
-
return (0, lodash_1.isEqual)(ac, bc);
|
|
47
|
-
}
|
|
48
|
-
exports.hardwareComponentsMatch = hardwareComponentsMatch;
|
|
49
|
-
function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription, packageFilename) {
|
|
50
|
-
const hdApiId = getApiIdentifierFromHardwareDescription(hardwareDescription);
|
|
51
|
-
const pfApiId = getApiIdentifierFromPackageFilename(packageFilename);
|
|
52
|
-
if (hdApiId && pfApiId) {
|
|
53
|
-
return hdApiId === pfApiId;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
const pfComponents = getHardwareComponentsFromPackageFilename(packageFilename);
|
|
57
|
-
const hdComponents = getAllComponentsFromHardwareDescription(hardwareDescription);
|
|
58
|
-
return hardwareComponentsMatch(pfComponents, hdComponents);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.isHardwareDescriptionCompatibleWithPackageFilename = isHardwareDescriptionCompatibleWithPackageFilename;
|
|
62
|
-
function getHardwareComponentsFromPackageFilename(packageFilename) {
|
|
63
|
-
if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
|
|
64
|
-
return packageFilename.split('_').slice(1, 4).map((b) => {
|
|
65
|
-
const p = b.split('-'); // ['ComEtherCAT', 'b']
|
|
66
|
-
return {
|
|
67
|
-
name: p[0],
|
|
68
|
-
serialNumber: '',
|
|
69
|
-
version: p[1],
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
// not all package filenames have components,
|
|
75
|
-
// e.g. 'package_SOMANET-Servo-Node-Circulo-1800_circulo1800_motion-drive_v4.2.0-beta.5.zip'
|
|
76
|
-
return [];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.getHardwareComponentsFromPackageFilename = getHardwareComponentsFromPackageFilename;
|
|
80
|
-
function getVersionFromPackageFilename(packageFilename) {
|
|
81
|
-
const parts = packageFilename.split('_');
|
|
82
|
-
const version = parts[parts.length - 1].replace(/\.zip$/, '').split(/\s+/)[0];
|
|
83
|
-
return semver_1.default.valid(version) ? version : undefined;
|
|
84
|
-
}
|
|
85
|
-
exports.getVersionFromPackageFilename = getVersionFromPackageFilename;
|
|
86
|
-
function getApiIdentifierFromPackageFilename(packageFilename) {
|
|
87
|
-
if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
const [, , apiIdentifier] = packageFilename.split('_');
|
|
91
|
-
return apiIdentifier;
|
|
92
|
-
}
|
|
93
|
-
exports.getApiIdentifierFromPackageFilename = getApiIdentifierFromPackageFilename;
|
|
94
|
-
/**
|
|
95
|
-
* This template is to be used in cases where hardware description file is not available on a device.
|
|
96
|
-
* It is imperative to replace the serial number with a unique identifier.
|
|
97
|
-
*/
|
|
98
|
-
exports.dummyHardwareDescriptionFileContentTemplate = {
|
|
99
|
-
fileVersion: '0.0.0',
|
|
100
|
-
device: {
|
|
101
|
-
macAddress: '',
|
|
102
|
-
keyId: '0000',
|
|
103
|
-
serialNumber: '0000-00-0000000-0000',
|
|
104
|
-
name: 'SOMANET Device',
|
|
105
|
-
id: '0000',
|
|
106
|
-
version: '00',
|
|
107
|
-
components: [],
|
|
108
|
-
},
|
|
109
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dummyHardwareDescriptionFileContentTemplate = exports.getApiIdentifierFromPackageFilename = exports.getVersionFromPackageFilename = exports.getHardwareComponentsFromPackageFilename = exports.isHardwareDescriptionCompatibleWithPackageFilename = exports.hardwareComponentsMatch = exports.getAllComponentsFromHardwareDescription = exports.getSerialNumberFromHardwareDescription = exports.getNameFromHardwareDescription = exports.getApiIdentifierFromHardwareDescription = exports.getIdFromHardwareDescription = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
function getIdFromHardwareDescription(hd) {
|
|
7
|
+
return hd.assembly
|
|
8
|
+
? hd.assembly.id
|
|
9
|
+
: hd.device.id;
|
|
10
|
+
}
|
|
11
|
+
exports.getIdFromHardwareDescription = getIdFromHardwareDescription;
|
|
12
|
+
function getApiIdentifierFromHardwareDescription(hd, skipKeyId = false) {
|
|
13
|
+
let apiId = hd.assembly
|
|
14
|
+
? `${hd.assembly.id}-${hd.assembly.version}`
|
|
15
|
+
: `${hd.device.id}-${hd.device.version}`;
|
|
16
|
+
if (!skipKeyId && hd.device.keyId) {
|
|
17
|
+
apiId += `-${hd.device.keyId}`;
|
|
18
|
+
}
|
|
19
|
+
return apiId;
|
|
20
|
+
}
|
|
21
|
+
exports.getApiIdentifierFromHardwareDescription = getApiIdentifierFromHardwareDescription;
|
|
22
|
+
function getNameFromHardwareDescription(hd) {
|
|
23
|
+
return hd.assembly
|
|
24
|
+
? hd.assembly.name
|
|
25
|
+
: hd.device.name;
|
|
26
|
+
}
|
|
27
|
+
exports.getNameFromHardwareDescription = getNameFromHardwareDescription;
|
|
28
|
+
function getSerialNumberFromHardwareDescription(hd) {
|
|
29
|
+
return hd.assembly
|
|
30
|
+
? hd.assembly.serialNumber
|
|
31
|
+
: hd.device.serialNumber;
|
|
32
|
+
}
|
|
33
|
+
exports.getSerialNumberFromHardwareDescription = getSerialNumberFromHardwareDescription;
|
|
34
|
+
function getAllComponentsFromHardwareDescription(hd) {
|
|
35
|
+
return hd.assembly
|
|
36
|
+
? [...hd.assembly.components, ...hd.device.components]
|
|
37
|
+
: hd.device.components;
|
|
38
|
+
}
|
|
39
|
+
exports.getAllComponentsFromHardwareDescription = getAllComponentsFromHardwareDescription;
|
|
40
|
+
function hardwareComponentsMatch(a, b) {
|
|
41
|
+
if (a.length === 0 && b.length === 0) {
|
|
42
|
+
return false; // edge case: when both components are empty they don't match since there are no components to compare
|
|
43
|
+
}
|
|
44
|
+
const ac = a.map((c) => `${c.name}-${c.version[0]}`.replace(/\s/g, '').toLocaleLowerCase()).sort();
|
|
45
|
+
const bc = b.map((c) => `${c.name}-${c.version[0]}`.replace(/\s/g, '').toLocaleLowerCase()).sort();
|
|
46
|
+
return (0, lodash_1.isEqual)(ac, bc);
|
|
47
|
+
}
|
|
48
|
+
exports.hardwareComponentsMatch = hardwareComponentsMatch;
|
|
49
|
+
function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription, packageFilename) {
|
|
50
|
+
const hdApiId = getApiIdentifierFromHardwareDescription(hardwareDescription);
|
|
51
|
+
const pfApiId = getApiIdentifierFromPackageFilename(packageFilename);
|
|
52
|
+
if (hdApiId && pfApiId) {
|
|
53
|
+
return hdApiId === pfApiId;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const pfComponents = getHardwareComponentsFromPackageFilename(packageFilename);
|
|
57
|
+
const hdComponents = getAllComponentsFromHardwareDescription(hardwareDescription);
|
|
58
|
+
return hardwareComponentsMatch(pfComponents, hdComponents);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.isHardwareDescriptionCompatibleWithPackageFilename = isHardwareDescriptionCompatibleWithPackageFilename;
|
|
62
|
+
function getHardwareComponentsFromPackageFilename(packageFilename) {
|
|
63
|
+
if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
|
|
64
|
+
return packageFilename.split('_').slice(1, 4).map((b) => {
|
|
65
|
+
const p = b.split('-'); // ['ComEtherCAT', 'b']
|
|
66
|
+
return {
|
|
67
|
+
name: p[0],
|
|
68
|
+
serialNumber: '',
|
|
69
|
+
version: p[1],
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// not all package filenames have components,
|
|
75
|
+
// e.g. 'package_SOMANET-Servo-Node-Circulo-1800_circulo1800_motion-drive_v4.2.0-beta.5.zip'
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.getHardwareComponentsFromPackageFilename = getHardwareComponentsFromPackageFilename;
|
|
80
|
+
function getVersionFromPackageFilename(packageFilename) {
|
|
81
|
+
const parts = packageFilename.split('_');
|
|
82
|
+
const version = parts[parts.length - 1].replace(/\.zip$/, '').split(/\s+/)[0];
|
|
83
|
+
return semver_1.default.valid(version) ? version : undefined;
|
|
84
|
+
}
|
|
85
|
+
exports.getVersionFromPackageFilename = getVersionFromPackageFilename;
|
|
86
|
+
function getApiIdentifierFromPackageFilename(packageFilename) {
|
|
87
|
+
if (packageFilename.match(/_Com[^_]+_Core[^_]+_Drive/g)) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const [, , apiIdentifier] = packageFilename.split('_');
|
|
91
|
+
return apiIdentifier;
|
|
92
|
+
}
|
|
93
|
+
exports.getApiIdentifierFromPackageFilename = getApiIdentifierFromPackageFilename;
|
|
94
|
+
/**
|
|
95
|
+
* This template is to be used in cases where hardware description file is not available on a device.
|
|
96
|
+
* It is imperative to replace the serial number with a unique identifier.
|
|
97
|
+
*/
|
|
98
|
+
exports.dummyHardwareDescriptionFileContentTemplate = {
|
|
99
|
+
fileVersion: '0.0.0',
|
|
100
|
+
device: {
|
|
101
|
+
macAddress: '',
|
|
102
|
+
keyId: '0000',
|
|
103
|
+
serialNumber: '0000-00-0000000-0000',
|
|
104
|
+
name: 'SOMANET Device',
|
|
105
|
+
id: '0000',
|
|
106
|
+
version: '00',
|
|
107
|
+
components: [],
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
110
|
//# sourceMappingURL=hardware-description.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Subject } from "rxjs";
|
|
2
|
+
import { MotionMasterClient } from "./motion-master-client";
|
|
3
|
+
import { DeviceRef } from "./types";
|
|
4
|
+
interface VelocityProfile {
|
|
5
|
+
target: number;
|
|
6
|
+
acceleration: number;
|
|
7
|
+
deceleration: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class IntegroEncoderCalibration {
|
|
10
|
+
private client;
|
|
11
|
+
readonly deviceRef: DeviceRef;
|
|
12
|
+
readonly notifications$: Subject<string>;
|
|
13
|
+
private readonly poeCalibrationVelocityProfile;
|
|
14
|
+
private readonly lookupTableVelocityProfileDirection1;
|
|
15
|
+
private readonly lookupTableVelocityProfileDirection2;
|
|
16
|
+
constructor(client: MotionMasterClient, deviceRef: DeviceRef);
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Validate device.
|
|
20
|
+
*/
|
|
21
|
+
validateDevice(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Set velocity profile.
|
|
24
|
+
*/
|
|
25
|
+
setVelocityProfile(velocityProfile: VelocityProfile): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Write encoder register value and validate response.
|
|
28
|
+
*/
|
|
29
|
+
writeEncoderRegisterValueAndValidateResponse(address: number, value: number, length?: number): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegroEncoderCalibration = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
6
|
+
const device_1 = require("./device");
|
|
7
|
+
const cia402_1 = require("./cia402");
|
|
8
|
+
const os_command_1 = require("./os-command");
|
|
9
|
+
const util_1 = require("./util");
|
|
10
|
+
const somanet_product_1 = require("./somanet-product");
|
|
11
|
+
class IntegroEncoderCalibration {
|
|
12
|
+
constructor(client, deviceRef) {
|
|
13
|
+
this.client = client;
|
|
14
|
+
this.deviceRef = deviceRef;
|
|
15
|
+
this.notifications$ = new rxjs_1.Subject();
|
|
16
|
+
this.poeCalibrationVelocityProfile = {
|
|
17
|
+
target: 1200,
|
|
18
|
+
acceleration: 4800,
|
|
19
|
+
deceleration: 4800, // RPM/s
|
|
20
|
+
};
|
|
21
|
+
this.lookupTableVelocityProfileDirection1 = {
|
|
22
|
+
target: 3000,
|
|
23
|
+
acceleration: 9000,
|
|
24
|
+
deceleration: 9000, // RPM/s
|
|
25
|
+
};
|
|
26
|
+
this.lookupTableVelocityProfileDirection2 = {
|
|
27
|
+
target: -3000,
|
|
28
|
+
acceleration: 9000,
|
|
29
|
+
deceleration: 9000, // RPM/s
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
start() {
|
|
33
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
// The calibration procedure should be performed after the drive is fully commissioned, and thus, the drive should be fully operational in Velocity mode.
|
|
35
|
+
// Tuning of the control loop should be done by the user.
|
|
36
|
+
yield this.validateDevice();
|
|
37
|
+
const deviceRef = this.deviceRef;
|
|
38
|
+
this.notifications$.next('Switching the source of the velocity to the value provided by the encoder.');
|
|
39
|
+
yield (0, rxjs_1.lastValueFrom)(this.client.request.runUseInternalEncoderVelocityOsCommand(deviceRef, 1, 10000, 1000, false));
|
|
40
|
+
// Trigger the POA automatic calibration with an OS command.
|
|
41
|
+
this.notifications$.next('Triggering automatic calibration of the POA by setting register 0x25 to 0x09.');
|
|
42
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x25, 0x09);
|
|
43
|
+
// Convert the POE calibration velocity profile values and update the device.
|
|
44
|
+
yield this.setVelocityProfile(this.poeCalibrationVelocityProfile);
|
|
45
|
+
this.notifications$.next('Setting modes of operation to Profile velocity mode and transitioning to Operation enabled CiA402 state.');
|
|
46
|
+
yield (0, rxjs_1.lastValueFrom)(this.client.request.setModesOfOperation(deviceRef, cia402_1.ModesOfOperation.PROFILE_VELOCITY_MODE));
|
|
47
|
+
yield this.client.request.transitionToCia402State(deviceRef, cia402_1.Cia402State.OPERATION_ENABLED);
|
|
48
|
+
this.notifications$.next('Polling the encoder register 0x24 until its value equals 0x11 or until 5 seconds have passed.');
|
|
49
|
+
// Read the value of the encoder register 0x24 until its value equals 0x11 or until 5 seconds have passed.
|
|
50
|
+
const osCommandResponse = yield (0, rxjs_1.lastValueFrom)((0, rxjs_1.defer)(() => this.client.request.runKublerEncoderRegisterCommunicationOsCommand(deviceRef, 0, 0x24, 1, 0, 10000, 1000, false).pipe((0, rxjs_1.repeat)({ count: 10, delay: 500 }), (0, rxjs_1.takeWhile)(osCommandResponse => (osCommandResponse === null || osCommandResponse === void 0 ? void 0 : osCommandResponse.kublerRegisterValue) !== 0x11, true))));
|
|
51
|
+
yield this.client.request.download(this.deviceRef, 0x60FF, 0, 0);
|
|
52
|
+
yield (0, util_1.resolveAfter)(500);
|
|
53
|
+
this.notifications$.next(os_command_1.kublerEncoderRegisterValueMeaning[0x24][osCommandResponse.kublerRegisterValue]);
|
|
54
|
+
if (osCommandResponse.kublerRegisterValue === 0x09) {
|
|
55
|
+
this.notifications$.next('The calibration of the integrated encoder analogue gains cannot converge. Writing 0x05 to the encoder register 0x25.');
|
|
56
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x25, 0x05);
|
|
57
|
+
}
|
|
58
|
+
// Lookup table learning.
|
|
59
|
+
this.notifications$.next('Disabling the POA active compensation by writing 0x00 to the encoder register 0x25.');
|
|
60
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x25, 0x00);
|
|
61
|
+
this.notifications$.next('Running the motor at a constant speed in one direction.');
|
|
62
|
+
// Run the motor at constant speed in one direction.
|
|
63
|
+
this.setVelocityProfile(this.lookupTableVelocityProfileDirection1);
|
|
64
|
+
yield (0, util_1.resolveAfter)(500);
|
|
65
|
+
this.notifications$.next('Writing 0x00C2 to the encoder register 0x50.');
|
|
66
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x50, 0x00C2, 2);
|
|
67
|
+
yield (0, util_1.resolveAfter)(1500);
|
|
68
|
+
yield this.client.request.download(this.deviceRef, 0x60FF, 0, 0);
|
|
69
|
+
yield (0, util_1.resolveAfter)(500);
|
|
70
|
+
this.notifications$.next('Reversing the rotation direction.');
|
|
71
|
+
// Reverse the rotation direction.
|
|
72
|
+
this.setVelocityProfile(this.lookupTableVelocityProfileDirection2);
|
|
73
|
+
yield (0, util_1.resolveAfter)(500);
|
|
74
|
+
this.notifications$.next('Writing 0x00C2 to the encoder register 0x50.');
|
|
75
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x50, 0x00C2, 2);
|
|
76
|
+
yield (0, util_1.resolveAfter)(1500);
|
|
77
|
+
yield this.client.request.download(this.deviceRef, 0x60FF, 0, 0);
|
|
78
|
+
yield (0, util_1.resolveAfter)(500);
|
|
79
|
+
this.notifications$.next('Re-enabling POA by writing 0x01 to the encoder register 0x25.');
|
|
80
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x25, 0x01);
|
|
81
|
+
this.notifications$.next('Saving the correction table by writing 0x00D0 to the encoder register 0x50.');
|
|
82
|
+
yield this.writeEncoderRegisterValueAndValidateResponse(0x50, 0x00D0, 2);
|
|
83
|
+
this.notifications$.next('Requesting Quick stop from device.');
|
|
84
|
+
yield this.client.request.quickStop(deviceRef);
|
|
85
|
+
this.notifications$.next('Switching the source of the velocity to the value calculated by the firmware.');
|
|
86
|
+
yield (0, rxjs_1.lastValueFrom)(this.client.request.runUseInternalEncoderVelocityOsCommand(deviceRef, 0, 10000, 1000, false));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Validate device.
|
|
91
|
+
*/
|
|
92
|
+
validateDevice() {
|
|
93
|
+
var _a, _b, _c, _d;
|
|
94
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const device = yield (0, rxjs_1.lastValueFrom)(this.client.request.resolveDevice(this.deviceRef));
|
|
96
|
+
this.notifications$.next(`Validating device: ${(_b = (_a = device === null || device === void 0 ? void 0 : device.hardwareDescription) === null || _a === void 0 ? void 0 : _a.device) === null || _b === void 0 ? void 0 : _b.serialNumber}`);
|
|
97
|
+
// The device must exist.
|
|
98
|
+
if (!device) {
|
|
99
|
+
throw new Error('No device was found when starting the Integro encoder calibration.');
|
|
100
|
+
}
|
|
101
|
+
// The device must be Integro.
|
|
102
|
+
if (!(0, somanet_product_1.isProductIdOfType)((_d = (_c = device.hardwareDescription) === null || _c === void 0 ? void 0 : _c.device) === null || _d === void 0 ? void 0 : _d.id, 'Integro')) {
|
|
103
|
+
throw new Error('The device must be an Integro for the encoder calibration.');
|
|
104
|
+
}
|
|
105
|
+
const deviceRef = this.deviceRef;
|
|
106
|
+
if (!deviceRef) {
|
|
107
|
+
throw new Error('No device reference could be determined from the device reference object.');
|
|
108
|
+
}
|
|
109
|
+
// The encoder configuration, which is assigned to port 1, must be of type Internal encoder (5).
|
|
110
|
+
const encoder1ConfigurationSensorPort = yield this.client.request.upload(deviceRef, 0x2110, 1);
|
|
111
|
+
if (encoder1ConfigurationSensorPort === 1) {
|
|
112
|
+
const encoder1ConfigurationType = yield this.client.request.upload(deviceRef, 0x2110, 2);
|
|
113
|
+
if (encoder1ConfigurationType !== 5) {
|
|
114
|
+
throw new Error('Encoder configuration 1, which is assigned to port 1, must be of type Internal encoder (5).');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const encoder2ConfigurationSensorPort = yield this.client.request.upload(deviceRef, 0x2112, 1);
|
|
119
|
+
if (encoder2ConfigurationSensorPort === 1) {
|
|
120
|
+
const encoder2ConfigurationType = yield this.client.request.upload(deviceRef, 0x2112, 2);
|
|
121
|
+
if (encoder2ConfigurationType !== 5) {
|
|
122
|
+
throw new Error('Encoder configuration 2, which is assigned to port 1, must be of type Internal encoder (5).');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
throw new Error('No encoder configuration is assigned to port 1.');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// The internal encoder must have a commutation function.
|
|
130
|
+
const torqueControllerEncoderSource = yield this.client.request.upload(deviceRef, 0x2010, 12);
|
|
131
|
+
if (torqueControllerEncoderSource !== 1) {
|
|
132
|
+
throw new Error('The internal encoder configuration must have a commutation function.');
|
|
133
|
+
}
|
|
134
|
+
// The internal encoder must have a velocity function.
|
|
135
|
+
const velocityControllerEncoderSource = yield this.client.request.upload(deviceRef, 0x2011, 5);
|
|
136
|
+
if (velocityControllerEncoderSource !== 1) {
|
|
137
|
+
throw new Error('The internal encoder configuration must have a velocity function.');
|
|
138
|
+
}
|
|
139
|
+
// The commutation offset must be set.
|
|
140
|
+
const commutationOffsetState = yield this.client.request.upload(deviceRef, 0x2009, 1);
|
|
141
|
+
if (commutationOffsetState !== 2) {
|
|
142
|
+
throw new Error('The commutation offset state must be valid before starting the Integro encoder calibration.');
|
|
143
|
+
}
|
|
144
|
+
// The velocity controller must be tuned.
|
|
145
|
+
const velocityControllerKp = yield this.client.request.upload(deviceRef, 0x2011, 1);
|
|
146
|
+
if (velocityControllerKp <= 0) {
|
|
147
|
+
throw new Error('Velocity controller must be tuned before starting the Integro encoder calibration.');
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Set velocity profile.
|
|
153
|
+
*/
|
|
154
|
+
setVelocityProfile(velocityProfile) {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const vp = Object.assign({}, velocityProfile); // make a copy
|
|
158
|
+
const maxMotorSpeed = yield this.client.request.upload(this.deviceRef, 0x6080, 0);
|
|
159
|
+
const siUnitVelocity = yield this.client.request.upload(this.deviceRef, 0x60A9, 0);
|
|
160
|
+
const feedConstant = yield (0, rxjs_1.lastValueFrom)(this.client.request.getFeedConstant(this.deviceRef));
|
|
161
|
+
// The velocity target value should not exceed the maximum motor speed.
|
|
162
|
+
// If it's higher than the maximum motor speed, set it to 95% of the maximum motor speed and update acceleration and deceleration accordingly.
|
|
163
|
+
if (maxMotorSpeed < vp.target) {
|
|
164
|
+
vp.target = maxMotorSpeed * 0.95;
|
|
165
|
+
vp.acceleration = vp.target * 3;
|
|
166
|
+
vp.acceleration = vp.deceleration * 3;
|
|
167
|
+
}
|
|
168
|
+
// Convert the velocity profile values using the user-configured SI unit velocity and Feed constant.
|
|
169
|
+
for (let [key, value] of Object.entries(vp)) {
|
|
170
|
+
vp[key] = (_a = (0, device_1.convertSiUnitVelocityAffectedValue)(value, 0x00B44700, siUnitVelocity)) !== null && _a !== void 0 ? _a : value;
|
|
171
|
+
vp[key] = (_b = (0, device_1.convertFeedConstantAffectedVelocityValue)(value, 0xFFFFFFFF, feedConstant)) !== null && _b !== void 0 ? _b : value;
|
|
172
|
+
}
|
|
173
|
+
// Update the velocity target, and profile acceleration and deceleration values.
|
|
174
|
+
this.notifications$.next(`Setting velocity target value to ${vp.target}, with velocity profile acceleration and deceleration set to ${vp.acceleration} and ${vp.deceleration}, respectively.`);
|
|
175
|
+
yield (0, rxjs_1.lastValueFrom)(this.client.request.setParameterValues([
|
|
176
|
+
[this.deviceRef, 0x6083, 0, vp.acceleration],
|
|
177
|
+
[this.deviceRef, 0x6084, 0, vp.deceleration],
|
|
178
|
+
[this.deviceRef, 0x6086, 0, 0],
|
|
179
|
+
[this.deviceRef, 0x60FF, 0, vp.target], // 0x60FF: Target velocity
|
|
180
|
+
]));
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Write encoder register value and validate response.
|
|
185
|
+
*/
|
|
186
|
+
writeEncoderRegisterValueAndValidateResponse(address, value, length = 1) {
|
|
187
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
let osCommandResponse = yield (0, rxjs_1.lastValueFrom)(this.client.request.runKublerEncoderRegisterCommunicationOsCommand(this.deviceRef, 1, address, length, value, 10000, 1000, false));
|
|
189
|
+
if (osCommandResponse.kublerRegisterValue !== value) {
|
|
190
|
+
throw new Error(`Unable to set the encoder register 0x${address.toString(16)} value to 0x${value.toString(16)}.`);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.IntegroEncoderCalibration = IntegroEncoderCalibration;
|
|
196
|
+
//# sourceMappingURL=integro-encoder-calibration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integro-encoder-calibration.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/integro-encoder-calibration.ts"],"names":[],"mappings":";;;;AAAA,+BAAwE;AAExE,qCAAwG;AAExG,qCAAyD;AACzD,6CAAiE;AACjE,iCAAsC;AACtC,uDAAsD;AAQtD,MAAa,yBAAyB;IAsBpC,YACU,MAA0B,EAClB,SAAoB;QAD5B,WAAM,GAAN,MAAM,CAAoB;QAClB,cAAS,GAAT,SAAS,CAAW;QAtBtB,mBAAc,GAAG,IAAI,cAAO,EAAU,CAAC;QAEtC,kCAA6B,GAAoB;YAChE,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,IAAI,EAAE,QAAQ;SAC7B,CAAC;QAEe,yCAAoC,GAAoB;YACvE,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,IAAI,EAAE,QAAQ;SAC7B,CAAC;QAEe,yCAAoC,GAAoB;YACvE,MAAM,EAA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AAK,KAAK,EAAE;gBACnD,MAAM,IAAI,KAAK,CAAC,wCAAwC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,eAAe,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;aACnH;QACH,CAAC;KAAA;CAEF;AAzOD,8DAyOC"}
|
package/src/lib/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const logger: import("roarr").Logger<import("roarr/dist/types").JsonObject>;
|
|
1
|
+
export declare const logger: import("roarr").Logger<import("roarr/dist/types").JsonObject>;
|
package/src/lib/logger.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = void 0;
|
|
4
|
-
const roarr_1 = require("roarr");
|
|
5
|
-
exports.logger = roarr_1.Roarr.child({
|
|
6
|
-
package: '@synapticon/motion-master-client'
|
|
7
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = void 0;
|
|
4
|
+
const roarr_1 = require("roarr");
|
|
5
|
+
exports.logger = roarr_1.Roarr.child({
|
|
6
|
+
package: '@synapticon/motion-master-client'
|
|
7
|
+
});
|
|
8
8
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration interface for monitoring settings.
|
|
3
|
-
*/
|
|
4
|
-
export interface MonitoringConfig {
|
|
5
|
-
/**
|
|
6
|
-
* Specifies the size of the buffer for monitoring messages from Motion Master before emitting them.
|
|
7
|
-
* This is useful, for example, for collecting a certain number of data points over time in a worker thread
|
|
8
|
-
* before emitting them to the main thread for plotting purposes.
|
|
9
|
-
*/
|
|
10
|
-
readonly bufferSize?: number;
|
|
11
|
-
/**
|
|
12
|
-
* Enables the collection of all monitoring data in {@link DataMonitoring}.
|
|
13
|
-
* The collected monitoring data can then be exported to a CSV file, or some statistical analysis can be performed on it.
|
|
14
|
-
*/
|
|
15
|
-
readonly collect?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Controls whether to emit only when the monitored data values change.
|
|
18
|
-
* This is useful for monitoring values like temperature or operation modes, which don't change frequently but need to be displayed continuously.
|
|
19
|
-
* If the monitored data doesn't change, no data will be emitted to the main thread.
|
|
20
|
-
*/
|
|
21
|
-
readonly distinct?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Optional message ID.
|
|
24
|
-
*/
|
|
25
|
-
readonly messageId?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Specifies the topic on the master to which to subscribe.
|
|
28
|
-
* It should be prefixed with the client ID and context to ensure a unique topic.
|
|
29
|
-
*/
|
|
30
|
-
readonly topic: string;
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Configuration interface for monitoring settings.
|
|
3
|
+
*/
|
|
4
|
+
export interface MonitoringConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Specifies the size of the buffer for monitoring messages from Motion Master before emitting them.
|
|
7
|
+
* This is useful, for example, for collecting a certain number of data points over time in a worker thread
|
|
8
|
+
* before emitting them to the main thread for plotting purposes.
|
|
9
|
+
*/
|
|
10
|
+
readonly bufferSize?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Enables the collection of all monitoring data in {@link DataMonitoring}.
|
|
13
|
+
* The collected monitoring data can then be exported to a CSV file, or some statistical analysis can be performed on it.
|
|
14
|
+
*/
|
|
15
|
+
readonly collect?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Controls whether to emit only when the monitored data values change.
|
|
18
|
+
* This is useful for monitoring values like temperature or operation modes, which don't change frequently but need to be displayed continuously.
|
|
19
|
+
* If the monitored data doesn't change, no data will be emitted to the main thread.
|
|
20
|
+
*/
|
|
21
|
+
readonly distinct?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Optional message ID.
|
|
24
|
+
*/
|
|
25
|
+
readonly messageId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Specifies the topic on the master to which to subscribe.
|
|
28
|
+
* It should be prefixed with the client ID and context to ensure a unique topic.
|
|
29
|
+
*/
|
|
30
|
+
readonly topic: string;
|
|
31
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=monitoring-config.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { MonitoringConfig } from "./monitoring-config";
|
|
3
|
-
import { MotionMasterMessage, ParameterValueType } from "./types";
|
|
4
|
-
export interface MonitoringEntry {
|
|
5
|
-
config: Required<MonitoringConfig>;
|
|
6
|
-
interval: number;
|
|
7
|
-
values$: Observable<ParameterValueType[]>;
|
|
8
|
-
parameters: MotionMasterMessage.Request.GetDeviceParameterValues.IParameter[];
|
|
9
|
-
}
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { MonitoringConfig } from "./monitoring-config";
|
|
3
|
+
import { MotionMasterMessage, ParameterValueType } from "./types";
|
|
4
|
+
export interface MonitoringEntry {
|
|
5
|
+
config: Required<MonitoringConfig>;
|
|
6
|
+
interval: number;
|
|
7
|
+
values$: Observable<ParameterValueType[]>;
|
|
8
|
+
parameters: MotionMasterMessage.Request.GetDeviceParameterValues.IParameter[];
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=monitoring-entry.js.map
|