GD300-29 VFDs use RS485 in RTU mode.

B.2.1 RS485

The interface of RS485 works on semiduplex and its data signal applies differential transmission which is called balance transmission, too. It uses twisted pairs, one of which is defined as A (+) and the other is defined as B (-). Generally, if the positive electrical level between sending drive A and B is among +2V–+6V, it is logic"1", if the electrical level is among -2V–-6V, it is logic "0".

485+ on the terminal board corresponds to A and 485- to B.

Communication baud rate means the binary bit number in one second. The unit is bit/s (bps). The higher the baud rate is, the quicker the transmission speed is and the weaker the anti-interference is. If the twisted pairs of 0.56mm (24AWG) is applied as the communication cables, the max. transmission distance is as below:

Baud rate

Max. transmission distance

Baud rate

Max. transmission distance

2400BPS

1800m

9600BPS

800m

4800BPS

1200m

19200BPS

600m

It is recommended to use shield cables and make the shield layer as the grounding wires during RS485 remote communication.

In the cases with less devices and shorter distance, it is recommended to use 120Ω terminal resistor as the performance will be weakened if the distance increase even though the network can perform well without load resistor.

B.2.1.1 Single application

Figure B‑1 is the site Modbus connection figure of a single VFD and PC. Generally, the computer does not have RS485 interface, and therefore the RS232 or USB interface of the computer should be converted into RS485 by converter. Connect the A terminal of RS485 to the 485+ terminal of the VFD and B to the 485- terminal. It is recommended to use the shield twisted pairs. When applying RS232-RS485 converter, if the RS232 interface of the computer is connected to the RS232 interface of the converter, the wire length should be as short as possible within the length of 15m. It is recommended to connect the RS232-RS485 converter to the computer directly. If using USB-RS485 converter, the wire should be as short as possible, too.

Select a right interface to the upper computer of the computer (select the interface of RS232-RS485 converter, such as COM1) after the wiring and set the basic parameters such as communication baud rate and digital check bit to the same as the VFD.

image.png

Figure B‑1 RS485 physical connection in single application

B.2.1.2 Multi-application

In the real multi-application, the chrysanthemum connection and star connection are commonly used.

Chrysanthemum chain connection is required in the RS485 industrial fieldbus standards. The two ends are connected to terminal resistors of 120Ω which is shown as Figure B-2. Figure B-3 is the simply connection figure and Figure B-4 is the real application figure.

image.png

Figure B‑2 Chrysanthemum connection

image.png

Figure B‑3 Chrysanthemum connection

image.png

Figure B‑4 Chrysanthemum connection applications

