DESIGNING A POSITION REGULATOR FOR AN ACTUATOR POWERED BY A CONTINUOUS CURRENT MOTOR USING THE PIC16F73 MICROCONTROLLER

Similar documents
Introduction to Using the PIC16F877 Justin Rice IMDL Spring 2002

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

DESIGN AND DEVELOPMENT OF A LOW-COST MICROCONTROLLER BASED SINGLE PHASE WATER-PUMP CONTROLLER

Pulse Width Modulation

Design of Low Cost Embedded Power Plant Relay Testing Unit

Modeling, Simulation and Implementation of Speed Control of DC Motor Using PIC 16F877A

Sensors and Sensing Motors, Encoders and Motor Control

ELCT 912: Advanced Embedded Systems

CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Design of double loop-locked system for brush-less DC motor based on DSP

Design of stepper motor position control system based on DSP. Guan Fang Liu a, Hua Wei Li b

Electric Bike BLDC Hub Motor Control Using the Z8FMC1600 MCU

TKT-3500 Microcontroller systems

TMS320F241 DSP Boards for Power-electronics Applications

International Journal of Advance Engineering and Research Development

Sensors and Sensing Motors, Encoders and Motor Control

Temperature controlling system using embedded equipment

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

Training Schedule. Robotic System Design using Arduino Platform

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

An Embedded Approach for Motor Control Boards Design in Mobile Robotics Applications

' The PicBasic Pro Compiler Manual is on line at: '

BLuAC5 Brushless Universal Servo Amplifier

Generating DTMF Tones Using Z8 Encore! MCU

Programming and Interfacing

DASL 120 Introduction to Microcontrollers

Lab 5: Inverted Pendulum PID Control

Designing with a Microcontroller (v6)

CS545 Contents XIV. Components of a Robotic System. Signal Processing. Reading Assignment for Next Class

Jaguar Motor Controller (Stellaris Brushed DC Motor Control Module with CAN)

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

Analog Inputs and Outputs

Simulation Of Radar With Ultrasonic Sensors

Measuring Distance Using Sound

Using Z8 Encore! XP MCU for RMS Calculation

LINE MAZE SOLVING ROBOT

BLuAC5 Brushless Universal Servo Amplifier

Cleaning Robot Working at Height Final. Fan-Qi XU*

Lab 23 Microcomputer-Based Motor Controller

CHAPTER-5 DESIGN OF DIRECT TORQUE CONTROLLED INDUCTION MOTOR DRIVE

Experiment#6: Speaker Control

2. Circuit diagram The overall functional diagram is:

Building an Analog Communications System

Closed loop speed control of dc motor using PID controller

Brian Hanna Meteor IP 2007 Microcontroller

EE 308 Lab Spring 2009

Standard single-purpose processors: Peripherals

Ocean Controls KT-5221 Modbus IO Module

PWM, ALT, HALT, HAST.

Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

EE 314 Spring 2003 Microprocessor Systems

Motor Control using NXP s LPC2900

RX23T inverter ref. kit

CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS

8-bit Microcontroller with 512/1024 Bytes In-System Programmable Flash. ATtiny4/5/9/10

Introduction. Theory of Operation

International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering. (An ISO 3297: 2007 Certified Organization)

SUNSTAR 传感与控制 TEL: FAX: Humidity and temperature measurement system using a

TB6537P/PG,TB6537F/FG

Control System Design of Magneto-rheoloical Damper under High-Impact Load

RL78 Motor Control. YRMCKITRL78G14 Starter Kit. Renesas Electronics Europe. David Parsons Application Engineering Industrial Business Group.

CR 33 SENSOR NETWORK INTEGRATION OF GPS

Design and Construction of PIC-based IR Remote Control Moving Robot

6. HARDWARE PROTOTYPE AND EXPERIMENTAL RESULTS

International Journal of Advance Engineering and Research Development

Capacitive Measuring Device

