Skip to content

Commit af6092d

Browse files
committed
Pull request #14: Develop
Merge in MCU16CE/mchv3-dspic33ck256mp508-an1206 from develop to master * commit '273616bce6b389c383bb46c66aa1e1077dedc867': Added a special note on low resolution issue of external op- amp configuration with AC300023 motor. Excel sheet is updated.(External op-amp max peak current is changed from 16.4 to 16.5A) main.json and changelog files are modified for the release of version 1.0.1 Tuning parameters for external op-Amp configuration are modified corresponding to peak current of 16.5A. Readme files are modified to correct the errors.
2 parents 9c15a6a + 273616b commit af6092d

File tree

9 files changed

+66
-34
lines changed

9 files changed

+66
-34
lines changed

.main-meta/main.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"content":{
55
"metaDataVersion":"1.3.0",
66
"name":"com.microchip.mplabx.project.mchv3-dspic33ck256mp508-an1206",
7-
"version":"1.0.0",
7+
"version":"1.0.1",
88
"displayName":"AN1206 dspic33ck256mp508 MCHV3",
99
"projectName":"mchv3-dspic33ck256mp508-an1206",
1010
"shortDescription":"Sensorless FOC (PLL estimator) of AC induction motor with field weakening",

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![image](images/microchip.jpg)
22

3-
# MCHV3 DSPIC33CK256MP508 AN1206
3+
# MCHV3 dsPIC33CK256MP508 AN1206
44

55
## INTRODUCTION
66
<p style='text-align: justify;'>
@@ -20,5 +20,30 @@ A Phase-Locked Loop (PLL) estimator is implemented to estimate the speed and pos
2020
<img src="images/pllestimatorblockdiagram.PNG">
2121
</p>
2222

23+
### The following hardware tools are used for the demonstration:
24+
25+
Use one of the High-Voltage Motor Control Development Boards mentioned below:
26+
- dsPICDEM™ MCHV-2 Development Board, [DM330023-2](https://www.microchip.com/en-us/development-tool/dm330023-2)
27+
- dsPICDEM™ MCHV-3 Development Board, [DM330023-3](https://www.microchip.com/en-us/development-tool/dm330023-3)
28+
- High Voltage 3-Phase AC Induction Motor, [AC300023](https://www.microchip.com/en-us/development-tool/AC300023)
29+
- dsPIC33CK256MP508 Internal Op-Amp Motor Control Plug-in module, [MA330041-2](https://www.microchip.com/en-us/development-tool/MA330041-2)
30+
- dsPIC33CK256MP508 External Op-Amp Motor Control Plug-in module, [MA330041-1](https://www.microchip.com/en-us/development-tool/MA330041-1)
31+
32+
Maximum rated current of the induction motor (AC300023) used for the demonstration is 0.25A. The default gain of the internal amplifier is 15, capable of measuring a maximum peak current of 11A. To improve the measurement accuracy, modify the amplifier gain so that the maximum peak current is 1A.
33+
34+
- Readme document for Internal op-amp configuration [Readme for Internal Op-Amp](mchv3_dspic33ck256mp508_an1206/docs/README_internal.md)
35+
36+
The default gain of the external amplifiers on the MCHV-2 or MCHV-3 is 10 (the maximum measurable peak current is 16.5A).
37+
2338
- Readme document for External op-amp configuration [Readme for External Op-Amp](mchv3_dspic33ck256mp508_an1206/docs/README_external.md)
24-
- Readme document for Internal op-amp configuration [Readme for Internal Op-Amp](mchv3_dspic33ck256mp508_an1206/docs/README_internal.md)
39+
40+
</br>
41+
42+
> **NOTE :**
43+
> - <p style='text-align: justify;'> The hardware setting for internal opamp configuration is altered to get a peak current of 1A. This is done to enable MCHV-2 or MCHV-3 board to run the induction motor -AC300023 whose maximum rated current is only 0.25A.</p>
44+
> - <p style='text-align: justify;'>The hardware setting for external opamp configuration is left unaltered (with a peak current of 16.5A). This enables user to run higher power motors on MCHV-2 or MCHV-3 board. But, with the default external amplifier gain settings, the induction motor - AC300023 may not run properly or may stall at certain speeds, due to lower current resolution.</p>
45+
46+
47+
48+
49+

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# mchv3-dspic33ck256mp508-an1206 v1.0.1
2+
### Release Highlights
3+
This is the code for Sensorless FOC (PLL estimator) of AC induction motor with field weakening.
4+
The code is set up for ZD AC induction motor (AC300023) with MCHV3 development board.
5+
6+
7+
### Features Added\Updated
8+
Tuning parameters for external op-Amp configuration are modified corresponding to peak current of 16.5A.
9+
Readme files are modified.
10+
111
# mchv3-dspic33ck256mp508-an1206 v1.0.0
212
### Release Highlights
313
This is the first version of code for Sensorless FOC (PLL estimator) of AC induction motor with field weakening.

images/internalconfigsetup.PNG

-76.2 KB
Loading

images/internalopampselection.PNG

93.8 KB
Loading

mchv3_dspic33ck256mp508_an1206/docs/README_external.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<p style='text-align: justify;'>
77
This document describes the setup requirements for running the Sensor-less FOC algorithm for an Induction Motor, which is referenced in AN1206 “Sensorless Field Oriented Control (FOC) of a Three-Phase AC Induction Motor (ACIM)” </p>
88
<p style='text-align: justify;'>
9-
The demonstration is configured to run on either the dsPICDEM™ MCHV-2 Development Board or the dsPICDEM™ MCHV-3 Development Board in the External Op-Amp configuration with the dsPIC33CK256MP508 Internal Op-Amp Motor Control Plug-In Module (PIM).
9+
The demonstration is configured to run on either the dsPICDEM™ MCHV-2 Development Board or the dsPICDEM™ MCHV-3 Development Board in the External Op-Amp configuration with the dsPIC33CK256MP508 External Op-Amp Motor Control Plug-In Module (PIM).
1010
</p>
1111

1212
## Hardware Connection and Running the Demo Code
@@ -26,8 +26,8 @@ To set up the demonstration, you may use one of the High-Voltage Motor Control D
2626
- dsPICDEM™ MCHV-3 Development Board [DM330023-3](https://www.microchip.com/en-us/development-tool/dm330023-3)
2727
> **_NOTE:_**
2828
>In this document, hereinafter High-Voltage Motor Control Development Board selected for setting up the demonstration is referred as Development Board..
29-
- High Voltage 3-Phase AC Induction Motor, Part-No. [AC300023](https://www.microchip.com/en-us/development-tool/AC300023)
30-
- dsPIC33CK256MP508 Internal Op-Amp Motor Control Plug-in module, Part-No. [AC300023](https://www.microchip.com/en-us/development-tool/MA330041-2)
29+
- High Voltage 3-Phase AC Induction Motor.
30+
- dsPIC33CK256MP508 External Op-Amp Motor Control Plug-in module, Part-No. [MA330041-1](https://www.microchip.com/en-us/development-tool/MA330041-1)
3131
<br />
3232

3333
> **_NOTE:_**
@@ -38,7 +38,7 @@ To set up the demonstration, you may use one of the High-Voltage Motor Control D
3838
<p style='text-align: justify;'>
3939
Refer dsPICDEM™ MCHV-2 Development Board User’s Guide or dsPICDEM™ MCHV-3 Development Board User’s Guide, for any clarification while setting up the hardware.</p>
4040
<p style='text-align: justify;'>
41-
1. Before making any connection, verify that the Development Board is not powered and it is fully discharged. This can be done by checking if Power on Status LED D13(Red) is off.</p>
41+
1. Before making any connection, verify that the Development Board is not powered and it is fully discharged. This can be done by checking if Power on Status LED D13(Red) is off.</p>
4242
<p style='text-align: justify;'>
4343
2. Open the top cover of the enclosure and set up the following jumpers (if they are not in specified positions):</p>
4444

@@ -57,7 +57,7 @@ Refer dsPICDEM™ MCHV-2 Development Board User’s Guide or dsPICDEM™ MCHV-3
5757
<img src="../../images/matrixboard.PNG">
5858
</p>
5959
<p style='text-align: justify;'>
60-
Note: Rated current of the board in External op amp configuration is 16.4 A.</p>
60+
Note: Rated current of the board in External op amp configuration is 16.5 A.</p>
6161
</br>
6262
<p style='text-align: justify;'>
6363
5. Insert the dsPIC33CK256MP508 External Op-Amp Motor Control PIM into the PIM Socket U11 provided on the Development Board. Make sure the PIM is correctly placed and oriented before proceeding.</p>
@@ -150,15 +150,15 @@ Define the Macro TORQUE_MODE, if the motor must run in Torque Control mode. If t
150150
</p>
151151

152152
<p style='text-align: justify;'>
153-
5. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure the required Motor is defined and the Board and Motor parameters are corre-sponding to External Op-Amp design from the tuning parameter excel sheet in docs folder</p>
153+
5. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure the required Motor is defined and the Board and Motor parameters are corresponding to External Op-Amp design from the tuning parameter excel sheet in docs folder</p>
154154
<p align="center">
155155
<img src="../../images/externalopampconfiguration.PNG">
156156
</p>
157157

158158
### **Parameters to Enter in the tuning parameter excel sheet:**
159159
### **Board Parameters:**
160160
- **Board Peak voltage:** The Maximum measurable DC Bus voltage corresponding to Analog Channel voltage of 3.3V. By default, Board Peak Voltage for MCHV2/MCHV3 is 453V.
161-
- **Board Peak current:** The Maximum measurable Phase Current corresponding to Analog Channel voltage of 3.3V. By default, Board Peak current for MCHV2/MCHV3 in External OP AMP Configuration is 11A.
161+
- **Board Peak current:** The Maximum measurable Phase Current corresponding to Analog Channel voltage of 1.65V. By default, Board Peak current for MCHV2/MCHV3 in External OP AMP Configuration is 16.5A.
162162
- **PWM Period (Ts):** PWM Period is equal to 1/PWM switching frequency
163163

164164
**Motor Parameters:**

mchv3_dspic33ck256mp508_an1206/docs/README_internal.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![image](../../images/microchip.jpg)
22

3-
# AN1206 Demonstration ReadMe for the dsPICDEM™ MCHV-2 Development Board or dsPICDEM™ MCHV-3 Development Board with the dsPIC33CK256MP508 Inernal Op-Amp Motor Control PIM(MPLAB® X IDE)
3+
# AN1206 Demonstration ReadMe for the dsPICDEM™ MCHV-2 Development Board or dsPICDEM™ MCHV-3 Development Board with the dsPIC33CK256MP508 Internal Op-Amp Motor Control PIM(MPLAB® X IDE)
44

55
## INTRODUCTION
66
<p style='text-align: justify;'>
@@ -25,9 +25,9 @@ To set up the demonstration, you may use one of the High-Voltage Motor Control D
2525
- dsPICDEM™ MCHV-2 Development Board, Part-No. [DM330023-2](https://www.microchip.com/en-us/development-tool/dm330023-2)
2626
- dsPICDEM™ MCHV-3 Development Board [DM330023-3](https://www.microchip.com/en-us/development-tool/dm330023-3)
2727
> **_NOTE:_**
28-
>In this document, hereinafter High-Voltage Motor Control Development Board selected for setting up the demonstration is referred as Development Board..
29-
- High Voltage 3-Phase AC Induction Motor, Part-No. [AC300023](https://www.microchip.com/en-us/development-tool/AC300023)
30-
- dsPIC33CK256MP508 Internal Op-Amp Motor Control Plug-in module, Part-No. [AC300023](https://www.microchip.com/en-us/development-tool/MA330041-2)
28+
>In this document, hereinafter High-Voltage Motor Control Development Board selected for setting up the demonstration is referred as Development Board.
29+
- High Voltage 3-Phase AC Induction Motor.
30+
- dsPIC33CK256MP508 Internal Op-Amp Motor Control Plug-in module, Part-No. [MA330041-2](https://www.microchip.com/en-us/development-tool/MA330041-2)
3131
<br />
3232

3333
> **_NOTE:_**
@@ -58,15 +58,13 @@ Refer dsPICDEM™ MCHV-2 Development Board User’s Guide or dsPICDEM™ MCHV-3
5858
</p>
5959

6060
<p style='text-align: justify;'>
61-
5. The rated current of Induction Motor (AC300023) is 0.25 A, and the default rated current of the Board in Internal Op Amp Configuration is 11A. To increase the resolution please modify the rated current of the Board in Internal Op Amp Configuration from 11A to 1A by changing the gains of the current Amplifier.</p>
61+
5. Maximum rated current of the induction motor (Part-No. AC300023) used for the demonstration is 0.25A. The default gain of the internal amplifier is 15, capable of measuring a maximum peak current of 11A. To improve the measurement accuracy, modify the amplifier gain so that the maximum peak current is 1A.</p>
6262

63-
Modify the **R6,R5,R13,R12** from **30k to 330k** ohm resistors.
63+
Modify the value of resistors **R6,R5,R13,R12** from **30k to 330k** ohm to change the measureable peak current from 11A to 1A.
6464
<p align="center">
6565
<img src="../../images/internalopampconfig.PNG">
6666
</p>
6767
<p style='text-align: justify;'>
68-
Note: if the Rated current of the motor is more than 1A, then there is no need to modify the gains of the internal Op Amp, during that case the rated current of the board in internal op amp configuration is 11A.</p>
69-
<p style='text-align: justify;'>
7068
6. Insert the dsPIC33CK256MP508 Internal Op-Amp Motor Control PIM into the PIM Socket U11 provided on the Development Board. Make sure the PIM is correctly placed and oriented before proceeding.</p>
7169

7270
<p style='text-align: justify;'>
@@ -94,18 +92,17 @@ Install MPLAB X IDE and MPLAB XC16 Compiler versions that support the device dsP
9492

9593
<p style='text-align: justify;'>If MPLAB IDE v8 or earlier is already installed on your computer, then run the MPLAB driver switcher (It is installed when MPLAB®X IDE is installed) to switch from MPLAB IDE v8 drivers to MPLAB X IDE drivers. If you have Windows 7 or 8, you must run MPLAB driver switcher in ‘Administrator Mode’. To run the Device Driver Switcher GUI application as administrator, right click on the executable (or desktop icon) and select ‘Run as Administrator’. For additional details refer MPLAB X IDE help topic “Before You Begin: Install the USB Device Drivers (For Hardware Tools): USB Driver Installation for Windows Operating Systems”. </p>
9694

97-
### Setup: X2C - SCOPE
95+
### Setup: X2C - Scope
9896
<p style='text-align: justify;'>
99-
X2C - SCOPE is a MPLAB X IDE plugin that allows a developer to interact with an application while the application program is running. X2C-Scope enables you to read, write, and plot global variables (for motor control) in real time. It communicates with the target using the UART. To use X2C, the plugin must be installed:</p>
97+
X2C - Scope is a MPLAB X IDE plugin that allows a developer to interact with an application while the application program is running. X2C-Scope enables you to read, write, and plot global variables (for motor control) in real time. It communicates with the target using the UART. To use X2C, the plugin must be installed:</p>
10098

10199
- In MPLAB X IDE, select Tools>Plugins and click on the Available Plugins tab.
102-
- Select X2C - SCOPE plug-in by checking its check box, and then click Install.
103-
- Look for tool X2C - SCOPE under Tools>Embedded.
100+
- Select X2C - Scope plug-in by checking its check box, and then click Install.
101+
- Look for tool X2C - Scope under Tools>Embedded.
104102

105103
<p align="center">
106104
<img src="../../images/x2cinstall.PNG">
107105
</p>
108-
<br />
109106

110107
## BASIC DEMONSTRATION
111108
### Firmware Description
@@ -123,7 +120,7 @@ For more details refer Microchip Application note AN1206 “Sensorless Field Ori
123120

124121
> **_NOTE:_**
125122
> The project may not build correctly in Windows OS if Maximum path length of any source file in the project is more than 260 characters. In case absolute path is exceeding or nearing maximum length, do any (or both) of the following:
126-
> - Shorten the name of the directory containing the firmware used in this demonstration. In this case, rename directory AN1206_dsPIC33CK256MP508_EXT_INT_OPAMP_MCHV2_MCHV3 to more ap-propriate shorter name. In case you renamed the directory, consider the new name while reading instructions provided in the upcoming sections of the document.
123+
> - Shorten the name of the directory containing the firmware used in this demonstration. In this case, rename directory AN1206_dsPIC33CK256MP508_EXT_INT_OPAMP_MCHV2_MCHV3 to more appropriate shorter name. In case you renamed the directory, consider the new name while reading instructions provided in the upcoming sections of the document.
127124
> - Place firmware in a location, such that absolute path length of each file included in the projects does not exceed the Maximum Path length specified.
128125
For details, refer MPLAB X IDE help topic “Path, File and Folder Name Restrictions”.
129126

@@ -152,23 +149,23 @@ Define the Macro OPEN_LOOP_FUNCTIONING, if the motor must run in Open loop (V/F)
152149
Define the Macro TORQUE_MODE, if the motor must run in Torque Control mode. If the Macro OPEN_LOOP_FUNCTIONING is defined, then motor will run in Speed Con-trol mode.</p>
153150

154151
<p style='text-align: justify;'>
155-
4. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure INTERNAL_OPAMP_CONFIGPIM is undefined as this demonstration is for Internal Op-Amp configuration.</p>
152+
4. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure INTERNAL_OPAMP_CONFIGPIM is defined as this demonstration is for Internal Op-Amp configuration.</p>
156153
<p align="center">
157-
<img src="../../images/undefinternalopamp.PNG">
154+
<img src="../../images/internalopampselection.PNG">
158155
</p>
159156

160157
<p style='text-align: justify;'>
161-
5. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure the required Motor is defined and the Board and Motor parameters are corre-sponding to Internal Op-Amp design from the tuning parameter excel sheet in docs folder</p>
158+
5. Open userparams.h (under acim.X -> headerfiles) in the project acim.X and ensure the required Motor is defined and the Board and Motor parameters are corresponding to Internal Op-Amp design from the tuning parameter excel sheet in docs folder.</p>
162159
<p align="center">
163160
<img src="../../images/internalconfigsetup.PNG">
164161
</p>
165162

166163
### **Parameters to Enter in the tuning parameter excel sheet:**
167164
### **Board Parameters:**
168165
- **Board Peak voltage:** The Maximum measurable DC Bus voltage corresponding to Analog Channel voltage of 3.3V. By default, Board Peak Voltage for MCHV2/MCHV3 is 453V.
169-
- **Board Peak current:** The Maximum measurable Phase Current corresponding to Analog Channel voltage of 3.3V. By default, Board Peak current for MCHV2/MCHV3 in Internal OP AMP Configuration is 11A.
166+
- **Board Peak current:** The Maximum measurable Phase Current corresponding to Analog Channel voltage of 1.65V. For running ZD Motor,Part-No. [AC300023](https://www.microchip.com/en-us/development-tool/AC300023) the gains of the internal op Amp Module are modified and the Modified Board Peak Current is 1A.
167+
See Point #5 in [Hardware setup](#hadware-setup)
170168

171-
**Note:** For running **ZD Motor** the gains of the internal op Amp Module are modified and the Modified Board Peak Current is 1A.
172169
- **PWM Period (Ts):** PWM Period is equal to 1/PWM switching frequency
173170

174171
**Motor Parameters:**
@@ -190,7 +187,7 @@ Enter the Motor Actual parameters and Generated parameters from tuning parameter
190187
In the ‘Conf: [default]’ category window:
191188

192189
- Select the specific Compiler Toolchain from the available list of compilers. Please ensure MPLAB® XC16 Compiler supports the device dsPIC33CK256MP508. In this case “XC16(v1.70)” is selected. The compiler used for testing the firmware is listed in the section Software Tools Used for Testing the firmware.
193-
- Select the Hardware Tool to be used for programming and debugging. In this case, “PKOB” is selected as the programmer from Connected Hardware Tools section.
190+
- Select the Hardware Tool to be used for programming and debugging. In this case, “PKoB” is selected as the programmer from Connected Hardware Tools section.
194191

195192
- After selecting Hardware Tool and Compiler Toolchain, click button Apply
196193
<p align="center">
Binary file not shown.

mchv3_dspic33ck256mp508_an1206/userparms.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ controllers, tuning mode will disable the speed PI controller and undef to run i
5959
#ifdef INTERNAL_OPAMP_CONFIG
6060
#define MC1_PEAK_CURRENT 1 /* I Base *//* 11A for Unmodified Gain*/
6161
#else
62-
#define MC1_PEAK_CURRENT 16.4 /* I Base */
62+
#define MC1_PEAK_CURRENT 16.5 /* I Base */
6363
#endif
6464

6565
/* Define to run ZD Induction motor*/
@@ -169,14 +169,14 @@ controllers, tuning mode will disable the speed PI controller and undef to run i
169169
/* the calculation of Rs gives a value exceeding the Q15 range so,
170170
the normalized value is further divided by 2^NORM_RS_SCALE to fit the 32768 limit
171171
this is taken care in the estim.c */
172-
#define NORM_RS 16438
172+
#define NORM_RS 16538
173173
#define NORM_RS_SCALE 4 /* 2^NORM_RS_SCALE is the scaling */
174174
#define NORM_RS_SCALE_SHIFT (15 - NORM_RS_SCALE)
175175
/* Normalized Sigmals/dt value */
176176
/* the calculation of NORM_SIGMA_LSDTBASE gives a value exceeding the Q15 range so,
177177
the normalized value is further divided by 2^NORM_SIGMA_LSDTBASE_SCALE to fit the 32768 limit
178178
this is taken care in the estim.c */
179-
#define NORM_SIGMA_LSDTBASE 21452
179+
#define NORM_SIGMA_LSDTBASE 21583
180180
#define NORM_SIGMA_LSDTBASE_SCALE 10 /* 2^NORM_LSDTBASE_SCALE is the scaling */
181181
#define NORM_SIGMA_LSDTBASE_SCALE_SHIFT (15- NORM_SIGMA_LSDTBASE_SCALE)
182182
/* Normalized 1/(Lm^2/Lr) value */
@@ -193,7 +193,7 @@ controllers, tuning mode will disable the speed PI controller and undef to run i
193193
/* Normalized Inverse rotor time constant*/
194194
#define NORM_INVTR 2501
195195
/* Normalized Stator Inductance (Lm + Lls)*/
196-
#define NORM_LS 26923
196+
#define NORM_LS 27088
197197
#define NORM_LS_SCALE 7
198198
/* Limitation constants */
199199
/* di = i(t1)-i(t2) limitation

0 commit comments

Comments
 (0)