18#include "SampleAppsHelper.h"
19#include "SampleApps.h"
24int PVTmotionMultiAxis::Run()
30 const int AXIS_COUNT = 2;
34 const double USER_UNITS = 1048576;
37 const int POINTS = (3000);
38 const double TIME_SLICE = (0.001);
45 const char rmpPath[] =
"C:\\RSI\\X.X.X\\";
87 double PI = 3.14159265358979323;
89 double degrees = 90.00 / (POINTS);
91 double position[POINTS * AXIS_COUNT];
92 double vel[POINTS * AXIS_COUNT];
96 for (
int i = 0, x = 0, y = 1; i < POINTS; i++)
98 position[x] = (radius*cos((i + 1)*degrees*PI / 180.0));
99 position[y] = (radius*sin((i + 1)*degrees*PI / 180.0));
104 time[i] = TIME_SLICE;
108 for (
int i = 0, x = 0, y = 1; i < (POINTS - 1); i++)
110 vel[x] = (position[x + 2] - position[x]) / TIME_SLICE;
111 vel[y] = (position[y + 2] - position[y]) / TIME_SLICE;
118 vel[(POINTS * 2) - 2] = 0;
119 vel[(POINTS * 2) - 1] = 0;
125 multiAxisXY->
Abort();
129 multiAxisXY->
MovePVT(position, vel, time, POINTS, -1,
false,
true);
136 printf(
"\n%s\n", err.text);
void UserUnitsSet(double countsPerUserUnit)
Sets the number of counts per User Unit.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
void PositionSet(double position)
Set the Command and Actual positions.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
void MotionCountSet(int32_t motionCount)
Set the number of processed Motion Supervisors in the controller.
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
MultiAxis * MultiAxisGet(int32_t motionSupervisorNumber)
MultiAxisGet returns a pointer to a MultiAxis object and initializes its internals.
int32_t AxisCountGet()
Get the number of axes processing.
int32_t MotionCountGet()
Get the number of Motion Supervisors available in the firmware.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void AxisAdd(Axis *axis)
Add an Axis to a MultiAxis group.
Represents multiple axes of motion control, allows you to map two or more Axis objects together for e...
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void AmpEnableSet(bool enable)
Enable all amplifiers.
void Abort()
Abort an axis.
int32_t MotionDoneWait()
Waits for a move to complete.
void MovePVT(const double *const position, const double *const velocity, const double *const time, int32_t pointCount, int32_t emptyCount, bool retain, bool final)
Move commanded by list of positions, velocities, and times.
Represents the error details thrown as an exception by all RapidCode classes. This class contains an ...
@ RSIActionNONE
None - do not perform any action.
static void SetupControllerForHardware(MotionController *controller)
Sets up the controller for hardware use by resetting it and starting the network.
static void CheckErrors(RapidCodeObject *rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void SetupControllerForPhantoms(MotionController *controller, int axisCount, std::vector< int > axisNums)
Sets up the controller for phantom axes, including configuring specified axes as phantom.