Open access peer-reviewed chapter

Start-Up of a PID Fuzzy Logic-Embedded Control System for the Speed of a DC Motor Using LabVIEW

By Ruthber Rodriguez Serrezuela, Jorge Luis Aroca Trujillo, Roberto Sagaro Zamora and Vadim Azhmyakov

Submitted: February 2nd 2018Reviewed: March 10th 2018Published: November 5th 2018

DOI: 10.5772/intechopen.76364

Downloaded: 756


This work explains the speed control design for a DC motor using fuzzy logic with LabVIEW software. It is also a literature review about the design and the implementation environment and is presented using fuzzy logic to describe the materials and methods used. Various processes on the subject highlight the idea, creation, development, and implementation of intelligent control, and the results considering the application and development for this purpose are presented.


  • fuzzy logic
  • LabVIEW
  • rules
  • industrial applications

1. Introduction

In the last decade, the use of various control techniques such as hybrid [1, 2] or artificial intelligence has grown exponentially in the fields of power electronics, control systems, and positioning systems. To carry out these development methods, a large database and understanding of control methods are necessary to describe the analysis system to facilitate decision-making. One of these methods is fuzzy logic [3, 4], which is necessary to realize improvements over classical logic and is basically a statement that can be understood as a logical value of 1 or 0.

In the control field, specifically in the DC motor, control can be applied by intelligent control techniques such as fuzzy logic, which is further applied in parallel with conventional control techniques. In fuzzy logic there are two well-known algorithms: logarithm Mamdani and Takagi Sugeno; these are useful in applications such as microelectronics and power electronics [5, 6].

Since it is a more compact and computationally efficient representation than a Mamdani system, the Sugeno system lends itself to the use of adaptive techniques for constructing fuzzy models [7, 8]. These adaptive techniques can be used to customize the membership functions so that the fuzzy system models the data with a significant improvement [9, 10].


2. Materials and methods

2.1. Process description

The device on which the fuzzy logic control will be applied is a 12 V DC motor as shown in Figure 1.

Figure 1.

12 V DC motor.

The block diagram of Figure 2 shows the control process. In the first stage, the input is the setpoint or reference rate to be applied to the motor. Next is the analog-digital converter, which is distinguished as a data acquisition card. The second stage is the fuzzy logic control developed in LabVIEW. The data acquisition card is used once again since this should act as both analog-digital converter at the input and digital-analog converter at the output. Hereafter, the analog signal passes through the actuator block, which is H-bridge pulse-width modulation (PWM) modified to the motor speed [11]. The next block in the plant is the DC motor. The tachometer, which is built into the DC motor, is a feedback system that checks whether the engine speed has altered and eliminates unwanted phenomena.

Figure 2.

Process control (closed loop).

LabVIEW [12] (Figure 3) is the software used to develop the controller through its fuzzy logic blocks. To facilitate programming the LabVIEW toolbox contains toolkits. This software is mainly used for data acquisition, mathematical analysis, instrument control, and controller design. In 2008 the software was used to control the Large Hadron Collider [13], a particle accelerator designed by about 2000 scientists from 34 countries around the world. This appliance is the largest of its kind and is located near Geneva.

Figure 3.

LabVIEW software programming.

To interact with LabVIEW, the user needs a data acquisition card, e.g., a National Instruments NI myDAQ (Figure 4). The function of the data acquisition card is to collect physical signals during the process and transform them into electrical voltages that are subsequently scanned on a PC and can be processed. To make the transformation to a digital signal the card is needed at the adaptation stage [14–16]

Figure 4.

Data acquisition card.

Within the data acquisition process is the transducer, which is an element that converts the physical quantity to be measured into an output signal, usually a voltage or current that is then processed on a PC or other system.

Signal conditioning is the stage that is responsible for filtering and adapting the outgoing signal transducer, which is then sent to the analog-digital converter, which as we know is the stage responsible for converting an analog signal to the digital output stage to connect the data acquisition system to a PC (Figure 5).

Figure 5.

NI MyDAQ components may be changed or substituted without notice.

In the initial window for the design of a new fuzzy controller, data such as name, designer name, date, and time are observed for the project. In the window in Figure 6, the fuzzy set editor and its consequences are introduced.

Figure 6.

Main window to start a new fuzzy controller in LabVIEW.

The input and output linguistic variables and their ranges are entered functionally. This takes into account the fuzzy set editor, which starts with a default configuration. The advantage over a conventional proportional-integral-derivative (PID) controller is that a fuzzy PD (proportional and derivative) controller can implement nonlinear control strategies, which uses linguistic rules. The rules evaluate the difference between the measured value and the set value, the error signal, and the tendency of the error signal to determine whether to increment or decrement the control variable (Figure 7).

Figure 7.

Fuzzy default settings set editor.

By deploying the box, it is necessary the input linguistic variables, where each one contains the following linguistic terms: NEx (term negative), ZOx (zero), POx (term positive), default data range is −1 to 1, variable name default: INX with x = 1, …, 4 (Figure 8).

Figure 8.

Input linguistic variables.

