Design of Three-Term Controller Using a PIC18F452 Microcontroller

*Mostefa Ghassoul*

## **Abstract**

Microcontrollers are used in almost any applications that come across one's mind, from small control applications such as home appliances to aerospace. Microcontroller-based controllers are cost-effective and flexible to modify the design to meet the requirement for any control of any industrial plant. Microcontrollers do not require external hardware interface, memories, counter/timers, and ADCs, because they are all integrated inside the chip. Those controllers could be programmed online and do not require any backup memories except for big applications. This chapter presents the implementation of the three-term PID controller using a Microchip PIC18F452 microcontroller. To read data into the controller, a 10-bit integrated ADC is used; and to read data out of the machine, an external 12-bit serial DAC is used. Before programming the PIC microcontroller, the task to be tested could be off-line using a software simulator to make sure that it is working according. When that is the case, it could be then fired into the controller on-line in a mater seconds. Not only that, if the user decides to use different algorithm, he only programs the controller again online.

**Keywords:** PIC microcontroller, PID, timer, Digital to analog converter, serial digital to converter, liquid crystal display

## **1. Introduction**

The PID (Proportional Integral Differential) algorithm is the most popular feedback controller used within the process industries. It has been successfully used for over 50 years. It is a robust easily understood algorithm that can provide excellent control performance despite the varied dynamic characteristics of process plant. It is designed to generate an output that causes some corrective effort to be applied to a process so as to drive a measurable process variable towards a desired value, known as the set point. The concept is based (as shown in **Figure 1**) on the re-input of the system own output according to certain laws (hence the name "feedback"). It is desired for the system output to follow the set point. All feedback controllers determine their output by observing the difference, called error, between the set point and the actual process variable measurement. The PID looks at (a) the current value of the error, (b) the integral of the error over a recent time interval, and (c) the current derivative of the error signal to determine not only how much of a correction to apply, but for how long. Each of those three quantities are multiplied by a (tuning constant) and added together. Thus the PID output is a weighted sum. Depending on the application one may want a faster convergence speed or a lower overshoot. By adjusting the weighting constants, Kp, Ki, and Kd, the PID is set to give the most desired performance.

## *Renewable Energy - Technologies and Applications*

As a result of enormous development in microcomputer technology, analog controllers have been replaced by digital controllers either in small or large industry. It is now a common practice to implement PID controllers in its digital version, which means that they operate in discrete time domain and deal with analog signals quantized in a limited number of levels. The trend toward digital rather than analog control is mainly due to: (1) versatility where programs can be easily modified or completely changed, (2) sophistication where advanced control laws could be implemented, (3) cost effectiveness where microcontrollers are available at very low costs compared to PLCs, industrial computers, RTUs or DCS. A typical digital feedback control system is shown in **Figure 2**. In digital feedback systems, the controller input and output are digital (sampled) rather than continuous signals. Thus, the continuous signal from the measurement device (sensor/transmitter) is sampled and converted periodically to a digital signal by an analog-to-digital converter (ADC). A digital control algorithm is then used to calculate the controller output as a digital signal. Because most final

control elements are analog devices, the digital output signal is usually converted to a

In feedback control, the objective is to reduce the error signal to zero where

where *e t*ð Þ = error signal, *ysp*ð Þ*t* = set point and *ym*ð Þ*t* = measured value of the controlled variable. For the PID controller, the three terms (proportional, integral, and derivative) are combined to minimize the error as much as possible. The most common combination of these three terms is in parallel as shown in **Figure 3**. The

> *τI* ð*t* 0

where *P*(*t*) *=* controller output; *P* = bias (steady-state) value; *KC* = controller

A straightforward way of deriving a digital version of the parallel form of the PID controller is to replace the integral and derivative terms by finite difference

*e t*ð Þ*dt* <sup>≈</sup> <sup>X</sup>

*dt* <sup>≈</sup> *ek* � *ek*�<sup>1</sup> *TS*

where *TS* = the sampling time (the time between successive measurements of the controlled variable); and *ek* = error at the *k*th sampling instant for *k* = 1, 2, 3, … There are two alternative forms of the digital PID control equation, the position form and the velocity form. Substituting Eqs. (3) and (4) into (2) gives the *position*

> *TS τI* X *k*

*j*¼1

where *Pk* is the controller output at the *K*th sampling instant. Eq. (5) is referred to as the position form of the PID control algorithm because the actual value of the

In the *velocity form*, the change in controller output is calculated. The velocity form can be derived by writing the position form of Eq. (5) for the (*k* � 1) sampling instant:

*j*¼1

*TS τI*

*ej* <sup>þ</sup> *<sup>τ</sup><sup>D</sup> TS*

*ek* <sup>þ</sup> *<sup>τ</sup><sup>D</sup> TS*

� � (7)

" #

*TS τI* X *k*�1

Note that the summation still begins at *j* = 1 because it is assumed that the process is at the desired steady state for *j* ≤ 0, and thus *ej* = 0 for *j* ≤ 0. Subtracting

Eq. (6) from (5) gives the velocity form of the digital PID algorithm:

*ej* <sup>þ</sup> *<sup>τ</sup><sup>D</sup> TS*

" #

ð Þ *ek* � *ek*�<sup>1</sup>

ð Þ *ek*�<sup>1</sup> � *ek*�<sup>2</sup>

ð Þ *ek* � 2*ek*�<sup>1</sup> þ *ek*�<sup>2</sup>

*k*

*j*¼1

*e t*ð Þ*dt* þ *τ<sup>D</sup>*

*e t*ðÞ¼ *ysp*ðÞ�*t ym*ð Þ*t* (1)

*de t*ð Þ *dt* � � (2)

*ejTS* (3)

(4)

(5)

(6)

corresponding analog signal by a digital-to-analog converter (DAC).

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

*P t*ðÞ¼ *<sup>P</sup>* <sup>þ</sup> *KC e t*ðÞþ <sup>1</sup>

ð*t* 0

*Pk* ¼ *P* þ *KC ek* þ

*Pk*�<sup>1</sup> ¼ *P* þ *KC ek*�<sup>1</sup> þ

Δ*Pk* ¼ *Pk* � *Pk*�<sup>1</sup> ¼ *KC* ð Þþ *ek* � *ek*�<sup>1</sup>

controller output is calculated [3, 4].

*de*

PID equation [1, 2] is given by:

approximations,

*form*:

**273**

gain; *τ<sup>I</sup>* = integral time; *τ<sup>D</sup>* = derivative time.

**Figure 1.**

*Typical closed loop control system.*

**Figure 2.**

*Digital closed loop based on a microcontroller.*

**Figure 3.** *The three-term PID controller.*

*Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

As a result of enormous development in microcomputer technology, analog controllers have been replaced by digital controllers either in small or large industry. It is now a common practice to implement PID controllers in its digital version, which means that they operate in discrete time domain and deal with analog signals quantized in a limited number of levels. The trend toward digital rather than analog control is mainly due to: (1) versatility where programs can be easily modified or completely changed, (2) sophistication where advanced control laws could be implemented, (3) cost effectiveness where microcontrollers are available at very low costs compared to PLCs, industrial computers, RTUs or DCS. A typical digital feedback control system is shown in **Figure 2**. In digital feedback systems, the controller input and output are digital (sampled) rather than continuous signals. Thus, the continuous signal from the measurement device (sensor/transmitter) is sampled and converted periodically to a digital signal by an analog-to-digital converter (ADC). A digital control algorithm is then used to calculate the controller output as a digital signal. Because most final

*Renewable Energy - Technologies and Applications*

**Figure 1.**

**Figure 2.**

**Figure 3.**

**272**

*The three-term PID controller.*

*Typical closed loop control system.*

*Digital closed loop based on a microcontroller.*

control elements are analog devices, the digital output signal is usually converted to a corresponding analog signal by a digital-to-analog converter (DAC).

In feedback control, the objective is to reduce the error signal to zero where

$$e(t) = \mathcal{y}\_{sp}(t) - \mathcal{y}\_m(t) \tag{1}$$

where *e t*ð Þ = error signal, *ysp*ð Þ*t* = set point and *ym*ð Þ*t* = measured value of the controlled variable. For the PID controller, the three terms (proportional, integral, and derivative) are combined to minimize the error as much as possible. The most common combination of these three terms is in parallel as shown in **Figure 3**. The PID equation [1, 2] is given by:

$$P(t) = \overline{P} + K\_C \left[ e(t) + \frac{1}{\tau\_I} \int\_0^t e(t)dt + \tau\_D \frac{de(t)}{dt} \right] \tag{2}$$

where *P*(*t*) *=* controller output; *P* = bias (steady-state) value; *KC* = controller gain; *τ<sup>I</sup>* = integral time; *τ<sup>D</sup>* = derivative time.

A straightforward way of deriving a digital version of the parallel form of the PID controller is to replace the integral and derivative terms by finite difference approximations,

$$\int\_{0}^{t} e(t)dt \approx \sum\_{j=1}^{k} e\_{j}T\_{S} \tag{3}$$

$$\frac{de}{dt} \approx \frac{e\_k - e\_{k-1}}{T\_S} \tag{4}$$

where *TS* = the sampling time (the time between successive measurements of the controlled variable); and *ek* = error at the *k*th sampling instant for *k* = 1, 2, 3, …

There are two alternative forms of the digital PID control equation, the position form and the velocity form. Substituting Eqs. (3) and (4) into (2) gives the *position form*:

$$P\_k = \overline{P} + K\_C \left[ e\_k + \frac{T\_S}{\tau\_I} \sum\_{j=1}^k e\_j + \frac{\tau\_D}{T\_S} (e\_k - e\_{k-1}) \right] \tag{5}$$

where *Pk* is the controller output at the *K*th sampling instant. Eq. (5) is referred to as the position form of the PID control algorithm because the actual value of the controller output is calculated [3, 4].

In the *velocity form*, the change in controller output is calculated. The velocity form can be derived by writing the position form of Eq. (5) for the (*k* � 1) sampling instant:

$$P\_{k-1} = \overline{P} + K\_C \left[ e\_{k-1} + \frac{T\_S}{\tau\_I} \sum\_{j=1}^{k-1} e\_j + \frac{\tau\_D}{T\_S} (e\_{k-1} - e\_{k-2}) \right] \tag{6}$$

Note that the summation still begins at *j* = 1 because it is assumed that the process is at the desired steady state for *j* ≤ 0, and thus *ej* = 0 for *j* ≤ 0. Subtracting Eq. (6) from (5) gives the velocity form of the digital PID algorithm:

$$
\Delta P\_k = P\_k - P\_{k-1} = K\_C \left[ (e\_k - e\_{k-1}) + \frac{T\_S}{\tau\_I} e\_k + \frac{\tau\_D}{T\_S} (e\_k - 2e\_{k-1} + e\_{k-2}) \right] \tag{7}
$$

$$P\_k = P\_{k-1} + K\_C \left[ (\varepsilon\_k - \varepsilon\_{k-1}) + \frac{T\_S}{\tau\_I} \varepsilon\_k + \frac{\tau\_D}{T\_S} (\varepsilon\_k - 2\varepsilon\_{k-1} + \varepsilon\_{k-2}) \right] \tag{8}$$

3.Flexible timer resources: four independent timers modules support timing measurements and output interval control with a timing resolution as fine as 0.1 μs. Those timers could be used to produce up to three pulse width

4.Free software tools: Microchip's Development Package MPLAB® (consisting of assembler, simulator, and user interface) as well as all manuals and application notes are available at no cost from their Web site (www.microchip.com).

5.Development tool versatility: it supports in-circuit debugger which permits the loading and execution of a user program as well as the use of breakpoints,

6.Build-in ADCs: it has analogue-to-digital converters with 10 bits resolution.

7.Built-in serial peripheral interface: it has a variety of serial bus interfaces like

8.C programmable: it could be programmed using C language with the use of a

The PIC18F452 microcontroller is a 40 or 44-pin depending on the package, where in the 40 pins configuration, a dual inline package is used; whereas in the 44 pins configuration, either thin quad flat package or dual flat no leads package is used. Its design is based on Harvard technology where the program and data have different buses. This type of microcontrollers is very cheap, small in size, and could be customized. It could be easily programmed on-line using either assembly language, BASIC or C language. In fact, it is ideal for small application such as the one in hand. The controller has a 24 kbytes of flash memory and 2048 bytes of SDRAM. It also has a 8 10 bits analog to digital channels. It also has 5 bidirectional digital ports with 33 inputs/outputs, configured as follows: 3 8 digital I/O ports (PORTB, PORTC and PORTD), one six digital I/O port (PORTA) and one three digital I/O port (PORTE). Unfortunately, one of the drawbacks of microcontrollers, it is very seldom to find one with a digital to analog converter. Luckily, they are few manufacturers around including microchip, which make serial DACs which could be programmed through Serial Port Interface (SPI) using only three wires. The PIC18F452 has four timer/counters which could be programmed either as 8 or 16 bit timers/counters. It also has two ports which could be configured either as capture, compare or pulse width modulation (PWM). It has two serial peripheral interfaces:

provided. For the microcontroller to output analogue data, an MCP4921 device is used. The device is a 12-bit buffered single voltage output Digital-to-Analog Converter (DAC). The device operates from a single 2.7 V to 5.5 V supply with an SPI compatible Serial Peripheral Interface. The user can configure the full-scale range of the device to be VREF or 2\*VREF by setting the gain selection option bit (gain of 1 of 2). The user can shut down the device by setting the Configuration Register bit. In Shutdown mode, most of the internal circuits are turned off for power savings, and the output amplifier is configured to present a known high resistance output load (500 kΩ, typical). The device includes double-buffered registers, allowing synchronous updates of the DAC output using the LDAC pin. The device also incorporates a Power-on Reset (POR) circuit to ensure reliable powerup. The device utilizes a resistive string architecture, with its inherent advantages of low Differential Non-Linearity (DNL) error and fast settling time. The device is specified over

