I/O systems

Norbert Brousek | Günter Herkommer,

Retrofitting technology functions via firmware update

Automation tasks are becoming increasingly complex. In view of this development, it is not only the control units themselves that are being challenged, but also the digital and analog I/O modules. Many technological functions can now be retrofitted via firmware updates.

© Siemens

While almost everything in I/O systems used to be cast in hardware, the majority of these modules now have their own controller. Many functions can be implemented via firmware (FW) and can therefore be designed flexibly. While, for example, the linearization of temperature sensor characteristics has been a standard feature of analogue input modules for some time now, it makes sense to integrate other 'technological' functions into the IO modules as well - for example:

  • Counting with digital input modules,
  • Pulse width modulation (PWM) with digital output modules,
  • oversampling,
  • Scaling measured values,
  • measuring range adjustment and temperature range scaling.

Compared to 'real' technology modules, which require their own hardware, firmware-based solutions have a reduced technical scope of performance; however, this approach is extremely cost-effective from the user's point of view. For example, the price of the integrated meter is no more than the channel price of the corresponding digital input. Another advantage is that modules already in the field can be retrofitted via firmware updates if required.

Advertisement

Counting with DI

The first function to be introduced here is 'Counting with DI'. Counting functions are required in almost all areas of production technology. The range of requirements for counting modules is correspondingly broad. Often, however, a complex high-speed counter is not required, but rather an inexpensive, simple solution. An example of this are the two modules 'DI 16x24VDC HF' and 'DI 32x24VDC HF' of the Simatic S7-1500 controller, where two inputs can be defined as counting inputs. The remaining 14 or 30 inputs can still be used as purely digital inputs. This is a 32-bit up-counter with a maximum control frequency of 1 kHz. The edge to which the counter reacts, which counting limit is to be monitored and how the counter should behave when this limit is reached is defined via project planning in the TIA Portal. It is also possible to set a start value and control via a software gate. All the necessary data is stored in the process image of the controller, which makes programming easy and convenient.

Pulse width modulation (PWM) with DQ

Figure 1: Principle of pulse width modulation: A digital output emits a square-wave signal with a specific frequency and a specific pulse-pause ratio.

© Siemens

With pulse width modulation, a digital output emits a square wave signal with a specific frequency and a specific pulse/pause ratio (duty cycle). The corresponding current is then set depending on the connected (inductive) load. Typical actuators that are controlled in this way are small DC motors, LED dimmers, heating controls and various valves.

With a digital 2 A output module such as the 'DQ 8x24VDC/2A HF', a corresponding firmware solution can also be implemented for this, in which two of the eight outputs can be used for PWM. The remaining six outputs can be used as regular binary outputs. The PWM outputs can be operated with a maximum frequency of 500 Hz, the pulse-pause ratio can be set from 0 % to 100 % with a resolution of 0.1 % (corresponds to 10 bits).

As valves in particular are predestined actuators, the special feature of the 'energy-saving function' should be pointed out here. Valves require their maximum current for a certain period of time during the tightening torque. After that, a significantly lower holding current is sufficient. Using PWM, the user can initially set the pulse-pause ratio to 100 %. This means that the output is permanently controlled. After the valve has activated, the pulse-pause ratio can be set to a significantly lower value, for example 50 %, depending on the valve. The user can easily control this from the user program, as all the parameters required for control are also in the process image for this module.

Oversampling

The 'Oversampling' function makes it possible to divide the Profinet clock into up to 16 equal clocks (so-called sub-clocks, intervals, sampling rate). This makes it possible to achieve a high temporal accuracy of 250 µs even with a relatively slow clock of 4 ms, for example, and even 62.5 µs with a bus clock of 1 ms. To achieve this, Profinet must be configured to be clock-synchronous. The respective module automatically divides this time into the sampling rate configured by the user. Instead of a value, the respective module provides a value for each sub-clock in each Profinet clock - i.e. 16 values for a sampling rate of 16. These can either be individual bits of a digital module or - in the case of analog modules - measured values.

Figure 2: How oversampling works in principle.

© Siemens