The result is output linguistic variables, which contain the following linguistic terms: NEo (term negative), ZOo (zero) and POo (term positive), default data range is from −1 to 1, variable name default: Output (Figure 9).

Figure 9.

Output linguistic variables.

The interference method, the method of defuzzification and output default configuration, is determined because of the rule editor (Figure 10).

Figure 10.

Rule editor.

The block features input and output characteristics that simulate the controller and graphically display the output behavior regarding parameter rules in the rule editor (Figure 11).

Figure 11.

Input and output characteristics.

At the end of this process, the fuzzy controller with all the information on the rules, which is observed in the graphical environment of LabVIEW as a block, is obtained (Figure 12).

Figure 12.

Fuzzy controller in LabVIEW graphical interface.

Pulse width modulation (PWM) is a process in which the duty cycle of a periodic signal, possibly to transmit information, is modified through a communications channel or to control the amount of power sent to a load (Figure 13).

Figure 13.

PWM output in LabVIEW.

The H-bridge implemented for controlling the DC motor is an LMD18200 [5], which is constructed with bipolar circuitry control complementary metal-oxide-semiconductor (CMOS) field-effect devices and a double-diffused metal-oxide-semiconductor (DMOS), and accommodates a peak output up to 6 A (Figure 14).

Figure 14.

Datasheet for an LM18200T H-bridge.

Feedback should be between 0 and 5 V as it is the voltage that supports the data acquisition card; a tachometer generates voltages from 0 to 12 V. This does not serve as an input to the program, thus it designs and implements an actuator to condition the signal, taking into account that the behavior guarantees a range between 0 and 5 V, which is the optimal voltage for scanning the signal (Figures 15 and 16).

Figure 15.

Design of the transducer in PROTEUS software.

Figure 16.

Card and bridge transducer circuit H.

Figure 17 shows the blocks of indicators and controls, such as the while loop; all the blocks work in a continuous cycle. The DAQ Assistant Express VI block communicates with the data acquisition card, the Merge Signals Function is the graphic indicator that shows the sign of the setpoint (red) control signal (green) and engine response (blue), and shift registers and the Feedback Node in loops are used to calculate the change of error. Time Domain Math Express VI is used to perform mathematical operations in time, in this case the change will be integrated with PWM and the output will be obtained from the desired range. The strip path function maintains the file path generated by the designer extension. Simulate Signal Express VI simulates square waves for PWM, the fuzzy logic controller, the controller, and the load fuzzy setpoint [7, 17].

Figure 17.

Block diagram for a DC motor controller in LabVIEW.

A while loop encloses the set of all blocks, which is responsible for implementing everything inside continuously [18, 19].

Figure 18 is the front panel view, which is where the user runs the program, the results are seen graphically, and the values are obtained after the control action [20, 21].

Figure 18.

Front panel for a DC motor controller in LabVIEW.

3. Results and discussion

At the time of connecting the entire set of devices such as the engine, transducer, font, procuring card data, and PC, configuration of the H-bridge pins and motor feedback are taken into account. After verifying that the assembly has the correct speed, control is executed in LabVIEW and the system is energized.

Within the controller, a value of 1600 RPM is entered to start the control engine speed, and on the graphic belonging to the GUI LabVIEW variation, PWM is observed in terms of engine speed in RPM. These results can be compared with a classic PID control showing that our fuzzy logic controller meets the design requirements. Achieving error values of 3% is acceptable in a practical manner (Figures 19 and 20).

Figure 19.

Front panel showing the resulting graph of the fuzzy controller.

Figure 20.

Diffuse logic PID control response at different engine speeds in RPM.

4. Conclusion

The foregoing is accomplished by designing a control system to understand alternative control applications that can used, for example, in an industrial sector. It is noted that fuzzy logic is a fast, solid, and robust control method for a system that is affected by constant instabilities, which in this case could be disturbances affecting a DC motor by applying opposing forces or weights within its axis rotation.

Fuzzy logic is a method of computing based on decision-making and is used for expert systems and process control. Fuzzy logic differs from traditional Boolean logic in that fuzzy logic allows for partial membership in a set. The great advantages and possibilities offered by the LabVIEW software for these applications are also stressed.

To implement real-time decision making or control of a physical system, data acquired by an A/D Converter must be obtained from a fuzzy controller. Which after making the corresponding interpretation of the linguistic rules and the corresponding defusification leaves the diffuse logic controller by means of a D/A Converter with DAQ analog output hardware to implement real-time process control.

Conflict of interest

The authors declare that there is no conflict of interest regarding the publication of this chapter.

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Ruthber Rodriguez Serrezuela, Jorge Luis Aroca Trujillo, Roberto Sagaro Zamora and Vadim Azhmyakov (November 5th 2018). Start-Up of a PID Fuzzy Logic-Embedded Control System for the Speed of a DC Motor Using LabVIEW, Electric Machines for Smart Grids Applications - Design, Simulation and Control, Adel El-Shahat, IntechOpen, DOI: 10.5772/intechopen.76364. Available from:

chapter statistics

756total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Advanced Control of the Permanent Magnet Synchronous Motor

By Marian Găiceanu

Related Book

First chapter

Introductory Chapter: Recent Advances

By Adel El-Shahat

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us