diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/README.md b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/README.md new file mode 100644 index 0000000..4903ab3 --- /dev/null +++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/README.md @@ -0,0 +1,4 @@ +# Motor Control Library for dsPIC33 DSCs +
The Motor Control Library is a collection of functions that you can use as building blocks for implementing Field Oriented Control (FOC) of 3-phase motor control applications on dsPIC® Digital Signal Controllers (DSCs).
++The Motor Control Library is architected to enable a user application to call time-critical control loop functions in it and take advantage of the motor control peripherals available on the dsPIC33 DSCs to implement a design.
\ No newline at end of file diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/libmotor_control_dspic-elf.a b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/libmotor_control_dspic-elf.a new file mode 100644 index 0000000..a30626a Binary files /dev/null and b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/libmotor_control_dspic-elf.a differ diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control.h b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control.h new file mode 100644 index 0000000..885dbd7 --- /dev/null +++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control.h @@ -0,0 +1,100 @@ +/******************************************************************************* + Motor Control Library Interface Header File + + File Name: + motor_control.h + + Summary: + This header file lists all the interfaces used by the Motor Control library. + + Description: + This header file lists the type defines for structures used by the Motor + Control library. Library function definitions are also listed along with + information regarding the arguments of each library function. This header file + also includes another header file that hosts inline definitions of certain + library functions. +*******************************************************************************/ + +// DOM-IGNORE-BEGIN +/* ********************************************************************* + * (c) 2017 Microchip Technology Inc. and its subsidiaries. You may use + * this software and any derivatives exclusively with Microchip products. + * + * This software and any accompanying information is for suggestion only. + * It does not modify Microchip's standard warranty for its products. + * You agree that you are solely responsible for testing the software and + * determining its suitability. Microchip has no obligation to modify, + * test, certify, or support the software. + + * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, + * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, + * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, + * AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH + * MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY + * APPLICATION. + + * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, + * PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF + * ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF + * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE + * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL + * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT + * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO + * MICROCHIP FOR THIS SOFTWARE. + + * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF + * THESE TERMS. + * + * *****************************************************************************/ +/******************************************************************************* +Note: +* Some parts of this header file are protected by #ifdef __XC16__. These protections + are provided to accommodate non-XC16 compilers to work with this header file. + Similarly, sections of the header file related to the MATLAB-based compiler are + protected by #ifdef __MATLAB_MEX__ protections. +* Some of the function declarations have a MC_ATTRB prefix. This prefix has been + provided as a placeholder for adding attributes for supporting future versions + of the compiler. +*******************************************************************************/ +// DOM-IGNORE-END + +#ifndef _MOTOR_CONTROL_H_ // Guards against multiple inclusion +#define _MOTOR_CONTROL_H_ + +// ***************************************************************************** +// ***************************************************************************** +// Section: Included Files +// ***************************************************************************** +// ***************************************************************************** + +#include
+ uint16_t temp;
+ int16_t angle;
+ MC_SINCOS_T mcSinCos;
+ temp = MC_CalculateSineCosine_Assembly_Ram(angle, &mcSinCos);
+
+
+ Remarks:
+ For integer scaling the Angle is scaled such that 0 <= Angle < 2*pi corresponds
+ to 0 <= Ang < 0xFFFF. The resulting Sine and Cosine values are returned scaled to
+ -32769 -> 32767 i.e. (0x8000 -> 0x7FFF).
+ For 1.15 scaling the Angle is scaled such that -pi <= Angle < pi corresponds to
+ -1 -> 0.9999 i.e. (0x8000 <= Ang < 0x7FFF). The resulting Sine and Cosine values are
+ returned scaled to -1 -> 0.9999 i.e. (0x8000 -> 0x7FFF).
+ *******************************************************************************/
+uint16_t MC_ATTRB MC_CalculateSineCosine_Assembly_Ram(int16_t angle,
+ MC_SINCOS_T *pSinCos);
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_TransformParkInverse_Assembly( const MC_DQ_T *pDQ, const MC_SINCOS_T *pSinCos,
+ MC_ALPHABETA_T *pAlphaBeta)
+
+ Summary:
+ This function calculates the inverse Park transformation.
+
+ Description:
+ This function calculates the inverse Park transform on a pair of stationary reference frame inputs.
+ Inverse park transformation is performed as described by the equation:
+
+ alpha = d*cos - q*sin
+ beta = d*sin + q*cos
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pDQ - Input - This parameter is a pointer to a MC_DQ_T type structure.
+ pSinCos - Input - This parameter is a pointer to a MC_SINCOS_T type structure.
+ pAlphaBeta - Output - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_DQ_T mcVDQ;
+ MC_SINCOS_T mcSinCos;
+ MC_ALPHABETA_T mcVAlphaBeta;
+ temp = MC_TransformParkInverse_Assembly(&mcVDQ, &mcSinCos, &mcVAlphaBeta);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_TransformParkInverse_Assembly( const MC_DQ_T *pDQ,
+ const MC_SINCOS_T *pSinCos,
+ MC_ALPHABETA_T *pAlphaBeta);
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_TransformClarkeInverseSwappedInput_Assembly( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = beta
+ b = -beta/2 + (sqrt(3)/2) * alpha
+ c = -beta/2 - (sqrt(3)/2) * alpha
+
+
+ This is a modified variant of the inverse Clarke transformation where alpha & beta are
+ swapped compared to the normal inverse Clarke transformation. This function is designed
+ to work with the CalculateSpaceVectorPhaseShifted() in order to simplify the calculation of
+ three-phase duty cycle values from a given set of inputs in the alpha-beta reference frame.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ temp = MC_TransformClarkeInverseSwappedInput_Assembly(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_TransformClarkeInverseSwappedInput_Assembly( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_TransformClarkeInverse_Assembly( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = alpha
+ b = -alpha/2 + (sqrt(3)/2) * beta
+ c = -alpha/2 - (sqrt(3)/2) * beta
+
+
+ This is the conventional form of the inverse Clarke transformation. This function is designed
+ to work with the CalculateSpaceVector().
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ temp = MC_TransformClarkeInverse_Assembly(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_TransformClarkeInverse_Assembly( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+/*******************************************************************************
+ Function:
+ void MC_TransformClarkeInverseNoAccum_Assembly( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = alpha
+ b = -alpha/2 + (sqrt(3)/2) * beta
+ c = -alpha/2 - (sqrt(3)/2) * beta
+
+
+ This is the conventional form of the inverse Clarke transformation. This function is designed
+ to work with the function CalculateSpaceVector() for duty cycle generation. It does not make use
+ of the DSP accumulators.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ void
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ MC_TransformClarkeInverseNoAccum_Assembly(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+void MC_ATTRB MC_TransformClarkeInverseNoAccum_Assembly( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_CalculateSpaceVectorPhaseShifted_Assembly( const MC_ABC_T *pABC, uint16_t iPwmPeriod, MC_DUTYCYCLEOUT_T *pDutyCycleOut)
+
+ Summary:
+ This function calculates the duty cycle values based on the three scaled
+ reference vectors in the a-b-c reference frame and the PWM period value.
+
+ Description:
+ This function calculates the duty cycle values based on the three scaled reference
+ vectors in the a-b-c reference frame and the PWM period value.
+
+ This function is designed to work with the TransformClarkeInverseSwappedInput()
+ in order to simplify the calculation of three-phase duty cycle values from a given
+ set of inputs in the alpha-beta reference frame.
+ This function uses a reference axis that is phase shifted by 30 degrees relative
+ to the standard Space Vector Modulation reference axis. This phase-shifted reference
+ axis is accommodated by using reference vector inputs from a modified version of
+ the inverse Clarke transform which swaps the alpha-beta values at its input.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ iPwmPeriod - Input - This parameter is an unsigned integer value of the PWM period.
+ pDutyCycleOut - Output - This parameter is a pointer to a MC_DUTYCYCLEOUT_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ABC_T mcVabc;
+ uint16_t iPwmPeriod;
+ MC_DUTYCYCLEOUT_T mcDutyCycleOut;
+ temp = MC_CalculateSpaceVectorPhaseShifted_Assembly(&mcVabc, iPwmPeriod, &mcDutyCycleOut);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_CalculateSpaceVectorPhaseShifted_Assembly( const MC_ABC_T *pABC,
+ uint16_t iPwmPeriod,
+ MC_DUTYCYCLEOUT_T *pDutyCycleOut);
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_CalculateSpaceVector_Assembly( const MC_ABC_T *pABC, uint16_t iPwmPeriod,
+ MC_DUTYCYCLEOUT_T *pDutyCycleOut)
+
+ Summary:
+ This function calculates the duty cycle values based on the three scaled
+ reference vectors in the a-b-c reference frame and the PWM period value.
+
+ Description:
+ This function calculates the duty cycle values based on the three scaled reference
+ vectors in the a-b-c reference frame and the PWM period value.
+
+ This function works with the conventional Clark inverse transform variants
+ in order to simplify the calculation of three-phase duty cycle values from a given
+ set of inputs in the alpha-beta reference frame.
+ The duty-cycle generation part of the function is identical to the phase shifted version
+ for SVM generation, so the initial part of this function compensates for the
+ swapped input inverse clark function. This ensures the motor rotation direction remains
+ the same.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ iPwmPeriod - Input - This parameter is an unsigned integer value of the PWM period.
+ pDutyCycleOut - Output - This parameter is a pointer to a MC_DUTYCYCLEOUT_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ABC_T mcVabc;
+ uint16_t iPwmPeriod;
+ MC_DUTYCYCLEOUT_T mcDutyCycleOut;
+ temp = MC_CalculateSpaceVector_Assembly(&mcVabc, iPwmPeriod, &mcDutyCycleOut);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_CalculateSpaceVector_Assembly( const MC_ABC_T *pABC,
+ uint16_t iPwmPeriod,
+ MC_DUTYCYCLEOUT_T *pDutyCycleOut);
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_TransformClarke_Assembly( const MC_ABC_T *pABC, MC_ALPHABETA_T *pAlphaBeta)
+
+ Summary:
+ This function calculates the Clarke transformation.
+
+ Description:
+ This function transforms inputs in an a-b-c reference frame to an alpha-beta
+ reference frame using the equation:
+
+ alpha = a
+ beta = a*(1/sqrt(3)) + 2*b*(1/sqrt(3))
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ pAlphaBeta - Output - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ABC_T mcIabc;
+ MC_ALPHABETA_T mcIAlphaBeta;
+ temp = MC_TransformClarke_Assembly(&mcIabc, &mcIAlphaBeta);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_TransformClarke_Assembly( const MC_ABC_T *pABC,
+ MC_ALPHABETA_T *pAlphaBeta);
+
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_TransformPark_Assembly( const MC_ALPHABETA_T *pAlphaBeta, const MC_SINCOS_T *pSinCos, MC_DQ_T *pDQ)
+
+ Summary:
+ This function calculates the Park transformation.
+
+ Description:
+ This function transforms inputs in an alpha-beta reference frame to a stationary
+ d-q reference frame using the equation:
+
+ d = alpha*cos + beta*sin
+ q = -alpha*sin + beta*cos
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pSinCos - Input - This parameter is a pointer to a MC_SINCOS_T type structure.
+ pDQ - Output - This parameter is a pointer to a MC_DQ_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcIAlphaBeta;
+ MC_SINCOS_T mcSinCos;
+ MC_DQ_T mcIDQ;
+ temp = MC_TransformPark_Assembly(&mcIAlphaBeta, &mcSinCos, &mcIDQ);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_TransformPark_Assembly( const MC_ALPHABETA_T *pAlphaBeta,
+ const MC_SINCOS_T *pSinCos,
+ MC_DQ_T *pDQ);
+
+
+/*******************************************************************************
+ Function:
+ uint16_t MC_ControllerPIUpdate_Assembly(int16_t inReference, int16_t inMeasure, MC_PISTATE_T *pPIState, int16_t *pPIParmOutput)
+
+ Summary:
+ This function calculates the PI correction.
+
+ Description:
+ This function calculates a PI correction output from a given measured input and a reference.
+ The equation for PI output is:
+
+ out = Kp*(inReference-inMeasure) + Ki*Integral[inReference-inMeasure, dt] - Kc*Excess
+
+ Where,
+ out = Fractional 1.15 output, is limited to between outMax and outMin.
+ Kp = Proportional gain co-efficient term
+ Ki = Integral gain co-efficient term
+ Kc = Excess gain co-efficient term
+ Excess = Excess error after "out" is limited to between outMax and outMin.
+ This implementation includes an anti-windup term to limit the integral windup.
+
+ Precondition:
+ None.
+
+ Parameters:
+ inReference - Input - This parameter is a 1.15 fractional format reference input.
+ inMeasure - Input - This parameter is a 1.15 fractional format measured input.
+ pPIState - Input/Output - This paramater is a pointer to a MC_PISTATE_T type structure.
+ pPIParmOutput - Output - This paramater is a pointer to a signed integer type variable.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_PIPARMIN_T mcPIParmInput;
+ MC_PIPARMOUT_T mcPIParmOutput;
+ temp = MC_ControllerPIUpdate_Assembly(mcPIParmInput.inReference, mcPIParmInput.inMeasure, &mcPIParmInput.piState, &mcPIParmOutput.out);
+
+
+ Remarks:
+ This routine requires inputs in the 1.15 format, except for Kp which is in 1.11 format.
+ The constant Kp is scaled so it can be represented in 1.15 format by adjusting the constant
+ by a power of 2.
+*******************************************************************************/
+uint16_t MC_ATTRB MC_ControllerPIUpdate_Assembly(int16_t inReference,
+ int16_t inMeasure,
+ MC_PISTATE_T *pPIState,
+ int16_t *pPIParmOutput);
+
+#ifdef __cplusplus // Provide C++ Compatibility
+ }
+#endif
+#endif // _MOTOR_CONTROL_DECLARATIONS_H_
+
+
+
+
+
diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_dsp.h b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_dsp.h
new file mode 100644
index 0000000..7fd6411
--- /dev/null
+++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_dsp.h
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ Motor Control library -- DSP registers
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ motor_control_dsp.h
+
+ Summary:
+ DSP register declarations
+
+ Description:
+ Contains DSP register declarations in global variables.
+*******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/* *********************************************************************
+ *
+ * (c) 2017 Microchip Technology Inc. and its subsidiaries. You may use
+ * this software and any derivatives exclusively with Microchip products.
+ *
+ * This software and any accompanying information is for suggestion only.
+ * It does not modify Microchip's standard warranty for its products.
+ * You agree that you are solely responsible for testing the software and
+ * determining its suitability. Microchip has no obligation to modify,
+ * test, certify, or support the software.
+
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH
+ * MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY
+ * APPLICATION.
+
+ * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL,
+ * PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF
+ * ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
+ * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
+ * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
+ * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT
+ * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO
+ * MICROCHIP FOR THIS SOFTWARE.
+
+ * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF
+ * THESE TERMS.
+ *
+ * *****************************************************************************/
+// DOM-IGNORE-END
+
+#ifndef _MOTOR_CONTROL_DSP_H_
+#define _MOTOR_CONTROL_DSP_H_
+
+#ifdef __cplusplus // Provide C++ Compatability
+ extern "C" {
+#endif
+
+#ifndef DSP_ACCUMULATOR_A_DEFINED
+#define DSP_ACCUMULATOR_A_DEFINED
+/** DSP accumulator A */
+volatile register int a_Reg asm("A");
+#endif
+
+#ifndef DSP_ACCUMULATOR_B_DEFINED
+#define DSP_ACCUMULATOR_B_DEFINED
+/** DSP accumulator B */
+volatile register int b_Reg asm("B");
+#endif
+
+#ifdef __cplusplus // Provide C++ Compatibility
+ }
+#endif
+
+#endif // _MOTOR_CONTROL_DSP_H_
+
+
+
+
diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_declarations.h b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_declarations.h
new file mode 100644
index 0000000..1bc9e4d
--- /dev/null
+++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_declarations.h
@@ -0,0 +1,571 @@
+/*******************************************************************************
+ Motor Control Library Inline Function Declaration Header File
+
+ File Name:
+ motor_control_inline_declarations.h
+
+ Summary:
+ This header file lists all the inline function declarations used by the Motor Control library.
+
+ Description:
+ This header file lists all the inline function declarations used by the Motor Control library.
+*******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/* *********************************************************************
+ *
+ * (c) 2017 Microchip Technology Inc. and its subsidiaries. You may use
+ * this software and any derivatives exclusively with Microchip products.
+ *
+ * This software and any accompanying information is for suggestion only.
+ * It does not modify Microchip's standard warranty for its products.
+ * You agree that you are solely responsible for testing the software and
+ * determining its suitability. Microchip has no obligation to modify,
+ * test, certify, or support the software.
+
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH
+ * MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY
+ * APPLICATION.
+
+ * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL,
+ * PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF
+ * ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
+ * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
+ * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
+ * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT
+ * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO
+ * MICROCHIP FOR THIS SOFTWARE.
+
+ * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF
+ * THESE TERMS.
+ *
+ * *****************************************************************************/
+/*******************************************************************************
+Note:
+* Some of the function declarations have a MC_ATTRB_INLINE prefix. This prefix has been
+ provided as a placeholder for adding attributes for supporting future versions
+ of the compiler.
+*******************************************************************************/
+// DOM-IGNORE-END
+
+#ifndef _MOTOR_CONTROL_INLINE_DECLARATIONS_H_ // Guards against multiple inclusion
+#define _MOTOR_CONTROL_INLINE_DECLARATIONS_H_
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include
+ uint16_t temp;
+ int16_t angle;
+ MC_SINCOS_T mcSinCos;
+ temp = MC_CalculateSineCosine_InlineC_Ram(angle, &mcSinCos);
+
+
+ Remarks:
+ This function uses the sine-table included within the library archive file. Hence,
+ the library archive file must be included in the application project for this function
+ to link correctly.
+
+ For integer scaling the Angle is scaled such that 0 <= Angle < 2*pi corresponds
+ to 0 <= Ang < 0xFFFF. The resulting Sine and Cosine values are returned scaled to
+ -32769 -> 32767 i.e. (0x8000 -> 0x7FFF).
+ For 1.15 scaling the Angle is scaled such that -pi <= Angle < pi corresponds to
+ -1 -> 0.9999 i.e. (0x8000 <= Ang < 0x7FFF). The resulting Sine and Cosine values are
+ returned scaled to -1 -> 0.9999 i.e. (0x8000 -> 0x7FFF).
+ *******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_CalculateSineCosine_InlineC_Ram(int16_t angle,
+ MC_SINCOS_T *pSinCos);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_TransformClarkeInverseSwappedInput_InlineC( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = beta
+ b = -beta/2 + (sqrt(3)/2) * alpha
+ c = -beta/2 - (sqrt(3)/2) * alpha
+
+
+ This is a modified variant of the inverse Clarke transformation where alpha & beta are
+ swapped compared to the normal inverse Clarke transformation. This function is designed
+ to work with the CalculateSpaceVectorPhaseShifted() in order to simplify the calculation of
+ three-phase duty cycle values from a given set of inputs in the alpha-beta reference frame.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ temp = MC_TransformClarkeInverseSwappedInput_InlineC(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_TransformClarkeInverseSwappedInput_InlineC( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_TransformClarkeInverse_InlineC( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = alpha
+ b = -alpha/2 + (sqrt(3)/2) * beta
+ c = -alpha/2 - (sqrt(3)/2) * beta
+
+
+ This is the conventional form of the inverse Clarke transformation. This function is designed
+ to work with the CalculateSpaceVector().
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ temp = MC_TransformClarkeInverse_InlineC(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_TransformClarkeInverse_InlineC( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+/*******************************************************************************
+ Function:
+ static inline void MC_TransformClarkeInverseNoAccum_InlineC( const MC_ALPHABETA_T *pAlphaBeta, MC_ABC_T *pABC)
+
+ Summary:
+ This function calculates the scaled reference vectors using inputs in an alpha-beta reference frame.
+
+ Description:
+ This function calculates the scaled reference vectors in an a-b-c reference frame using
+ inputs from an alpha-beta reference frame, as described by the equation:
+
+ a = alpha
+ b = -alpha/2 + (sqrt(3)/2) * beta
+ c = -alpha/2 - (sqrt(3)/2) * beta
+
+
+ This is the conventional form of the inverse Clarke transformation. This function is designed
+ to work with the CalculateSpaceVector(). It does not use the DSP accumulators.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pABC - Output - This parameter is a pointer to a MC_ABC_T type structure.
+
+ Returns:
+ void
+
+ Example:
+
+ MC_ALPHABETA_T mcVAlphaBeta;
+ MC_ABC_T mcVabc;
+ MC_TransformClarkeInverseNoAccum_InlineC(&mcVAlphaBeta, &mcVabc);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline void MC_ATTRB_INLINE MC_TransformClarkeInverseNoAccum_InlineC( const MC_ALPHABETA_T *pAlphaBeta,
+ MC_ABC_T *pABC);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_CalculateSpaceVectorPhaseShifted_InlineC( const MC_ABC_T *pABC,
+ uint16_t iPwmPeriod, MC_DUTYCYCLEOUT_T *pDutyCycleOut)
+
+ Summary:
+ This function calculates the duty cycle values based on the three scaled
+ reference vectors in the a-b-c reference frame and the PWM period value.
+
+ Description:
+ This function calculates the duty cycle values based on the three scaled reference
+ vectors in the a-b-c reference frame and the PWM period value.
+
+ This function is designed to work with the TransformClarkeInverseSwappedInput()
+ in order to simplify the calculation of three-phase duty cycle values from a given
+ set of inputs in the alpha-beta reference frame.
+ This function uses a reference axis that is phase shifted by 30 degrees relative
+ to the standard Space Vector Modulation reference axis. This phase-shifted reference
+ axis is accommodated by using reference vector inputs from a modified version of
+ the inverse Clarke transform which swaps the alpha-beta values at its input.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ iPwmPeriod - Input - This parameter is an unsigned integer value of the PWM period.
+ pDutyCycleOut - Output - This parameter is a pointer to a MC_DUTYCYCLEOUT_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ABC_T mcVabc;
+ uint16_t iPwmPeriod;
+ MC_DUTYCYCLEOUT_T mcDutyCycleOut;
+ temp = MC_CalculateSpaceVectorPhaseShifted_InlineC(&mcVabc, iPwmPeriod, &mcDutyCycleOut);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_CalculateSpaceVectorPhaseShifted_InlineC( const MC_ABC_T *pABC,
+ uint16_t iPwmPeriod,
+ MC_DUTYCYCLEOUT_T *pDutyCycleOut);
+
+/*******************************************************************************
+ Function:
+ static inline void MC_CalculateZeroSequenceModulation_InlineC(const MC_ABC_T *pabc_in, MC_ABC_T *pabc_out, int16_t min, int16_t max)
+
+ Summary:
+ Computes realizable duty cycles from a three-phase set of inputs
+ so that they are centered and clipped within a given output range..
+
+ Description:
+ Adds an identical zero-sequence offset to the input duty cycles to center them
+ within the requested output range, and clips the resulting outputs between min and max.
+ This is equivalent to conventional space vector PWM (CSVPWM).
+
+ As long as clipping does not occur, differences between any pair of signals
+ are preserved from input to output, for a small-signal gain of 1.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pabc_in - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ pabc_out - Output - This pointer to structure returns the CSVPWM ZSM modulated signal.
+ min,max - Input - These parameters supply the min and max values to clip the duty cycle
+ limits to.
+
+ Returns:
+ void
+
+ Example:
+
+ MC_ABC_T mcVabc;
+ MC_ABC_T mcVabcOut;
+ int16_t min,max;
+
+ MC_CalculateZeroSequenceModulation_InlineC(&mcVabc, &mcVabcOut, min, max );
+
+
+ Remarks:
+ In order to reduce execution time, the implementation of this function assumes
+ that the output values min and max must have an average which is not negative.
+ (Typically min is a number slightly above 0 and max is a number slightly below 1.0 Q15)
+
+*******************************************************************************/
+static inline void MC_ATTRB_INLINE MC_CalculateZeroSequenceModulation_InlineC(const MC_ABC_T *pabc_in, MC_ABC_T *pabc_out, int16_t min, int16_t max);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_TransformClarke_InlineC( const MC_ABC_T *pABC, MC_ALPHABETA_T *pAlphaBeta)
+
+ Summary:
+ This function calculates the Clarke transformation.
+
+ Description:
+ This function transforms inputs in an a-b-c reference frame to an alpha-beta
+ reference frame using the equation:
+
+ alpha = a
+ beta = a*(1/sqrt(3)) + 2*b*(1/sqrt(3))
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - This parameter is a pointer to a MC_ABC_T type structure.
+ pAlphaBeta - Output - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ABC_T mcIabc;
+ MC_ALPHABETA_T mcIAlphaBeta;
+ temp = MC_TransformClarke_InlineC(&mcIabc, &mcIAlphaBeta);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_TransformClarke_InlineC( const MC_ABC_T *pABC,
+ MC_ALPHABETA_T *pAlphaBeta);
+
+/*******************************************************************************
+ Function:
+ static inline void MC_TransformClarkeABC_InlineC( const MC_ABC_T *pABC, MC_ALPHABETA_T *pAlphaBeta)
+
+ Summary:
+ This function calculates the Clarke transformation.
+
+ Description:
+ This function transforms inputs from per-phase a-b-c reference frame to orthogonal alpha-beta
+ reference frame given by
+
+ alpha = a*2/3 - b/3- c/3
+ beta = b/sqrt3 - c/sqrt3
+
+ This function differs from the more popular version that transforms from a-b to alpha-beta
+ exploiting the identity a + b + c = 0 in a system with no neutral current flow.
+
+ Precondition:
+ None.
+
+ Parameters:
+ pABC - Input - pointer to a MC_ABC_T type structure.
+ pAlphaBeta - Output - pointer to a MC_ALPHABETA_T type structure.
+
+ Returns:
+ void
+
+ Example:
+
+ MC_ABC_T mcIabc;
+ MC_ALPHABETA_T mcIAlphaBeta;
+ MC_TransformClarkeABC_InlineC(&mcIabc, &mcIAlphaBeta);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline void MC_ATTRB_INLINE MC_TransformClarkeABC_InlineC( const MC_ABC_T *abc, MC_ALPHABETA_T *alphabeta);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_TransformPark_InlineC( const MC_ALPHABETA_T *pAlphaBeta,
+ const MC_SINCOS_T *pSinCos, MC_DQ_T *pDQ)
+
+ Summary:
+ This function calculates the Park transformation.
+
+ Description:
+ This function transforms inputs in an alpha-beta reference frame to a stationary
+ d-q reference frame using the equation:
+
+ d = alpha*cos + beta*sin
+ q = -alpha*sin + beta*cos
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+ pSinCos - Input - This parameter is a pointer to a MC_SINCOS_T type structure.
+ pDQ - Output - This parameter is a pointer to a MC_DQ_T type structure.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcIAlphaBeta;
+ MC_SINCOS_T mcSinCos;
+ MC_DQ_T mcIDQ;
+ temp = MC_TransformPark_InlineC(&mcIAlphaBeta, &mcSinCos, &mcIDQ);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_TransformPark_InlineC(const MC_ALPHABETA_T *alphabeta,
+ const MC_SINCOS_T *sincos,
+ MC_DQ_T *dq);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_TransformParkInverse_InlineC(const MC_DQ_T *dq, const MC_SINCOS_T *sincos,
+ MC_ALPHABETA_T *alphabeta)
+
+ Summary:
+ This function calculates the Inverse Park transformation.
+
+ Description:
+ This function transforms inputs in stationary d-q reference frame to a rotating
+ alpha-beta reference frame using the equation:
+
+
+ alpha = d*cos - q*sin
+ beta = d*sin + q*cos
+
+
+ Precondition:
+ None.
+
+ Parameters:
+ pDQ - Output - This parameter is a pointer to a MC_DQ_T type structure.
+ pSinCos - Input - This parameter is a pointer to a MC_SINCOS_T type structure.
+ pAlphaBeta - Input - This parameter is a pointer to a MC_ALPHABETA_T type structure.
+
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_ALPHABETA_T mcIAlphaBeta;
+ MC_SINCOS_T mcSinCos;
+ MC_DQ_T mcIDQ;
+ temp = MC_TransformParkInverse_InlineC(&mcIAlphaBeta, &mcSinCos, &mcIDQ);
+
+
+ Remarks:
+ This routine works for any q format so long as it is consistent across input and output.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_TransformParkInverse_InlineC(const MC_DQ_T *dq, const MC_SINCOS_T *sincos,
+ MC_ALPHABETA_T *alphabeta);
+
+/*******************************************************************************
+ Function:
+ static inline uint16_t MC_ControllerPIUpdate_InlineC(int16_t inReference, int16_t inMeasure, MC_PISTATE_T *pPIState, int16_t *pPIParmOutput)
+
+ Summary:
+ This function calculates the PI correction.
+
+ Description:
+ This function calculates a PI correction output from a given measured input and a reference.
+ The equation for PI output is:
+
+ out = Kp*(inReference-inMeasure) + Ki*Integral[inReference-inMeasure, dt] - Kc*Excess
+
+ Where,
+ out = Fractional 1.15 output, is limited to between outMax and outMin.
+ Kp = Proportional gain co-efficient term
+ Ki = Integral gain co-efficient term
+ Kc = Excess gain co-efficient term
+ Excess = Excess error after "out" is limited to between outMax and outMin.
+ This implementation includes an anti-windup term to limit the integral windup.
+
+ Precondition:
+ None.
+
+ Parameters:
+ inReference - Input - This parameter is a 1.15 fractional format reference input.
+ inMeasure - Input - This parameter is a 1.15 fractional format measured input.
+ pPIState - Input/Output - This paramater is a pointer to a MC_PISTATE_T type structure.
+ pPIParmOutput - Output - This paramater is a pointer to a signed integer type variable.
+
+ Returns:
+ Unsigned integer value '1'.
+
+ Example:
+
+ MC_PIPARMIN_T mcPIParmInput;
+ MC_PIPARMOUT_T mcPIParmOutput;
+ temp = MC_ControllerPIUpdate_InlineC(mcPIParmInput.inReference, mcPIParmInput.inMeasure, &mcPIParmInput.piState, &mcPIParmOutput.out);
+
+
+ Remarks:
+ This routine requires inputs in the 1.15 format, except for Kp which is in 1.11 format.
+ The constant Kp is scaled so it can be represented in 1.15 format by adjusting the constant
+ by a power of 2.
+*******************************************************************************/
+static inline uint16_t MC_ATTRB_INLINE MC_ControllerPIUpdate_InlineC(int16_t inReference,
+ int16_t inMeasure,
+ MC_PISTATE_T *pPIState,
+ int16_t *pPIParmOutput);
+
+#ifdef __cplusplus // Provide C++ Compatibility
+ }
+#endif
+#endif // _MOTOR_CONTROL_INLINE_DECLARATIONS_H_
+
+
+
+
+
diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_dspic.h b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_dspic.h
new file mode 100644
index 0000000..02871dd
--- /dev/null
+++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-motor/motor_control_inline_dspic.h
@@ -0,0 +1,551 @@
+/*******************************************************************************
+ Motor Control library inline definitions header file
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ motor_control_inline_dspic.h
+
+ Summary:
+ This header file hosts inline definitions of certain library functions included
+ in the Motor Control library.
+
+ Description:
+ This header file hosts inline definitions of certain library functions included
+ in the Motor Control library. This header file is automatically included when the
+ library interfaces header file is included in the project.
+*******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/* *********************************************************************
+ *
+ * (c) 2017 Microchip Technology Inc. and its subsidiaries. You may use
+ * this software and any derivatives exclusively with Microchip products.
+ *
+ * This software and any accompanying information is for suggestion only.
+ * It does not modify Microchip's standard warranty for its products.
+ * You agree that you are solely responsible for testing the software and
+ * determining its suitability. Microchip has no obligation to modify,
+ * test, certify, or support the software.
+
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS INTERACTION WITH
+ * MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY
+ * APPLICATION.
+
+ * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL,
+ * PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF
+ * ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
+ * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
+ * FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL
+ * LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT
+ * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO
+ * MICROCHIP FOR THIS SOFTWARE.
+
+ * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF
+ * THESE TERMS.
+ *
+ * *****************************************************************************/
+// DOM-IGNORE-END
+
+#ifndef _MOTOR_CONTROL_INLINE_DSPIC_H_
+#define _MOTOR_CONTROL_INLINE_DSPIC_H_
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+/* This section lists the other files that are included in this file.
+*/
+#include +X2C-Scope is a virtual oscilloscope tool developed by Linz Center of Mechatronics which allows run-time debugging or monitoring of your embedded application in MPLAB X IDE. This tool allows you to “Watch” or “Plot” any global variable in your embedded application at run-time i.e. without halting your CPU.
\ No newline at end of file diff --git a/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-x2cscope/X2CScope.h b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-x2cscope/X2CScope.h new file mode 100644 index 0000000..4bd58be --- /dev/null +++ b/mclv-48v-300w-an1292-dspic33ck256mc506/library/library-x2cscope/X2CScope.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2013, Linz Center of Mechatronics GmbH (LCM) http://www.lcm.at/ + * (c) 2016, Microchip Technology Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Linz Center of Mechatronics GmbH, Microchip + * Technology Inc nor the names of its contributors may be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL Linz Center of Mechatronics GmbH, MICROCHIP TECHNOLOGY INC + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __X2CSCOPE_H__ +#define __X2CSCOPE_H__ + +#include