|
Motion Master 6.0.0-alpha.86
Next-generation motion control software
|
Everything the task needs to know, so nothing is hard-coded in execute.
More...
#include <example_cyclic_task.h>
Public Attributes | |
| uint16_t | slavePosition = 1 |
| mm::node::ObjectAddress< int32_t > | temperature |
| int32_t | temperatureLimit = 60000 |
| int32_t | velocity = 100 |
Everything the task needs to know, so nothing is hard-coded in execute.
| uint16_t mm::example::ExampleCyclicTask::Config::slavePosition = 1 |
1-based bus position of the drive to watch. Position is not identity: inserting a device into the chain shifts every position after it, so re-check this after changing the bus.
| mm::node::ObjectAddress<int32_t> mm::example::ExampleCyclicTask::Config::temperature |
The temperature object, as an ObjectAddress: index, subindex, and the C++ type the drive's own dictionary declares, in one constant from somanet_drive_objects.h. Defaults to SOMANET 0x2031:01 "Drive temperature" — measured near the inverter, which is what a power-stage interlock cares about; kCoreTemperatureMeasuredTemperature is the control board instead.
The type travelling with the address is the point, not decoration. This object is a DINT; reading it as an int16_t returns nothing at all, and this task reads "no value" as too hot — so the drive would never enable and the example would look simply broken. Substituting another drive's object is a one-line change here, and the type follows it.
| int32_t mm::example::ExampleCyclicTask::Config::temperatureLimit = 60000 |
Above this, the drive is quick-stopped and held until it cools.
In the object's own units, which here are milli-degrees Celsius — the generated line for kDriveTemperatureMeasuredTemperature carries m°C in its trailing comment, decoded from the ESI's ETG.1004 unit 0xFD2D0000. So this is 60 °C; writing 60 would mean 0.06 °C and quick-stop the drive immediately.
| int32_t mm::example::ExampleCyclicTask::Config::velocity = 100 |
The velocity commanded while the drive is enabled and below the limit, in whatever units 0x60FF uses on your drive (RPM on a SOMANET drive configured that way). Keep it small while trying this out.