📜 ⬆️ ⬇️

PLC Ace: small controller for smart home

I develop software for programmable logic controllers (PLCs) in industrial automated process control systems (APCS).

For those who are faced with this word for the first time, I will explain. PLC is a special mini-computer that works like this:
1. Receives input discrete (Di) or analog (Ai) signals;
2. It processes these signals according to a program set by the programmer;
3. Produces a control signal via discrete (DO) or analog (AO) outputs.

Discrete - when a signal can have only 2 states: 0 or 1, “yes” or “no”. For example, the button is pressed or released, the light is on or off.
Analog - when the value of the parameter depends on the level of the electrical signal. For example, the higher the signal level (volt or milliampere) from a temperature sensor, the higher the measured temperature.
')
PLCs are mainly used in industry, machine tools, home automation systems, smart home, etc.

Naturally, by virtue of the profession, I am interested in everything related to PLC and other equipment used in the process control system. Somehow, surfing the net, I went to the site of the American company Velocio , which manufactures Ace, Branch, Embeded PLC series.

The main features of these controllers are small size, only 2.5 '' x 2.5 '', power 5 volts and price from $ 49 for a model with 6 discrete inputs and 6 discrete outputs. Especially impressed with the size, I have never met such a small PLC:

image

I was interested in the PLC, I contacted the Velocio company and they sent me a controller of the Ace 3090v5 model. I would like to briefly tell about this PLC and a wider audience of Habr. Looking ahead, I would say that Velocio's PLCs are best suited for smart homes and other home automation systems.

Here came to me a package wrapped straight from the city of Huntsville, Alabama:



image

Package Contents:
1. PLC Velocio Ace 3090v5, $ 179
2. DIN Rail Mount, $ 5
3. Connectors of signal lines (3,4,8 pin, pitch 2.5 mm), 6 pcs., $ 6 * 3
4. Flat screwdriver, 1.5 mm tip, free
5. Power Connector (2 pin, 2.5 mm pitch), $ 2
6. USB cable Am-miniB, $ 5

USB cable for programming Ace is not necessary to buy in Velocio, this is a regular USB cable Am-miniB, which is sold in any computer store. Connectors can also be searched elsewhere, but the DIN rail mounting is unique and needs to be purchased with the controller.

Expectations Ace 3090v5 justified, it is really very small:



Specifications:
TitleVelocio Ace 3090v5
PurposePLC for home and industrial automation
DI Amount6
DO count18, transistor
AIQty, total7
Amount AI 16 bits / type4 / Thermocouples J, K, T, N;
± 0.256 V, ± 0.512 V, ± 1.024 V, ± 2.048 V
Amount AI 12 bits / type3/0 ... + 5 V
Communication portsMini USB (can work on Modbus), RS-232
Data transfer protocolsModbus RTU slave
Data transfer rate, bps9600, 19200, 38400, 57600
MountDIN rail
Nutrition5 V DC
Dimensions63.5x63.5x12.7 mm
Operating temperature-40 ... 85 °
IP ratingIP65
Programming environmentVelocio vBuilder, free
Price$ 179

Design


With its size, the controller has a total of 31 inputs and outputs, an RS-232 serial communication port and a Mini USB port for downloading programs and communicating with external devices.

The front of the case shows the power and status LEDs of the digital inputs and outputs:



On the back of the case there are notches for mounting the DIN rail mounting:


On the side walls of the case there are ports for connecting all signals through connectors. Ports are marked with letters A, B, C, D, E, F:




Wiring occurs via COMBICON PTSM Series connectors from Phoenix Contact with a 2.5 mm (0.098 '') leg pitch:



Wires are inserted into the connector with a screwdriver that comes with the PLC as follows:



Discrete output-transistor, for good reason:
  • the relay in the controller housing still does not fit
  • to ensure high speed, for example when controlling stepper motors

Naturally, for switching a 220 V electrical network, transistor outputs are not suitable and it is necessary to install intermediate relays after them. You can buy modules with intermediate relays in the same place from Velocio, when you buy a PLC. And you can save and buy similar Chinese motherboards on ebee, as I did:



Analog inputs (Ai) in Ace 3090v5 are divided into 2 groups:
  • 3 Ai with common ground in port A, input range 0… 5 V
  • 4 Ai differential in port F, connection of temperature sensors (thermocouples) of type J, K, T, N, as well as millivolt signals

So I connected a type "K" thermocouple from a Chinese tester to the Ai F1 input and brought the temperature value to the laptop:

By the way, in this example I did not calibrate the thermocouple in the controller. Nevertheless, the temperature readings corresponded to the values ​​of the alcohol thermometer, which acted in my role as a control device.

Ace has a low power consumption: 5 V at max. current up to 0.3 A. That is, as a power supply, you can use 5-volt charging for a mobile phone.

Programming


Software development is carried out through the free vBuilder programming environment . The installation package also contains the virtual COM port driver needed to connect the controller to the computer:



Studying vBuilder is better to start with watching video tutorials . There is also complete documentation in English called “vBuilder Manual” of several hundred pages.

Program development is possible in two graphic languages: Ladder Logic language and Flow Chart language.

Ladder Logic is an LD language well known to all PLC programmers that is one of the IEC 61131-3 standardized industrial languages.
LD was invented specifically for not only programmers, but also ordinary electricians to write programs on it. The program on the LD and looks like an electrical circuit:



It is an easy language to learn and work.

The language of flowcharts (Flow Chart) is a graphical language in which a program is created in the form of flowcharts :



Many people remember the flowcharts and principles of their construction from the time of computer science at school. For example, I graduated from grade 11 in 1999, in the dark times of the post-Soviet computer Middle Ages. At that time, Intel was already selling Pentium-II processors, Bill Gates was selling Windows 98, and in our school there were Soviet electronics computers with black and white screens. For most of the lesson, we sat at the desk and drew programs in notebooks with exactly flowcharts. Then they transferred them to BASIC, sat down at the “Electronics” (4 people per car) and then entered into the computer. And in other schools there were no computers at all.

So for beginners, Flow Chart is even easier than LD. At the same time, in my opinion, it is clearer and allows you to create more complex programs. By the way, I often use flowcharts now, working with different PLCs. When I need to think over some complicated algorithm, I first draw flowcharts on a leaflet, and then translate them into a program in a specific language.

In both programming languages, the same program blocks are available:
  • comparison (<,>, =, etc.)
  • assignment with the possibility of entering formulas
  • copying
  • counter
  • timer
  • real time clock
  • digital filter
  • reading encoders
  • stepper motor control
  • PID controller
  • PWM
  • soft start / stop
  • scaling
  • bit shift and “flip” numbers
  • statistics
  • com-port control for implementing your own data transfer protocols
  • subroutine call

As a “quick help” for software blocks, the same vBulder download page is used . Just click on the icons of the corresponding vBuilder blocks on the right of the page and read how they work:



If the English is very tight, the Ghrome browser translator comes to the rescue: right mouse button-> translate into Russian. The translation is technical, but the meaning will be clear.

Available programming options:
  • creating own variables (tags) of the type bit, unsigned int 8/16 bit, signed int 16/32 bit, float;
  • creating arrays;
  • creating subroutines;
  • Moreover, the subroutines here are objects of the type FB as in Step-7 and Codesys;
  • each input / output and tags can be assigned an address for transmitting their values ​​via Modbus;
  • communication via Modbus from a PC, touch panels, etc. via Modbus in slave mode; it is possible to connect via Modbus to 2 master devices simultaneously;
  • the ability to implement their own data transfer protocols via RS-232;
  • debugging the program in steps.

Connecting Ace to a computer and touch panels


For communication with external devices over the network in Ace 3090v5 has 2 ports: RS-232 and USB. Both of these ports can transmit data via the Modbus RTU slave protocol. At the same time, 2 master devices can be connected to Ace. For example, a computer via USB, and a touch panel via RS-232. Special programs like SCADA are used for computer control, but you can also write a program on some visual of BASIC.

RS-232 is a good old computer COM port. Previously, the mouse connected to it. To connect the computer to Ace, I found an old Komov mouse with a ball, cut off its tail and connected it to the 3-pin RS-232 Ase connector according to this scheme:



If your computer does not have a COM port, you need to buy any USB / RS-232 converter for about $ 8.

Options for the implementation of Ace data exchange with external devices:
  • according to the internal Ace protocol for communication with a computer on which free SCADA vFactory is installed;
  • on the universal data transmission protocol Modbus RTU for communication with computers, touch panels and other PLCs;
  • according to its own protocol, implemented programmatically in the controller.

Free SCADA vFactory works only with Velocio's PLC, because it uses not the internal Modbus, but the internal closed protocol of the controllers. Documentation on vFactory is not, in order to master it, one video lesson is enough. Very simple SCADA without a scripting language and archiving capabilities. The toolbar is small:



But you can quickly make a working program without special programming skills:


If the vFactory capabilities are not enough, you can connect any other SCADA via the Modbus RTU protocol. For example, in a clip with a thermocouple, I applied SCADA Trace Mode 6 Base.

You can also program your own data transfer protocol in Ace;

PLC Ace in home automation


I think this controller will show itself well in the "smart home" system. Controller's advantages: small size, low power consumption, power supply from just 5 V, a lot of discrete outputs, the ability to connect thermocouples, 2 communication ports with external devices, ease of programming, a large number of different program blocks.

If you liked the Ace controller, but 6 discrete inputs are not enough, you can look at the Branch series - the same Ace, only with the possibility of connecting expansion modules (up to 450 inputs / outputs). However, this is already without me - I still have enough of Ace to play.

Source: https://habr.com/ru/post/256911/


All Articles