Figure 2 illustrates this behavior using the 'AI 8xU/I HS' and 'AQ 8xU/I HS' modules as examples. In this example, the Profinet clock is set to 1 ms and the sampling rate is set to eight. This means that the module reads in a new value every 125 µs. The module starts the conversion at the beginning of the Profinet clock 'n'. After 125 µs, the first value for channel 0 is available, after the second sub-cycle - i.e. after 250 µs - the second value is available, and so on. Once the eight intervals are over, all eight measured values are available. These are transferred to the CPU in the following Profinet cycle. According to this procedure, the I/O module converts all eight channels in parallel, so that at the end of a Profinet cycle, 8 × 8, i.e. 64 measured values, are always transmitted to the CPU.

Accordingly, the user specifies eight values per channel at once for the analog output module. The module then outputs these values to the process independently every 125 µs.

Scaling measured values

In purely physical terms, analog input modules record currents or voltages and convert them into a hexadecimal format that can be processed by the controller. Ultimately, however, this always involves a technological process variable such as pressure, length or torque.

While the temperature value is transferred directly to the user program when measuring using a thermocouple (TC) or resistance thermometer (RTD), other technological variables must be processed further in the user program using special scaling blocks. These occupy user memory and cost runtime, as they have to be called up for each individual channel.

Figure 3: Chain of acquisition of an analog process signal and conversion to hexadecimal format.

© Siemens

However, this task can also be carried out with an analog module such as the eight-channel 'AI 8xU/I HF' itself, i.e. it can convert the abstract hexadecimal value directly into the quantity required by the user - for example a length (fill level) in meters. To do this, the user configures the lower and upper limits of the measured value to be scaled in the engineering tool. In the example shown in Figure 3, for example, 1 V corresponds to a fill level of 1 m and 5 V to a fill level of 10 m. The module interpolates the levels in between linearly. Instead of the usual 16-bit S7 format, it supplies the level directly as a floating point number.

As a 32-bit real value can be mapped by converting it into a floating point number, it is now possible to use the full resolution of the A/D converter installed in the analog input module. This means, for example, that a resolution of up to 24 bits is available.

Scaling measuring range adjustment and temperature range

Figure 4: Scaling the temperature range increases the resolution of the 'RTD' and 'TC' measuring ranges to 21 bits and thus the number of decimal places and the calculation accuracy.

© Siemens

Many processes do not utilize the entire input range of a module. For example, a pressure sensor only supplies 2 to 7 V, or in temperature control it is important to keep the operating point as constant as possible. In this case, it is important to make optimum use of the 16 bits provided by the S7 format. In other words, the range to be measured should have as high a resolution as possible so that temperature control, for example, can be calculated internally with several decimal places. This function allows the effective resolution of the module in the 'RTD' and 'TC' measuring ranges to be increased to 21 bits.

Figure 4 schematically shows the basic procedure using the example of temperature measurement and the associated project planning in the TIA Portal. It can be seen that the entire measuring range is available to the user without scaling. If the user selects an operating point (measuring range center point) and two decimal places, the measuring range itself becomes smaller, but the number of decimal places increases. With three decimal places, the range is further restricted. The upper and lower limits are displayed in the TIA portal.

Figure 4 shows this conversion very clearly: without scaling, the entire range from -270.0 °C to +1,622.0 °C (i.e. a range of 1,892.0 K) is available to the user to one decimal place. If the calculation accuracy is now increased to two decimal places for an operating point of 450.00 °C, for example, only a range of 124.88 °C to 775.11 °C (corresponds to 650.23 K) is available. This range is further reduced to 65.023 K if three decimal places are required for a constant operating point of 450 °C.

Author:
Norbert Brousek is Product Manager at Siemens.

  • Xing Icon
  • LinkedIn Icon
Advertisement
Advertisement

You might also be interested in

Advertisement
Advertisement
Advertisement
Advertisement

Prostep / Siemens

Cooperation expanded

Prostep and Siemens Digital Industries Software have expanded their collaboration: Now the Siemens software Polarion ALM and Teamcenter Manufacturing from the Siemens Xcelerator portfolio can also be connected to Prostep's OpenPDM integration...

read more...

Siemens

Plus 27 % in industrial business

Siemens has continued its strong growth momentum with comparable order growth of 20% since the beginning of the fiscal year, as CEO Roland Busch explained on the occasion of the publication of Siemens' quarterly figures. The figures in detail.

read more...
Advertisement
Advertisement
Advertisement
Subscribe to our newsletter
Advertisement
Back to home