Академический Документы
Профессиональный Документы
Культура Документы
Abstract—This contribution describes three procedures registers (ex. Timer Registers, Timer Counter / Control
and the related software operations which are used to Registers, Output Compare Registers) [4], [8], [9], [10].
obtain the pulse-width modulation (PWM) signal for Modifying the values of the PWM registers is leading to
industrial use. The hardware platforms used to generate modifications such as:
the signals are embedded systems, manufactured in recent • Frequency of a PWM signal;
years. Three types of microcontrollers based on their
register architecture were used: 8-bit ATMEGA 328P, 16- • The duty-cycle value;
bit SAB80C167 and 32-bit PIC32MX320F128H. PWM is a • The type of the PWM generation mode (ex. Fast
preferred way for control in modern semiconductor PWM, Phase-Correct PWM);
devices. The very short rising and falling time ensure the
minimum of switching transition time respectively of the • The pre-scale factor value (ex. 1:1, 1:8, 1:256 and so
switching losses. In this context, the paper will analyze on);
comparatively a new structure, related on a classical • The bit length of the timers (ex. 8 bits timers, 16 bits
reference structure, both the hardware and the software. timers, 32 bits timers);
At the end of the paper some conclusions might be drawn
on the code length, system latency and the technical • The bit length of the PWM frequency range (ex. 10 bit
limitations of their usual or rated performance. PWM, 11 bit PWM and so on).
In this context the present paper is aimed to describe the
Keywords—PWM; microcontroller; signal; software; generate; process of generating some PWM signals and analyzing few
timer; embedded; system; register aspects like:
• Differences in using various microcontroller register
I. INTRODUCTION architectures (8 bits, 16 bits and 32 bits);
In the context of increasingly industrialization and • The ease of access for generating the PWM signals by
automation, the need of intelligent devices capable of driving accessing the PWM registers;
and controlling a wide range of electrical and electro-
mechanical devices becomes a great challenge [1], [2]. • Boot-up / reset timings until the PWM signal
generation is active (depends on the values of R and C
Any modern factory or facility is full of all types of of the reset mechanism);
intelligent machines (ex. mobile robots, robotic arms and so
on). These machines or special devices may contain one or • Amplitude spectrum analysis for the PWM signals
more microcontrollers / microprocessors capable of controlling and highlighting the presence of parasite signals /
them. noise (rectangular FFT generated by a digital
phosphor oscilloscope);
Different types of AC motors, DC motors (servo-motors,
stepper-motors and so on), switching-on power supplies, power • Source-code involved in the process of generating the
amplifiers (especially class D power amplifiers) use the PWM PWM signals [1], [2], [3], [4].
signal to be controlled. These PWM signals are usually
generated by special microcontrollers [3], [4], [5], [6], [7]. In the experiments were used three different frequencies
and two different duty-cycle values (Frequencies: 500 Hz, 1
There are many types of microcontrollers with a wide range KHz, 2 KHz; Duty-cycle values: 50%, 90%) [10].
of features. One of these features is the PWM function on one
or more digital pins. The end-user is able to manipulate the Three types of microcontrollers have also been used: 8-bit
characteristics of a PWM signal by accessing the special PWM ATMEGA 328P; 16-bit SIEMENS SAB80C167, 32-bit
PIC32MX320F128H.
Fig. 9 The binary sketch size is displayed after compiling the source-code of a
PWM program for the ATMEGA 328P microcontroller
Fig. 10 The binary sketch size is displayed after compiling the source-code of a
PWM program for the PIC32MX320F128H microcontroller
Fig. 8 C / C++ Source-code for generating a PWM signal of 500 Hz frequency
and 50% duty-cycle using the 8-bit ATMEGA 328P microcontroller Even if each microcontroller used in the experiments is
generating the same types of PWM signals, the final binary
Fig. 14 The time delay (4.93 seconds) for a PWM signal to be active, from the
moment when a reboot / reset command is initiated till the moment the
microcontroller is active (PIC32MX320F128H)
REFERENCES
[1] C.H. Hsieh and J.H. Chou, “Analysis and optimal control of pulse width
modulation feedback systems”, Journal of Systems and Control
Engineering, 2004, pp. 218-277.
[2] M. Taghizadeh, A. Ghaffari, F. Najafia, “Improving dynamic
Fig. 15 The time delay (1.99 seconds) for a PWM signal to be active, from the
moment when a reboot / reset command is initiated till the moment the performances of PWM-driven servo-pneumatic systems via a novel
microcontroller is active (ATMEGA 328P) pneumatic circuit”, ISA Transactions, Volume 48, Issue 4, October
2009, Pages 512–518.
[3] M. Nor Rudzuana, D. Hazryb, W.A.N. Khairunizamc, A.B. Shahrimanc,
Excluding the manual reboot, another automatic reboot M. Saifizia, M. Nasir Ayoba, “Differential Steering Control for an
possibility is when a software failure / error occurs, or when a Autonomous Mobile Robot: A Preliminary Experimental Study”,
International Symposium on Robotics and Intelligent Sensors 2012
some sort of short-circuit happens. (IRIS 2012), Procedia Engineering, Volume 41, 2012, pp. 189–195.
If a reboot occurs and depending on the industry process [4] N. Saad, M. Arrofiq, “A PLC-based modified-fuzzy controller for
architecture / structure, the initializing time (few seconds) of PWM-driven induction motor drive with constant V/Hz ratio control”,
Robotics and Computer-Integrated Manufacturing, Elsevier, Volume 28,
the microcontrollers could destabilize the processes which they Issue 2, April 2012, Pages 95–112.
are controlling. The values of the reset capacitors should be [5] M. Z. Ghazalia, N. M. Noora, N. Ramlya, S. Putit, “Development of
chosen carefully (lower values were possible) in order to Microcontroller Based Mobile Gas Sensing Robot”, International
reduce as much as possible all time delays in the reset process. Symposium on Robotics and Intelligent Sensors 2012 (IRIS 2012),
Some special industry processes might request PWM signals Procedia Engineering, Volume 41, 2012, Pages 1190–1196.
with very less noise. Noise-free PWM signals are difficult to be [6] Ch. K. Volosa, I. M. Kyprianidisb, I. N. Stouboulosb, “Experimental
produced [9], [10]. investigation on coverage performance of a chaotic autonomous mobile
robot”, Robotics and Autonomous Systems, Elsevier, Volume 61, Issue
In the present experiments all the generated signals have 12, December 2013, Pages 1314–1322.
some noise (parasite frequencies), which in some types of [7] E. F.Vasca, L. Iannelli, “Dynamics and control of switched Electronic
process control might be a problem. Parasite signals (noise) Systems. Advanced Perspectives for Modeling, Simulation and control
of power converters.”, Publisher: Springer 2012, ISBN. 978-1-4471-
could be introduced by oscilloscope probes, or by cables, or by 2884-7.
faulty wire contacts, environmental parameters, etcetera [4], [8] A. Katalin, “Microcontroller based system for vibration analysis”, IEEE
[5], [6], [7], [8]. International Conference on Automation, Quality and Testing, Robotics
(AQTR), 22-25 May 2008, pp. 171 – 174, Volume 2, Print ISBN: 978-1-
4244-2576-1, Digital Object Identifier : 10.1109/AQTR.2008.4588815.
IV. CONCLUSIONS AND FUTURE WORK
[9] C. Rusu, I. Birou, E. Szoke, “Model based design controller for the
The purpose of the this paper was to present three stepper motor”, IEEE International Conference on Automation, Quality
procedures and the related software operations which are used and Testing, Robotics (AQTR), 22-25 May 2008, pp. 175 – 179, Print
ISBN: 978-1-4244-2576-1, Digital Object Identifier :
to obtain the pulse-width modulation (PWM) signal for 10.1109/AQTR.2008.4588816.
industrial use by using three different microcontrollers.
[10] K. Agoston, C. Nagy, “Data acquisition for angular measuring and
Each PWM generation procedure is simple and 100% safe, positioning system”, IEEE International Conference on Automation,
Quality and Testing, Robotics (AQTR), 24-27 May 2012, pp. 175 – 178,
so the main goal of the paper was achieved. Depending on the Print ISBN: 978-1-4673-0701-7, Digital Object Identifier :
10.1109/AQTR.2012.6237698.