Thursday, March 28, 2024
HomeWhite papersMicrochip microcontrollers for electric motor control

Microchip microcontrollers for electric motor control

4.3
(3)

32-bit components of the PIC32CM and PIC32MK series.

PIC32CM microcontroller family, MC series

The broad portfolio of 32-bit PIC microcontrollers is divided into several families, each distinguished by a number of specific features. The most recent is the PIC32CM 'MC' family, where 'MC' stands for 'motor control'.

Intended for motor operation control, as they are dedicated to this type of application. These 32-bit components are based on the ARM Cortex-M0+ architecture.

They can be operated with a clock signal with a frequency of up to 48 MHz, have built-in Flash memory (up to 128 KB) and 16 KB SRAM.

The operating voltage ranges from 2.7V to 5.5V DC. This range allows their application in simple battery-powered circuits, for example, single lithium polymer (LiPo) or lithium ion (Li-Ion) cells. In addition, they have been preliminarily protected against the voltage fluctuations that accompany the power supply to electric motors. They have also been designed to ensure resistance to electromagnetic interference (EMC).

In the PIC32CM "MC" series circuits we will find a number of solutions to facilitate motor control. The first is the integrated PDEC (Positional Decoder) circuit, i.e. a circuit through which the microcontroller obtains information on the current position of the rotor. This allows precise and ergonomic control of the drive: the power supply to the subsequent motor windings is at the optimum angle of rotation of the switch. The designer thus obtains full control over the operation of the motor, even under heavy loads, when management by PWM signal alone might not be sufficient.

Motor operation control using PIC32CM microcontrollers

The drive control program is most often based on conditional instructions. The direction and speed of rotation of the motor depend on the device status data.

The microcontroller can obtain this information using simple binary signals, e.g. from the limit switches.

However, more and more frequently we are faced with situations in which the data comes from accelerometers, optical sensors or magnetic field sensors, etc. The communication with these circuits generally requires the implementation of at least one protocol (e.g. SPI or I2C) in the program. Communication with these circuits generally requires at least one protocol (e.g. SPI or I2C) to be implemented in the program.

As the number of peripherals increases, as well as the complexity of the entire circuit, designers often have to deal with the limited hardware resources of the microcontroller. For example, its timers (counters) can be used to generate interrupts, as well as being used by various libraries to manage communication protocols.

Sometimes, even the data acquisition, processing and transmission processes alone affect the maximum number of controlled devices and require the use of additional external multiplexers and drivers.

The PIC32CM 'MC' family of microcontrollers features a range of solutions that simplify the design of complex control systems by minimising the number of external components.

The control of the motors in these system circuits is carried out by dedicated and integrated timers and counters (TTC). These operate independently of the other peripherals of the microcontroller, so that the control signals are accurate and not disturbed by the side activities carried out by the program.

The PIC32 MC systems also feature four hardware serial communication modules (SERCOM), which can be configured to transmit data via USART, SPI, I2C, RS485 or LIN interfaces - the most common standards used in industrial embedded systems.

The dedicated 12-bit data bus, equipped with a CRC module (to minimise communication errors), allows data to be exchanged between the microcontroller memory and the peripherals, bypassing the core, thanks to the Direct Memory Access (DMA) mechanism. This solution does not cause delays in program execution.

Microcontroller programming using MPLAB X and Harmony software

Applications for PIC32 microcontrollers are programmed in the MPLAB X environment. This is an integrated solution that makes it possible to fully exploit the possibilities of Microchip circuits.

As the manufacturer's proprietary solution, MPLAB X software allows the same code to be used on different hardware platforms from that manufacturer (provided they have compatible functionality), for easy migration between different microcontroller families at any stage of application design.

The intuitive interface gives developers access to all the information about the programmed microcontroller and the operations it performs. The MPLAB Harmony overlay contains over 1,000 free sample programs, as well as numerous libraries that provide an excellent foundation for learning, as well as help with project development. More details on the content and functionality of the MPLAB X / Harmony environment will be presented below, in the context of the PIC32MK family.

Microcontrollers of the PIC32MK GPG and MCM family

In more demanding projects where motor management is only one of the many functions performed by the microcontroller, the more advanced PIC32MK systems may be the appropriate solution.