MCU Reset and Oscillator Circuits Application Note

Laboration: Frequency measurements and PWM DC motor. Embedded Electronics IE1206

INTELLIGENT SEGREGATION SYSTEM

MicroToys Guide: Motors N. Pinckney April 2005

DTMF receiver for telephones

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

ISSN Vol.05,Issue.01, January-2017, Pages:

THE PERFORMANCE TEST OF THE AD CONVERTERS EMBEDDED ON SOME MICROCONTROLLERS

PRODUCT OVERVIEW OVERVIEW OTP

MICROCONTROLLER BASED BOOST PID MUNAJAH BINTI MOHD RUBAEE

EIE/ENE 334 Microprocessors

Using the HT66F016L and the HT66F50 to Implement Remote Encoding and Decoding

Brushed DC Motor Control. Module with CAN (MDL-BDC24)

PLC-K506 Series FEATURES DESCRIPTION FEATURES

Physics 335 Lab 7 - Microcontroller PWM Waveform Generation

Study of M.A.R.S. (Multifunctional Aero-drone for Remote Surveillance)

Logistics. Kinetic Art. Embedded Systems. Embedded Systems and Kinetic Art. Jim Campbell s Algorithm

Embedded Systems and Kinetic Art. CS5968: Erik Brunvand School of Computing. Art4455: Paul Stout Department of Art and Art History.

Ocean Controls KT-5198 Dual Bidirectional DC Motor Speed Controller

Based on the ARM and PID Control Free Pendulum Balance System

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

AN INNOVATIVE METHOD FOR LOW-EMI PWM GENERATION IN INVERTERS

Application Note Using MagAlpha Devices to Replace Optical Encoders

CD4541BC Programmable Timer

Development of a Robotic Vehicle and Implementation of a Control Strategy for Gesture Recognition through Leap Motion device

GF of 9 THE GADGET FREAK FILES CASE #165. Analog Clock Measures Time in Meters

AERO2705 Space Engineering 1 Week 7 The University of Sydney

EMBEDDED BOOST CONVERTER USING VOLTAGE FEEDBACK TECHNIQUE

INF8574 GENERAL DESCRIPTION

EE445L Fall 2011 Quiz 2A Page 1 of 6


HOME AUTOMATION WITH SPY ROBOT AND SECURITY SYSTEM

Transcription:

U.P.B. Sci. Bull., Series C, Vol. 80, Iss. 2, 2018 ISSN 2286-3540 DESIGNING A POSITION REGULATOR FOR AN ACTUATOR POWERED BY A CONTINUOUS CURRENT MOTOR USING THE PIC16F73 MICROCONTROLLER Monica-Anca CHITA 1, Paul SCHIOPU 2 The paper presents the design of a position regulator for an actuator powered by a continuous current motor using the PIC16F73 microcontroller. The system contains the electric drive motor, transducer (an incremental encoder), an impulse counter, the processor, the digital-to-analog converter, and the power amplifier. The novelty is represented by the usage of the PIC16F73 microcontroller to design the position controller for an actuator powered by a DC motor, and the usage of the HS oscillator when designing. Computer interfacing was performed in a Java development environment. Keywords: the PIC16F73 microcontroller; the HS oscillator; the PWM (Pulse Width Modulation) module, position controller for a DC motor 1. Introduction Advanced automation and miniaturization, available nowadays in all areas of engineering, require the continued development of a variety of safe and compact drives within the structure of modern systems. Actuators are controllable execution elements that transform the input energy (electrical, magnetic, thermal, optical or chemical) into mechanical work. The conversion of the input energy into the useful output energy is achieved by means of magnetic fields, due to physical phenomena: the piezoelectric phenomenon, the magneto-strictive phenomenon, the memory storage phenomenon due to the expansion of the bodies to the temperature increase, the phase changes, the electro-rheological, electro-hydrodynamic, diamagnetic effect. The actuator mechanism transforms, amplifies and transmits the movement by agreeing with parameters specific to the technological purpose. Generally, actuator means a subassembly that converts a form of energy (electrical, pneumatic, thermal, chemical, etc.) into mechanical energy. Its structure can no longer be broken down into sub-structures except at the risk of 1 Assoc Prof., Dept. of Electronics, Computers Science and Electrical Engineering, University of Pitesti, Romania, e-mail: chita_monica@yahoo.com 2 Prof., Dept. of Dept.of Electronics Technology and Reliability, University POLITEHNICA of Bucharest, Romania, e-mail: paul.schiopu@yahoo.com

