Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
somanet_procedures.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <chrono>
5#include <cstdint>
6#include <expected>
7#include <filesystem>
8#include <nlohmann/json_fwd.hpp>
9#include <optional>
10#include <stop_token>
11#include <string>
12#include <string_view>
13#include <vector>
14
16#include "node/device.h"
17#include "node/device_manager.h"
20#include "node/procedure.h"
22#include "node/somanet_drive.h"
23
24namespace mm::node {
25
34
36inline constexpr std::string_view kOsCommandProcedure = "os-command";
37
39inline constexpr std::string_view kOsCommandStep = "command";
40
49 std::vector<uint8_t> command;
50 std::chrono::milliseconds timeout{1000};
51 std::chrono::milliseconds pollInterval{10};
55};
56
74std::expected<OsCommandRequest, std::string> parseOsCommandRequest(const nlohmann::json& body);
75
81std::vector<ProcedureParameter> osCommandParameters();
82
88 uint8_t status = 0;
89 std::vector<uint8_t> data;
90 std::optional<uint8_t> errorCode;
93 std::vector<uint8_t> fsBuffer;
94};
95void to_json(nlohmann::json& j, const OsCommandResult& result);
96
98std::vector<ProgressStep> osCommandSteps();
99
114std::expected<void, std::string> runOsCommandProcedure(Device& device, ProgressReporter& reporter,
115 std::stop_token stop,
116 const OsCommandRequest& request);
117
120inline constexpr std::string_view kEncoderRegisterProcedure = "encoder-register-communication";
121
123inline constexpr std::string_view kEncoderRegisterStep = "register-access";
124
136
145std::expected<EncoderRegisterRequest, std::string> parseEncoderRegisterRequest(
146 const nlohmann::json& body);
147
149std::vector<ProcedureParameter> encoderRegisterParameters();
150
152std::vector<ProgressStep> encoderRegisterSteps();
153
172std::expected<void, std::string> runEncoderRegisterProcedure(Device& device,
173 ProgressReporter& reporter,
174 std::stop_token stop,
175 const EncoderRegisterRequest& request);
176
179inline constexpr std::string_view kIcMuCalibrationModeProcedure = "ic-mu-calibration-mode";
180
182inline constexpr std::string_view kIcMuCalibrationModeStep = "set-mode";
183
193
201std::expected<IcMuCalibrationModeRequest, std::string> parseIcMuCalibrationModeRequest(
202 const nlohmann::json& body);
203
205std::vector<ProcedureParameter> icMuCalibrationModeParameters();
206
208std::vector<ProgressStep> icMuCalibrationModeSteps();
209
223std::expected<void, std::string> runIcMuCalibrationModeProcedure(
224 Device& device, ProgressReporter& reporter, std::stop_token stop,
225 const IcMuCalibrationModeRequest& request);
226
230inline constexpr std::string_view kHrdStreamingProcedure = "hrd-streaming";
231
234inline constexpr std::string_view kHrdConfigureStep = "configure-stream";
235
237inline constexpr std::string_view kHrdRecordStep = "record";
238
249
260std::expected<HrdStreamingRequest, std::string> parseHrdStreamingRequest(
261 const nlohmann::json& body);
262
267std::vector<ProcedureParameter> hrdStreamingParameters();
268
270std::vector<ProgressStep> hrdStreamingSteps();
271
295std::expected<void, std::string> runHrdStreamingProcedure(Device& device,
296 ProgressReporter& reporter,
297 std::stop_token stop,
298 const HrdStreamingRequest& request);
299
302inline constexpr std::string_view kKueblerRegisterProcedure = "kuebler-register-communication";
303
305inline constexpr std::string_view kKueblerRegisterStep = "register-access";
306
309 uint8_t address = 0;
310 uint8_t length = 1;
311 bool write = false;
312 uint32_t value = 0;
313};
314
323std::expected<KueblerRegisterRequest, std::string> parseKueblerRegisterRequest(
324 const nlohmann::json& body);
325
327std::vector<ProcedureParameter> kueblerRegisterParameters();
328
330std::vector<ProgressStep> kueblerRegisterSteps();
331
344std::expected<void, std::string> runKueblerRegisterProcedure(Device& device,
345 ProgressReporter& reporter,
346 std::stop_token stop,
347 const KueblerRegisterRequest& request);
348
351inline constexpr std::string_view kVelocitySourceProcedure = "velocity-source";
352
354inline constexpr std::string_view kVelocitySourceStep = "set-source";
355
363
367std::expected<VelocitySourceRequest, std::string> parseVelocitySourceRequest(
368 const nlohmann::json& body);
369
371std::vector<ProcedureParameter> velocitySourceParameters();
372
374std::vector<ProgressStep> velocitySourceSteps();
375
388std::expected<void, std::string> runVelocitySourceProcedure(Device& device,
389 ProgressReporter& reporter,
390 std::stop_token stop,
391 const VelocitySourceRequest& request);
392
396inline constexpr std::string_view kFirmwareLatencyProcedure = "firmware-latency-measurement";
397
399inline constexpr std::string_view kFirmwareLatencyStartStep = "start-measurement";
400
403inline constexpr std::string_view kFirmwareLatencyObserveStep = "observe";
404
406inline constexpr std::string_view kFirmwareLatencyReadStep = "read-maximum";
407
409inline constexpr std::string_view kFirmwareLatencyStopStep = "stop-measurements";
410
419enum class FirmwareLatencyAction : uint8_t {
422 kMeasure,
424 kStart,
428 kStop,
429};
430
432constexpr std::string_view toString(FirmwareLatencyAction action) {
433 switch (action) {
435 return "measure";
437 return "start";
439 return "read-maximum";
441 return "stop";
442 }
443 return "unknown";
444}
445
447std::optional<FirmwareLatencyAction> parseFirmwareLatencyAction(std::string_view token);
448
461
469std::expected<FirmwareLatencyRequest, std::string> parseFirmwareLatencyRequest(
470 const nlohmann::json& body);
471
473std::vector<ProcedureParameter> firmwareLatencyParameters();
474
481std::vector<ProgressStep> firmwareLatencySteps();
482
505std::expected<void, std::string> runFirmwareLatencyProcedure(Device& device,
506 ProgressReporter& reporter,
507 std::stop_token stop,
508 const FirmwareLatencyRequest& request);
509
512inline constexpr std::string_view kTriggerErrorProcedure = "trigger-error";
513
515inline constexpr std::string_view kTriggerErrorStep = "trigger";
516
526
531std::expected<TriggerErrorRequest, std::string> parseTriggerErrorRequest(
532 const nlohmann::json& body);
533
535std::vector<ProcedureParameter> triggerErrorParameters();
536
538std::vector<ProgressStep> triggerErrorSteps();
539
556std::expected<void, std::string> runTriggerErrorProcedure(Device& device,
557 ProgressReporter& reporter,
558 std::stop_token stop,
559 const TriggerErrorRequest& request);
560
563inline constexpr std::string_view kSystemIdentificationProcedure = "system-identification";
564
566inline constexpr std::string_view kSystemIdConfigureStep = "configure-chirp";
567
569inline constexpr std::string_view kSystemIdArmStep = "arm";
570
583
598std::expected<SystemIdentificationRequest, std::string> parseSystemIdentificationRequest(
599 const nlohmann::json& body);
600
602std::vector<ProcedureParameter> systemIdentificationParameters();
603
605std::vector<ProgressStep> systemIdentificationSteps();
606
628std::expected<void, std::string> runSystemIdentificationProcedure(
629 Device& device, ProgressReporter& reporter, std::stop_token stop,
630 const SystemIdentificationRequest& request);
631
634inline constexpr std::string_view kIgnoreBissStatusBitsProcedure = "ignore-biss-status-bits";
635
637inline constexpr std::string_view kIgnoreBissStatusBitsStep = "set-ignore";
638
648
656std::expected<IgnoreBissStatusBitsRequest, std::string> parseIgnoreBissStatusBitsRequest(
657 const nlohmann::json& body);
658
660std::vector<ProcedureParameter> ignoreBissStatusBitsParameters();
661
663std::vector<ProgressStep> ignoreBissStatusBitsSteps();
664
682std::expected<void, std::string> runIgnoreBissStatusBitsProcedure(
683 Device& device, ProgressReporter& reporter, std::stop_token stop,
684 const IgnoreBissStatusBitsRequest& request);
685
688inline constexpr std::string_view kSkippedCyclesProcedure = "skipped-cycles-counter";
689
691inline constexpr std::string_view kSkippedCyclesStep = "read-counter";
692
699
710std::expected<SkippedCyclesRequest, std::string> parseSkippedCyclesRequest(
711 const nlohmann::json& body);
712
714std::vector<ProcedureParameter> skippedCyclesParameters();
715
717std::vector<ProgressStep> skippedCyclesSteps();
718
733std::expected<void, std::string> runSkippedCyclesProcedure(Device& device,
734 ProgressReporter& reporter,
735 std::stop_token stop,
736 const SkippedCyclesRequest& request);
737
740inline constexpr std::string_view kReadObjectDictionaryProcedure = "read-object-dictionary";
741
743inline constexpr std::string_view kReadObjectDictionaryStep = "read-dictionary";
744
746std::vector<ProgressStep> readObjectDictionarySteps();
747
767std::expected<void, std::string> runReadObjectDictionaryProcedure(Device& device,
768 ProgressReporter& reporter,
769 std::stop_token stop);
770
783inline constexpr std::string_view kPrepareStep = "prepare";
784inline constexpr std::string_view kReleaseBrakeStep = "release-brake";
785inline constexpr std::string_view kRestoreStep = "restore";
786
788inline constexpr std::string_view kOpenPhaseDetectionProcedure = "open-phase-detection";
789
791inline constexpr std::string_view kOpenPhaseDetectionStep = "open-phase-detection";
792
794std::vector<ProgressStep> openPhaseDetectionSteps();
795
825std::expected<void, std::string> runOpenPhaseDetectionProcedure(Device& device,
826 ProgressReporter& reporter,
827 std::stop_token stop);
828
830inline constexpr std::string_view kPolePairDetectionProcedure = "pole-pair-detection";
831
833inline constexpr std::string_view kPolePairDetectionStep = "pole-pair-detection";
834
836std::vector<ProgressStep> polePairDetectionSteps();
837
858std::expected<void, std::string> runPolePairDetectionProcedure(Device& device,
859 ProgressReporter& reporter,
860 std::stop_token stop);
861
864inline constexpr std::string_view kMotorPhaseOrderDetectionProcedure =
865 "motor-phase-order-detection";
866
868inline constexpr std::string_view kMotorPhaseOrderDetectionStep = "motor-phase-order-detection";
869
872std::vector<ProgressStep> motorPhaseOrderDetectionSteps();
873
893std::expected<void, std::string> runMotorPhaseOrderDetectionProcedure(Device& device,
894 ProgressReporter& reporter,
895 std::stop_token stop);
896
903inline constexpr std::string_view kOffsetDetectionProcedure = "offset-detection";
904
907std::vector<ProgressStep> offsetDetectionSteps();
908
942std::expected<void, std::string> runOffsetDetectionProcedure(Device& device,
943 ProgressReporter& reporter,
944 std::stop_token stop);
945
948inline constexpr std::string_view kCommutationOffsetMeasurementProcedure =
949 "commutation-offset-measurement";
950
952inline constexpr std::string_view kCommutationOffsetMeasurementStep =
953 "commutation-offset-measurement";
954
961inline constexpr std::string_view kSetBrakeStep = "set-brake";
962
965std::vector<ProgressStep> commutationOffsetMeasurementSteps();
966
999std::expected<void, std::string> runCommutationOffsetMeasurementProcedure(
1000 Device& device, ProgressReporter& reporter, std::stop_token stop);
1001
1004inline constexpr std::string_view kPhaseResistanceMeasurementProcedure =
1005 "phase-resistance-measurement";
1006
1008inline constexpr std::string_view kPhaseResistanceMeasurementStep = "phase-resistance-measurement";
1009
1011std::vector<ProgressStep> phaseResistanceMeasurementSteps();
1012
1033std::expected<void, std::string> runPhaseResistanceMeasurementProcedure(Device& device,
1034 ProgressReporter& reporter,
1035 std::stop_token stop);
1036
1039inline constexpr std::string_view kPhaseInductanceMeasurementProcedure =
1040 "phase-inductance-measurement";
1041
1043inline constexpr std::string_view kPhaseInductanceMeasurementStep = "phase-inductance-measurement";
1044
1046std::vector<ProgressStep> phaseInductanceMeasurementSteps();
1047
1059std::expected<void, std::string> runPhaseInductanceMeasurementProcedure(Device& device,
1060 ProgressReporter& reporter,
1061 std::stop_token stop);
1062
1065inline constexpr std::string_view kTorqueConstantMeasurementProcedure =
1066 "torque-constant-measurement";
1067
1069inline constexpr std::string_view kTorqueConstantMeasurementStep = "torque-constant-measurement";
1070
1073std::vector<ProgressStep> torqueConstantMeasurementSteps();
1074
1099std::expected<void, std::string> runTorqueConstantMeasurementProcedure(Device& device,
1100 ProgressReporter& reporter,
1101 std::stop_token stop);
1102
1103// ── Firmware installation ──────────────────────────────────────────────────────────────────────
1104//
1105// The one procedure here that changes AL state. Installing firmware *is* a sequence of transitions
1106// (BOOT, write the files, back), so it takes the manager and the position rather than one device.
1107
1114
1116inline constexpr std::string_view kFirmwareInstallationProcedure = "firmware-installation";
1117
1143
1150 std::vector<uint8_t> package;
1151 std::string filename;
1154 std::optional<FirmwarePackageName> name;
1155 std::vector<std::string> skipFiles;
1156 bool cachePackage = true;
1158
1166 std::chrono::milliseconds bootWarmUp{2000};
1167};
1168
1173std::filesystem::path firmwareCacheDir();
1174
1176std::vector<ProcedureParameter> firmwareInstallationParameters();
1177
1179std::vector<ProgressStep> firmwareInstallationSteps();
1180
1194std::expected<FirmwareInstallationRequest, std::string> parseFirmwareInstallationRequest(
1195 const nlohmann::json& body);
1196
1218std::expected<void, std::string> runFirmwareInstallationProcedure(
1219 DeviceManager& deviceManager, uint16_t devicePosition, ProgressReporter& reporter,
1220 std::stop_token stop, const FirmwareInstallationRequest& request);
1221
1222} // namespace mm::node
Represents a single node on the fieldbus.
Definition device.h:116
The handle a procedure body uses to report where it has got to.
Definition procedure.h:327
What a SOMANET firmware package is, offline: how its filename decodes, what its zip holds,...
The register map of the Integro's internal (Kübler) encoder — reference data for OS command 19,...
EtherCatState
EtherCAT Application Layer state values.
Definition fieldbus_driver.h:36
@ PreOp
PRE-OPERATIONAL — mailbox communication active.
IcMuCalibrationMode
How the BiSS service clocks and interprets an iC-MU encoder (OS command 1). The enum value is the "mo...
Definition somanet_drive.h:165
@ kStandard
Normal clocking — the mode an encoder runs in when nothing is being calibrated.
FirmwareService
One of the drive's two independently-scheduled control loops, as the firmware's FirmwareServiceId nam...
Definition somanet_drive.h:205
@ kDriveControl
The current/torque loop — the fast one, period per 0x60C2.
EncoderOrdinal
Which of a drive's two encoders a command addresses. The enum value is the ordinal the firmware expec...
Definition somanet_drive.h:144
@ kEncoder1
The encoder configured in 0x2110.
VelocitySource
Where the velocity control loop takes its feedback from (OS command 18). The enum value is the trigge...
Definition somanet_drive.h:267
ChirpSignalType
Which excitation the system-identification run sweeps with (parameter 4).
Definition somanet_drive.h:462
@ kLogarithmic
Logarithmic frequency sweep whose amplitude rises with it, from half the target to the target.
SystemIdentificationStart
What writing parameter 5 does — arm the run, and on what trigger.
Definition somanet_drive.h:484
FirmwareLatency
Which internal firmware latency OS command 22 measures. The enum value is the latency index byte the ...
Definition somanet_drive.h:297
FirmwareErrorType
The errors OS command 16 can provoke in a firmware service. The enum value is the error-type byte the...
Definition somanet_drive.h:329
HrdData
Which signal a high resolution data (HRD) stream records — OS command 3's data index....
Definition somanet_drive.h:577
Definition bus_health_source.h:7
std::expected< FirmwareLatencyRequest, std::string > parseFirmwareLatencyRequest(const nlohmann::json &body)
Parses and validates a client's firmware latency request body.
Definition somanet_procedures.cc:1670
std::vector< ProgressStep > hrdStreamingSteps()
The HRD streaming procedure's step template — configure, then record.
Definition somanet_procedures.cc:1138
std::expected< void, std::string > runEncoderRegisterProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const EncoderRegisterRequest &request)
Runs one encoder register access as a procedure body.
Definition somanet_procedures.cc:962
std::filesystem::path firmwareCacheDir()
Where installed packages are kept: a firmwares subdirectory of the per-user cache.
Definition somanet_procedures.cc:2310
constexpr std::string_view kCommutationOffsetMeasurementStep
The step commutation offset measurement's own measurement reports against.
Definition somanet_procedures.h:952
std::expected< HrdStreamingRequest, std::string > parseHrdStreamingRequest(const nlohmann::json &body)
Parses and validates a client's HRD streaming request body.
Definition somanet_procedures.cc:1073
std::string_view toString(FirmwareMatch match)
What a match is called, for a message or a JSON body: "none", "assembly", "device".
Definition firmware_package.cc:295
std::expected< void, std::string > runPhaseResistanceMeasurementProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs phase resistance measurement as a procedure body.
Definition somanet_procedures.cc:1435
std::expected< VelocitySourceRequest, std::string > parseVelocitySourceRequest(const nlohmann::json &body)
Parses and validates a client's velocity source request body.
Definition somanet_procedures.cc:1593
std::expected< void, std::string > runFirmwareLatencyProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const FirmwareLatencyRequest &request)
Measures one internal firmware latency as a procedure body.
Definition somanet_procedures.cc:1765
constexpr std::string_view kSystemIdArmStep
The step that arms the run — or disarms it.
Definition somanet_procedures.h:569
FirmwareLatencyAction
What one firmware latency run should do.
Definition somanet_procedures.h:419
@ kStart
Start measuring and leave it running, to be read by a later run.
@ kStop
Stop measuring — necessarily both latencies, as the command has no per-latency stop.
@ kReadMaximum
Read and clear the maximum of a measurement already running (or already stopped).
std::vector< ProcedureParameter > osCommandParameters()
What the OS command procedure accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:814
std::expected< void, std::string > runSystemIdentificationProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const SystemIdentificationRequest &request)
Configures and optionally arms a system identification run as a procedure body.
Definition somanet_procedures.cc:2073
std::vector< ProgressStep > velocitySourceSteps()
The velocity-source procedure's step template — one step, idle.
Definition somanet_procedures.cc:1634
constexpr std::string_view kReadObjectDictionaryStep
The single step reading the whole object dictionary reports against.
Definition somanet_procedures.h:743
constexpr std::string_view kEncoderRegisterProcedure
Procedure name for encoder register communication, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:120
std::vector< ProgressStep > torqueConstantMeasurementSteps()
Torque constant measurement's step template — prepare, release the brake, measure,...
Definition somanet_procedures.cc:2288
constexpr std::string_view kSkippedCyclesStep
The single step reading a skipped cycles counter reports against.
Definition somanet_procedures.h:691
std::vector< ProgressStep > firmwareInstallationSteps()
The procedure's step template, in order.
Definition somanet_procedures.cc:2374
constexpr std::string_view kTriggerErrorStep
The single step provoking a firmware error reports against.
Definition somanet_procedures.h:515
constexpr std::string_view kOpenPhaseDetectionStep
The step open phase detection's own measurement reports against.
Definition somanet_procedures.h:791
constexpr std::string_view kIcMuCalibrationModeProcedure
Procedure name for setting an iC-MU calibration mode, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:179
constexpr std::string_view kOsCommandProcedure
Procedure name for the raw OS command, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:36
constexpr std::string_view kHrdRecordStep
The step that records. Occupies the whole configured duration.
Definition somanet_procedures.h:237
constexpr std::string_view kHrdStreamingProcedure
Procedure name for recording a high resolution data stream, as it appears in its URL and its snapshot...
Definition somanet_procedures.h:230
std::vector< ProcedureParameter > encoderRegisterParameters()
What encoder register communication accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:941
std::vector< ProgressStep > kueblerRegisterSteps()
The Kübler register procedure's step template — one step, idle.
Definition somanet_procedures.cc:1569
std::expected< void, std::string > runVelocitySourceProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const VelocitySourceRequest &request)
Chooses the velocity loop's feedback source as a procedure body.
Definition somanet_procedures.cc:1636
constexpr std::string_view kPhaseInductanceMeasurementProcedure
Procedure name for phase inductance measurement, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:1039
std::vector< ProgressStep > osCommandSteps()
The OS command procedure's step template — one step, all idle.
Definition somanet_procedures.cc:863
std::vector< ProcedureParameter > systemIdentificationParameters()
What system identification accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:2014
std::vector< ProgressStep > phaseResistanceMeasurementSteps()
Phase resistance measurement's step template — prepare, measure, restore, all idle.
Definition somanet_procedures.cc:1431
std::expected< void, std::string > runMotorPhaseOrderDetectionProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs motor phase order detection as a procedure body.
Definition somanet_procedures.cc:1249
constexpr std::string_view kSkippedCyclesProcedure
Procedure name for reading a skipped cycles counter, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:688
void to_json(nlohmann::json &j, const Cia402Status &s)
Serialises a Cia402Status. Emits state/modeName as human-readable strings alongside the numeric statu...
Definition cia402_drive.cc:13
std::expected< void, std::string > runOffsetDetectionProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs the whole commissioning sequence as one procedure body.
Definition somanet_procedures.cc:1273
std::expected< void, std::string > runHrdStreamingProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const HrdStreamingRequest &request)
Records one high resolution data stream as a procedure body.
Definition somanet_procedures.cc:1142
constexpr std::string_view kIgnoreBissStatusBitsStep
The single step ignoring BiSS status bits reports against.
Definition somanet_procedures.h:637
std::vector< ProgressStep > polePairDetectionSteps()
Pole pair detection's step template — prepare, release the brake, detect, restore.
Definition somanet_procedures.cc:1224
constexpr std::string_view kKueblerRegisterStep
The single step a Kübler register access reports against.
Definition somanet_procedures.h:305
constexpr std::string_view kFirmwareLatencyReadStep
The step that reads and clears the recorded maximum.
Definition somanet_procedures.h:406
constexpr std::string_view kSystemIdentificationProcedure
Procedure name for configuring a system identification run, as it appears in its URL and its snapshot...
Definition somanet_procedures.h:563
std::vector< ProgressStep > firmwareLatencySteps()
The firmware latency procedure's step template — start, observe, read, stop.
Definition somanet_procedures.cc:1760
constexpr std::string_view kFirmwareInstallationProcedure
Procedure name, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:1116
constexpr std::string_view kPrepareStep
The step ids shared by every procedure that prepares a drive, measures, and puts it back.
Definition somanet_procedures.h:783
std::vector< ProcedureParameter > ignoreBissStatusBitsParameters()
What ignoring BiSS status bits accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:2154
std::vector< ProgressStep > skippedCyclesSteps()
The skipped cycles procedure's step template — one step, idle.
Definition somanet_procedures.cc:2239
constexpr std::string_view kFirmwareLatencyObserveStep
The step that lets the drive run while the measurement collects. Occupies the whole requested duratio...
Definition somanet_procedures.h:403
std::vector< ProgressStep > motorPhaseOrderDetectionSteps()
Motor phase order detection's step template — prepare, release the brake, detect, restore.
Definition somanet_procedures.cc:1245
constexpr std::string_view kTorqueConstantMeasurementStep
The step torque constant measurement's own measurement reports against.
Definition somanet_procedures.h:1069
constexpr std::string_view kTriggerErrorProcedure
Procedure name for provoking a firmware error, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:512
std::vector< ProgressStep > openPhaseDetectionSteps()
Open phase detection's step template — prepare, check, restore, all idle.
Definition somanet_procedures.cc:1178
std::optional< FirmwareLatencyAction > parseFirmwareLatencyAction(std::string_view token)
Parses a firmware latency action token. std::nullopt if it names none of them.
Definition somanet_procedures.cc:1660
constexpr std::string_view kOsCommandStep
The single step the OS command procedure reports against.
Definition somanet_procedures.h:39
constexpr std::string_view kReadObjectDictionaryProcedure
Procedure name for reading the whole object dictionary, as it appears in its URL and its snapshot key...
Definition somanet_procedures.h:740
constexpr std::string_view kVelocitySourceStep
The single step choosing the velocity source reports against.
Definition somanet_procedures.h:354
std::expected< TriggerErrorRequest, std::string > parseTriggerErrorRequest(const nlohmann::json &body)
Parses and validates a client's trigger-error request body.
Definition somanet_procedures.cc:1832
std::vector< ProcedureParameter > firmwareInstallationParameters()
What the procedure accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:2312
constexpr std::string_view kPolePairDetectionStep
The step pole pair detection's own measurement reports against.
Definition somanet_procedures.h:833
constexpr std::string_view kPhaseInductanceMeasurementStep
The step phase inductance measurement's own measurement reports against.
Definition somanet_procedures.h:1043
constexpr std::string_view kFirmwareLatencyProcedure
Procedure name for measuring a firmware latency, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:396
constexpr std::string_view kFirmwareLatencyStopStep
The step that stops both measurements.
Definition somanet_procedures.h:409
std::vector< ProcedureParameter > kueblerRegisterParameters()
What a Kübler register access accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1546
constexpr std::string_view kSystemIdConfigureStep
The step that writes the chirp's five settings.
Definition somanet_procedures.h:566
constexpr std::string_view kFirmwareLatencyStartStep
The step that starts a measurement, and clears whatever the latency recorded.
Definition somanet_procedures.h:399
constexpr std::string_view kMotorPhaseOrderDetectionProcedure
Procedure name for motor phase order detection, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:864
std::expected< IcMuCalibrationModeRequest, std::string > parseIcMuCalibrationModeRequest(const nlohmann::json &body)
Parses and validates a client's iC-MU calibration mode request body.
Definition somanet_procedures.cc:988
constexpr std::string_view kPhaseResistanceMeasurementProcedure
Procedure name for phase resistance measurement, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:1004
std::expected< SkippedCyclesRequest, std::string > parseSkippedCyclesRequest(const nlohmann::json &body)
Parses and validates a client's skipped cycles request body.
Definition somanet_procedures.cc:2195
std::vector< ProcedureParameter > hrdStreamingParameters()
What HRD streaming accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1111
std::expected< void, std::string > runFirmwareInstallationProcedure(DeviceManager &deviceManager, uint16_t devicePosition, ProgressReporter &reporter, std::stop_token stop, const FirmwareInstallationRequest &request)
Installs request's package on the device at devicePosition.
Definition somanet_procedures.cc:2469
std::vector< ProcedureParameter > triggerErrorParameters()
What provoking a firmware error accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1869
std::expected< void, std::string > runCommutationOffsetMeasurementProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs commutation offset measurement as a procedure body — OS command 5 and nothing else.
Definition somanet_procedures.cc:1399
constexpr std::string_view kPhaseResistanceMeasurementStep
The step phase resistance measurement's own measurement reports against.
Definition somanet_procedures.h:1008
std::expected< void, std::string > runPolePairDetectionProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs pole pair detection as a procedure body.
Definition somanet_procedures.cc:1228
std::expected< void, std::string > runIcMuCalibrationModeProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const IcMuCalibrationModeRequest &request)
Sets an iC-MU encoder's calibration mode as a procedure body.
Definition somanet_procedures.cc:1048
constexpr std::string_view kOpenPhaseDetectionProcedure
Procedure name for open phase detection, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:788
std::vector< ProgressStep > readObjectDictionarySteps()
The read-object-dictionary procedure's step template — one step, idle.
Definition somanet_procedures.cc:2263
constexpr std::string_view kTorqueConstantMeasurementProcedure
Procedure name for torque constant measurement, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:1065
std::expected< void, std::string > runTriggerErrorProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const TriggerErrorRequest &request)
Provokes a firmware error in a control service as a procedure body.
Definition somanet_procedures.cc:1911
constexpr std::string_view kPolePairDetectionProcedure
Procedure name for pole pair detection, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:830
constexpr std::string_view kSetBrakeStep
The step that puts the brake where the configured method needs it.
Definition somanet_procedures.h:961
std::vector< ProcedureParameter > firmwareLatencyParameters()
What measuring a firmware latency accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1713
std::vector< ProgressStep > icMuCalibrationModeSteps()
The iC-MU calibration mode procedure's step template — one step, idle.
Definition somanet_procedures.cc:1044
constexpr std::string_view kEncoderRegisterStep
The single step encoder register communication reports against.
Definition somanet_procedures.h:123
constexpr std::string_view kKueblerRegisterProcedure
Procedure name for a Kübler encoder register access, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:302
std::vector< ProcedureParameter > icMuCalibrationModeParameters()
What setting an iC-MU calibration mode accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1020
std::vector< ProgressStep > commutationOffsetMeasurementSteps()
Commutation offset measurement's step template — prepare, release the brake, measure,...
Definition somanet_procedures.cc:1394
std::vector< ProgressStep > encoderRegisterSteps()
Encoder register communication's step template — one step, idle.
Definition somanet_procedures.cc:960
std::expected< EncoderRegisterRequest, std::string > parseEncoderRegisterRequest(const nlohmann::json &body)
Parses and validates a client's encoder register request body.
Definition somanet_procedures.cc:908
std::expected< SystemIdentificationRequest, std::string > parseSystemIdentificationRequest(const nlohmann::json &body)
Parses and validates a client's system identification request body.
Definition somanet_procedures.cc:1933
std::expected< KueblerRegisterRequest, std::string > parseKueblerRegisterRequest(const nlohmann::json &body)
Parses and validates a client's Kübler register request body.
Definition somanet_procedures.cc:1488
std::expected< void, std::string > runPhaseInductanceMeasurementProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs phase inductance measurement as a procedure body.
Definition somanet_procedures.cc:1451
constexpr std::string_view kVelocitySourceProcedure
Procedure name for choosing the velocity feedback source, as it appears in its URL and its snapshot k...
Definition somanet_procedures.h:351
constexpr std::string_view kReleaseBrakeStep
Definition somanet_procedures.h:784
std::expected< void, std::string > runReadObjectDictionaryProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Reads every object dictionary value in one transfer, as a procedure body.
Definition somanet_procedures.cc:2267
std::expected< OsCommandRequest, std::string > parseOsCommandRequest(const nlohmann::json &body)
Parses and validates a client's OS command request body.
Definition somanet_procedures.cc:733
constexpr std::string_view kHrdConfigureStep
The step that arms the recording — chooses the signal and the duration, and clears the files the last...
Definition somanet_procedures.h:234
constexpr std::string_view kRestoreStep
Definition somanet_procedures.h:785
constexpr std::string_view kIgnoreBissStatusBitsProcedure
Procedure name for ignoring a BiSS encoder's status bits, as it appears in its URL and its snapshot k...
Definition somanet_procedures.h:634
std::expected< IgnoreBissStatusBitsRequest, std::string > parseIgnoreBissStatusBitsRequest(const nlohmann::json &body)
Parses and validates a client's ignore-BiSS-status-bits request body.
Definition somanet_procedures.cc:2130
std::vector< ProgressStep > ignoreBissStatusBitsSteps()
The ignore-BiSS-status-bits procedure's step template — one step, idle.
Definition somanet_procedures.cc:2166
std::vector< ProgressStep > offsetDetectionSteps()
The commissioning sequence's step template — every command in the order it runs, plus the shared prep...
Definition somanet_procedures.cc:1266
std::expected< void, std::string > runTorqueConstantMeasurementProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs torque constant measurement as a procedure body.
Definition somanet_procedures.cc:2292
std::expected< void, std::string > runKueblerRegisterProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const KueblerRegisterRequest &request)
Reads or writes one Integro internal-encoder register as a procedure body.
Definition somanet_procedures.cc:1571
constexpr std::string_view kIcMuCalibrationModeStep
The single step setting an iC-MU calibration mode reports against.
Definition somanet_procedures.h:182
std::expected< FirmwareInstallationRequest, std::string > parseFirmwareInstallationRequest(const nlohmann::json &body)
Parses and validates a client's installation request.
Definition somanet_procedures.cc:2379
std::vector< ProgressStep > phaseInductanceMeasurementSteps()
Phase inductance measurement's step template — prepare, measure, restore, all idle.
Definition somanet_procedures.cc:1447
constexpr std::string_view kMotorPhaseOrderDetectionStep
The step motor phase order detection's own measurement reports against.
Definition somanet_procedures.h:868
std::vector< ProgressStep > systemIdentificationSteps()
The system identification procedure's step template — configure, then arm.
Definition somanet_procedures.cc:2069
std::vector< ProcedureParameter > skippedCyclesParameters()
What reading a skipped cycles counter accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:2219
std::expected< void, std::string > runOsCommandProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const OsCommandRequest &request)
Runs one raw OS command as a procedure body.
Definition somanet_procedures.cc:865
std::expected< void, std::string > runIgnoreBissStatusBitsProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const IgnoreBissStatusBitsRequest &request)
Starts or stops ignoring a BiSS encoder's status bits as a procedure body.
Definition somanet_procedures.cc:2170
std::expected< void, std::string > runSkippedCyclesProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop, const SkippedCyclesRequest &request)
Reads one control loop's skipped-cycle counter as a procedure body.
Definition somanet_procedures.cc:2241
std::vector< ProcedureParameter > velocitySourceParameters()
What choosing the velocity source accepts, as its descriptor advertises it.
Definition somanet_procedures.cc:1614
constexpr std::string_view kOffsetDetectionProcedure
Procedure name for the whole commissioning sequence, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:903
std::expected< void, std::string > runOpenPhaseDetectionProcedure(Device &device, ProgressReporter &reporter, std::stop_token stop)
Runs open phase detection as a procedure body.
Definition somanet_procedures.cc:1182
std::vector< ProgressStep > triggerErrorSteps()
The trigger-error procedure's step template — one step, idle.
Definition somanet_procedures.cc:1909
constexpr std::string_view kCommutationOffsetMeasurementProcedure
Procedure name for commutation offset measurement, as it appears in its URL and its snapshot key.
Definition somanet_procedures.h:948
What one encoder register access was asked to do.
Definition somanet_procedures.h:130
uint8_t value
The byte to write; ignored when reading.
Definition somanet_procedures.h:134
bool write
Write the register rather than read it.
Definition somanet_procedures.h:132
uint8_t registerAddress
The register to access; no default, so a request must say.
Definition somanet_procedures.h:133
somanet::EncoderOrdinal encoder
Which encoder.
Definition somanet_procedures.h:131
Where an install leaves the device, as an AL state.
Definition somanet_procedures.h:1149
std::string filename
Definition somanet_procedures.h:1151
mm::comm::EtherCatState finalState
Definition somanet_procedures.h:1157
std::vector< std::string > skipFiles
Entries not to write; defaults per the descriptor.
Definition somanet_procedures.h:1155
std::optional< FirmwarePackageName > name
Definition somanet_procedures.h:1154
std::chrono::milliseconds bootWarmUp
Definition somanet_procedures.h:1166
std::vector< uint8_t > package
The package zip's bytes.
Definition somanet_procedures.h:1150
bool cachePackage
Keep a copy under firmwareCacheDir when named.
Definition somanet_procedures.h:1156
What one firmware latency run was asked to do.
Definition somanet_procedures.h:450
FirmwareLatencyAction action
Definition somanet_procedures.h:453
somanet::FirmwareLatency latency
Which latency. Ignored by FirmwareLatencyAction::kStop, which stops both.
Definition somanet_procedures.h:456
std::chrono::milliseconds duration
How long to let the measurement collect, used only by FirmwareLatencyAction::kMeasure.
Definition somanet_procedures.h:459
What one high resolution data recording was asked to capture.
Definition somanet_procedures.h:240
std::chrono::milliseconds duration
Definition somanet_procedures.h:247
somanet::HrdData data
Definition somanet_procedures.h:243
What one iC-MU calibration mode change was asked to do.
Definition somanet_procedures.h:185
somanet::EncoderOrdinal encoder
Which encoder.
Definition somanet_procedures.h:186
somanet::IcMuCalibrationMode mode
Definition somanet_procedures.h:191
Which encoder's status bits to act on, and which way.
Definition somanet_procedures.h:640
somanet::EncoderOrdinal encoder
Which encoder.
Definition somanet_procedures.h:641
bool ignore
Definition somanet_procedures.h:646
What one Kübler register access was asked to do.
Definition somanet_procedures.h:308
uint8_t length
Width in bytes, 1 to 4. Must match the register's real width.
Definition somanet_procedures.h:310
uint8_t address
Which register; no default, so a request must name one.
Definition somanet_procedures.h:309
uint32_t value
The value to write; ignored when reading.
Definition somanet_procedures.h:312
bool write
Write value rather than read.
Definition somanet_procedures.h:311
An OS command's fs-buffer transfer — the data that does not fit in the 8 command bytes.
Definition somanet_drive.h:1078
What one raw OS command run was asked to do.
Definition somanet_procedures.h:48
std::chrono::milliseconds pollInterval
Definition somanet_procedures.h:51
std::vector< uint8_t > command
The 8 request bytes (byte 0 = command ID).
Definition somanet_procedures.h:49
OsCommandFsBuffer fsBuffer
Definition somanet_procedures.h:54
std::chrono::milliseconds timeout
Ceiling on the whole command.
Definition somanet_procedures.h:50
What one raw OS command run produced — the step's value.
Definition somanet_procedures.h:87
std::vector< uint8_t > fsBuffer
Definition somanet_procedures.h:93
std::vector< uint8_t > data
Service response payload, if the drive sent one.
Definition somanet_procedures.h:89
uint8_t status
Terminal status byte (0x1023:03 byte 0).
Definition somanet_procedures.h:88
std::optional< uint8_t > errorCode
Definition somanet_procedures.h:90
Which control loop's counter to read.
Definition somanet_procedures.h:694
somanet::FirmwareService service
Definition somanet_procedures.h:697
One system identification run, as a client describes it.
Definition somanet_procedures.h:572
uint32_t targetFrequencyMilliHz
Where it ends. Required, and not below the start.
Definition somanet_procedures.h:574
somanet::ChirpSignalType signalType
Which chirp.
Definition somanet_procedures.h:577
uint32_t startFrequencyMilliHz
Where the sweep begins. Required.
Definition somanet_procedures.h:573
uint32_t targetAmplitudePermil
Peak excitation, per-mille of rated torque. Required.
Definition somanet_procedures.h:575
somanet::SystemIdentificationStart start
Definition somanet_procedures.h:581
uint32_t transitionTimeMs
How long the sweep takes. Required.
Definition somanet_procedures.h:576
Which service to break, and how.
Definition somanet_procedures.h:518
somanet::FirmwareService service
Definition somanet_procedures.h:519
somanet::FirmwareErrorType errorType
Definition somanet_procedures.h:524
Which velocity the control loop should use.
Definition somanet_procedures.h:357
somanet::VelocitySource source
Definition somanet_procedures.h:361