These include, for example, the "GPG" and "MCM" series. These are closely related products, sharing most of the features.

The differences are not great, but in some applications they can prove crucial. In the "MCM" series the Flash memory has a maximum volume of 1 MB (512kb for the "GPG" series), in these controllers an additional phase synchronisation loop has been provided for the USB interface, the number of analogue inputs has been increased to 42 and 6 (instead of 2) SPI/I2C communication modules have been used. Since the features of the two series are not so different, we will take a look at the entire PIC32MK family below.

The PIC32MK microcontrollers of the "GPG" and "MCM" series are built using the MIPS32 architecture and are equipped with an impressive feature set.

The systems allow the control of DC motors using PWM signals (in 9 or 12 pairs), but also operation with brushless DC drives (BLDC) and even their AC variant, i.e. PMSM (sometimes called BLAC), using algorithms that do not exploit external position sensors.

The circuits provide hardware support for floating-point processing (mathematical coprocessor), offer seven 12-bit ADCs with a sampling rate of 3.75 Msps multiplexed over 30 or 42 channels, and have eight channels with direct access to DMA memory.

Dozens of noteworthy peripherals are built into the microcontrollers, including: a real-time clock (RTC), up to eight timers/counters with 32-bit resolution, three 12-bit D/A converters (DACs), four operational amplifiers and five comparators.

PIC32MK GPG
PIC32MK GPG
PIC32MK MCM
PIC32MK MCM
PIC32 series display and touch user interface

Using Microchip's microcontrollers, the designer obtains a wide range of user interface functionality: the controllers are equipped with a parallel port (PMP) to support liquid crystal displays (LCD), as well as an integrated CVD converter, thanks to which the microcontrollers can act as controllers for matrix touch keyboards, realised in capacitive technology.

The controller design supports a maximum of six I2S channels, i.e. the protocol that achieves transmission to sound transducers without loss of PCM samples. In addition, all I/O pins can be used to generate interrupts, making the PIC32MK controller ideal as a control unit even for complex systems.

It is worth noting here that five outputs can be programmed to trigger an interrupt if a certain voltage is exceeded, which makes it easier to integrate the microcontroller into analogue sensors, for example.

Although the microcontroller is powered with voltages in the range of 2.3V to 3.6V DC, the GPIO ports tolerate voltages up to 5V DC.

Certification and libraries for secure IoT devices

As with the series described above, the programming environment for the PIC32MK circuits is MPLAB X with Harmony overlay.

The libraries provided by the manufacturer offer a wide range of possibilities. Depending on requirements, the user can take advantage of support for the TCP/IP stack, USB communication and mTouch technology (creation of touch buttons, scroll bars, etc.).

Consumer device designers are offered the opportunity to create audio applications based on the Bluetooth standard within Android or MFi (Apple) operating systems.

Among the demonstration programmes provided by the manufacturer, there is also an example of using the wolfSSL library.

It is one of the most popular solutions in terms of communication security for IoT devices: it allows the transmission of encrypted data via SSL and TLS 1.3 protocols. It will be particularly important for designers building mobile broadband devices based on the PIC32MK.

Staying on the subject of consumer electronics and safety, the issue of the Class-B Safety library must also be addressed.

This is a set of low-level procedures developed by the manufacturer that enables PIC32 microcontroller-based devices to meet IEC 60335 and IEC 607030 safety standards.

These requirements apply not only to consumer devices, but also to accessories used by professionals. IEC 60730 certification has become mandatory for every product sold in Europe. However, this will not be an obstacle for manufacturers using Microchip brand solutions. Because the Class-B Safety library has been tested on all of the vendor's platforms, applications created using this solution do not have to undergo additional testing, which significantly reduces the time to market. In addition, Microchip offers professional support to all engineers interested in using the Class-B Safety library in their projects.

It is also worth mentioning that the PIC32MK microcontrollers support microMIPS technology. Under the assumptions of this solution, most of the 32-bit processor functions are available from the 16-bit instruction level; this allows code compression, reducing its volume by up to 25%.

Prototyping with PIC32CM and PIC32MK microcontrollers

PIC32 development kits have also been included in TME's offering. For any designer, these will be excellent platforms for testing, developing and improving devices. They provide access to all the functions of the microcontrollers in question, as well as helping to plan the design of the target device.

