Blockset described on this wiki is deprecated since 2012.

For Model Based Design (MBD), use the free MPLAB Device Blocks for Simulink, tool from Microchip.
Updated Rapid Control Prototyping (RCP) custom projects are published at: https://lubin.kerhuel.eu.

PIC32 Sensorless Speed Controller for DC Motor Applied on Picooz Main Rotor

From http://www.kerhuel.eu/wiki - Simulink device driver Blockset for dsPIC / PIC24 / PIC32 Microcontrollers --[[User:LubinKerhuel|LubinKerhuel]] 12:40, 3 September 2009 (UTC)
Jump to navigation Jump to search

Implementation of a sensorless DC speed motor control system with a PIC32 microcontroller.

Introduction

One common problem of battery powered system is their dependence on the accumulator voltage. In the case of the Picooz tiny helicopter, the speed rate of the main and tail propellers are crucial for precise control. On the original Picooz electronics, it seems that motor are controlled in open loop in the way that the motor's power is proportional to the joystick stick. Thus, as the battery voltage decrease, both motor slow down and the user has to adjust both sticks in real time. A sensorless speed controller which requires only one ADC input channel allows to overcome that problem. The speed controller will also speed up the dynamic of the motor and will reject efficiently external perturbations.

The objective here is to design a DC motor speed controller without any speed sensor. Motor's rotational speed is estimated by a measurement of the back-Electro Motrice Force (EMF). The motor is commanded through a PWM signal. During the PWM time where the motor is not powered, the motor acts as a dynamo. Measuring the generated voltage provides a pretty good speed estimation.

A dsPIC or PIC32 are ideal target to test such controllers. The blockset for simulink available on this website allow to implement the controller efficiently without requiring knowlege about microcontrollers's programming technics.

Electronics

Electronic schematic connected to an Explorer 16 board. This board power the DC motor with a PMW signal. The PIC OC1 pin generate a PWM signal with controllable duty cycle that control a MOSFET transistor: FDC6305N. The back EMF is measured via the AN5 channel of the explorer 16 board. The overall system is powered here at 3.3V but could be powered with higher voltages.

I did not build a complete embedded electronic system for the PICOOZ. This is a demo example is based on the Explorer 16 board, using the PIC32MX460F512L gracefully provided by Microchip. Converting the code for others dsPIC (30f, 33F, 24h) is quite straight using the Simulink blockset. Thus, the Picooz is taken as a test bench for the design of a sensorless speed controller. i.e. The helicopter will not flight in theses tests.

One tiny electronics board composed of three components (see image) is connected to the Explorer 16 board. This tiny board allows to provide energy power suply to the motor. The motor power suply is controlled through a PWM duty cycle from the microcontroller allowing to controll the voltage given to the motor. The MOSFET transistor: FDC6305N act as a high speed switch. When passing, its internal resistor is only of 0.1 Ohms. This small resistor has small impact on the max speed. It also make the MOSFET to keep low temperature. The resistor between the Microcontroller OC1 pin (PWM) and the MOSFET protects the microcontroller. The diode in parallel with the DC motor limits the nasty glitch due to the PWM signal passihg through the motor coil. This dode is very important to protect the microcontroller. Removing this diode may severly damage the ADC of the microcontroller, of the entire microcontroller.

Measuring the Back EMF

This model makes the motor PWM duty cycle increasing linearly increasing thus the picooz rotor's speed rate. For each different ducy cycle, channel 5 of the ADC (AN5) is sampled 120 times at 120 different location within the PWM periode. Datas are sent through the UART 2 for analysis.


Identification of the dynamic of the Picooz's main rotor

Controller design

Results