Figure B‑5 is the star connection. Terminal resistor should be connected to the two devices which have the longest distance. (1# and 15#device)

image.png

Figure B‑5 Star connection

It is recommended to use shield cables in multiple connection. The basic parameter of the devices, such as baud rate and digital check bit in RS485 should be the same and there should be no repeated address.

B.2.2 RTU mode

B.2.2.1 RTU communication frame format

If the controller is set to communicate by RTU mode in Modbus network every 8bit byte in the message includes two 4Bit hex characters. Compared with ACSII mode, this mode can send more data at the same baud rate.

Code system

  • 1 start bit

  • 7 or 8 digital bit, the minimum valid bit can be sent firstly. Every 8 bit frame includes two hex characters (0...9, A...F)

  • 1 even/odd check bit . If there is no checkout, the even/odd check bit is inexistent.

  • 1 end bit (with checkout), 2 Bit(no checkout)

Error detection field

  • CRC

The data format is illustrated as below:

11-bit character frame (BIT1–BIT8 are the data bits)

Start bit

BIT1

BIT2

BIT3

BIT4

BIT5

BIT6

BIT7

BIT8

Check bit

End bit

10-bit character frame (BIT1–BIT7 are the data bits)

Start bit

BIT1

BIT2

BIT3

BIT4

BIT5

BIT6

BIT7

Check bit

End bit

In one character frame, the digital bit takes effect. The start bit, check bit and end bit is used to send the digital bit right to the other device. The digital bit, even/odd checkout and end bit should be set as the same in real application.

In the RTU mode, the transmission of a new frame always starts from an idle time (the transmission time of 3.5 bytes). On a network where the transmission rate is calculated based on the baud rate, the transmission time of 3.5 bytes can be easily obtained. After the idle time ends, the data domains are transmitted in the following sequence: slave address, operation command code, data, and CRC check character. Each byte transmitted in each domain includes 2 hexadecimal characters (0–9, A–F). The network devices always monitor the communication bus. After receiving the first domain (address information), each network device identifies the byte. After the last byte is transmitted, a similar transmission interval (the transmission time of 3.5 bytes) is used to indicate that the transmission of the frame ends. Then, the transmission of a new frame starts.

image.png

The information of a frame must be transmitted in a continuous data flow. If there is an interval greater than the transmission time of 1.5 bytes before the transmission of the entire frame is complete, the receiving device deletes the incomplete information, and mistakes the subsequent byte for the address domain of a new frame. Similarly, if the transmission interval between two frames is shorter than the transmission time of 3.5 bytes, the receiving device mistakes it for the data of the last frame. The CRC check value is incorrect due to the disorder of the frames, and thus a communication fault occurs.

The standard structure of RTU frame:

START

T1-T2-T3-T4(transmission time of 3.5 bytes)

ADDR

Communication address: 0–247(decimal system)(0 is the broadcast address)

CMD

03H:read slave parameters

06H:write slave parameters

DATA (N-1)

...

DATA (0)

The data of 2*N bytes are the main content of the communication as well as the core of data exchanging

CRC CHK low bit

Detection value:CRC (16BIT)

CRC CHK high bit

END

T1-T2-T3-T4(transmission time of 3.5 bytes)

B.2.2.2 RTU communication frame error checkout

Various factors may cause error in the data transmission. If there is no error checkout, the receiving devices will not find the message is wrong and they may give incorrect response which cause serious result. So the checkout is essential to the message.

The theme of checkout is that: the sender calculate the sending data according to a fixed formula, and then send the result with the message. When the receiver gets this message, they will calculate anther result according to the same method and compare it with the sending one. If two results are the same, the message is correct. If not, the message is incorrect.

The error checkout of the frame can be divided into two parts: the bit checkout of the byte and the whole data checkout of the frame (CRC check).

Bit checkout of the byte

The user can select different bit checkouts or non-checkout, which impacts the check bit setting of each byte.

The definition of even checkout: add an even check bit before the data transmission to illustrate the number of "1" in the data transmission is odd number or even number. When it is even, the check byte is "0", otherwise, the check byte is"1". This method is used to stabilize the parity of the data. 

The definition of odd checkout: add an odd check bit before the data transmission to illustrate the number of "1" in the data transmission is odd number or even number. When it is odd, the check byte is "0", otherwise, the check byte is"1". This method is used to stabilize the parity of the data. 

For example, when transmitting "11001110", there are five "1" in the data. If the even checkout is applied, the even check bit is "1"; if the odd checkout is applied; the odd check bit is "0". The even and odd check bit is calculated on the check bit position of the frame. And the receiving devices also carry out even and odd checkout. If the parity of the receiving data is different from the setting value, there is an error in the communication.

CRC check

The checkout uses RTU frame format. The frame includes the frame error detection field which is based on the CRC calculation method. The CRC field is two bytes, including 16 figure binary values. It is added into the frame after calculated by transmitting device. The receiving device recalculates the CRC of the received frame and compares them with the value in the received CRC field. If the two CRC values are different, there is an error in the communication.

During CRC, 0*FFFF will be stored. And then, deal with the continuous 6-above bytes in the frame and the value in the register. Only the 8Bit data in every character is effective to CRC, while the start bit, the end and the odd and even check bit is ineffective.

Each 8 bit character xors with the register, the result moves to the lowest effective bit and the highest bit is filled by 0. If LSB is detected to be 1, the register will xor with the preset value. If LSB is 0, the action will not carry on. Repeat 8 times during the whole process. After the last bit is completed, the next 8 bit character will xor with the current value of the register. The final value in the register is the CRC after the completion of operating all bytes.

The calculation of CRC applies the international standard CRC checkout principles. When the user is editing CRC calculation, he can refer to the relative standard CRC calculation to write the required CRC calculation program.

Here provided a simple function of CRC calculation for the reference (programmed with C language):

unsigned int crc_cal_value(unsigned char*data_value,unsigned char data_length)

{

     int i;

     unsigned int crc_value=0xffff;  

     while(data_length--)

     {

         crc_value^=*data_value++;

         for(i=0;i<8;i++)

         {

              if(crc_value&0x0001)

                   crc_value=(crc_value>>1)^0xa001;

              else

                   crc_value=crc_value>>1;

         }

     }

     return(crc_value);

}

In ladder logic, CKSM calculated the CRC value according to the frame with the table inquiry. The method is advanced with easy program and quick calculation speed. But the ROM space the program occupied is huge. So use it with caution according to the program required space.


上一章节 下一章节