Controllers are devices that allow processing of digital signals. Just a few decades ago, all logical systems were built on the basis of electromechanical relays. They are still used, but in most areas they have been replaced by microcontrollers. Controllers are most widespread in industry, specifically in control and automation systems. The MODICON device, manufactured by Bedford Associates, first appeared on the electronics market in the 1960s.
Similar devices developed by other companies became known as PLCs. More precisely, these are programmable logic controllers. Their work depends on a program that is written using a personal computer through a special interface. It was thanks to the use of devices on controllers that it was possible to replace a large number of electromechanical relays with logical elements.
PLC - what is it?
The controller is the brain of the machine. The more complex the machine, the more functional the controller. The technical implementation of the brain can be different - mechanics, pneumatics or hydraulics, relay or electronic systems.
If the design uses relays or solutions with “hard” logic, then the machine can only perform certain actions - it is impossible to teach the machine other operations without interfering with its technical part. Only programmable logic controllers or PLCs have such functions.
A PLC controller is a microprocessor-based control device that is adapted for use in production. The device is programmed in simplified languages that are accessible to the user without extensive training.
Operating principle of the control unit
The signal going to the device comes from the accelerator handle. The device receives data and, based on it, changes the rotation speed of the electric motor. In order to extend the operating life of the unit, a smooth decrease in the pulse length must be ensured during deceleration. Among other things, the controller can offer the electric bike to move in reverse.
The device extends the life of the battery, which should not reach a deep discharge. To do this, a threshold charge indicator is introduced into the control unit and when it is reached, the electric motor is switched off. The controller monitors the system temperature, which prevents current overload. When selecting a control device, it is imperative to take into account the battery voltage, maximum operating current and other parameters.
PLC structure and device
The controller can be figuratively provided in the format of a mini-computer, but very compact and with features. PLCs, like PCs, consist of RAM, a processor, and auxiliary peripheral equipment. However, the point is also that industrial controllers must perform not only calculation tasks, like a PC, but also collect information from a mass of devices - these are sensors. The controller also produces signals in the circuit.
Controllers are now available in various form factors. This:
- All-in-one device. The processor, memory, outputs/inputs are combined in one housing;
- Distributed solutions - the processor module with wiring is made in the form of a separate block, and modules for output and input are connected via the bus or through interfaces.
The first models are very common, however, they are designed for operation in small objects and systems where a small number of signals need to be processed.
The second type of controllers is used much more widely in industry - production facilities with fully functional automated control systems require a significantly larger number of signals that need to be processed. If the production is large-scale, then it is more convenient to distribute input/output modules throughout the territory and combine them into a single network, which is subordinate to a separate logical controller. Such networks are called field networks or fieldbus. Sensors and executive systems are connected to this system, which are intelligent because they have this capability.
There are many types of field networks. IEC61158 standard ( IEC61158 ) includes 8 types of networks. And before the introduction of this standard, each manufacturer invented and used its own field network.
The PLC structure has the basic components:
- Processor module;
- Power unit;
- I/O modules.
The processor module is equipped with built-in memory. There are connectors for the programmer, remote devices, and for connecting to networks. Power supply is implemented as a separate unit. Modules can be discrete or analog.
Depending on how many channels there are for input and output and what type of processor, I/O modules can be installed in one CPU chassis or in several. Until the late 80s, modules for data input and output were located separately from the processor. In a standard modern type controller, the input and output module is located on the same chassis with the microprocessor. Some PLCs allow more than one microprocessor to be installed.
Smaller models are often DIN rail compatible. The most compact micro or even nano devices have the entire system, including power adapter and I/O system, in one package. Microcontrollers are sometimes equipped with built-in panels for configuration and monitoring. Most micro-solutions have a certain number of input/output channels and it is not possible to increase them. As an example - Arduino board
How to buy the right controller
Now the choice of these devices is huge, so there is no need to rush to the first models you come across on the Internet without understanding the details. The World Wide Web is not the only place where you can purchase a suitable controller. In real life, there are specialized workshops that allow you to remove wires from the control unit for the functions required by the buyer.
Most control device boards offer users maximum functionality, but it is not fully displayed. For example, it may be that recuperation is disabled, or reverse is not activated, or cruise control is not activated. When you purchase a product from such offices, these and other functions can be displayed immediately, and you will pay quite reasonable money for everything. As for the cost, the situation is as follows: there are different price segments for control units, so to speak, for any request and any wallet.
For example, in Moscow, a wide variety of products are offered. Want something cheaper? No problem: control devices for the domestic market of the People's Republic of China, manufactured according to the principle of cheap and cheerful, are developed so that you can simply ride an electric bicycle. They come mainly in 2 modes and can work with or without Hall sensors.
Further export options from China with connected displays and wireless control are offered. Overseas and German products can please with their technical perfection those users who, as they say, do not mind money - these products represent a line of expensive control devices for electric bikes.
Operating principle of PLC
Unlike microprocessor technology, the operating principle of a PLC is slightly different. The software is divided into two parts. The first part is a block of system programs. If we draw an analogy with a PC, then the controller system software acts as an operating system responsible for the operation of low-level processes. The system part of the software is installed in permanent memory and comes into operation at any time.
When the PLC turns on, the operating system starts within a moment. Execution of the user program is cyclic. The work cycle consists of four phases:
- Polling inputs;
- Executing commands;
- Setting values for inputs;
- Auxiliary operations.
The first phase of the cycle is completely provided by the PLC system control software. Then the application software, an algorithm created by the operator, takes control. According to this program, the controller will do what they want it to do. Once these commands are completed, the work is again transferred to the system software. The process of creating a PLC control application program is simplified as much as possible - the programmer does not have to think about how to manage the hardware capabilities. The operator only has to indicate what signal will be at the input and how to react to it at the output.
Connecting elements to the PLC
All controller models have terminals for connecting power - some require AC voltage up to 120 V, while others require DC voltage up to 24 V. The supply voltage depends on the device model. The input terminals are designated by the letter X - each receives a separate signal. The common wire is usually connected to the neutral of the AC source or to the minus of the DC source.
The controller body contains an optical isolator - a simple LED. With its help, the input terminal and the common terminal are connected. When voltage is applied to the PLC, the LED lights up - it is from this that you can judge that the device is working. At the output, a signal is generated using computer circuitry - the switching device is activated. Electromagnetic relays, transistors, power switches, and thyristors can be used as a switching device. The outputs are designated by the letter Y. Each output has an LED indicating that the device is working.
Inputs and outputs
Any controller has three types of inputs: discrete, analog, and special.
Discrete input
One input can only accept one signal and it will be binary. The input can be either on or off. One input is 1 bit . The appropriate equipment is connected to this input.
If the state of the devices cannot be described in 1 bit , then several discrete inputs are used to operate such equipment.
The system software must be equipped with a driver. It counts the physical values of each RAM input. Due to this, programmers do not need to understand how the controller works inside. Discrete input - bits that can be read and changed from the device's RAM.
Analog input
An electrical analog signal is a voltage or current level corresponding to certain physical quantities. This can be the value of temperature, pressure, weight, position, speed of movement, speed of rotation. Since a PLC is primarily a computing device, the analog signal is converted to digital. This results in a discrete variable.
Special entrance
Ordinary entrances can satisfy almost all needs. The need for special inputs appears when there are difficulties in processing signals.
PLCs are equipped with specialized inputs that allow you to measure duration, record edges, and count pulses. For example, to determine the position of shafts, sensors are used that can produce pulses per revolution. The frequency can be very high. Even on powerful processors the process takes a long time. In such situations, specialists are needed. inputs capable of primarily processing information.
The second type of such inputs are inputs that can instantly trigger user commands with interruptions to the execution of the main software.
Discrete output
Only one signal can be switched with one output. Various actuators can be used as output loads.
Nintendo Offer: Nintendo Switch Pro Controller
The Nintendo
Switch Pro Controller has been praised since its launch for its extremely comfortable design and excellent gyroscopic sensors that can be transferred to PC. The controller uses a fairly standard Xbox-style layout, save for some minor changes such as the order of the face buttons (for example, the "A" and "B" buttons are swapped). This controller also seems to be more powerful than others and lasts for 40 hours on a full charge. It connects via standard Bluetooth, but relies on DirectInput instead of Xinput, so running it through the Steam Controller Configurator is highly recommended - especially since it powers the gyroscope.
Types of PLC
Devices are qualified as follows:
- Number of channels for data input/output;
- Arrangement of modules for input/output;
- Purpose;
- Installation method;
- Programming languages.
Based on the number of channels for input/output, PLCs are divided into classes:
- Nano PLC controller – often has built-in capabilities, contains up to 16 channels;
- Small – from 16 to 100 channels;
- Medium systems for working with 100-300 inputs and outputs - a typical representative of the 110 Aries PLC;
- Large models with the ability to process 300-2000 inputs/outputs;
- Extra-large models - from 2000 or more channels.
Based on how the modules are arranged, controllers are divided into:
- Monoblocks - the I/O module is not separated from the controller and must be replaced. The device looks like a candy bar with an input/output module. Often, models have a small number of channels and are characterized by low power;
- Modular ones consist of a common basket or chassis where the processor is located, as well as replaceable modules with inputs and outputs. Modules are selected based on the problem being solved. The controllers are equipped with a number of slots - from 8 to 32. A modular design is also possible, where each module is connected via a bus. .
- Distributed controllers - modules are manufactured in separate housings and are connected to the central processing unit via a network. The range can be up to 1.2 km.
PLCs also differ in purpose - these are universal general industrial devices, communication devices, PID controllers, systems for robotics, for controlling movement and positioning.
According to the installation method, industrial controllers can be divided into:
- Panel;
- For DIN rail;
- Rack-mounted;
- Bodyless.
By programming languages, models are distinguished that are programmed in the language of PLC systems MEK 61131-3 and in classical languages such as C, C#, Visual Basic, Scala.
For classic games: 8Bitdo Sn30 + Pro
8Bitdo
8Bitdo is one of the best third-party controller makers, and although it mainly specializes in Nintendo Switch, the Sn30+ Pro works great on PC too. The controller looks like a classic SNES controller with larger knobs and joysticks, and it's great for playing sidescrollers and other old-school games. Through 8Bitdo's "Ultimate" software, you can customize inputs (great because the default is Nintendo's button layout), change trigger sensitivity, and even set up turbo buttons that repeat the same input at high speed.
The Sn30+ Pro connects via Bluetooth and will last about 18 hours on a full charge. It's also available in several colors that mimic the style of the SNES, Super Famicom, and standard black (pictured above).
Basics of PLC programming. Relay and controller
The logic is loaded into the PLC using software. This software determines which outputs will be energized and what input conditions are needed for any changes. The control program is similar to the operating diagram of a physical relay, but there are physically no relays, no wires, no coils. All these elements are imaginary. The software is developed and reviewed on a PC connected to the controller interface.
There is a button, a controller and an indicator. When the button is not activated, no signal will be sent to the controller input. Software indicating an open input will not send a signal to the output. So, there is no current at the output and the lamp will not light.
If the button is pressed, the corresponding signal is sent to the input channel. The contacts will switch to an active state, like a physical relay. In this case, the controller contact that was opened earlier will close and the program will send a signal to the output. When the output contact is energized, the indicator will light up.
The contacts with the indicator are connected physically. And the signal is virtual. However, all elements exist only in computer software, but not as physical ones. But the relay principle is used here. You can also set conditions in the program that will be checked and fulfilled by the controller.
To create the same circuit, but based on physical hardware components, you will need three relays, with two open contacts - each of them will be used. But with the help of a PLC, you can use as many contacts for each input as you want without adding unnecessary equipment.
Control commands in relay logic language are simple and understandable for electrical engineers. All logical operations are visible on the graphical interface. This is an electrical circuit with closed or open contacts. If current flows through the circuit, that is true. If no current flows, then the state is false.
The basis of the control program are logical expressions consisting of operands and variables. The program also consists of statements. Operators are commands in a programming language.
A PLC software engineer today is more of an engineer than a programmer. Nowadays there is no need for complex languages, writing assembly inserts. It is enough to use standard function blocks.
Why do you need a computer
Using a computer, a logical connection is created between the input and output terminals. The software used to compose the logic allows you to send a virtual signal to the controller and see how it will act under certain conditions. After the logic is embedded inside the PLC, the computer turns off and the controller operates independently. He will be able to carry out all the commands that were given to him at the programming stage without outside help.
Programming environment
The standard for PLC programming is the MEK languages. In the early 90s, CoDeSys . the IEC 61131-3 standard for PLC operation. The software is in great demand due to its free license.
Now this software package has grown significantly. In addition to the standard code editor, debugger and compiler integrated into the system, it also includes a configurator for controllers, industrial networks, an editor for creating mnemonic diagrams, a debugging server, OPC and DDE . Many PLC manufacturers offer this environment as a basic tool for work.
Types of controllers
These devices are divided according to several criteria.
By type of feedback:
1. For use with Hall sensors.
2. Without them.
3. Universal controllers. They combine the first and second points.
By type of output signal:
1. Rectangular shape (meander). Similar gadgets are used on cheaper models of electric bicycles, and they themselves are inexpensive. They enable the user to obtain a higher rotation speed, but at the same time, this leads to an increase in the noise of the electric motor. And the engine is noisy due to microvibration of the windings under the influence of a signal of this form.
2. Signal in the form of a sine wave. The rotation speed is lower, but the sound of the electric motor rotating is completely absent.
3. There is also an intermediate version - a “modified sinusoid”. This variation can be called a “smoothed meander”. However, this variety did not gain popularity among users.
Controllers may have different reactions to signals coming from the accelerator handle: in one case you will regulate the speed, in the other - the power or thrust of the engine.
PLC programming languages
Control programs for controllers are developed in languages that are created not for programmers in the modern sense, but for automated process control engineers.
The simplest and most popular tool is considered to be a set of ready-made modules and a configurator that allows you to assemble the modules into a control circuit. Until recently, each PLC manufacturer had its own language. But by the mid-90s the situation had changed. Languages have been standardized.
IEC 1131.3 standard defines five languages:
- Ladder Diagram Language LD is a traditional relay-based language where algorithms are represented as diagrams;
- FBD – represents a configurator and standard subroutines;
- SFC is a sequential circuit language. A tool that is close to traditional programming and implements algorithms with sequential control;
- ST is a structured type language. Pascal- like language with support for structured programming;
- IL – instruction language. It is a low-level tool like Assembler , but it is not focused on microprocessor architecture. It is mainly used to create fast programs.
What does it include
Now this is a very complex technical unit, which has been significantly improved since its development. A modern average controller has its own microprocessor, registers of external devices, thanks to which the device interacts with the CPU, RAM, ROM, and matching (buffer) circuits. That's what a controller is. To imagine what this complex device is, imagine a simplified specialized electronic computer that deals only with a certain range of actions - for example, it interacts with a keyboard that is connected to a computer. As soon as a key is pressed, this information is transmitted to the central processor, where it is processed accordingly.
Remote control and monitoring
The controllers have flexible capabilities for communicating with other equipment. These capabilities allow you to remotely control devices, as well as integrate PLCs into automated control and data acquisition systems.
A operator terminal or HIM is a visualization device. It can be built-in or connected by cable. There are many different types of such solutions - from simple digital ones with buttons to serious touch ones with the function of online monitoring and parameter correction.
SCADA is an abbreviation for supervisory control and data acquisition system. These are software packages that allow you to develop applications in real time. The package also has tools for data collection and processing, archiving and display or management.
The web interface allows you to access the PLC over local or wide area networks. Depending on the functionality, the controller may not have an operator panel, but there is a port for connecting the PLC to Ethernet. Then the device can be configured remotely via the web interface or from a laptop.
A more advanced solution is implemented in the Siemens - an embedded web server. It allows you to monitor as well as manage the system. Today, PLCs implement cloud connectivity functions for remote control.
Premium Update: Xbox Elite Wireless Controller Series 2
The Microsoft
Elite Controller is a step up from the standard Xbox controller in every way, and it has a lot of premium features at a correspondingly high price. This controller is highly customizable both at the software and hardware levels; you can swap out the joysticks and D-pad for alternate designs and sizes, adjust trigger dead zones and remap inputs via software, and use the paddles on the back of the controller for additional actions. Add in an improved design with comfortable grips and a rechargeable battery that lasts up to 40 hours, and you have a great controller.
And just like a standard Xbox Wireless Controller, you shouldn't have any problems connecting the Elite to your Windows PC via Bluetooth or an adapter (sold separately).
PLC Manufacturers
There are a lot of companies that manufacture industrial controllers - these are:
- Advantech,
- Delta,
- VIPA,
- Mitsubishi Electric,
- WAGO I/O,
- Phoenix Contact
- and many others.
Russian PLC manufacturers:
- Kontar,
- Aries,
- Segnetics,
- Fastwel,
- Tekon.
What to look for when purchasing
It all depends on the type of production and the tasks that need to be solved, but there are also universal solutions. Key points:
- Universality of the programming environment for different platforms;
- Controllers with distributed input/output;
- Devices with built-in input/output;
- PC connection;
- CPU and I/O system duplication;
- Web-enabled PLC;
- PLC with PC type processor;
- Portable devices for creating programs.
The most important point here is the first point. You should not try to find the most affordable equipment on the market - the process of retraining specialists will reduce all possible savings to zero. It is worth choosing several manufacturers and collaborating only with their products.
Other experts argue that the most important thing is software. The differences in the comfort of using software products are much greater than in PLC hardware.
Programmable control devices
Programmable control devices are increasingly in demand among users. They make it possible to change indicators: from the magnitude of battery and phase currents, to phase advance angles and field weakening. Connection to a computer is made via a USB cable, and with mobile devices, such controllers are connected via Bluetooth.
When choosing a control unit, pay attention to the auxiliary functions: reverse, recuperation, individual power output for lighting devices, modes for selecting speed and power level, etc.
For fans of fighting games: 8Bitdo Arcade Stick
8Bitdo
Traditional fighting games are always best played in the arcade, so 8Bitdo brought a piece of that home with their Arcade Stick. This unusual controller perfectly imitates the design of arcade cabinets and has a variety of buttons to display all the inputs. You can also open 8Bitdo's "Ultimate" software to create macros and remap inputs, but changing the inputs doesn't just change it at the software level. There's an LED label next to each button that tells you what it does, and it will change accordingly when you remap the inputs. Although the Arcade Stick is primarily designed for fighting games, it also works great with any classic arcade games or even modern games playing similar genres.
The Arcade Stick connects via Bluetooth or the included wireless adapter and will last 30-40 hours on a full charge. And for those interested in modding, you'll be happy to hear that 8Bitdo designed this controller to be compatible with any 30mm/24mm arcade buttons and most arcade joysticks.
Reasons for blocking the battery by the controller
If the controller blocks the battery, the reason may be the following:
- short circuit inside the battery;
- deep discharge – critical voltage drop across the cells.
A discharged battery should be charged as soon as possible. If you store it in this condition, further self-discharge will lead to complete discharge, and it will not be possible to charge the battery. For safety reasons, the controller simply will not allow the charging process to start.
This is explained by the fact that when storing discharged batteries, irreversible degradation processes occur in their structure, lithium crystals are formed, dangerous contact between the poles and the danger of explosion arise. The controller’s task is to prevent such consequences, so it blocks the further use of batteries with a voltage that has fallen below a critical minimum.
The previous VirtusTec blog article is devoted to lithium batteries for forklifts, stackers, and other types of warehouse equipment.