Category Archives: software

Internal workings of process controllers II.

Continued from the previous post

In practice, all these process controllers incorporate a microcontroller.

But microcontrollers are programmed in assembly or in C language, so to create a function block programmable process controller from a C programmable microcontroller, an intermediate firmware must be written.

Continue reading Internal workings of process controllers II.

Internal workings of process controllers I.

This time the internal workings of a process controller will be shown.

I’ll show it through a Siemens SIPART DR24 process controller.

Its user manual can be found on the Siemens’ website:

Siemens SIPART DR24 manual

Although it is almost obsolete, the operational principles can easily be demonstrated with it.

Continue reading Internal workings of process controllers I.

Predictive digital filtering for first order systems

Today measurements must be fast, cheap and accurate at the same time.
These requirements are not easy to achieve.

This post describes a simple but very efficient software method to make a slow measurement faster.

Let’s look at a simple temperature measurement example.

The temperature sensor sits in a protective metal cover.

This sensor is at room tempeature, and we would like to measure the temperature of boiling water.

The example is very simple but it will clearly show the operation of the computing method.

When we put the sensor into the boiling water, we know that the measured value jumps from 20 °C to 100 °C.

but the sensor’s output rises slowly since the protective cover needs time to heat up.

This heat up phenomena acts as a first order filter function.

The first order filter function is described as:

f
where T(t) is the measured temperature at a given t time, T(final) is the final value (100 °C in this example), T(0) is the starting temperature (20 °C in this example) and Tau is the time constant of the filter.

It may seems a little complicated, but plotting a graph gives a very clear demonstration of how it works.

comp1

The problem here is that we know that the measured temperature momentarily rises as the sensor goes into the boiling water, but the measurement shows a slow rising to the final value.

Continue reading Predictive digital filtering for first order systems

Thermocouple Measurement Clarification

This is just a brief overview of how to do thermocouple measurements correctly and simply.
The principles of measuring with thermocouples are described by a lot of web pages. However, one can easily misinterpret the informations obtained form the internet.
The first confusion usually comes from the use of “ice bath” as cold junction compensation, the other is when someone tries to use the thermocouples’ mV – temperature tables.

Continue reading Thermocouple Measurement Clarification

Switch debouncing in PLC software

When a switch or a pushbutton has to be connected to a digital circuit it is often (almost always) a nasty thing, because its unwanted behaviour.

It is a common practice to connect a button or a switch to a digital system (to a microcontroller, to a PLC, or to a PC). The simplest way to do it is shown in the picture below:

pushbutton_connect

Connecting a pushbutton to a microcontroller

If we measure the voltage at the input of the microcontroller with an oscilloscope, it would show the following:

contact_bouncing

Contact bouncing phenomena

The problem is obvious. There isn’t a simple, clean low to high transition. If the microcontroller is fast enough, it senses this switch on event as if there were several pushbutton pressings.

Continue reading Switch debouncing in PLC software