| ApossC SDK V01.15

SDK_Amplifier_DS402_StateMachine.mh
Go to the documentation of this file.
1
7 #pragma once
8
9
13 //State machine
14 long sdkDS402_ReadStatusWord(long busId);
15 long sdkDS402_ReadControlWord(long busId);
16 void sdkDS402_WriteControlWord(long busId, long value);
17 long sdkDS402_GetActDriveState(long busId);
18 void sdkDS402_PrintState(long state);
19 long helperDS402_ExecuteTransition(long busId, long transition);
20 long sdkDS402_TransitionToState(long busId, long newState);
21 long sdkDS402_WaitTransitionToState(long busId, long targetState, long timeout);
22
23 //Profile Mode settings
24 void sdkDS402_SetProfileAcceleration(long busId, long acc);
25 void sdkDS402_SetProfileDeceleration(long busId, long dec);
26 void sdkDS402_SetProfileVelocity(long busId, long vel);
27 void sdkDS402_SetMotionProfileType(long busId, long type);
28 void sdkDS402_SetMaxProfileVelocity(long busId, long vel);
29 void sdkDS402_SetMaxMotorSpeed(long busId, long vel);
30 void sdkDS402_SetMaxAcceleration(long busId, long acc);
31 void sdkDS402_SetQuickStopDeceleration(long busId, long dec);
32 void sdkDS402_SetProfileMovementParameter(long busId, long acc, long dec, long velocity);
33
34 //Profile Mode functions
35 void sdkDS402_SetOpartionMode(long busId, long operationMode);
36 long sdkDS402_GetOpartionMode(long busId);
37 void sdkDS402_QuickStop(long busId);
38 void sdkDS402_Halt(long busId);
39 void sdkDS402_ResetFault(long busId);
40 void sdkDS402_Print_StatusWord(long busId);
41 void sdkDS402_Print_ControlWord(long busId);
42
43 //Profile postion mode PPM
44 long helperDS402_PPM_PosStart(long busId, long pos, long relative, long startImmediately);
45 long sdkDS402_PPM_PosAbsStart(long busId, long pos, long startImmediately);
46 long sdkDS402_PPM_PosRelStart(long busId, long pos, long startImmediately);
47 long sdkDS402_PPM_TargetReached(long busId);
48 long sdkDS402_PPM_WaitTargetReached(long busId, long timeout);
49
50 //Profile velocity mode PVM
51 void sdkDS402_PVM_SetTargetVelocity(long busId, long targetVelocity);
52 long sdkDS402_PVM_CvelStart(long busId);
53 long sdkDS402_PVM_CvelStop(long busId);
54 long sdkDS402_PVM_TargetReached(long busId);
55 long sdkDS402_PVM_WaitTargetReached(long busId, long timeout);
56
57
60 #define DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON 1
61 #define DS402_DRIVE_STATE_SWITCH_ON_DISABLED 2
62 #define DS402_DRIVE_STATE_READY_TO_SWITCH_ON 3
63 #define DS402_DRIVE_STATE_SWITCHED_ON 4
64 #define DS402_DRIVE_STATE_OPERATION_ENABLED 5
65 #define DS402_DRIVE_STATE_QUICK_STOP_ACTIVE 6
66 #define DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE 7
67 #define DS402_DRIVE_STATE_FAULT 8
68
69 //Transitions
70 #define DS402_TRANSITION_SHUTDOWN 1
71 #define DS402_TRANSITION_SWITCH_ON 2
72 #define DS402_TRANSITION_ENABLE_OPERATION 3
73 #define DS402_TRANSITION_DISABLE_VOLTAGE 4
74 #define DS402_TRANSITION_DISABLE_OPERATION 5
75 #define DS402_TRANSITION_QUICK_STOP 6
76 #define DS402_TRANSITION_FAULT_RESET 7
77
78
81 #define DS402_ABORT_CONNECTION_OPTION_CODE 0x6007
82 #define DS402_ERROR_CODE 0x603F
83 #define DS402_CONTROLWORD 0x6040
84 #define DS402_CW_BIT_SWITCH_ON 0
85 #define DS402_CW_BIT_ENABLE_VOLTAGE 1
86 #define DS402_CW_BIT_QUICK_STOP 2
87 #define DS402_CW_BIT_ENABLE_OPERATION 3
88 #define DS402_CW_BIT_HALT 8
89
90 //PPM
91 #define DS402_CW_PPM_BIT_NEW_SETPOINT 4
92 #define DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY 5
93 #define DS402_CW_PPM_BIT_RELATIVE_MOVEMENT 6
94 #define DS402_CW_PPM_BIT_ENDLESS_MOVEMENT 15
95
96 #define DS402_STATUSWORD 0x6041
97 #define DS402_SW_BIT_READY_TO_SWITCH_ON 0
98 #define DS402_SW_BIT_SWITCHED_ON 1
99 #define DS402_SW_BIT_OPERATION_ENABLED 2
100 #define DS402_SW_BIT_FAULT 3
101 #define DS402_SW_BIT_VOLTAGE_ENABLED 4
102 #define DS402_SW_BIT_QUICK_STOP 5
103 #define DS402_SW_BIT_SWITCH_ON_DISABLED 6
104 #define DS402_SW_BIT_WARNING 7
105 #define DS402_SW_BIT_REMOTE 9
106 #define DS402_SW_BIT_TARGET_REACHED 10
107 #define DS402_SW_BIT_INTERNAL_LIMIT 11 //I2T, Current, max velocity, max speed
108
109 //PPM
110 #define DS402_SW_PPM_BIT_SETPOINT_ACK 12
111 #define DS402_SW_PPM_BIT_FOLLWING_ERROR 13
112
113 //PVM
114 #define DS402_SW_PVM_BIT_SPEED 12
115 #define DS402_QUICK_STOP_OPTION_CODE 0x605A
116 #define DS402_SHUTDOWN_OPTION_CODE 0x605B
117 #define DS402_DISABLE_OPERATION_OPTION_CODE 0x605C
118 #define DS402_FAULT_REACTION_OPTION_CODE 0x605E
119 #define DS402_MODES_OF_OPERATION 0x6060 // 0x00: Switches the actually chosen operating mode
120 #define DS402_OP_PPM 0x01 // Profile Position Mode
121 #define DS402_OP_PVM 0x03 // Profile Velocity Mode
122 //#define DS402_OP_HMM 0x06 // Homing Mode
123 //#define DS402_OP_CSP 0x08 // Cyclic Synchronous Position Mode
124 //#define DS402_OP_CSV 0x09 // Cyclic Synchronous Velocity Mode
125 //#define DS402_OP_CST 0x0A // Cyclic Synchronous Torque Mode
126 #define DS402_MODES_OF_OPERATION_DISPLAY 0x6061
127 #define DS402_POSITION_DEMAND_VALUE 0x6062
128 #define DS402_POSITION_ACTUAL_VALUE 0x6064
129 #define DS402_FOLLOWING_ERROR_WINDOW 0x6065
130 #define DS402_FOLLOWING_ERROR_TIMEOUT 0x6066
131 #define DS402_VELOCITY_DEMAND_VALUE 0x606B
132 #define DS402_VELOCITY_ACTUAL_VALUE 0x606C
133 #define DS402_TARGET_TORQUE 0x6071
134 #define DS402_MOTOR_RATED_TORQUE 0x6076
135 #define DS402_TORQUE_ACTUAL_VALUE 0x6077
136 #define DS402_TARGET_POSITION 0x607A
137 #define DS402_POSITION_RANGE_LIMIT 0x607B
138 #define DS402_SOFTWARE_POSITION_LIMIT 0x607D
139 #define DS402_MAX_PROFILE_VELOCITY 0x607F
140 #define DS402_MAX_MOTOR_SPEED 0x6080
141 #define DS402_PROFILE_VELOCITY 0x6081
142 #define DS402_PROFILE_ACCELERATION 0x6083
143 #define DS402_PROFILE_DECELERATION 0x6084
144 #define DS402_QUICK_STOP_DECELERATION 0x6085
145 #define DS402_MOTION_PROFILE_TYPE 0x6086
146 #define DS402_HOMING_METHOD 0x6098 // 0x00: Used to select the desired homing method
147 #define DS402_HOMING_ACT_POSITION 37
148 #define DS402_HOMING_IDX_P_SPEED 34
149 #define DS402_HOMING_IDX_N_SPEED 33
150 #define DS402_HOMING_SWITCH_P_SPEED 23
151 #define DS402_HOMING_SWITCH_N_SPEED 27
152 #define DS402_HOMING_LIMIT_P_SPEED 18
153 #define DS402_HOMING_LIMIT_N_SPEED 17
154 #define DS402_HOMING_SWITCH_IDX_P_SPEED 7
155 #define DS402_HOMING_SWITCH_IDX_N_SPEED 11
156 #define DS402_HOMING_LIMIT_IDX_P_SPEED 2
157 #define DS402_HOMING_LIMIT_IDX_N_SPEED 1
158 #define DS402_HOMING_CURRENT_IDX_P_SPEED -1
159 #define DS402_HOMING_CURRENT_IDX_N_SPEED -2
160 #define DS402_HOMING_CURRENT_P_SPEED -3
161 #define DS402_HOMING_CURRENT_N_SPEED -4
162 #define DS402_HOMING_SPEEDS 0x6099 // 0x01: Speed for switch search, 0x02: Speed for zero search
163 #define DS402_HOMING_ACCELERATION 0x609A // 0x00: Acceleration and deceleration ramps in the homing profile
164 #define DS402_SI_UNIT_POSITION 0x60A8
165 #define DS402_SI_UNIT_VELOCITY 0x60A9
166 #define DS402_SI_UNIT_ACCELERATION 0x60AA
167 #define DS402_POSITION_OFFSET 0x60B0
168 #define DS402_VELOCITY_OFFSET 0x60B1
169 #define DS402_TORQUE_OFFSET 0x60B2
170 #define DS402_TOUCH_PROBE_FUNCTION 0x60B8
171 #define DS402_TOUCH_PROBE_STATUS 0x60B9
172 #define DS402_TOUCH_PROBE_POSITION_1_POSITIVE_VALUE 0x60BA
173 #define DS402_TOUCH_PROBE_POSITION_1_NEGATIVE_VALUE 0x60BB
174 #define DS402_INTERPOLATION_TIME_PERIOD 0x60C2
175 #define DS402_MAX_ACCELERATION 0x60C5
176 #define DS402_TOUCH_PROBE_SOURCE 0x60D0
177 #define DS402_TOUCH_PROBE_1_POSITIVE_EDGE_COUNTER 0x60D5
178 #define DS402_TOUCH_PROBE_1_NEGATIVE_EDGE_COUNTER 0x60D6
179 #define DS402_ADDITIONAL_POSITION_ACTUAL_VALUES 0x60E4
180 #define DS402_ADDITIONAL_VELOCITY_ACTUAL_VALUES 0x60E5
181 #define DS402_FOLLOWING_ERROR_ACTUAL_VALUE 0x60F4
182 #define DS402_DIGITAL_INPUTS 0x60FD
183 #define DS402_DIGITAL_OUTPUTS 0x60FE
184 #define DS402_TARGET_VELOCITY 0x60FF
185 #define DS402_MOTOR_TYPE 0x6402
186 #define DS402_SUPPORTED_DRIVE_MODES 0x6502
187
188 //Profile postion mode constants
189 #define DS402_PPM_ABSOLUTE 0
190 #define DS402_PPM_RELATIVE 1
191 #define DS402_PPM_AFTER_ACTUAL_POSITIONING 0
192 #define DS402_PPM_IMMEDIATELY 1
sdkDS402_SetProfileDeceleration
void sdkDS402_SetProfileDeceleration(long busId, long dec)
Set the profile deceleration DS402_PROFILE_DECELERATION(0x6084)
Definition: SDK_Amplifier_DS402_StateMachine.mc:401
sdkDS402_Print_StatusWord
void sdkDS402_Print_StatusWord(long busId)
Print the status word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:588
sdkDS402_ReadControlWord
long sdkDS402_ReadControlWord(long busId)
Read control word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:46
sdkDS402_PVM_WaitTargetReached
long sdkDS402_PVM_WaitTargetReached(long busId, long timeout)
Wait until target is reachd.
Definition: SDK_Amplifier_DS402_StateMachine.mc:976
sdkDS402_PVM_CvelStart
long sdkDS402_PVM_CvelStart(long busId)
Start continuous velocity (PVM)
Definition: SDK_Amplifier_DS402_StateMachine.mc:904
sdkDS402_ReadStatusWord
long sdkDS402_ReadStatusWord(long busId)
Declaration of functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:33
sdkDS402_PPM_PosAbsStart
long sdkDS402_PPM_PosAbsStart(long busId, long pos, long startImmediately)
Start absolute positioning.
Definition: SDK_Amplifier_DS402_StateMachine.mc:797
sdkDS402_PPM_WaitTargetReached
long sdkDS402_PPM_WaitTargetReached(long busId, long timeout)
Wait until target is reachd.
Definition: SDK_Amplifier_DS402_StateMachine.mc:853
sdkDS402_SetMaxMotorSpeed
void sdkDS402_SetMaxMotorSpeed(long busId, long vel)
Set the max profile velocity DS402_MAX_MOTOR_SPEED(0x6080)
Definition: SDK_Amplifier_DS402_StateMachine.mc:452
sdkDS402_PPM_PosRelStart
long sdkDS402_PPM_PosRelStart(long busId, long pos, long startImmediately)
Start relative positioning.
Definition: SDK_Amplifier_DS402_StateMachine.mc:819
sdkDS402_GetActDriveState
long sdkDS402_GetActDriveState(long busId)
Get the actual drive state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:83
sdkDS402_TransitionToState
long sdkDS402_TransitionToState(long busId, long newState)
Transition to another state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:230
sdkDS402_SetProfileAcceleration
void sdkDS402_SetProfileAcceleration(long busId, long acc)
Profile Mode settings.
Definition: SDK_Amplifier_DS402_StateMachine.mc:389
sdkDS402_SetProfileMovementParameter
void sdkDS402_SetProfileMovementParameter(long busId, long acc, long dec, long velocity)
Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)
Definition: SDK_Amplifier_DS402_StateMachine.mc:488
sdkDS402_PrintState
void sdkDS402_PrintState(long state)
Print the name of certain drive state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:111
sdkDS402_SetMotionProfileType
void sdkDS402_SetMotionProfileType(long busId, long type)
Set the motion profile type DS402_MOTION_PROFILE_TYPE(0x6086)
Definition: SDK_Amplifier_DS402_StateMachine.mc:427
sdkDS402_PPM_TargetReached
long sdkDS402_PPM_TargetReached(long busId)
Checks whether the target was reached.
Definition: SDK_Amplifier_DS402_StateMachine.mc:836
helperDS402_PPM_PosStart
long helperDS402_PPM_PosStart(long busId, long pos, long relative, long startImmediately)
Profile Position Mode functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:721
helperDS402_ExecuteTransition
long helperDS402_ExecuteTransition(long busId, long transition)
Execute a state transition.
Definition: SDK_Amplifier_DS402_StateMachine.mc:152
sdkDS402_WriteControlWord
void sdkDS402_WriteControlWord(long busId, long value)
Write control word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:60
sdkDS402_PVM_CvelStop
long sdkDS402_PVM_CvelStop(long busId)
Stop continuous velocity (PVM)
Definition: SDK_Amplifier_DS402_StateMachine.mc:935
sdkDS402_Halt
void sdkDS402_Halt(long busId)
Stop the motor.
Definition: SDK_Amplifier_DS402_StateMachine.mc:557
sdkDS402_GetOpartionMode
long sdkDS402_GetOpartionMode(long busId)
Get the mode of operation DS402_MODES_OF_OPERATION(0x6060)
Definition: SDK_Amplifier_DS402_StateMachine.mc:531
sdkDS402_QuickStop
void sdkDS402_QuickStop(long busId)
Execute quick stop.
Definition: SDK_Amplifier_DS402_StateMachine.mc:544
sdkDS402_SetOpartionMode
void sdkDS402_SetOpartionMode(long busId, long operationMode)
Profile Mode functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:508
sdkDS402_PVM_TargetReached
long sdkDS402_PVM_TargetReached(long busId)
Checks whether the target velocity has reached.
Definition: SDK_Amplifier_DS402_StateMachine.mc:959
sdkDS402_WaitTransitionToState
long sdkDS402_WaitTransitionToState(long busId, long targetState, long timeout)
Wait transition to another state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:347
sdkDS402_SetQuickStopDeceleration
void sdkDS402_SetQuickStopDeceleration(long busId, long dec)
Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)
Definition: SDK_Amplifier_DS402_StateMachine.mc:476
sdkDS402_ResetFault
void sdkDS402_ResetFault(long busId)
Reset fault.
Definition: SDK_Amplifier_DS402_StateMachine.mc:574
sdkDS402_PVM_SetTargetVelocity
void sdkDS402_PVM_SetTargetVelocity(long busId, long targetVelocity)
Profile Velocity Mode functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:888
sdkDS402_Print_ControlWord
void sdkDS402_Print_ControlWord(long busId)
Print the control word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:656
sdkDS402_SetMaxAcceleration
void sdkDS402_SetMaxAcceleration(long busId, long acc)
Set the max acceleration DS402_MAX_ACCELERATION(0x60C5)
Definition: SDK_Amplifier_DS402_StateMachine.mc:464
sdkDS402_SetProfileVelocity
void sdkDS402_SetProfileVelocity(long busId, long vel)
Set the profile velocity DS402_PROFILE_VELOCITY(0x6081)
Definition: SDK_Amplifier_DS402_StateMachine.mc:414
sdkDS402_SetMaxProfileVelocity
void sdkDS402_SetMaxProfileVelocity(long busId, long vel)
Set the max profile velocity DS402_MAX_PROFILE_VELOCITY(0x607F)
Definition: SDK_Amplifier_DS402_StateMachine.mc:439

Data Sheets | Released Software | Software Manuals | Hardware Manuals | Maxon Shop

Maxon Support Center