134 Monica-Anca Chita, Paul Schiopu losing its capacity to generate motion. The overall structure of an actuator is shown in Fig. 1. 2. Block diagram of the system Fig. 1 Structura generală a unui actuator The block diagram of the system is shown in Fig. 2. Fig.2 Block diagram of modern digital system: D / A - digital-analog converter; A - Power Amplifier; T - transducer; M - DC motor The system contains the electric drive motor, the transducer (an incremental encoder), the impulse counter, the processor, the digital-to-analog converter, and the power amplifier. Pulse Width Modulation (PWM) output, i.e. pulse duration modulation, of the microcontroller may be a signal that carries both the PWM information and the steering signal, or a single signal containing only the PWM information. In the first case, a PWM signal fill factor, that is equal to 50%, will produce a zero voltage at the output (the voltage at the motor terminals will be zero), a 0% fill factor will provide a maximum negative voltage at the output and for a 100% fill factor, and a maximum positive voltage will be obtained. In the second case, a PWM signal fill factor equal to 50% will produce a U/2 voltage at the output, a 0% fill factor will provide a zero voltage at the output, and for a 100% fill factor, a positive maximum voltage (U) will be obtained.

Designing a position regulator for an actuator powered by a continuous current motor using 135 The encoder used (fig. 3) is directly integrated into the motor, it is of the incremental type in quadrature (it presents the signal A and B, B being 90 degrees ahead or back depending on the directifigureon of rotation) with 282 pulses per revolution. If it is used for triggering both signal A and signal B obtain a resolution of 564 pulses per revolution, i.e. 360/564 = 0.6383 degrees. Fig.3 Example of encoder used The controller works only in automatic mode, the adjustment function is of the PI type with the band of proportionality, integration time, and sampling time established by MatLAB simulations, with small adjustments on the real model. 3. The designing of the digital part of the circuit and the low power part 3.1 Presentation of the PIC16F73 microcotroller The chosen microcontroller has the following features that have led to its choice: CPU RISC (Reduced Instruction Set Computing), i.e. it has a small set of instructions that allows it to work faster than an extended set controller; 35 singleword instructions; all instructions are executed in a single cycle, except those that cause leaps; operating frequency: 20MHz, 200ns / instruction; 8K x 14-bit FLASH memory RAM memory 368 x 8 bits; EEPROM memory 256 x 8 bits; maximum 14 sources of masked interruptions; 8-level hardware stack; direct, indirect and relative addressing modes; supply voltage from 2.0V to 5.5V; current debited / absorbed by 25mA / pin; low power consumption below 0.6mW at 3V and 4MHz; two timers, of which 8-bit TIMER0, 16-bit TIMER1, 8-bit TIMER2, each with a special function, two PWM outputs; A 10-bit A / D converter built-in RS232 serial port; DIP28 (Dual Inline Plastic, 40 pins) capsule. 3.2 Microcontroller power supply Generally, correct power supply is of utmost importance for the correct operation of the microcontroller system. For proper operation of any microcontroller, it is necessary to provide a stable power supply, a safe reset when you turn it on and an oscillator.