C). An asynchronous port (USART) is also

modulations which could be used for electrical motor control.

memory/ register modification, and single stepping.

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

variety of built in C libraries developed by microchip.

USART, I2

C & SPI.

(SPI) and an inter-integrated circuit (I<sup>2</sup>

**275**

In this study, velocity form is chosen because of the following advantages:


## **2. PIC18F452 background**

As mentioned earlier, the implementation is based on a Microchip PIC18F452 microcontroller, where the controller plays the role of the brain of the control system [5]. The right choice of the microcontroller is essential, as it will be the core of the final design. The PIC18F452 from Microchip has been chosen for the following advantages:


The PIC18F452 microcontroller is a 40 or 44-pin depending on the package, where in the 40 pins configuration, a dual inline package is used; whereas in the 44 pins configuration, either thin quad flat package or dual flat no leads package is used. Its design is based on Harvard technology where the program and data have different buses. This type of microcontrollers is very cheap, small in size, and could be customized. It could be easily programmed on-line using either assembly language, BASIC or C language. In fact, it is ideal for small application such as the one in hand. The controller has a 24 kbytes of flash memory and 2048 bytes of SDRAM. It also has a 8 10 bits analog to digital channels. It also has 5 bidirectional digital ports with 33 inputs/outputs, configured as follows: 3 8 digital I/O ports (PORTB, PORTC and PORTD), one six digital I/O port (PORTA) and one three digital I/O port (PORTE). Unfortunately, one of the drawbacks of microcontrollers, it is very seldom to find one with a digital to analog converter. Luckily, they are few manufacturers around including microchip, which make serial DACs which could be programmed through Serial Port Interface (SPI) using only three wires. The PIC18F452 has four timer/counters which could be programmed either as 8 or 16 bit timers/counters. It also has two ports which could be configured either as capture, compare or pulse width modulation (PWM). It has two serial peripheral interfaces: (SPI) and an inter-integrated circuit (I<sup>2</sup> C). An asynchronous port (USART) is also provided. For the microcontroller to output analogue data, an MCP4921 device is used. The device is a 12-bit buffered single voltage output Digital-to-Analog Converter (DAC). The device operates from a single 2.7 V to 5.5 V supply with an SPI compatible Serial Peripheral Interface. The user can configure the full-scale range of the device to be VREF or 2\*VREF by setting the gain selection option bit (gain of 1 of 2). The user can shut down the device by setting the Configuration Register bit. In Shutdown mode, most of the internal circuits are turned off for power savings, and the output amplifier is configured to present a known high resistance output load (500 kΩ, typical). The device includes double-buffered registers, allowing synchronous updates of the DAC output using the LDAC pin. The device also incorporates a Power-on Reset (POR) circuit to ensure reliable powerup. The device utilizes a resistive string architecture, with its inherent advantages of low Differential Non-Linearity (DNL) error and fast settling time. The device is specified over

*Pk* ¼ *Pk*�<sup>1</sup> þ *KC* ð Þþ *ek* � *ek*�<sup>1</sup>

*Renewable Energy - Technologies and Applications*

control algorithms, which do not need initialization.

avoiding total loss of control of the process.

sampling period.

**2. PIC18F452 background**

ing advantages:

instruction.

**274**

*TS τI*

In this study, velocity form is chosen because of the following advantages:

1. It does not need initialization. The position form requires the initial value of the controller output *P*, which is not normally known in practice. For example, an operator keeps the control loop in the manual mode until a desired steady state operation has been reached. At this point the error is zero and the

position of the control valve would correspond to the *P* value. Therefore, if the operator would like to transfer the control from manual to automatic, he or she should enter in the position control algorithm the value of *P* which is not normally known. This difficulty can be bypassed with the velocity form of the

2. It is protected against integral windup. The integral mode of a controller causes its output to continue changing as long as there is a nonzero error. Often the errors cannot be eliminated quickly enough and given enough time they produce larger and larger values for the integral term, which in turn keeps increasing the control action until it is "saturated" (e.g., the valve completely opens or closes). This condition is called *integral windup.* Then, even if the error returns to zero, the control action will remain saturated. The position form with its continuous summation of errors will produce integral windup and special attention will be required. The velocity form, on the other hand, is protected from integral windup for the following reason: The control action changes continuously until it becomes saturated. But then as soon as the error changes sign, the control action can return within the control range in one

3. It protects the process against computer failure*.* With the velocity algorithm one can send out a signal which is used to drive an integrating amplifier or a stepper motor. These devices will retain the last calculated position of the control valve (or other final control element) in case the computer fails, thus

As mentioned earlier, the implementation is based on a Microchip PIC18F452 microcontroller, where the controller plays the role of the brain of the control system [5]. The right choice of the microcontroller is essential, as it will be the core of the final design. The PIC18F452 from Microchip has been chosen for the follow-

1.Speed: with its maximum internal clock rate of 20 MHz and its 16-bit-wide instruction bus, the CPU can execute most of its instructions at a single

2.Math support: unlike classical microprocessors, the controller in hand has got a hardware multiplier and divider for multiple-bytes, fixed-point numbers and

for floating-point numbers so multiplication is carried out in a single

machine cycle of four clocks which is equivalent to a 0.2 μs.

*ek* <sup>þ</sup> *<sup>τ</sup><sup>D</sup> TS*

ð Þ *ek* � 2*ek*�<sup>1</sup> þ *ek*�<sup>2</sup>

(8)

bit 13 : Output Gain Selection bit 1 = 1x (VOUT = VREF \* D/4096) 0 = 2x (VOUT = 2 \* VREF \* D/4096) bit 12 : Output Shutdown Control bit 1= Active mode operation. VOUT is available.

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

**3. Liquid crystal display (LCD)**

**4. System design**

are used as follows:

**277**

VOUT pin is connected to 500 kΩ (typical).

8 lines for the data bus (connected to port D) [7].

0 = Shutdown the device. Analog output is not available.

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

This module is designed to display the value of the temperature detected by the temperature sensor and to guide the user in changing the parameters of the controller. The LCD is a 16 2 alphanumeric display with the built-in Hitachi 44780 controller and LED backlighting. It works with an 8-bit data bus, which means it will require a total of 11 data lines. Three control lines (connected to port E) plus the

The system is design around a stand-alone PIC18F452 controller, where the measured variable (MV) is read through channel0 (pin 2). The MV is subtracted from the set point automatically by the controller. The error is treated by the PIC PID and produces a digital control variable. This control variable is outputted through PIC serial data output pin (SDO pin 24) together with serial clock pin (SCK pin 18) to synchronize the conversion process. For the conversion to take place, the serial DAC chip select (CS) has to be pulled low. The CS is connected to pin RC0. The positive reference voltage is connected to +5 V (pin 6) and the negative reference voltage (pin 7) is tied to zero volt. The analog output is read through pin8 (Vout). This voltage is small to drive an electric motor. This voltage is pulled up to +12 V through the non-inverting operational amplifier (LM358). The Darlington transistor 2SD1409 is used to bust the current. The motor is connected to the emitter follower so that the driving current is sufficient enough to drive the motor. Needless to say that the diode 1N4148 is used to protect the Darlington transistor against any spike due to the change of current. **Figure 6** shows the schematic of the system. The LCD is used to display the measured temperature. To manipulate the setting of different parameters, six push buttons

Six push buttons were used in the project to allow the user to change the setting

2. Stop: interrupt the program to allow the user to change the controller settings

and the controller parameters. Their functions are as follows:

4.Mode: To allow the user to change between setting modes.

5. Increment: To increment the controller variables by 1 or 0.1.

6.Decrement: To decrement the controller variables by 1 or 0.1.

1.Reset: To reset the microcontroller.

3.Run: To run the program

**Figure 4.** *MCP4921 pin configuration.*


#### **Figure 5.**

*Write command register for MCP4921 (12-bit DAC).*

the extended temperature range (+125°C). It provides high accuracy and low noise performance for consumer and industrial applications where calibration or compensation of signals (such as temperature, pressure and humidity) is required. The MCP4921 device is available in the PDIP, SOIC, MSOP and DFN packages. **Figure 4** shows the chip pin configuration. The MCP4921 device is designed to interface directly with the Serial Peripheral Interface (SPI) port, which is available on the PIC18F452 microcontroller and supports Mode 0,0 and Mode 1,1. Commands and data are sent to the device via the SDI pin, with data being clocked-in on the rising edge of SCK. The communication is unidirectional; this means the data cannot be read out of the MCP4921. The CS (chip select active low) pin must be held low for the duration of a write command. The write command consists of 16 bits and is used to configure the DAC's control and data latches. Register shown in **Figure 5**, details the write command which is loaded into the input register that is used to configure and load the DAC register [6].

The write command is initiated by driving the CS pin low, followed by clocking the four Configuration bits and the 12 data bits into the SDI pin on the rising edge of SCK. The CS pin is then raised, causing the data to be latched into the DAC's input register. The MCP4921 utilizes a double-buffered latch structure to allow the analog output to be synchronized with the LDAC pin, if desired. By bringing the LDAC pin down to a low state, the content stored in the DAC's input register is transferred into the DAC's output register (VOUT), and VOUT is updated. The write to the MCP4921 device is 16-bit words. Any clocks past the 16th clock will be ignored. The Most Significant 4 bits are Configuration bits. The remaining 12 bits are data bits. No data can be transferred into the device with CS high. This transfer will only occur if 16 clocks have been transferred into the device. If the rising edge of CS occurs prior to that, shifting of data into the input register will be aborted. The most four significant bits are defined as follows:

bit 15 0 = Write to DAC register

1 = Ignore this command

bit 14 BUF: VREF Input Buffer Control bit

1 = Buffered

0 = Unbuffered

*Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

bit 13 : Output Gain Selection bit 1 = 1x (VOUT = VREF \* D/4096) 0 = 2x (VOUT = 2 \* VREF \* D/4096)

bit 12 : Output Shutdown Control bit 1= Active mode operation. VOUT is available. 0 = Shutdown the device. Analog output is not available. VOUT pin is connected to 500 kΩ (typical).

## **3. Liquid crystal display (LCD)**

This module is designed to display the value of the temperature detected by the temperature sensor and to guide the user in changing the parameters of the controller. The LCD is a 16 2 alphanumeric display with the built-in Hitachi 44780 controller and LED backlighting. It works with an 8-bit data bus, which means it will require a total of 11 data lines. Three control lines (connected to port E) plus the 8 lines for the data bus (connected to port D) [7].

## **4. System design**

the extended temperature range (+125°C). It provides high accuracy and low noise performance for consumer and industrial applications where calibration or compensation of signals (such as temperature, pressure and humidity) is required. The MCP4921 device is available in the PDIP, SOIC, MSOP and DFN packages. **Figure 4** shows the chip pin configuration. The MCP4921 device is designed to interface directly with the Serial Peripheral Interface (SPI) port, which is available on the PIC18F452 microcontroller and supports Mode 0,0 and Mode 1,1. Commands and data are sent to the device via the SDI pin, with data being clocked-in on the rising edge of SCK. The communication is unidirectional; this means the data cannot be read out of the MCP4921. The CS (chip select active low) pin must be held low for the duration of a write command. The write command consists of 16 bits and is used to configure the DAC's control and data latches. Register shown in **Figure 5**, details the write command which is loaded into the input register that is used to configure

The write command is initiated by driving the CS pin low, followed by clocking the four Configuration bits and the 12 data bits into the SDI pin on the rising edge of SCK. The CS pin is then raised, causing the data to be latched into the DAC's input register. The MCP4921 utilizes a double-buffered latch structure to allow the analog output to be synchronized with the LDAC pin, if desired. By bringing the LDAC pin down to a low state, the content stored in the DAC's input register is transferred into the DAC's output register (VOUT), and VOUT is updated. The write to the MCP4921 device is 16-bit words. Any clocks past the 16th clock will be ignored. The Most Significant 4 bits are Configuration bits. The remaining 12 bits are data bits. No data can be transferred into the device with CS high. This transfer will only occur if 16 clocks have been transferred into the device. If the rising edge of CS occurs prior to that, shifting of data into the input register will be aborted. The most

and load the DAC register [6].

**Figure 4.**

**Figure 5.**

*MCP4921 pin configuration.*

*Write command register for MCP4921 (12-bit DAC).*

*Renewable Energy - Technologies and Applications*

four significant bits are defined as follows: bit 15 0 = Write to DAC register 1 = Ignore this command bit 14 BUF: VREF Input Buffer Control bit

> 1 = Buffered 0 = Unbuffered

**276**

The system is design around a stand-alone PIC18F452 controller, where the measured variable (MV) is read through channel0 (pin 2). The MV is subtracted from the set point automatically by the controller. The error is treated by the PIC PID and produces a digital control variable. This control variable is outputted through PIC serial data output pin (SDO pin 24) together with serial clock pin (SCK pin 18) to synchronize the conversion process. For the conversion to take place, the serial DAC chip select (CS) has to be pulled low. The CS is connected to pin RC0. The positive reference voltage is connected to +5 V (pin 6) and the negative reference voltage (pin 7) is tied to zero volt. The analog output is read through pin8 (Vout). This voltage is small to drive an electric motor. This voltage is pulled up to +12 V through the non-inverting operational amplifier (LM358). The Darlington transistor 2SD1409 is used to bust the current. The motor is connected to the emitter follower so that the driving current is sufficient enough to drive the motor. Needless to say that the diode 1N4148 is used to protect the Darlington transistor against any spike due to the change of current. **Figure 6** shows the schematic of the system. The LCD is used to display the measured temperature. To manipulate the setting of different parameters, six push buttons are used as follows:

Six push buttons were used in the project to allow the user to change the setting and the controller parameters. Their functions are as follows:

1.Reset: To reset the microcontroller.

2. Stop: interrupt the program to allow the user to change the controller settings


current execution and perform another action. The trigger will be caused by either

This routine, as mentioned earlier, is dedicated to configure the direction of external pins as well as interrupt sources. It also allows the user to choose the measured variable (temperature, flow, level or others). The flow chart of this

First PORTA (pin RA0) is configured as an analog input channel0 and PORTB as input digital port which is connected to the push button switches; while all other

The configuration of the LCD was performed by separate software from Microchip called Application Maestro [8]. With the aid of this software, a configuration code was produced after modifying the module parameters. It was then incorporated into the project. Once incorporated, the LCD is configured and ready to work. One feature of using Application Maestro is its ability to use the prewritten code

Timer0 can operate as a timer or as a counter. In Timer mode, the Timer0 module will increment with every instruction cycle (without prescaler). It is configured by setting a special function register called T0CON (timer0 control byte). This register is a readable and writable register that controls all the aspects of Timer0, including the prescale selection. In the design in hand, T0CON register is

that this software provides to initialize or to write to the LCD.

set to 0x85 (0b10000101) as shown below [9, 10].

This value will configure the timer0 as follows:

●Bit3 PSA = 0 : Timer0 prescaler is assigned

●Bit6 T08BIT = 0 : Timer0 is configured as a 16-bit timer ●Bit5 T0CS = 0 : Internal instruction cycle clock ●Bit4 T0SE = 0 : This bit is used only with external clock

●Bit2 T0PS2 = 1 : Bit2: T0PS2 =1: } 1:64 prescaler value