First, let's take a look at solutions using PIC32CM controllers.

Curiosity Nano board - how to start using the PIC32 microcontroller?

This small, compact development kit that fits in one hand allows access to most of the PIC32CM's functionality. And at the same time it is competitively priced and does not require any additional devices to program it (as it has a built-in programmer/debugger). Certainly this product should be of interest to all those who are just starting to use PIC32 circuits and wish to expand their knowledge in the field of state-of-the-art microcontrollers.

The EV10N93A symbol board is equipped with a PIC32CM1216MC00032 circuit, whose GPIO pins have been installed on the PCB (for soldering goldpin connectors, or for PCB mounting as a component soldered to the PCB due to the presence of slot connectors), a Micro USB socket for powering and programming the circuit, a single button, and LEDs indicating the status of the device. The kit is fully supported in the MPLAB X environment.

PIC32CM Curiosity Pro Kit (EV15N46A)

Another kit features the PIC32CM1216MC00048 microcontroller. It has all the features of the Nano kit, but in the case of the EV15N46A, the user receives additional buttons and the output of all microcontroller pins on different goldpin connectors (separately for GPIO, control signals, as well as A/D and D/A converters), a separate port for the programmer/debugger with SWD interface, external oscillator for the RTC clock and current measurement point in order to precisely measure and optimise the power consumption of the microcontroller and the motors it controls.

PIC32CM Motor Control Plug-In Module and MCHV-2 and MCHV-3 Kits

The module with symbol EV94F66A, i.e. PIC32CM Motor Control Plug-In, has a PIC32CM1216MC0048 microcontroller with the basic components necessary for its operation. The module also has a port for an ISP programmer and a 100-pin connector, which is needed to install the module on the prototyping board or on a development kit.

Dedicated development kits include the MCHV-2 and MCHV-3, which are tools for developing designs to control motors with high current draw, used for example in household appliances.

The PIM module, together with the development kit, speeds up the design process, as it has all the power and control components. The designer can therefore concentrate on designing the functionality of the controller and optimising the program code with a fully functional prototype.

MCHV kits are supplied with AC current from 85V to 260V AC. The kit's power supply can provide a current of 6.5A and work with three-phase loads of up to 2kVA (such as an inverter motor for a washing machine, but also a complex device in the industrial automation segment).

Development boards are designed in such a way that the components placed on them can take over the functions of certain components placed inside the microcontroller, for example, operational amplifiers that are not suitable for heavy loads.

PIC32MK microcontroller module

The advantage of the 100-pin connector used in MCHV boards is its versatility. In the slot it is possible to install both PIC32MC modules and modules equipped with PIC32MK microcontrollers. However, the products in this group, thanks to their broad functionality, can form the heart of an independent and integrated device, not only for supervising motor operation, but also equipped with a user interface, network communication module and many other functions. The development of such a project is complicated, but the use of the ready-made module with PIC32MK1024MCM microcontroller will speed up the development work.

While MCHV boards simplify work on a project in its initial phase, the MA320211 module(PIC32MK MCM Motor Control Plug-In Module) can be reused during testing of the device/controller prototype, for development work on other elements of the project ( HMI Human Machine Interface communication, data transmission, etc.).

For further information click here

Text drafted by Transfer Multisort Elektronik Sp. z o.o.

The original source of text: https://www.tme.eu/it/news/library-articles/page/43066/Microcontrollori-del-marchio-Microchip-per-il-controllo-dei-motori-elettrici/

How interesting did you find this article?

Average rating 4.3 / 5. Number of ratings: 3

No ratings yet! Be the first to rate this item.

Register on Elettronica TECHtoo !
Here are the exclusive benefits for registered users:
- FREE Electronic Lab Collection Ed. 1
- FREE subscription to Elettronica AV magazine
- receipt of real-time updates
- ability to review and comment on articles
SIGN UP NOW!

LATEST NEWS

PARTNER

MARKET

SOCIAL

IN EVIDENCE

Register on Elettronica TECHtoo !
Here are the exclusive benefits for registered users:
- FREE Electronic Lab Collection Ed. 1
- FREE subscription to Elettronica AV magazine
- receipt of real-time updates
- ability to review and comment on articles
SIGN UP NOW!