136 Monica-Anca Chita, Paul Schiopu 3.3 Choosing the type of oscillator The PIC16F73 can work with four different oscillator configurations. Because the crystal oscillator and resistor-capacitor (RC) configurations are the ones most commonly used, it is only them to be mentioned here. The HS oscillator The operating frequency of the 20MHz crystal oscillator (maximum catalogue frequency) was chosen. To design the oscillator, a ceramic capacitor of 22pF is required with the other end to the ground to be connected to each pin, as in fig. 4. Fig. 4 Designing the HS Oscillator 3.4 The Reset The reset is used to set the microcontroller in a 'known' condition. This basically means that the microcontroller may behave incorrectly under some undesirable conditions. To continue working properly, it must be reset, meaning all registers will be set in a start-up status. To prevent a logic zero from reaching the MCLR pin accidentally (the above line means that the reset is enabled by a logic zero), the MCLR must be connected via a resistor to the positive pole of the power supply. The resistor should be between 5 and 10k (Fig. 5). The PIC16F73 microcontroller has several reset sources: reset to power, POR (Power-On Reset); reset during normal work by bringing a logical zero to the MCLR pin of the microcontroller; reset during SLEEP mode; reset to the watchdog timer (WDT) exceeding; reset during WDT exceeding during SLEEP mode. Fig.5 Example of reset to PIC 16F877 microcontroller

Designing a position regulator for an actuator powered by a continuous current motor using 137 The most important reset resources are a) and b). The first occurs every time the microcontroller is powered and serves to bring all of the registers to the initial start position. The second is to bring a logical zero to the MCLR pin during the normal operation of the microcontroller. It is often used in program development. 3.5 Serial communication SCI is an abbreviation for the Serial Communication Interface, and as a special subsystem, it is available for the majority of microcontrollers. At the PIC16F877 microcontroller this is hardware made. Fig. 6 Example of SCI designing at the PIC16F877 microcontroller In the case of hardware communication, we use the standard NRZ (Non Return to Zero) format known as 8 (9) -N-1 or 8 or 9 bits of data, without parity and with a stop bit. The free line is defined as the one logical status. Beginning of the transmission - The Start Bit has a logical zero status. After the data bits following the start bit (the first bit is the least significant bit) there follows a Stop Bit that has logical one status. The length of the stop bit, T, depends on the transmission speed and it is adjusted according to the transmission needs. For a transmission speed of 9600 baud, T is 104us. To connect a microcontroller to a serial port on a PC, we need to adjust the signal level for the communication to take place. The signal level at a PC is -10V for logic zero and +10V for logic one. Because the signal level at a microcontroller is + 5V for logic one and 0V for logic zero, we need an intermediate stage to convert the levels. A specially designed integration for this task is MAX232. The diagram of the interface is detailed in fig. 7.

138 Monica-Anca Chita, Paul Schiopu Fig. 7 Interfacing the microcontroller with the computer 3.6 The PWM mode 3.6.1 Calculating the minimum frequency of the PWM signal The choice of the PWM signal frequency is made taking into account the L electric time constant of the motor =. The calculation of the minimum R frequency of the PWM signal is done at a filling factor of 0.5, as it follows in Fig. 8: Fig. 8 The minimum frequency of the PWM signal is calculated at a fill factor of 0.5 At the time T = T/2 the current i1 must not have a ripple greater than P% than at the time t = 0 (i0). This results in the following condition: P i1. = 1. i0 (3.1) 100