●Bit7 TMR0ON = 1 : Timer0 is enabled

●Bit1 T0PS1 = 0 : Bit1: T0PS1 =0: ●Bit0 T0PS0 = 1 : Bit0: T0PS0 =1:

**279**

Because the time is a crucial element in digital control, the PID algorithm is controlled through a timer interrupt. This choice allows the user the ability to calculate the sampling time accurately. On the other hand, an external interrupt (INT0) is used to interrupt the program in order to allow the user a chance to modify the controller parameters. In the

an overflow in timer register or a change on an external pin (RB0/INT0).

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

following we discuss in some details about the functions of each routine.

**5.1 Main routine**

*5.1.1 Routine function*

routine is shown in **Figure 7**.

*5.1.2 External ports configuration*

pins are configured as outputs.

*5.1.3 LCD configuration*

*5.1.4 Timer0 configuration*

#### **Figure 6.**

*System schematic circuit showing all the connection to the microcontroller, as well as the liquid crystal display and the final control element.*

These switches are connected to PIC PORTB to allow the user to use the internal build-in pull up resistors to prevent floating instead of using external pull-down resistors. The reset has got a separate button connected to MCLR pin. A buzzer is used as an alarm to indicate that the temperature is more than what the user specifies. Three LEDs were used to show the user the status of the microcontroller program. The three colors green, yellow, and orange were used as follows:

1.Green: means that the PID controller is working properly.

2.Yellow: means that the program is interrupted by (STOP) push button.

3.Red: means that the alarm is triggered.

### **5. Software design**

To implement the control program, three major routines are used; the main routine along with the timer and external interrupts. The program starts with the main routine which contains all the configurations of the external pins whether outputs or inputs. It also contains the configurations of timer and external interrupts, so when one of these interrupts is triggered, the microcontroller will stop its

## *Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

current execution and perform another action. The trigger will be caused by either an overflow in timer register or a change on an external pin (RB0/INT0).

Because the time is a crucial element in digital control, the PID algorithm is controlled through a timer interrupt. This choice allows the user the ability to calculate the sampling time accurately. On the other hand, an external interrupt (INT0) is used to interrupt the program in order to allow the user a chance to modify the controller parameters. In the following we discuss in some details about the functions of each routine.

### **5.1 Main routine**

## *5.1.1 Routine function*

This routine, as mentioned earlier, is dedicated to configure the direction of external pins as well as interrupt sources. It also allows the user to choose the measured variable (temperature, flow, level or others). The flow chart of this routine is shown in **Figure 7**.

## *5.1.2 External ports configuration*

First PORTA (pin RA0) is configured as an analog input channel0 and PORTB as input digital port which is connected to the push button switches; while all other pins are configured as outputs.

## *5.1.3 LCD configuration*

The configuration of the LCD was performed by separate software from Microchip called Application Maestro [8]. With the aid of this software, a configuration code was produced after modifying the module parameters. It was then incorporated into the project. Once incorporated, the LCD is configured and ready to work. One feature of using Application Maestro is its ability to use the prewritten code that this software provides to initialize or to write to the LCD.

### *5.1.4 Timer0 configuration*

These switches are connected to PIC PORTB to allow the user to use the internal build-in pull up resistors to prevent floating instead of using external pull-down resistors. The reset has got a separate button connected to MCLR pin. A buzzer is used as an alarm to indicate that the temperature is more than what the user specifies. Three LEDs were used to show the user the status of the microcontroller program. The three colors green, yellow, and orange were used

*System schematic circuit showing all the connection to the microcontroller, as well as the liquid crystal display*

2.Yellow: means that the program is interrupted by (STOP) push button.

To implement the control program, three major routines are used; the main routine along with the timer and external interrupts. The program starts with the main routine which contains all the configurations of the external pins whether outputs or inputs. It also contains the configurations of timer and external interrupts, so when one of these interrupts is triggered, the microcontroller will stop its

1.Green: means that the PID controller is working properly.

3.Red: means that the alarm is triggered.

*Renewable Energy - Technologies and Applications*

as follows:

**278**

**Figure 6.**

*and the final control element.*

**5. Software design**

Timer0 can operate as a timer or as a counter. In Timer mode, the Timer0 module will increment with every instruction cycle (without prescaler). It is configured by setting a special function register called T0CON (timer0 control byte). This register is a readable and writable register that controls all the aspects of Timer0, including the prescale selection. In the design in hand, T0CON register is set to 0x85 (0b10000101) as shown below [9, 10].


This value will configure the timer0 as follows:


*5.1.5 Interrupt configuration*

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

unwanted interruptions.

of the interrupt sources is triggered.

838.848 ms. This is obtained as follows:

**5.2 Timer interrupt routine**

*5.2.1 Routine function*

routine function.

**281**

*5.2.2 Timer reloading*

There are ten registers which are used to control internal and external interrupt operations to accommodate a variety of interrupts [11]. In the project in hand, only two interrupts are required INT0 and timer0 interrupt. To do so, only three control

To start the interrupt, the global interrupt bit GIE/GIEH (INTCON<7>) must be set. If set, it enables all unmasked interrupts, so if more than one interrupt source is used (as in our case) the Interrupt Priority Enable bit IPEN (RCON<7>) must be set and the interrupt sources should be specified either as high or low priority interrupt. The interrupt priority bit TMR0IP (INTCON2<2>) is used to specify the interrupt priority for Timer0. This bit is reset so timer0 interrupt is set to low priority. On the other hand, no need to specify the priority of the external interrupt

After configuring the interrupts, the program will enter an infinite loop until one

The main purpose of this routine is to calculate the controller output and send it to the DAC serially through the synchronous SPI module [12]. **Figure 8** shows the

Because of the importance of time in calculating the timed controller output, timer0 is used as an accurate hardware timer. The source clock of the timer is the crystal oscillator which is fed to the clock pin of Timer0 internally. The clock used is a 20 MHz derived from a stable crystal oscillator. This frequency is automatically divided by 4 because the controller machine cycle is 4 clocks to give a 5 MHz which is fed to the timer. The timer is exactly clocked every 0.2 μs and takes 13107.2 μs (16-bit mode) to count from zero to zero again. However, by loading the timer with a suitable value, a smaller time interval could be obtained. For example, by loading the timer with the value 4095 (0xFFF), the overflow would occur after 12288.2 μs. Alternatively, the time period can be extended by using a prescaler as was done in the main routine. If a divide by 64 prescaler is selected, timer0 only overflows after

5 MHz

<sup>64</sup> <sup>¼</sup> 78, 125 Hz

ð Þ 78, 125 Hz �<sup>1</sup> <sup>¼</sup> <sup>12</sup>*:*<sup>8</sup> <sup>μ</sup><sup>s</sup>

12*:*8 μs � 65, 535 ¼ 838*:*848 ms

registers are required. These registers are INTCON, INTCON2, and RCON. INTCON register contains various enable bits as well as several interrupt flags. RCON is the Reset Control register which contains flag bits that allow differentiation between the sources RESET. Timer0 interrupt is enabled by setting TMR0IE bit (<5>) while external interrupt is enabled by setting INT0IE (INTCON<4>). Note that the interrupt flags are reset before enabling the interrupt in order to avoid

(INT0), because it is already set to high priority by default.

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

**Figure 7.** *Main routine.*

## *5.1.5 Interrupt configuration*

There are ten registers which are used to control internal and external interrupt operations to accommodate a variety of interrupts [11]. In the project in hand, only two interrupts are required INT0 and timer0 interrupt. To do so, only three control registers are required. These registers are INTCON, INTCON2, and RCON. INTCON register contains various enable bits as well as several interrupt flags. RCON is the Reset Control register which contains flag bits that allow differentiation between the sources RESET. Timer0 interrupt is enabled by setting TMR0IE bit (<5>) while external interrupt is enabled by setting INT0IE (INTCON<4>). Note that the interrupt flags are reset before enabling the interrupt in order to avoid unwanted interruptions.

To start the interrupt, the global interrupt bit GIE/GIEH (INTCON<7>) must be set. If set, it enables all unmasked interrupts, so if more than one interrupt source is used (as in our case) the Interrupt Priority Enable bit IPEN (RCON<7>) must be set and the interrupt sources should be specified either as high or low priority interrupt. The interrupt priority bit TMR0IP (INTCON2<2>) is used to specify the interrupt priority for Timer0. This bit is reset so timer0 interrupt is set to low priority. On the other hand, no need to specify the priority of the external interrupt (INT0), because it is already set to high priority by default.

After configuring the interrupts, the program will enter an infinite loop until one of the interrupt sources is triggered.

## **5.2 Timer interrupt routine**

## *5.2.1 Routine function*

The main purpose of this routine is to calculate the controller output and send it to the DAC serially through the synchronous SPI module [12]. **Figure 8** shows the routine function.

#### *5.2.2 Timer reloading*

Because of the importance of time in calculating the timed controller output, timer0 is used as an accurate hardware timer. The source clock of the timer is the crystal oscillator which is fed to the clock pin of Timer0 internally. The clock used is a 20 MHz derived from a stable crystal oscillator. This frequency is automatically divided by 4 because the controller machine cycle is 4 clocks to give a 5 MHz which is fed to the timer. The timer is exactly clocked every 0.2 μs and takes 13107.2 μs (16-bit mode) to count from zero to zero again. However, by loading the timer with a suitable value, a smaller time interval could be obtained. For example, by loading the timer with the value 4095 (0xFFF), the overflow would occur after 12288.2 μs. Alternatively, the time period can be extended by using a prescaler as was done in the main routine. If a divide by 64 prescaler is selected, timer0 only overflows after 838.848 ms. This is obtained as follows:

$$\frac{5\text{ MHz}}{64} = 78,125\text{ Hz}$$

$$(78,125\text{ Hz})^{-1} = 12.8\text{ }\mu\text{s}$$

$$12.8\text{ }\mu\text{s} \times 65,535 = 838.848\text{ ms}$$

**Figure 7.** *Main routine.*

*Renewable Energy - Technologies and Applications*

**280**

This time period is less than one second, while a one second sampling time is required for the design in hand. To obtain a one second sampling time, the timer

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

Because timer0 register is only 16 bit wide, it is only limited to count up to 65,535 pulses. The interruption is trigged several times to obtain one second timing, after which the controller computes the control action and sends it to the DAC. By using MPLAP simulator, it was found that 5362 cycles are required to calculate the controller output and send it to the DAC besides 51 extra cycles needed to reload the timer with time constant. If the interruption is required to repeat itself five times before calculating the controller output, one needs 5362 + 51 � 5 = 5617 cycles (1.1234 ms). Thus, in order to get exactly one second sampling time, the timer register (TMR0) has to be reloaded with a value that interrupts the program every 998.8766 ms (1 s–1.1234 ms). The following shows how this value is obtained:

No*:*of cycles for 1 s <sup>¼</sup> <sup>5</sup> � <sup>10</sup><sup>6</sup> cycles Therefore no*:*of cycles between interrupts <sup>¼</sup> <sup>5</sup> � 106 � <sup>5617</sup> <sup>¼</sup> 4, 997, 383 cycles

But because the timer counts in ascending order (from 0x0000 to 0xFFFF):

Reload value ¼ 65, 535 � 15616*:*82188 ¼ 49918*:*17812

However, the timer register accepts only integer numbers, thus the final value that should be added to the timer register is 49918. Because we omitted the numbers after the decimal point, our error will be � 1 count which is equal to 64 cycles.

Timer error ¼ 64 � 0*:*2 μs ¼ 12*:*8 μs

This calculation is for getting 1 s sampling time. To expand the calculation in order to enable the user to change the sampling time, one defines two integer variables (repeat and cycle). The first variable repeat is to determine how many times we need to repeat the interrupt, while the second one cycle is the final value that should be added to the timer register. The following pseudo code shows the

The ADC module normally operates at 10-bits resolution, giving output digital values 0–1024 [13]. It needs a reference voltage to set the maximum and minimum

