| ApossC SDK V01.15

SDK_Amplifier_MACS.mc
Go to the documentation of this file.
1
19 #pragma once
20
21 #include <SysDef.mh>
22 #include "SDK_Amplifier_MACS.mh"
23
48 long sdkSetupAmpDcMotor(long axis, long controlMode,long polePairs, long maxCur, long encQc, long maxRpm)
49 {
50 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_DC; // Set motor type
51 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
52 HWAMP_PARAM(axis, HWAMP_POLES) = polePairs; // Number of pole pairs
53 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
54 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
55 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
56
57 return(1);
58 }
59
85 long sdkSetupAmpBldc120Motor(long axis, long controlMode,long polePairs, long maxCur, long encQc, long maxRpm)
86 {
87 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_BLDC_120; // Set motor type
88 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
89 HWAMP_PARAM(axis, HWAMP_POLES) = polePairs; // Number of pole pairs
90 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
91 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
92 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
93
94 return(1);
95 }
96
122 long sdkSetupAmpBldcMotor(long axis, long hallAligment, long controlMode,long polePairs, long maxCur, long encQc, long maxRpm)
123 {
124 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_BLDC; // Set motor type
125 HWAMP_PARAM(axis, HWAMP_HALL_ALIGNMENT) = hallAligment; // set hall alignment
126 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
127 HWAMP_PARAM(axis, HWAMP_POLES) = polePairs; // Number of pole pairs
128 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
129 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
130 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
131
132 return(1);
133 }
134
159 long sdkSetupAmpStepMotor_CL(long axis, long controlMode,long steps, long maxCur, long encQc, long maxRpm)
160 {
161 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_STEP; // Set motor type
162 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
163 HWAMP_PARAM(axis, HWAMP_POLES) = steps/4; // For 2-phase stepper: Poles = Steps per revolution / 4
164 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
165 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
166 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
167
168 return(1);
169 }
193 long sdkSetupAmpStepMotor_OL(long axis, long steps, long maxCur,long maxRpm)
194 {
195 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_STEP; // Set motor type
196 HWAMP_PARAM(axis, HWAMP_MODE) = HWAMP_MODE_PFG_CUR_PWM; // Set controller priciple
197 HWAMP_PARAM(axis, HWAMP_POLES) = steps/4; // For 2-phase stepper: Poles = Steps per revolution / 4
198 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
199 HWAMP_PARAM(axis, HWAMP_ENCRES) = HWAMP_PARAM(axis, HWAMP_POLES) * HWAMP_ENCRES_MICROSTEP_RES;// Given in qc
200 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
201
202 return(1);
203 }
204
230 long sdkSetupAmpPmsmMotor(long axis, long controlMode,long polePairs, long maxCur, long encQc, long maxRpm) //$B
231 {
232 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_PMSM; // Set motor type
233 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
234 HWAMP_PARAM(axis, HWAMP_POLES) = polePairs; // Number of pole pairs
235 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
236 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
237 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
238
239 return(1);
240 }
268 long sdkSetupAmpHallPmsmMotor(long axis, long controlMode,long polePairs, long maxCur, long encQc, long maxRpm, long elPol)
269 {
270 HWAMP_PARAM(axis, HWAMP_COMMTYPE) = HWAMP_COMMTYPE_HALL_PMSM; // Set motor type
271 HWAMP_PARAM(axis, HWAMP_ELPOL) = elPol; // encoder polarity vs. electrical polarity:
272 HWAMP_PARAM(axis, HWAMP_MODE) = controlMode; // Set controller priciple
273 HWAMP_PARAM(axis, HWAMP_POLES) = polePairs; // Number of pole pairs
274 HWAMP_PARAM(axis, HWAMP_MAXCUR) = maxCur; // Max current in mA
275 HWAMP_PARAM(axis, HWAMP_ENCRES) = encQc; // Given in qc
276 HWAMP_PARAM(axis, HWAMP_MAXRPM) = maxRpm; // Given in RPM
277
278 return(1);
279 }
280
293 long sdkSetupCurrentPIControl(long axis, long curkprop, long curkint, long curkilim)
294 {
295 // parameters for current controller
296 HWAMP_PARAM((axis), HWAMP_CURKPROP) = curkprop; // current-controller proportional factor: +/-32767 (CURKPROP)
297 HWAMP_PARAM((axis), HWAMP_CURKINT) = curkint; // current-controller integral factor: +/-32767 (CURKINT)
298 HWAMP_PARAM((axis), HWAMP_CURKILIM) = curkilim; // current-controller Integral limit: 0 … 32767 (CURKILIM)
299
300 return(1);
301 }
302
315 long sdkSetupVelocityPIControl(long axis, long velkprop, long velkint, long velkilim)
316 {
317 // parameters for velocity controller
318 HWAMP_PARAM(axis, HWAMP_VELKPROP) = velkprop; // velocity-controller proportional factor: +/-32767 (VELKPROP)
319 HWAMP_PARAM(axis, HWAMP_VELKINT) = velkint; // velocity-controller integral factor: +/-32767 (VELKINT)
320 HWAMP_PARAM(axis, HWAMP_VELKILIM) = velkilim; // velocity-controller Integral limit: 0 … 32767 (VELKILIM)
321
322 return(1);
323 }
324
336 long sdkSetupVirtualI2T(long axis, long nominalCur, long thermalTime)
337 {
338 // parameters for I2T protection
339 VIRTAMP_PARAM(axis,VIRTAMP_I2TLIMIT) = (nominalCur*nominalCur/1000); // I*I*1000
340 VIRTAMP_PARAM(axis,VIRTAMP_I2TTIME) = thermalTime;
341
342 return(1);
343 }
HWAMP_MODE
#define HWAMP_MODE
Mode of operation.
Definition: SdoDictionary.mh:7639
sdkSetupAmpHallPmsmMotor
long sdkSetupAmpHallPmsmMotor(long axis, long controlMode, long polePairs, long maxCur, long encQc, long maxRpm, long elPol)
Sets the amplifier parameters for a brushless, PMSM commuted motor (Hall sensors are used)
Definition: SDK_Amplifier_MACS.mc:268
sdkSetupVirtualI2T
long sdkSetupVirtualI2T(long axis, long nominalCur, long thermalTime)
Function to generate a virtual I2T protection.
Definition: SDK_Amplifier_MACS.mc:336
HWAMP_COMMTYPE
#define HWAMP_COMMTYPE
Commutation type in use.
Definition: SdoDictionary.mh:7749
HWAMP_ELPOL
#define HWAMP_ELPOL
encoder polarity vs.
Definition: SdoDictionary.mh:7917
HWAMP_VELKINT
#define HWAMP_VELKINT
Integral factor of velocity controller.
Definition: SdoDictionary.mh:7707
HWAMP_COMMTYPE_BLDC_120
#define HWAMP_COMMTYPE_BLDC_120
Definition: SdoDictionary.mh:8284
SDK_Amplifier_MACS.mh
Declaration of the integreted amplifier functions.
HWAMP_VELKILIM
#define HWAMP_VELKILIM
Integral limit of velocity controller.
Definition: SdoDictionary.mh:7716
sdkSetupAmpBldcMotor
long sdkSetupAmpBldcMotor(long axis, long hallAligment, long controlMode, long polePairs, long maxCur, long encQc, long maxRpm)
Sets the amplifier parameters for a BLDC motor.
Definition: SDK_Amplifier_MACS.mc:122
HWAMP_MAXCUR
#define HWAMP_MAXCUR
Maximal current allowed.
Definition: SdoDictionary.mh:7815
sdkSetupAmpBldc120Motor
long sdkSetupAmpBldc120Motor(long axis, long controlMode, long polePairs, long maxCur, long encQc, long maxRpm)
Sets the amplifier parameters for a BLDC 120° motor Deprecated: Use sdkSetupAmpBldcMotor() and HWAMP...
Definition: SDK_Amplifier_MACS.mc:85
HWAMP_POLES
#define HWAMP_POLES
Number of pole pairs.
Definition: SdoDictionary.mh:7765
sdkSetupVelocityPIControl
long sdkSetupVelocityPIControl(long axis, long velkprop, long velkint, long velkilim)
Set parameters for PI velocity control loop.
Definition: SDK_Amplifier_MACS.mc:315
HWAMP_VELKPROP
#define HWAMP_VELKPROP
Proportional factor of velocity controller.
Definition: SdoDictionary.mh:7698
HWAMP_COMMTYPE_STEP
#define HWAMP_COMMTYPE_STEP
Definition: SdoDictionary.mh:8286
VIRTAMP_PARAM
#define VIRTAMP_PARAM(modno, parno)
Virtual Amplifier Parameters: Setter.
Definition: SdoDictionary.mh:5280
VIRTAMP_I2TLIMIT
#define VIRTAMP_I2TLIMIT
I2T Limit value.
Definition: SdoDictionary.mh:5533
HWAMP_CURKILIM
#define HWAMP_CURKILIM
Integral limit of current controller.
Definition: SdoDictionary.mh:7743
HWAMP_COMMTYPE_PMSM
#define HWAMP_COMMTYPE_PMSM
Definition: SdoDictionary.mh:8289
sdkSetupAmpStepMotor_OL
long sdkSetupAmpStepMotor_OL(long axis, long steps, long maxCur, long maxRpm)
Sets the amplifier parameters for a stepper motor (closed loop)
Definition: SDK_Amplifier_MACS.mc:193
sdkSetupAmpPmsmMotor
long sdkSetupAmpPmsmMotor(long axis, long controlMode, long polePairs, long maxCur, long encQc, long maxRpm)
Sets the amplifier parameters for a brushless, PMSM commuted motor (no Hall sensors are used)
Definition: SDK_Amplifier_MACS.mc:230
sdkSetupAmpDcMotor
long sdkSetupAmpDcMotor(long axis, long controlMode, long polePairs, long maxCur, long encQc, long maxRpm)
Sets the amplifier parameters for a DC motor.
Definition: SDK_Amplifier_MACS.mc:48
VIRTAMP_I2TTIME
#define VIRTAMP_I2TTIME
I2T Time interval for filtering.
Definition: SdoDictionary.mh:5479
HWAMP_MODE_PFG_CUR_PWM
#define HWAMP_MODE_PFG_CUR_PWM
Definition: SdoDictionary.mh:8275
HWAMP_CURKINT
#define HWAMP_CURKINT
Integral factor of current controller.
Definition: SdoDictionary.mh:7734
HWAMP_PARAM
#define HWAMP_PARAM(modno, parno)
HW Amplifier Parameters: Setter.
Definition: SdoDictionary.mh:7627
HWAMP_MAXRPM
#define HWAMP_MAXRPM
Maximum velocity in RPM.
Definition: SdoDictionary.mh:7833
HWAMP_COMMTYPE_DC
#define HWAMP_COMMTYPE_DC
Definition: SdoDictionary.mh:8282
sdkSetupCurrentPIControl
long sdkSetupCurrentPIControl(long axis, long curkprop, long curkint, long curkilim)
Set parameters for PI current control loop.
Definition: SDK_Amplifier_MACS.mc:293
HWAMP_COMMTYPE_HALL_PMSM
#define HWAMP_COMMTYPE_HALL_PMSM
Definition: SdoDictionary.mh:8287
HWAMP_ENCRES
#define HWAMP_ENCRES
Resolution of the encoder for position feed back in increments (quadcounts)
Definition: SdoDictionary.mh:7802
HWAMP_HALL_ALIGNMENT
#define HWAMP_HALL_ALIGNMENT
Hall Alignment.
Definition: SdoDictionary.mh:8228
HWAMP_CURKPROP
#define HWAMP_CURKPROP
Proportional factor of current controller.
Definition: SdoDictionary.mh:7725
HWAMP_ENCRES_MICROSTEP_RES
#define HWAMP_ENCRES_MICROSTEP_RES
Definition: SdoDictionary.mh:8301
HWAMP_COMMTYPE_BLDC
#define HWAMP_COMMTYPE_BLDC
Definition: SdoDictionary.mh:8283
sdkSetupAmpStepMotor_CL
long sdkSetupAmpStepMotor_CL(long axis, long controlMode, long steps, long maxCur, long encQc, long maxRpm)
Sets the amplifier parameters for a stepper motor (closed loop)
Definition: SDK_Amplifier_MACS.mc:159

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

Maxon Support Center