Designing a position regulator for an actuator powered by a continuous current motor using 139 t tr L i = I e = I e (3.2) so for the fill factor of 0.5 it results: tr tr P 0 P 2L P L L I e = (1 ) Ie e = 1 T = ln(1 ) or 100 100 R 100 R f = (3.3) P 2l ln 1 100 For the parameters of the used motor (R = 1.8Ω and L = 8.5mH) and a 5% P ripple, the minimum frequency f = 6.89 khz is obtained. It was chosen the frequency of 19.53 khz (maximum frequency of the PWM signag / 10-bit signal that can be obtained with the PIC16F877 microcontroller with the 20MHz clock) resulting in a 2% ripple at a fill factor of 0.5. 3.6.2 Programming the microcontroller for the given PWM frequency In the Pulse Width Modulation - PWM - mode, the CCP1 pin produces a PWM output with a resolution of up to 10 bits. The simplified scheme of this module is illustrated in the figure below. Fig. 9 The simplified scheme of the PWM module The PWM output has a time base (period) and a fill factor, the period can be calculated with the relation: period ( PR2) + 1 4 T ( TMR ) PWM = 2 (3.4) OSC prescalervalue The frequency FPWM of 19.53 khz was chosen, that is equal to the maximum frequency for this resolution, resulting in the following values: TMR2prescaler = 1 and PR2 register = 0xFFh;

140 Monica-Anca Chita, Paul Schiopu To program the module, follow these steps: the PWM period is determined by entering the calculated value (0xFFh) in the PR2 register; the Duty Cycle PWM (filling factor) is set by writing the desired value in CCPR1L registers (bits 0:7 duty) and CCP1CON bits 4 and 5 (bits 8: 9 duty); et the CCP1 pin as output, resetting bit TRISC.2; set the TMR2prescaler; the CCP1 module is configured in the PWM mode (write the bits 3:0 of the CCP1CON register with the value 11xx). The wiring diagram resulting following the design is shown in Fig. 10. G PID Fig. 10 The wiring diagram resulting following the design 3.7 Making the software 3.7.1 Designing the PID regulator The PID continuous setting function is given by the 3.6 formula: ( s) = K P K + S 1 + K D S G PID ( z) = K P K1 Te + 2 z z + 1 + K 1 D 2 T e z 1 z + 1 (3.6) 2 z 1 s = Te z + 1 for example, for KP = 100, KI = 200, KD = 10, Te = 0.002, the following unstable response of the system results, by processing in MatLAB:

Designing a position regulator for an actuator powered by a continuous current motor using 141 Fig. 11 Unit response level with PID adjustme The program was written in C and compiled with compiler Boost C. Computer interfacing was performed in a Java development environment, as it can be seen in Fig. 12: Fig. 12 Computer interfacing was performed in a Java development environment

142 Monica-Anca Chita, Paul Schiopu Fig.13 The main program

Designing a position regulator for an actuator powered by a continuous current motor using 143 Fig. 14 Data initiation Fig. 15 Interruption routine INT0. Fig. 16 Interruption routine TMR

144 Monica-Anca Chita, Paul Schiopu 4. Conclusions The implementation of a position control system of a DC motor actuator with the help of microcontrollers allows for the adjustment of the position in a wide range of values, working at high frequencies, implementation of robust, stable positioning with an error of less than 1%. The control system ensures high energy efficiency and a relatively low cost of the entire system, with practical implementation requiring a minimum of components. Programming the PIC16F73 microcontroller by the user opens up numerous possibilities for adjusting the actuator position according to the inventiveness of each person implementing it. R E F E R E N C E S [1]. M.A. Chita, Senzori și actuatoare (Sensors and actuators), Editura MarixROM, București, 2017. [2]. Ioan Ciascai, Aplicații industriale cu microcontrolere (Industrial applications with microcontrolers), Ability Thesis, Universitatea Tehnică din Cluj Napoca, 2015. [3] V. Bande,S. Pop, I. Ciascai,and D. Pitica "Real-time sensor acquisition interfacing using MatLAB,, The 18th International Symposium for Design and Technology in Electronic Packaging (SIITME), October 2012, pg.189-192. [4]. S.K.Peddapelli, Pulse Width Modulation:Analysis and Performance in Multilevel Inverter, Walter de Gruyter GmbH & Co KG Edition, 2017. [5]. E. Monmasson, Power Electronic Converters: PWM Strategies and Current Control Technique, Willey Edition,2013. [6]. *** Data Sheet PIC16F73 microcontroller, 2017.