<sup>64</sup> <sup>¼</sup> 78, 084*:*<sup>10938</sup>

<sup>5</sup> <sup>¼</sup> 15, 616*:*<sup>82188</sup>

No*:* of counts <sup>¼</sup> 4, 997, 383

No*:* of counts <sup>¼</sup> 78, 084*:*<sup>10938</sup>

should count 78,125 pulses.

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

By using a timer with 64 prescaler:

repeat=5\*sampling\_time; term\_1=((repeat)\*51.0+5362.0);

term\_3=term\_2/repeat; cycle=65535-term\_3;

When we repeat the interrupt for 5 times:

term\_2=(5000000.0\*sampling\_time-term\_1)/64.0;

general formula used to reload the timer register.

*5.2.3 Analog to digital converter module*

**283**

Therefore, our error in calculating the sampling time will be:

**Figure 8.** *Timer interrupt routine.*

*Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

This time period is less than one second, while a one second sampling time is required for the design in hand. To obtain a one second sampling time, the timer should count 78,125 pulses.

Because timer0 register is only 16 bit wide, it is only limited to count up to 65,535 pulses. The interruption is trigged several times to obtain one second timing, after which the controller computes the control action and sends it to the DAC. By using MPLAP simulator, it was found that 5362 cycles are required to calculate the controller output and send it to the DAC besides 51 extra cycles needed to reload the timer with time constant. If the interruption is required to repeat itself five times before calculating the controller output, one needs 5362 + 51 � 5 = 5617 cycles (1.1234 ms). Thus, in order to get exactly one second sampling time, the timer register (TMR0) has to be reloaded with a value that interrupts the program every 998.8766 ms (1 s–1.1234 ms). The following shows how this value is obtained:

No*:*of cycles for 1 s <sup>¼</sup> <sup>5</sup> � <sup>10</sup><sup>6</sup> cycles

Therefore no*:*of cycles between interrupts <sup>¼</sup> <sup>5</sup> � 106 � <sup>5617</sup> <sup>¼</sup> 4, 997, 383 cycles

By using a timer with 64 prescaler:

$$\text{No. of counts} = \frac{4,997,383}{64} = 78,084.10938$$

When we repeat the interrupt for 5 times:

$$\text{No. of counts} = \frac{78,084.10938}{5} = 15,616.82188$$

But because the timer counts in ascending order (from 0x0000 to 0xFFFF):

Reload value ¼ 65, 535 � 15616*:*82188 ¼ 49918*:*17812

```
repeat=5*sampling_time;
term_1=((repeat)*51.0+5362.0);
term_2=(5000000.0*sampling_time-term_1)/64.0;
term_3=term_2/repeat;
cycle=65535-term_3;
```
However, the timer register accepts only integer numbers, thus the final value that should be added to the timer register is 49918. Because we omitted the numbers after the decimal point, our error will be � 1 count which is equal to 64 cycles. Therefore, our error in calculating the sampling time will be:

Timer error ¼ 64 � 0*:*2 μs ¼ 12*:*8 μs

This calculation is for getting 1 s sampling time. To expand the calculation in order to enable the user to change the sampling time, one defines two integer variables (repeat and cycle). The first variable repeat is to determine how many times we need to repeat the interrupt, while the second one cycle is the final value that should be added to the timer register. The following pseudo code shows the general formula used to reload the timer register.

#### *5.2.3 Analog to digital converter module*

The ADC module normally operates at 10-bits resolution, giving output digital values 0–1024 [13]. It needs a reference voltage to set the maximum and minimum

**Figure 8.**

**282**

*Timer interrupt routine.*

*Renewable Energy - Technologies and Applications*

values for the input conversion. This reference can be provided internally as Vdd and Vss (supply values) or externally through Vref+ and Vref pins. To configure this module, OpenADC function from Microchip C library is used. This function performs a bitwise AND operation ("&") between its arguments which are defined in the file adc.h. The parameters of this function along with their meaning of each argument are discussed below [1]

output which will be sent to the DAC. The following code shows how to calculate the

To send the control variable to the final control element, the serial DAC, which is interfaced to the Serial Peripheral Interface (SPI) port, is used. The SPI is initiated using Microchip C library called OpenSPI. This function also performs a bitwise AND operation between its arguments which are defined in the file SPI.h according

After configuring the module, it is time to write a command to the DAC in order to convert it into analog signal. The write command is initiated by driving the CS pin low, followed by clocking the four configuration bits and the 12 data bits into the SDI pin on the rising edge of SCK. The CS pin is then raised, causing the data to be latched into the DAC's input registers and when the LDAC pin is pulled down through RC1, the values held in the DAC's input registers are transferred into the DAC's output registers to provide the analog signal. It is important to mention here that we wrote the write command in two steps (as shown in the following code)

To write characters to the LCD, required prewritten functions are provided by

Application Maestro options XLCDPut(data) It sends the clocking signal and data to be displayed to the LCD

Application Maestro. Some of These functions are listed in following table:

XLCDInit() It is used to initialize the LCD module according to the

term\_3 = KC\*(TD/sampling\_time)\*(error-(2\*last\_error)+prev\_error);

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

• SPI\_FOSC\_16: Master mode and the clock = FOSC/16

• SMPEND: Input data sample at end of data out

OpenSPI(SPI\_FOSC\_16, MODE\_00, SMPEND);

because the SPI module send only 8 bit at a time.

WriteSPI(pid\_output\_16\_high); //4MSB as command + 4LSB as data

LATCbits.LATC1=0; // enable LDAC for data output to DAC

LATCbits.LATC0 = 0; // Chip Select is set

LATCbits.LATC1=1; // disable LDAC

CloseSPI();

**285**

*5.2.6 Writing on the LCD*

WriteSPI(pid\_output\_16\_low); // 8 bit data LATCbits.LATC0 = 1; // Chip Select is reset

• MODE\_00: Mode 0,0 (change takes place on the rising edge)

pid\_output\_v = term\_1 + term\_2 + term\_3+pid\_output\_v;

controller output

*5.2.5 SPI module*

to the following formula.

term\_1 = KC\*(error-last\_error); term\_2 = KC\*(sampling\_time/TI)\*error;

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

OpenADC(ADC\_FOSC\_32 & ADC\_RIGHT\_JUST & ADC\_8ANA\_0REF, ADC\_CH0 & ADC\_INT\_OFF);

• ADC\_FOSC\_32: FOSC/32.

A clock divider to allow the minimum specified conversion time (about 20 μs). A 32 prescaler was chosen because the clock source is 20 MHz

• ADC\_RIGHT\_JUST: Right justified.

Because the ADRES register pair (where the converted values are loaded) is 16 bit wide. But the ADC is only 10bit wide. The ADC module could either be configured as right or left justified. In this project, right justified is chosen as shown in **Figure** 9. This sets the 6 most significant bits of register ADRES to zeros.

• ADC\_8ANA\_0REF: VREF+ = VDD, VREF = VSS

The supply values are chosen as the voltage references to the ADC.


## *5.2.4 Controller calculation*

Due to the limitation in the microcontroller's memory, the PID equation is divided into three terms (term\_1, term\_2, and term\_3) and after calculating each term separately, they are added together along with the previous output to give the controller

**Figure 9.** *Choosing right justified for data input.*

*Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

output which will be sent to the DAC. The following code shows how to calculate the controller output

```
term_1 = KC*(error-last_error);
term_2 = KC*(sampling_time/TI)*error;
term_3 = KC*(TD/sampling_time)*(error-(2*last_error)+prev_error);
pid_output_v = term_1 + term_2 + term_3+pid_output_v;
```
## *5.2.5 SPI module*

values for the input conversion. This reference can be provided internally as Vdd and Vss (supply values) or externally through Vref+ and Vref pins. To configure this module, OpenADC function from Microchip C library is used. This function performs a bitwise AND operation ("&") between its arguments which are defined in the file adc.h. The parameters of this function along with their meaning of each argument are

A clock divider to allow the minimum specified conversion time (about 20 μs). A

Because the ADRES register pair (where the converted values are loaded) is 16-

configured as right or left justified. In this project, right justified is chosen as shown

bit wide. But the ADC is only 10bit wide. The ADC module could either be

in **Figure** 9. This sets the 6 most significant bits of register ADRES to zeros.

The supply values are chosen as the voltage references to the ADC.

• Once the A/D conversion is completed, the result is stored in an integer

variable called result. After reading the analog value by the ADC module, the result will be compared with the variable alarm-trigger which was previously specified. If the result is greater than this value, the microcontroller triggers the

Due to the limitation in the microcontroller's memory, the PID equation is divided into three terms (term\_1, term\_2, and term\_3) and after calculating each term separately, they are added together along with the previous output to give the controller

• ADC\_INT\_OFF: Interrupts of ADC interrupts are disabled.

OpenADC(ADC\_FOSC\_32 & ADC\_RIGHT\_JUST & ADC\_8ANA\_0REF,

32 prescaler was chosen because the clock source is 20 MHz

• ADC\_8ANA\_0REF: VREF+ = VDD, VREF = VSS

• ADC\_CH0: Channel0 (AN0) is selected

buzzer and lights the red LED.

*5.2.4 Controller calculation*

*Choosing right justified for data input.*

**Figure 9.**

**284**

discussed below [1]

ADC\_CH0 & ADC\_INT\_OFF);

• ADC\_FOSC\_32: FOSC/32.

• ADC\_RIGHT\_JUST: Right justified.

*Renewable Energy - Technologies and Applications*

To send the control variable to the final control element, the serial DAC, which is interfaced to the Serial Peripheral Interface (SPI) port, is used. The SPI is initiated using Microchip C library called OpenSPI. This function also performs a bitwise AND operation between its arguments which are defined in the file SPI.h according to the following formula.


OpenSPI(SPI\_FOSC\_16, MODE\_00, SMPEND);

After configuring the module, it is time to write a command to the DAC in order to convert it into analog signal. The write command is initiated by driving the CS pin low, followed by clocking the four configuration bits and the 12 data bits into the SDI pin on the rising edge of SCK. The CS pin is then raised, causing the data to be latched into the DAC's input registers and when the LDAC pin is pulled down through RC1, the values held in the DAC's input registers are transferred into the DAC's output registers to provide the analog signal. It is important to mention here that we wrote the write command in two steps (as shown in the following code) because the SPI module send only 8 bit at a time.

```
LATCbits.LATC0 = 0; // Chip Select is set
WriteSPI(pid_output_16_high); //4MSB as command + 4LSB as data
WriteSPI(pid_output_16_low); // 8 bit data
LATCbits.LATC0 = 1; // Chip Select is reset
LATCbits.LATC1=0; // enable LDAC for data output to DAC
LATCbits.LATC1=1; // disable LDAC
CloseSPI();
```
## *5.2.6 Writing on the LCD*

To write characters to the LCD, required prewritten functions are provided by Application Maestro. Some of These functions are listed in following table:



● bit 13 **Spt:** set in the set point mode ● bit 12 **KC:** set in the controller gain mode ● bit 11 **TI:** set in the integral time mode ● bit 10 **TD:** set in the derivative time mode ● bit 9 **Stm:** set in the sampling time mode ● bit 8 **Sen:** set in the sensitivity mode ● bit 7 **Alm:** set in the alarm mode ● bit 6 **Tun:** set in the tuning mode ● bit 5 **Dp:** set in the process delay mode ● bit 4 **Tp:** set in the process time constant mode ● bit 3 **Kp:** set in the process gain mode

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

● bit 2-0 Unimplemented

if (mode\_pin==0){ Delay10KTCYx(70);

else if (inc\_pin==0){

else if (dec\_pin==0){

else if(end\_pin==0) return;

**6. Testing and verification**

}

}

}

Eq. (10).

**287**

present\_button=mode\_pushed;

Delay10KTCYx(70); present\_button=inc\_pushed;

Delay10KTCYx(70); present\_button=dec\_pushed;

action= present\_mode | present\_button;

Initially, before pressing any push button, present\_button variable is loaded with 0x8000 (no push button pressed), and present\_mode with 0x2000 (starting mode).Then if any push button is pressed, the corresponding bit of that push button will be set, giving a specific value of present\_button which indicates the push button that was pressed by the user. So by performing a bitwise OR operation between the two variables (present\_button and present\_mode) we will come up with a number indicates the push button pressed and the present mode and based on that number we can decide the proper action to be taken by the microcontroller. The following code shows how to perform the OR operation after checking which of the push buttons was pressed. Beside changing the controller variables, this routine has another feature, it gives the user preliminary values of the controller parameters after entering the process variables. The result is derived based on Cohen-Koon tuning method. However, this feature is impractical if the sampling time is big [14].

To test the system, a first order system given by the equation below was used. To run the control action, the system was converted into a difference equation given by

<sup>5</sup>*<sup>S</sup>* <sup>þ</sup> <sup>1</sup> (9)

*Gp* <sup>¼</sup> <sup>10</sup>

For numbers to be displayed, they are first converted into strings (characters) before being sent to the LCD, since the latter only accepts strings. To do so a C function called sprintf is called upon. This function saves the number in an array after converting it into string. The subroutine to do so is shown below [4]:

sprintf (buf,"%d",temp\_set); XLCDPutRamString(buf);

### **5.3 External interrupt routine**

#### *5.3.1 Routine function*

The main function of this routine is to allow the user to change the controller parameters. The routine is initiated by pressing the push button (STOP) which is connected to the external interrupt pin (RB0/INT0). Once initiated, the user is able to change all the parameters of the controller (KC, τI, τD, sampling time, alarm trigger and sensitivity) by using three push buttons (MODE, INCREMENT and DECREMENT [11].

To determine which action the microcontroller should take if any push button is pressed, we defined two integer variables (present\_button and present\_mode) to be used as statuses. That is, each bit of them has specific meaning as described below:

• present\_button


*Design of Three-Term Controller Using a PIC18F452 Microcontroller DOI: http://dx.doi.org/10.5772/intechopen.89815*

● bit 13 **Spt:** set in the set point mode

XLCDL1home() Points to the first address location of line one of the LCD XLCDL2home() Points to the first address location of line two of the LCD XLCDClear() Clears the DDRAM content of the LCD and points to the 00 address location

XLCDCommand(Command) It sends clocking signal and instructions to the LCD

For numbers to be displayed, they are first converted into strings (characters) before being sent to the LCD, since the latter only accepts strings. To do so a C function called sprintf is called upon. This function saves the number in an array after converting it into string. The subroutine to do so is shown below [4]:

The main function of this routine is to allow the user to change the controller parameters. The routine is initiated by pressing the push button (STOP) which is connected to the external interrupt pin (RB0/INT0). Once initiated, the user is able to change all the parameters of the controller (KC, τI, τD, sampling time, alarm trigger and sensitivity) by using three push buttons (MODE, INCREMENT and

To determine which action the microcontroller should take if any push button is pressed, we defined two integer variables (present\_button and present\_mode) to be used as statuses. That is, each bit of them has specific meaning as described below:

Np \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ \_\_\_\_ dec inc Mod bit15 bit0

\_\_\_\_ Srt Spt KC TI TD Stm Sen Alm Tun Dp Tp Kp \_\_\_\_ \_\_\_\_ \_\_\_\_ bit15 bit0

XLCDPutRomString(addr) Displays String in Program memory XLCDPutRamString(addr) Displays String in Data memory

*Renewable Energy - Technologies and Applications*

sprintf (buf,"%d",temp\_set); XLCDPutRamString(buf);

**5.3 External interrupt routine**

*5.3.1 Routine function*

DECREMENT [11].

• present\_button

● bit 14-3 Unimplemented

• present\_mode

● bit 15 Unimplemented

**286**

● bit 14 **Srt:** set in the starting mode

● bit 15 **Np:** set if there are no push buttons pressed

● bit 2 **dec:** set if the DECREMENT push button pressed ● bit 1 **inc:** set if the INCREMENT push button pressed ● bit 0 **mod:** set if the MODE push button pressed


Initially, before pressing any push button, present\_button variable is loaded with 0x8000 (no push button pressed), and present\_mode with 0x2000 (starting mode).Then if any push button is pressed, the corresponding bit of that push button will be set, giving a specific value of present\_button which indicates the push button that was pressed by the user. So by performing a bitwise OR operation between the two variables (present\_button and present\_mode) we will come up with a number indicates the push button pressed and the present mode and based on that number we can decide the proper action to be taken by the microcontroller. The following code shows how to perform the OR operation after checking which of the push buttons was pressed. Beside changing the controller variables, this routine has another feature, it gives the user preliminary values of the controller parameters after entering the process variables. The result is derived based on Cohen-Koon tuning method. However, this feature is impractical if the sampling time is big [14].

```
if (mode_pin==0){
  Delay10KTCYx(70);
 present_button=mode_pushed;
}
else if (inc_pin==0){
      Delay10KTCYx(70);
 present_button=inc_pushed;
  }
else if (dec_pin==0){
      Delay10KTCYx(70);
present_button=dec_pushed;
  }
else if(end_pin==0)
    return;
action= present_mode | present_button;
```
## **6. Testing and verification**

To test the system, a first order system given by the equation below was used. To run the control action, the system was converted into a difference equation given by Eq. (10).

$$G\_p = \frac{10}{\text{5S} + 1} \tag{9}$$

The process transfer function is first order, thus the discrete transfer function obtained using Zero-Order Hold will be:

$$HG(z) = \frac{az^{-1}}{1 - bz^{-1}}\tag{10}$$

where:

$$a = k\_p \left[ 1 - \exp\left(\frac{-T\_s}{\tau\_p}\right) \right]$$

$$b = \exp\left(\frac{-T\_s}{\tau\_p}\right)$$

If *kp* = 10, *τ<sup>p</sup>* = 5, and *Ts* = 1, The discrete transfer function will be:

$$HG(z) = \frac{1.813z^{-1}}{1 - 0.8187z^{-1}}\tag{11}$$

$$\Rightarrow \left(1 - 0.8187z^{-1}\right)Y(z) = 1.813z^{-1}C(z)$$

$$Y(z) - 0.8187z^{-1}Y(z) = 1.813z^{-1}C(z)$$

$$\mathcal{Y}\_n - 0.8187\mathcal{Y}\_{n-1} = 1.813c\_{n-1}$$

Therefore the difference equation of the output is:

$$y\_n = 0.8187y\_{n-1} + 1.813c\_{n-1} \tag{12}$$

**7. Conclusion**

**Figure 11.**

**Author details**

Mostefa Ghassoul

**289**

benefits those types of controllers offer.

*Controller response with Kc = 0.1,Ti = 3.0 and Td = 0.2.*

*Design of Three-Term Controller Using a PIC18F452 Microcontroller*

*DOI: http://dx.doi.org/10.5772/intechopen.89815*

provided the original work is properly cited.

Chemical Engineering, University of Bahrain, Bahrain

\*Address all correspondence to: mghassoul@uob.edu.bh

By referring to the previous graphs, it could be concluded that the response tracks the set point as expected. In addition, the increase in controller gain (*Kc*) does speed up the response but at the expense of the overshoot. Based on these results, it could be concluded that the three-term controller is working according to plan. Because of the flexibility of the microcontroller and its programming, any control scheme could be developed and implemented in the manner as described in this chapter. Not only that, the scheme could be transferred to several high range microcontrollers from the same company such as 16 or 32 bits with the use of the

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

After getting the difference equation, the control scheme was tested and the output of **Figure 10** was obtained with the parameters set to: *Kc* = 0.2,*Ti* = 4.0 and *Td* = 0.0. The parameters were then changed to: *Kc* = 0.1,*Ti* = 3.0 and *Td* = 0.2. The response is shown in **Figure 11**.

**Figure 10.** *Controller response with Kc = 0.2,Ti = 4.0 and Td = 0.*

**Figure 11.**

The process transfer function is first order, thus the discrete transfer function

*HG z*ð Þ¼ *az*�<sup>1</sup>

*<sup>a</sup>* <sup>¼</sup> *kp* <sup>1</sup> � exp �*Ts*

*<sup>b</sup>* <sup>¼</sup> exp �*Ts*

*HG z*ð Þ¼ <sup>1</sup>*:*813*z*�<sup>1</sup>

) <sup>1</sup> � <sup>0</sup>*:*8187*z*�<sup>1</sup> *Y z*ð Þ¼ <sup>1</sup>*:*813*z*�<sup>1</sup>

*yn* � <sup>0</sup>*:*8187*yn*�<sup>1</sup> <sup>¼</sup> <sup>1</sup>*:*813*cn*�<sup>1</sup>

After getting the difference equation, the control scheme was tested and the output of **Figure 10** was obtained with the parameters set to: *Kc* = 0.2,*Ti* = 4.0 and *Td* = 0.0. The parameters were then changed to: *Kc* = 0.1,*Ti* = 3.0 and *Td* = 0.2. The

If *kp* = 10, *τ<sup>p</sup>* = 5, and *Ts* = 1, The discrete transfer function will be:

*Y z*ð Þ� <sup>0</sup>*:*8187*z*�<sup>1</sup>

Therefore the difference equation of the output is:

response is shown in **Figure 11**.

*Controller response with Kc = 0.2,Ti = 4.0 and Td = 0.*

**Figure 10.**

**288**

*τp*

*τp* 

*Y z*ð Þ¼ <sup>1</sup>*:*813*z*�<sup>1</sup>

<sup>1</sup> � *bz*�<sup>1</sup> (10)

<sup>1</sup> � <sup>0</sup>*:*8187*z*�<sup>1</sup> (11)

*C z*ð Þ

*C z*ð Þ

*yn* <sup>¼</sup> <sup>0</sup>*:*8187*yn*�<sup>1</sup> <sup>þ</sup> <sup>1</sup>*:*813*cn*�<sup>1</sup> (12)

obtained using Zero-Order Hold will be:

*Renewable Energy - Technologies and Applications*

where:

*Controller response with Kc = 0.1,Ti = 3.0 and Td = 0.2.*

## **7. Conclusion**

By referring to the previous graphs, it could be concluded that the response tracks the set point as expected. In addition, the increase in controller gain (*Kc*) does speed up the response but at the expense of the overshoot. Based on these results, it could be concluded that the three-term controller is working according to plan. Because of the flexibility of the microcontroller and its programming, any control scheme could be developed and implemented in the manner as described in this chapter. Not only that, the scheme could be transferred to several high range microcontrollers from the same company such as 16 or 32 bits with the use of the benefits those types of controllers offer.

## **Author details**

Mostefa Ghassoul Chemical Engineering, University of Bahrain, Bahrain

\*Address all correspondence to: mghassoul@uob.edu.bh

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

## **References**

[1] Ogunnaike BA, Ray WH. Process Dynamics, Modeling, and Control. 1st ed. USA: Oxford University Press; 1994

[2] Stephanopoulos G. Chemical Process Control: An Introduction to Theory and Practice. USA: Prentice Hall; 1983

[3] Seborg DE, Edgar TF, Mellichamp DA, Doyle FJ. Process Dynamics and Control. 4th ed. New York, USA: John Wiley and Son; 2017. pp. 115-117

[4] Phillips CL, Nagle HT, Chakrabortty A. Digital Control System Analysis and Design. UK: Pearson; 2015. pp. 279-335

[5] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers" Microchip 2006 (DS39564C)

[6] Microchip MCP4921/4922 datasheet "12-Bit DAC with SPI™ Interface" Microchip 2007

[7] HD44780 LCD starter guide. 2001

[8] Microchip application maestro software user's guide. 2003

[9] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: Timers" Microchip 2006 (DS39564C). pp. 103-115

[10] Bates M. PIC Microcontrollers: An Introduction to Microelectronics. Newnes; 2011

[11] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: External interrupts" Microchip 2006 (DS39564C). pp. 73-85

[12] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: Timer0 interrupt" Microchip 2006 (DS39564C). p. 85

[13] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: 10 bit ADC" Microchip 2006 (DS39564C). Chandler, Arizona USA; pp. 181-188

**Chapter 18**

**Abstract**

**1. Introduction**

civilization are presented in this chapter.

type reactor (NES\_Oklo).

**291**

*Dan Serbanescu*

Energy Sources

Lessons Learnt from Some Natural

The chapter presents in a systematic manner the lessons learnt from the natural energy systems (NES) and their specific features. The conclusions are based on the evaluation of the risk impact on environment and for the improvement of the risk evaluation methodologies of such systems. A specific feature of the NES is the interdependence between them and society/mankind and the environment. Risk analyses for such systems have specific features underlined while compared with the features of the artificial (man-made) energy systems (MMES). Previous works illustrated in detail the NES versus MMES differences. This chapter presents the main aspects of such a review, when applied to a specific NES, the natural nuclear fission reactor in Oklo, Gabon (NES\_Oklo). NES\_Oklo operated about two billion years ago for about two hundreds millions of years. The lessons drawn from studying how this reactor was built, operated and self-decommissioned are of high importance for nuclear energy and not only. There are conclusions drawn from the study of Oklo reactor, which seem to shake some taboo issues in Physics, like for instance the light speed limit and other fundamental aspects of Quantum Mechan-

**Keywords:** natural energy system (NES), man made energy systems (MMES), risk, nuclear reactor, quantum mechanics, philosophy of science, speed of light, ecology, energy systems life cycle (ES\_LC), knowledge process (KP), topological structure (K(i)), theory of a given topological structure (Th(K(i)), Backward engineering)

Two and a half billion years ago a natural fission reactor operated on the Earth (Oklo). The discovery of this natural energy source created a series of theories and had implications yet to be evaluated both on the man-made artifacts of similar type and on some fundamentals considered so far as improbable to be challenged in quantum physics, biology, ecology, nuclear reactor theory. It also has an impact on knowledge management, on the epistemology and ethics. Aspects of the implications for mankind and the lessons learnt so far on the actions to build a sustainable

In 1972 the international community involved in the research, design and operation of MMES of fission type reactors was surprised and challenged by a discovery of the remains of an ancient natural fission reactor, in Oklo (Gabon). It was a NES

ics, which have also important philosophical implications.

[14] Deitel PJ, Deitel HM. C How to Program. 6th ed. New Jersey USA: Pearson Prentice Hall; 2010

## **Chapter 18**

**References**

[1] Ogunnaike BA, Ray WH. Process Dynamics, Modeling, and Control. 1st ed. USA: Oxford University Press; 1994

*Renewable Energy - Technologies and Applications*

[13] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: 10 bit ADC"

Microchip 2006 (DS39564C). Chandler,

[14] Deitel PJ, Deitel HM. C How to Program. 6th ed. New Jersey USA: Pearson Prentice Hall; 2010

Arizona USA; pp. 181-188

[2] Stephanopoulos G. Chemical Process Control: An Introduction to Theory and Practice. USA: Prentice Hall; 1983

[3] Seborg DE, Edgar TF,

[4] Phillips CL, Nagle HT,

2017. pp. 115-117

pp. 279-335

(DS39564C)

Microchip 2007

Newnes; 2011

**290**

Mellichamp DA, Doyle FJ. Process Dynamics and Control. 4th ed. New York, USA: John Wiley and Son;

Chakrabortty A. Digital Control System Analysis and Design. UK: Pearson; 2015.

[5] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers" Microchip 2006

[6] Microchip MCP4921/4922 datasheet "12-Bit DAC with SPI™ Interface"

[7] HD44780 LCD starter guide. 2001

[9] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: Timers" Microchip 2006 (DS39564C). pp. 103-115

[10] Bates M. PIC Microcontrollers: An Introduction to Microelectronics.

[11] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: External interrupts" Microchip 2006 (DS39564C). pp. 73-85

[12] Microchip PIC18FXX2 Data Sheet "High-Performance, Enhanced Flash Microcontrollers: Timer0 interrupt" Microchip 2006 (DS39564C). p. 85

[8] Microchip application maestro software user's guide. 2003

## Lessons Learnt from Some Natural Energy Sources

*Dan Serbanescu*

## **Abstract**

The chapter presents in a systematic manner the lessons learnt from the natural energy systems (NES) and their specific features. The conclusions are based on the evaluation of the risk impact on environment and for the improvement of the risk evaluation methodologies of such systems. A specific feature of the NES is the interdependence between them and society/mankind and the environment. Risk analyses for such systems have specific features underlined while compared with the features of the artificial (man-made) energy systems (MMES). Previous works illustrated in detail the NES versus MMES differences. This chapter presents the main aspects of such a review, when applied to a specific NES, the natural nuclear fission reactor in Oklo, Gabon (NES\_Oklo). NES\_Oklo operated about two billion years ago for about two hundreds millions of years. The lessons drawn from studying how this reactor was built, operated and self-decommissioned are of high importance for nuclear energy and not only. There are conclusions drawn from the study of Oklo reactor, which seem to shake some taboo issues in Physics, like for instance the light speed limit and other fundamental aspects of Quantum Mechanics, which have also important philosophical implications.

**Keywords:** natural energy system (NES), man made energy systems (MMES), risk, nuclear reactor, quantum mechanics, philosophy of science, speed of light, ecology, energy systems life cycle (ES\_LC), knowledge process (KP), topological structure (K(i)), theory of a given topological structure (Th(K(i)), Backward engineering)

### **1. Introduction**

Two and a half billion years ago a natural fission reactor operated on the Earth (Oklo). The discovery of this natural energy source created a series of theories and had implications yet to be evaluated both on the man-made artifacts of similar type and on some fundamentals considered so far as improbable to be challenged in quantum physics, biology, ecology, nuclear reactor theory. It also has an impact on knowledge management, on the epistemology and ethics. Aspects of the implications for mankind and the lessons learnt so far on the actions to build a sustainable civilization are presented in this chapter.

In 1972 the international community involved in the research, design and operation of MMES of fission type reactors was surprised and challenged by a discovery of the remains of an ancient natural fission reactor, in Oklo (Gabon). It was a NES type reactor (NES\_Oklo).

However the discovery was predicted long time before by PK Kuroda [1]. The reactor in Gabon operated, intermittently, two and a half billion years ago for about two hundreds millions year and had an approximate power of 100 kW. It operated with uranium ore (using the isotope U235) and water [2–5].

**2. Evaluation method**

*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

possible, as they

transformations,

method is based on three principles [10]:

paradoxes that result at each step.

**293**

category considered as:

their lifecycles.

This chapter will focus only on the lessons learnt so far. However, there are more than only natural sciences implications, but also on the manner we acquire knowledge, on how we build models and interact with their reality and how we related to

Therefore the chapter will not address the details of the researches on Oklo, but

For this endeavor, a systematic approach was adopted and presented previously [6–9]. Based on this approach the NES and MMES are evaluated in their interaction and development/transformation from one to another in a systematic manner,

1.Energy sources create systems, which might be considered Complex Systems (CS) [6] These systems are composed of elements and connectors between

2.For the ES considered as CS, defined by NES and MMES, because they have a behavior of topological nature and for their models, a topological description is

• their emergence/transformation from one phase/state/form/source to

The KP of a given ES for a given NES cannot be predicted in detail, but in its

general features. The proposed approach considers that the KP generates a topological structure (K(i)) based on a set of relationships between the objects modeled and it is developed in accordance with a certain Theory (Th(K(i))). The topological structure resulting from the KP is in isomorphism with the topological structure describing the emergence rules of the NES from one state to another. The

**Principle 1:** The topological structure K(i) is described by the notion of

• being a general description of cybernetic description of objects and

• being described by objects, morphisms, and identity morphisms

**Principle 2:** KP is performed in iterations on the categories for each object and each level up to the moment of reaching a critical status due to number and type of

models as "black-boxes" for each level of construction and for each object.

• reflecting a hierarchical "matrioshka" type of structure

• are described by invariants, that preserve their nature after

them defined as categories, in the mathematical sense [6].

• create complex networks fractal like structures and

another takes place step by step [10].

rather the lessons learnt to the humanity for such a discovery. The approach adopted in the presentation of Oklo lessons in this chapter is also based on some author's researches on the philosophy of science and models proposed to consider, model and interact with the energy sources, by describing their creation/emergence, their lifecycle and their interaction with mankind and its knowledge.

which is based on some assumptions, as follows:

As the reactor physics classic results show, this would not be possible, provided the concentration of U235 (considered as a constant for the whole universe) being presently 0.71% was not higher (around 3.3%) by the time the reactor started operating. And this is not all. The reactor had to have a concentrated amount of U235 in a place forming a geometry and a configuration of cooling (with cooling water) of a very specific precise type. Apparently cyanobacteria concentrated the uranium and the water from the underground, pushed by the geological moves by that time (Africa and South America were splitting apart) created actually the reactor core, as called in the nuclear engineering. Even more than that, the type of soil assured the retention of the radioactive elements resulted from fission, which actually did not migrate further than the site.

All those aspects were very troubling for the nuclear community. In addition the calculations for the MMES reactors were seriously challenged when they were used to describe NES\_Oklo.

Findings did not stop here, as series of other theories were developed, as for instance:


There is a vast literature on Oklo reactor, of which the references are representative in our view. The references could be started with the works of PK Kuroda, who predicted the first the possibility of the existence of a natural fission reactor on Earth.

## **2. Evaluation method**

However the discovery was predicted long time before by PK Kuroda [1]. The reactor in Gabon operated, intermittently, two and a half billion years ago for about two hundreds millions year and had an approximate power of 100 kW. It operated

As the reactor physics classic results show, this would not be possible, provided the concentration of U235 (considered as a constant for the whole universe) being presently 0.71% was not higher (around 3.3%) by the time the reactor started operating. And this is not all. The reactor had to have a concentrated amount of U235 in a place forming a geometry and a configuration of cooling (with cooling water) of a very specific precise type. Apparently cyanobacteria concentrated the uranium and the water from the underground, pushed by the geological moves by that time (Africa and South America were splitting apart) created actually the reactor core, as called in the nuclear engineering. Even more than that, the type of soil assured the retention of the radioactive elements resulted from fission, which

All those aspects were very troubling for the nuclear community. In addition the calculations for the MMES reactors were seriously challenged when they were used

Findings did not stop here, as series of other theories were developed, as for

• Theories related to how the oxygen formation (taking place exactly by that time) were related to the activity of the geyser nuclear reactor splitting water

• As for the biology the time of NES\_Oklo operation is also coincident with the appearance of eukaryotes, living beings having cells with nucleus in a

• Not to mention the fact that new theories and observations started to assume that, may be even the Earth core is a nuclear fission reactor and may be Oklo

• More than that evidence on existence of fission reactors is found also in our neighboring planets (Mars), all taking place at a certain time of evolution of energy chains of the universe, of the solar system and of our Earth. Operation of such NES reactors appears to give serious inputs on how an ecological type of such source of energy might be designed by mankind. All those aspects are

• A troubling set of correlations and coincidences illustrate for this particular case how various phenomena with their lifecycles, their appearance, and development are connected to each other and how Mother Nature gives us lessons on how to manage complicated lifecycles of high energies without

There is a vast literature on Oklo reactor, of which the references are representative in our view. The references could be started with the works of PK Kuroda, who predicted the first the possibility of the existence of a natural fission reactor on Earth.

• As a top of troubling discoveries, the site evaluations challenged some fundamentals of quantum mechanics and relativity, related to the alpha

vapors, as water got overheated, to the atmosphere.

really of high interest and researches are going on.

with uranium ore (using the isotope U235) and water [2–5].

actually did not migrate further than the site.

*Renewable Energy - Technologies and Applications*

membrane, to which we also belong.

constant and the speed of light.

was not the only surface reactor.

damaging it.

**292**

to describe NES\_Oklo.

instance:

This chapter will focus only on the lessons learnt so far. However, there are more than only natural sciences implications, but also on the manner we acquire knowledge, on how we build models and interact with their reality and how we related to their lifecycles.

Therefore the chapter will not address the details of the researches on Oklo, but rather the lessons learnt to the humanity for such a discovery. The approach adopted in the presentation of Oklo lessons in this chapter is also based on some author's researches on the philosophy of science and models proposed to consider, model and interact with the energy sources, by describing their creation/emergence, their lifecycle and their interaction with mankind and its knowledge.

For this endeavor, a systematic approach was adopted and presented previously [6–9]. Based on this approach the NES and MMES are evaluated in their interaction and development/transformation from one to another in a systematic manner, which is based on some assumptions, as follows:

	- are described by invariants, that preserve their nature after transformations,
	- create complex networks fractal like structures and
	- their emergence/transformation from one phase/state/form/source to another takes place step by step [10].

The KP of a given ES for a given NES cannot be predicted in detail, but in its general features. The proposed approach considers that the KP generates a topological structure (K(i)) based on a set of relationships between the objects modeled and it is developed in accordance with a certain Theory (Th(K(i))). The topological structure resulting from the KP is in isomorphism with the topological structure describing the emergence rules of the NES from one state to another. The method is based on three principles [10]:

**Principle 1:** The topological structure K(i) is described by the notion of category considered as:


**Principle 2:** KP is performed in iterations on the categories for each object and each level up to the moment of reaching a critical status due to number and type of paradoxes that result at each step.

• The set of invariants (syzygies) is continuously optimized from diverse points of view (using tools from different sciences) and based on the existing results on them a final set of minimal syzygies for a given model —using a given scientific tool—is reached (Hilbert's syzygy theorem).

measure of the efficiency of an energy conversion process. This generator has

• Entropy in a thermodynamic (EnTh) interpretation as a measure of disorder

• Information entropy (EnI) (as a measure of knowledge limits themselves)

• Synergy (Sy) as a measure of a resultant set of features for a NES appearing from the existence and interaction of all systems and subsystems, leading to a set of characteristics for the whole NES than exist in the sum of its parts

• Emergence (Em) from one level to another (in the example for NES presented from SQ to CSU) a process in which larger entities, patterns, and regularities arise through interactions among smaller or simpler entities that themselves do

• Nonlinearity (even for simple systems) and/or complexity (NlnCx) of NES as

• Features of CAS—fractals type of structure (Fr) of NES and K(i) knowledge

4.The physical meaning of the dominating syzygies, defining the phase change of ES (NES and MMES) is that they are a triadic set of characteristics of the

These are optimal descriptors of each ES state and are described by the formulas

*j*¼1

*j*¼1

*j*¼1

(k) ψ <sup>1</sup>

define the term called real energy/mass/entropy; examples of energy in such

*E*ð Þ*<sup>k</sup> <sup>j</sup>* ∗ *i* ð Þ*k*

*m*ð Þ*<sup>k</sup> <sup>j</sup>* ∗ *i* ð Þ*k*

ψð Þ*<sup>k</sup> <sup>j</sup>* ∗ *i* ð Þ*k*

(k)\*i1

*<sup>j</sup>* (3)

*<sup>j</sup>* (4)

*<sup>j</sup>* (5)

(k) (Noted for the states 0 and 1)

<sup>0</sup> <sup>þ</sup><sup>X</sup> 8

<sup>0</sup> <sup>þ</sup><sup>X</sup> 8

<sup>0</sup> <sup>þ</sup><sup>X</sup> 8

*<sup>E</sup>*ð Þ*<sup>k</sup>* <sup>¼</sup> *<sup>E</sup>*ð Þ*<sup>k</sup>*

*<sup>m</sup>*ð Þ*<sup>k</sup>* <sup>¼</sup> *<sup>m</sup>*ð Þ*<sup>k</sup>*

<sup>ψ</sup>ð Þ*<sup>k</sup>* <sup>¼</sup> <sup>ψ</sup>ð Þ*<sup>k</sup>*

(k); m1

(k)\*i1

(k)\*i1

◦ It is destroyed whenever an irreversible process occurs.

not exhibit such properties and evolve to new levels.

sources of chaotic structure and behavior

state of the ES/syzygies and are [10, 11]:

• Energy (E)

• Mass (m)

(3)–(5)

where

**295**

• E0, m0, ψ<sup>0</sup> –and E1

• Entropy (ψ)

topological structures built for them.

◦ It is conserved only when all processes of the system and the environment

some specific characteristics:

*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

are reversible

	- Subquantic (SQ)
	- Quantic (Q)
	- Electromagnetic (EM)
	- Molecular (MO)
	- Molecular and life (MOL)
	- Conscious planetary life (CPL)
	- Stellar and universe not alive (SUNA)
	- Stellar and universe life (SUA)
	- Conscious stellar and universe (CSU)

**Principle 3:** KP is asymptotically stable and complete. However the resultant final structure of this process, which is a CAS, may not be known by its detailed phenomenological characteristics, nor predicted, but rather known for its dominant syzygies.

3.The invariants are called syzygies and they are in the format described by formulas (1) and (2).

$$\text{Gen [NES]} = \left[ \text{EnTh EnI Sy Em NInTx Fr} \right] \tag{1}$$

$$\text{(\textbf{Syzgyy} [\text{NES}] = f \ (\text{Gen}[\text{NES}])\tag{2})}$$

There are some specific generators (in the sense of syzygy theory) for a K(i) structure built for NES:

• Exergy (Ex) of a NES (defined as the maximum useful work possible during a process that brings the system into equilibrium with a heat reservoir), as a

• The set of invariants (syzygies) is continuously optimized from diverse points of view (using tools from different sciences) and based on the existing results on them a final set of minimal syzygies for a given model —using a given scientific tool—is reached (Hilbert's syzygy theorem).

• The KP with these new tools will lead to another set of syzygies and have a status of paradoxes in comparison with the real object that will require a

• An example of NES group is presented in this paragraph. NES are assumed to consist of the following levels of energy sources (NES):

• The process of reaching a status for a set of syzygies is therefore predictable and has an end. However the end state described by the resultant set of syzygies in that KP phase may not correspond to the real object. Therefore, a new iteration using another type of methods analogy from another science that the previous iteration—is used for a

new iteration.

*Renewable Energy - Technologies and Applications*

new iteration etc.

◦ Subquantic (SQ)

◦ Molecular (MO)

syzygies.

**294**

formulas (1) and (2).

structure built for NES:

◦ Electromagnetic (EM)

◦ Molecular and life (MOL)

◦ Conscious planetary life (CPL)

◦ Stellar and universe life (SUA)

◦ Stellar and universe not alive (SUNA)

◦ Conscious stellar and universe (CSU)

**Principle 3:** KP is asymptotically stable and complete. However the resultant final structure of this process, which is a CAS, may not be known by its detailed phenomenological characteristics, nor predicted, but rather known for its dominant

3.The invariants are called syzygies and they are in the format described by

Gen NES ½ �¼ EnTh EnI Sy Em NlnCx Fr

There are some specific generators (in the sense of syzygy theory) for a K(i)

• Exergy (Ex) of a NES (defined as the maximum useful work possible during a process that brings the system into equilibrium with a heat reservoir), as a

(1)

Syzygy NES ½ �¼ f Gen NES ð Þ ½ � (2)

◦ Quantic (Q)

measure of the efficiency of an energy conversion process. This generator has some specific characteristics:

	- Energy (E)
	- Mass (m)
	- Entropy (ψ)

These are optimal descriptors of each ES state and are described by the formulas (3)–(5)

$$E^{(k)} = E\_0^{(k)} + \sum\_{j=1}^{8} E\_j^{(k)} \* i\_j^{(k)} \tag{3}$$

$$m^{(k)} = m\_0^{(k)} + \sum\_{j=1}^{8} m\_j^{(k)} \* i\_j^{(k)} \tag{4}$$

$$
\Psi^{(k)} = \Psi\_0^{(k)} + \sum\_{j=1}^{8} \Psi\_j^{(k)} \* i\_j^{(k)} \tag{5}
$$

where

• E0, m0, ψ<sup>0</sup> –and E1 (k)\*i1 (k); m1 (k)\*i1 (k) ψ <sup>1</sup> (k)\*i1 (k) (Noted for the states 0 and 1) define the term called real energy/mass/entropy; examples of energy in such

states are the energies perceived at Earth level by a human observer (including such as NES\_Oklo), defining the Real Reality.

However, the interpretation we make of this source is done at a certain level of our civilization (in its very early beginnings, judging by the criteria of what kind of energy we could harness) [6]. We are far away by several centuries before being able to harness the energy of our sun, which is quite a primitive phase. On the other side, our KP is based on an extremely advanced tool (the interdisciplinary and trans disciplinary one) which may push us to advance much faster than we may envisage now. However, the stronger the forces we harness, the higher the risk to get to the

We are at a crossroad of the evolution and lessons from NES like Oklo are extremely useful, as they show us how to harness better high energy with high risk sources [6].

8. In our present knowledge the KP assumes for the ES cases a set of assumptions

• **Paradigm 1-ES as a CS:** A modeling system has to be built in order to represent Risk Analyses for ES (RES) as a complex system, too. RES is converging to a stable unique real state. However the KP results, including those RES are limited by our present knowledge, as described

• **Paradigm 2:** ES model involves knowledge of the risks associated to a certain source of energy. However, usually we actually are not aware of the real risks and we know very little about the interconnections of lifecycle dangers for interfering processes (energy level, emergence

correlated with civilization one or with geological one etc.)

• **Paradigm 3:** Details of ES and their lessons learnt. We design ES (MMES) for which Nature already indicated the optimal solutions. However, due to our reduced technical and scientific level at a certain moment we cannot understand the lessons from the beginning, but step

• **Paradigm 4:** Understanding the ES risks (RES) and defining them is a difficult task as we design first of a kind MMES and as we are not aware of all the aspects of the lifecycle. The MMES are challenged inevitably by

• **Paradigm 5:** ES risk analyses results are seen as inputs to decision making risk calculation results are used for decisions. However we are facing decisions under high uncertainties and the use of lateral thinking is decisive.

• **Paradigm 6:** In the ES risk analyses results there are limits and biases specific to the level of knowledge of that issue, but also there are "hidden" biases due to the level of KP in the whole civilization at that moment. Inter and trans disciplinarity is not just a desired option, but a mandatory

• **Paradigm 7:** RES results evaluation for further iterations in the.KP is an iterative process and the Principle 3 mentioned above applies. The result could be a better understanding by the use of diverse tools, as for instance the information one can get by "backward engineering" from natural

serious events, which apparently test the design continuously.

generated by the paradigms, creating paradoxes, as for instance [6]:

by the real Earth level mentioned above.

finish of civilization by self-destruction.

*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

by step.

one to minimize such biases.

examples.

**297**

	- Thermodynamic entropy, for the states 0 and 1 for the real states
	- Shannon entropy for the states 2 and 3, for the simple complex states
	- Enantiotropy for the states 4–<sup>8</sup>

The triadic set of syzygies defined the set of Realities (as in formula (6))

$$\mathcal{R}^{(k)} = \mathcal{R}\_0^{(k)} + \sum\_{j=1}^{8} \mathcal{R}\_j^{(k)} \* \dot{\mathbf{t}}\_j^{(k)} \tag{6}$$

	- Other natural phenomena
	- At a given level of civilization

For instance NES\_Oklo appeared 2.5 billion years ago, while the "Reactor designer" had at its disposal:


*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

states are the energies perceived at Earth level by a human observer (including

• indexes 2 and 3 the simple complex part (for the states 2 and 3); examples of states of this type are the paranormal phenomena, energies, information channels perceived by a human observer becoming part of the observed object,

defining the Intuition Reality of the second level Realm (cosmic) and

• the rest of components are the hyper-complex part (for the states 4–8); examples are states of paradoxical situations coming from other realities and

enantiotropy feedback chain (entropy of states of the triadic ES) and they are our connection to the Universe Realm and diverse realities (Universes)

• The entropy has the following dominant syzygies for each state, as follows [11]:

◦ Shannon entropy for the states 2 and 3, for the simple complex states

◦ Thermodynamic entropy, for the states 0 and 1 for the real states

The triadic set of syzygies defined the set of Realities (as in formula (6))

<sup>0</sup> <sup>þ</sup><sup>X</sup> 8

5.ES and their models define topological algebraic spaces, which might be represented as polyhedral type, describing their states and illustrating the

6.The description of emergence/transformation of one source in another or of passage from one phase to another is based on the method presented in [6, 10].

For instance NES\_Oklo appeared 2.5 billion years ago, while the "Reactor designer"

7.ES and their models exist in two types of interconnections, with:

*j*¼1

*R*ð Þ*<sup>k</sup> <sup>j</sup>* ∗ *i* ð Þ*k*

*<sup>j</sup>* (6)

*<sup>R</sup>*ð Þ*<sup>k</sup>* <sup>¼</sup> *<sup>R</sup>*ð Þ*<sup>k</sup>*

totally unexplainable for a human observer, but managing them by

such as NES\_Oklo), defining the Real Reality.

*Renewable Energy - Technologies and Applications*

◦ Enantiotropy for the states 4–<sup>8</sup>

• Other natural phenomena

• At a given level of civilization

• A certain geological configuration

• A certain status of interface with cosmos

• Environment as we know being under construction

• A certain status of living beings

• No existing civilization

(formula (6))

optimal cases.

had at its disposal:

**296**

However, the interpretation we make of this source is done at a certain level of our civilization (in its very early beginnings, judging by the criteria of what kind of energy we could harness) [6]. We are far away by several centuries before being able to harness the energy of our sun, which is quite a primitive phase. On the other side, our KP is based on an extremely advanced tool (the interdisciplinary and trans disciplinary one) which may push us to advance much faster than we may envisage now. However, the stronger the forces we harness, the higher the risk to get to the finish of civilization by self-destruction.

We are at a crossroad of the evolution and lessons from NES like Oklo are extremely useful, as they show us how to harness better high energy with high risk sources [6].

	- **Paradigm 1-ES as a CS:** A modeling system has to be built in order to represent Risk Analyses for ES (RES) as a complex system, too. RES is converging to a stable unique real state. However the KP results, including those RES are limited by our present knowledge, as described by the real Earth level mentioned above.
	- **Paradigm 2:** ES model involves knowledge of the risks associated to a certain source of energy. However, usually we actually are not aware of the real risks and we know very little about the interconnections of lifecycle dangers for interfering processes (energy level, emergence correlated with civilization one or with geological one etc.)
	- **Paradigm 3:** Details of ES and their lessons learnt. We design ES (MMES) for which Nature already indicated the optimal solutions. However, due to our reduced technical and scientific level at a certain moment we cannot understand the lessons from the beginning, but step by step.
	- **Paradigm 4:** Understanding the ES risks (RES) and defining them is a difficult task as we design first of a kind MMES and as we are not aware of all the aspects of the lifecycle. The MMES are challenged inevitably by serious events, which apparently test the design continuously.
	- **Paradigm 5:** ES risk analyses results are seen as inputs to decision making risk calculation results are used for decisions. However we are facing decisions under high uncertainties and the use of lateral thinking is decisive.
	- **Paradigm 6:** In the ES risk analyses results there are limits and biases specific to the level of knowledge of that issue, but also there are "hidden" biases due to the level of KP in the whole civilization at that moment. Inter and trans disciplinarity is not just a desired option, but a mandatory one to minimize such biases.
	- **Paradigm 7:** RES results evaluation for further iterations in the.KP is an iterative process and the Principle 3 mentioned above applies. The result could be a better understanding by the use of diverse tools, as for instance the information one can get by "backward engineering" from natural examples.

## **3. Lessons learnt from NES\_Oklo**

NES\_Oklo sends to us messages. By diverse evaluations one could mention so far messages as the following:

ii. Diffusion of small distances in the specific rock of the site (several

organisms; therefore the containment was the whole atmosphere,

iii. Radioactive radio-sols were part of the creation of new living

iv. There was an intrinsic safety assured by delayed neutrons, preventing transformation of the reactor into a bomb

d. NES\_Oklo has a direct impact on the lifecycle preparation of existing and

i. Review the type of best plant control—centralized versus

ii. Review of the safety analyses models for all the lifecycles and

iii. Review existing researches on the future man machine interface for new reactors, role of artificial intelligence and the role of KP

iv. Set the goal of maximum simplification of MMES, counting to the highest extent possible on passive features and intrinsic safety

v. Review the manner various phenomena are modeled for the reactor in coupled computer codes and either use higher

vi. Design MMES as part of regional/global energy sources systems, integrated in the environment, based on ecological principles.

i. How constant is the alpha constant and the role of the amazing

ii. It appears that some constants are not so constant (for instance speed of light). If so the impact is very high on many aspects already considered confirmed and taboo to be challenged. An epistemic revolution is to be generated in Physics on the way to

iii. There is an amazing set of coincidences to have a reactor core designed (geological, biological, cosmic, etc.). If the rare

e. Several aspects from fundamental quantum mechanics and theory of relativity are yet to be reviewed, as the NES\_Oklo measurements are

number 137 in the architecture of the universe

change the existing paradigms.

c. The validity of reactor physics codes used for MMES was highly challenged. Although it seems so far that they could reproduce the

reactor core design, there are yet issues to be clarified.

especially for decommissioning

and generations to operate the plants

computing capacities or simplify them

future MMES, as follows:

*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

decentralized

protection.

challenging some of them

**299**

meters for more than 2 billion years [12]).

without damaging it, but helping it.

	- a. The limits of NES\_Oklo were very well defined for all its lifecycle phases
		- i. During operation
			- 1.Geometry stability of the core assured by the rocks configuration (the concrete part of any MMES)
			- 2.Climate was stable in the parameters of the period
			- 3. Interface with living organism was designed to be not only harmless, but also useful for both sides (cyanobacteria were prosperous for several millions of years).
		- ii. During decommissioning
			- 1.There was no migration beyond the site of the heavy radioactive solid waste.
			- 2.The aerosols were actually part of the plan to rebuild the Earth atmosphere and generate new living beings—eukaryotes.
			- 3.Apparently the design assumed how to better decommission it at the end of the lifecycle. Thinking of decommissioning from the research phase is a mandatory requirement for a well-designed MMES.
	- b. There is a fractal like design of the whole NES\_Oklo reactor, as for instance the manner the following reactor functions were assured, as reflection at lower levels of the same principles:
		- i. Fuel load (uranium 235) to the reactor core, assured by cyanobacteria, as an intrinsic self-regulated process, in mirror with the operation of the whole reactor.

**3. Lessons learnt from NES\_Oklo**

*Renewable Energy - Technologies and Applications*

messages as the following:

NES\_Oklo sends to us messages. By diverse evaluations one could mention so far

lessons learnt from NES\_Oklo show. NES\_Oklo was a combined non-live living organisms operation to produce energy. This is a high important topic for the future MMES to be designed by assuming the use of Artificial Intelligence, may be also natural and living organisms, etc. The evolution of our civilization and/or possible future interactions at cosmic level require a clear strategy on how to proceed if combined (natural, artificial, living non-living, etc.) energy

1.The issue of the meaning of risk analyses for ES is very important, as the

2.NES\_Oklo teaches us on the absolute importance of intrinsic safety (the reactor operated, got decommissioned without being of any harm to its environment, but on the contrary, being part of the evolution "plan").

3.NES\_Oklo has the following features of importance for future evolutive MMES

a. The limits of NES\_Oklo were very well defined for all its lifecycle phases

1.Geometry stability of the core assured by the rocks configuration (the concrete part of any MMES)

2.Climate was stable in the parameters of the period

1.There was no migration beyond the site of the heavy

2.The aerosols were actually part of the plan to rebuild the Earth atmosphere and generate new living beings—eukaryotes.

3.Apparently the design assumed how to better decommission it at the end of the lifecycle. Thinking of decommissioning from the research phase is a mandatory requirement for a

cyanobacteria, as an intrinsic self-regulated process, in mirror with

prosperous for several millions of years).

b. There is a fractal like design of the whole NES\_Oklo reactor, as for instance the manner the following reactor functions were assured, as

i. Fuel load (uranium 235) to the reactor core, assured by

3. Interface with living organism was designed to be not only harmless, but also useful for both sides (cyanobacteria were

sources production is to be evaluated and designed.

to be designed, built and operated by the mankind:

ii. During decommissioning

radioactive solid waste.

well-designed MMES.

reflection at lower levels of the same principles:

the operation of the whole reactor.

**298**

i. During operation

	- i. Review the type of best plant control—centralized versus decentralized
	- ii. Review of the safety analyses models for all the lifecycles and especially for decommissioning
	- iii. Review existing researches on the future man machine interface for new reactors, role of artificial intelligence and the role of KP and generations to operate the plants
	- iv. Set the goal of maximum simplification of MMES, counting to the highest extent possible on passive features and intrinsic safety protection.
	- v. Review the manner various phenomena are modeled for the reactor in coupled computer codes and either use higher computing capacities or simplify them
	- vi. Design MMES as part of regional/global energy sources systems, integrated in the environment, based on ecological principles.
	- i. How constant is the alpha constant and the role of the amazing number 137 in the architecture of the universe
	- ii. It appears that some constants are not so constant (for instance speed of light). If so the impact is very high on many aspects already considered confirmed and taboo to be challenged. An epistemic revolution is to be generated in Physics on the way to change the existing paradigms.
	- iii. There is an amazing set of coincidences to have a reactor core designed (geological, biological, cosmic, etc.). If the rare

coincidence might be more or less accepted, the troubling finding that the NES\_Oklo is not the only one of this type leads to the debate about anaphatic and kataphatic approaches to the understanding of the *Designer* of the world.

	- i. The evolution of life on Earth, the meaning of life and the role of randomness (if any) in its emergence and evolution.
	- ii. The future of our civilization and how to use better the lessons so that to avoid destroying ourselves by the time we harness more and more powerful energy sources.
	- iii. Why and how was it possible at a certain moment in time to have NES\_Oklo? How to explain strange coincidences of NES\_Oklo with eukaryotes, Earth terraforming and conditions for us to appear in the evolution (or what?) chain.
	- iv. How to understand/manage messages for which we do not have yet the capability to understand, as they are from the category of hyper complex reality?

**Author details**

Dan Serbanescu1,2

**301**

dserbanescu@nuclearelectrica.ro

provided the original work is properly cited.

*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

1 Division of Logic and Models in Science and Technology of the Romanian Committee for Science and Technology, Romanian Academy, Bucharest, Romania

\*Address all correspondence to: dan.serbanescu1953@yahoo.com;

2 Romanian National Nuclear Electricity Company Nuclearelectrica SA, Romania

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

## **4. Conclusions**

NES\_Oklo had so far a significant impact on nuclear physics and nuclear engineering. However, its impact is yet to be completed, as new investigations and interdisciplinary works discover unexpected facts of the lessons transmitted by Oklo to us.

NES\_Oklo is an example of how to build and operate an optimal, environmental friendly, for all lifecycle phases, nuclear fission reactor.

Summarizing, its lessons are related to:


*Lessons Learnt from Some Natural Energy Sources DOI: http://dx.doi.org/10.5772/intechopen.90863*

coincidence might be more or less accepted, the troubling finding that the NES\_Oklo is not the only one of this type leads to the debate about anaphatic and kataphatic approaches to the

enantiotropy (entropy of the optimal ES states) is a very possible answer to previous questions. High level cybernetics—the cybernetics of CS states is indicated as describing such systems.

i. The evolution of life on Earth, the meaning of life and the role of

ii. The future of our civilization and how to use better the lessons so that to avoid destroying ourselves by the time we harness more

iii. Why and how was it possible at a certain moment in time to have NES\_Oklo? How to explain strange coincidences of NES\_Oklo with eukaryotes, Earth terraforming and conditions for us to

iv. How to understand/manage messages for which we do not have yet the capability to understand, as they are from the category of

NES\_Oklo had so far a significant impact on nuclear physics and nuclear engineering. However, its impact is yet to be completed, as new investigations and interdisciplinary works discover unexpected facts of the lessons transmitted by Oklo to us.

NES\_Oklo is an example of how to build and operate an optimal, environmental

• The high advantages of using combined live-non alive elements in the fuel cycle

• Foster the fundamental research in quantum mechanics, as the lessons are that, we are not yet understanding even basic aspects (as for instance the role of

• Review the models we build for the Physics and ES and improve the KP for

randomness (if any) in its emergence and evolution.

iv. The NES\_Oklo operated from the design to decommissioning phase as a cybernetic machine understandable with high level cybernetics considering all the three levels from formulas (3)–(6)

—real, simple complex and hyper-complex. The hypercybernetics, governed by the feedback control via the

understanding of the *Designer* of the world.

*Renewable Energy - Technologies and Applications*

f. NES\_Oklo raises a series of philosophical debates, too:

and more powerful energy sources.

hyper complex reality?

friendly, for all lifecycle phases, nuclear fission reactor.

those aspects by using systematic approaches

• Improvement of the design strategies for new MMES

• Lessons on how to solve the waste management problem

Summarizing, its lessons are related to:

various universal constants)

**4. Conclusions**

**300**

appear in the evolution (or what?) chain.

## **Author details**

Dan Serbanescu1,2

1 Division of Logic and Models in Science and Technology of the Romanian Committee for Science and Technology, Romanian Academy, Bucharest, Romania

2 Romanian National Nuclear Electricity Company Nuclearelectrica SA, Romania

\*Address all correspondence to: dan.serbanescu1953@yahoo.com; dserbanescu@nuclearelectrica.ro

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

## **References**

[1] Kuroda PK. The Origin of the Chemical Elements and the Oklo Phenomenon. Springer; 1982. ISBN: 978-3-642-68667-2

[2] Gil L. IAEA Office of Public Information and Communication, Meet Oklo, the Earth's Two-Billion-Year-Old Only Known Natural Nuclear Reactor. 2018. Available from: https://www.iaea. org/newscenter/news/meet-oklo-the-ea rths-two-billion-year-old-onlyknown-natural-nuclear-reactor

[3] https://en.wikipedia.org/wiki/Oklo

[4] Meshik AP. The Workings of an Ancient Nuclear Reactor. Scientific American on January 26, 2009, originally appeared in the October 2005. Available from: https://www.scientifica merican.com/article/ancient-nuclearreactor/

[5] Lederman LM. Symmetry and the Beautiful Universe. Prometheus Books; 2004. ISBN: 9781591022428

[6] Serbanescu D. Selected Topics in Risk Analyses for Some Energy Systems. Lambert; 2015

[7] Spiridon LV, Serbanescu D, Sticlaru G. O Privire Asupra Unor Lectii de Cunoastere Date de Cavalcada Modelelor in f Zica. IYL; 2015

[8] Serbanescu D. Energetica si Fizica Nucleara Descoperiri, Accidente, Lectii ale Naturii, Comitetul Roman de Istoria si Filozofia Ştiinţei şi Tehnicii (CRIFST) Curs de Initiere in Istoria si Filozofia Stiintei Seria a IXoa. 2015

[9] Serbanescu D. On Some Natural Energy Systems and Lessons Learnt from Their Analysis [Despre Unele Sisteme Energetice Naturale si Invatamintele Studierii]. ISBN: 9783668669192; ISBN (Book): 9783668669208

[10] Șerbănescu D. An integrated perspective on knowledge and existence. In: Noema XVI; 2017. pp. 185-216

[11] Serbanescu D. On Some Unifying Approaches in Physics and Mind Sciences [Despre Unele Abordări Integratoare ale Fizicii și Științelor Minții—(A Main Text in Romanian with Extended Presentations in English of the Models and Results)]. DOI: 10.13240/ RG.2.2.29959

**Chapter 19**

*Ľubomír Šooš*

**Abstract**

Press Machines

designs of these press machines.

**303**

**1. Design of the new press machines**

Research and Development of the

Throughout the world in the last two decades, solid noble biofuels produced on the basis of wood and agricultural biomass have been widely used. Many European Union countries have enacted legislation for solid noble biofuels oriented primarily to energy carriers manufactured from wood raw materials. The production of noble biofuels is a fitting direction for the recovery of biomass and other energy wastes. Fuel in the twenty-first century must, in addition to environmental and economic criteria, fulfil the criterion of high comfort and safety in its combustion. Modern energy carriers must have uniform size, density, moisture and shape. One of the most progressive means of waste recovery is the compaction of particulate matter into different shapes and sizes. The technologies of transforming biomass into biofuels with the required properties are compacting, briquetting and pelleting. I am working on a research of compaction technologies and the development of compacting machine design at the Institute of Production Systems, Environmental Technology and Quality Management of the Faculty of Mechanical Engineering of STU in Bratislava for more than 26 years. In its scientific research activity, the definition of equations describing the dynamic process of compaction, experimental tests of the compaction process, design and testing of new press machine were undertaken. Over the stated period, we have designed and developed several machines that are today in serial production. Chief among these is the BL 55–280 briquetting press, the DZ 240 disintegrating machine, the KUDO 2009 mobile unit for treatment of wood waste, the TR 200 solid material separator, the PLG 150 round pelleting press, the ZBL-2-860 double-screw briquetting press or the RCM 650 ring compacting machine. We have submitted over 53 patents and industrial models. The aim of this chapter is to describe the new original and progressive

**Keywords:** research, press technology, original design, machine, patent, fuels

Research into compaction technologies and the development of compacting machine construction have been undertaken by the Institute of Production Systems, Environmental Technology and Quality Management of the Mechanical Engineering Faculty at the Slovak University of Technology in Bratislava (ÚSETM SjF STU) for more than 18 years. In its scientific research activity, the definition of equations

New Progressive Construction

[12] Yucca Mountain Project (YMP). Oklo: Natural Nuclear Reactors. Office of Civilian Radioactive Waste Management (OCRWM); 2004. Fact sheets. DOE. YMP-0010. Archived from the original on 2004

## **Chapter 19**

**References**

reactor/

Lambert; 2015

978-3-642-68667-2

[1] Kuroda PK. The Origin of the Chemical Elements and the Oklo Phenomenon. Springer; 1982. ISBN:

[2] Gil L. IAEA Office of Public

rths-two-billion-year-old-onlyknown-natural-nuclear-reactor

[3] https://en.wikipedia.org/wiki/Oklo

originally appeared in the October 2005. Available from: https://www.scientifica merican.com/article/ancient-nuclear-

[5] Lederman LM. Symmetry and the Beautiful Universe. Prometheus Books;

[6] Serbanescu D. Selected Topics in Risk Analyses for Some Energy Systems.

Sticlaru G. O Privire Asupra Unor Lectii de Cunoastere Date de Cavalcada Modelelor in f Zica. IYL; 2015

[8] Serbanescu D. Energetica si Fizica Nucleara Descoperiri, Accidente, Lectii ale Naturii, Comitetul Roman de Istoria si Filozofia Ştiinţei şi Tehnicii (CRIFST) Curs de Initiere in Istoria si Filozofia

[9] Serbanescu D. On Some Natural Energy Systems and Lessons Learnt from Their Analysis [Despre Unele Sisteme Energetice Naturale si Invatamintele Studierii]. ISBN: 9783668669192; ISBN (Book):

2004. ISBN: 9781591022428

[7] Spiridon LV, Serbanescu D,

Stiintei Seria a IXoa. 2015

9783668669208

**302**

[4] Meshik AP. The Workings of an Ancient Nuclear Reactor. Scientific American on January 26, 2009,

Information and Communication, Meet Oklo, the Earth's Two-Billion-Year-Old Only Known Natural Nuclear Reactor. 2018. Available from: https://www.iaea. org/newscenter/news/meet-oklo-the-ea

*Renewable Energy - Technologies and Applications*

[10] Șerbănescu D. An integrated perspective on knowledge and existence. In: Noema XVI; 2017.

[11] Serbanescu D. On Some Unifying Approaches in Physics and Mind Sciences [Despre Unele Abordări Integratoare ale Fizicii și Științelor Minții—(A Main Text in Romanian with Extended Presentations in English of the Models and Results)]. DOI: 10.13240/

[12] Yucca Mountain Project (YMP). Oklo: Natural Nuclear Reactors. Office

of Civilian Radioactive Waste Management (OCRWM); 2004. Fact sheets. DOE. YMP-0010. Archived from

the original on 2004

pp. 185-216

RG.2.2.29959
