A kind of optimization method and device of FlexRay bus node build-out resistor
Technical field
The invention belongs to data bus communication technical fields, are related to a kind of optimization of FlexRay bus node build-out resistor
Method and device.
Background technique
Automotive electronics has become a staple market of automobile industry, and the maximum hot spot of Automobile Electronic Industry is exactly network
Change.Automobile of today is already a mobile massaging device, by in-vehicle network system, can receive, sends and handle
A large amount of data make necessary reaction to certain situations.Necessarily the degree of automation is increasingly for the development trend of future automobile
Height keeps automobile safer, more reliable, more comfortable, it means that use more sensors, transmission device and electronics control in the car
Unit processed, this will also put forward higher requirements In-vehicle networking.For the demand for development of future automobile In-vehicle networking, FlexRay
It comes into being.FlexRay is concerned with some core demands of current automobile industry, including faster data rate, more flexible
Data communication, more fully topology selection and fault-tolerant operation etc..The appearance of FlexRay compensates for existing bus protocol application
In automobile line control system or the deficiency too low with fault-tolerance when safety-related system and transmission rate, and will gradually replace
CAN bus becomes the automobile bus of a new generation.
Requirement to FlexRay is that reliable, real-time and very efficient number is provided between electrically and mechanically electronic component
According to transmission.The peak data transfer rate in each channel of FlexRay bus is 10MBit/s, therefore FlexRay is one very high
The system of speed.But it if the impedance matching of FlexRay bus does not design, will lead under data traffic signals quality
Drop, the excessively high bit error rate will lead to entire FlexRay bus system communication efficiency sharp fall, even result in entire
FlexRay bus cisco unity malfunction.
In conclusion urgent need invents one kind and can be improved FlexRay bus signals communication quality, the impedance of the bit error rate is reduced
Matched optimization method, to improve the reliability and stability of FlexRay bus comprehensively.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of optimization method of FlexRay bus node build-out resistor and
Device applies pumping signal to FlexRay bus by the device, by the voltage for measuring and calculating FlexRay bus node
Signal, and the distributed parameter model of FlexRay bus is combined, obtain the best match impedance about FlexRay bus.This method
It can effectively improve FlexRay bus signals communication quality, reduce the bit error rate in data communication process, it is ensured that FlexRay is total
The Stability and dependability of line data communication.
In order to achieve the above objectives, the invention provides the following technical scheme:
A kind of optimization method of FlexRay bus node build-out resistor, comprising the following steps:
S1: the Chirp code signal source of 1M~10MHz is successively motivated to each node of FlexRay bus;
S2: when Chirp code signal source forcing FlexRay some node of bus, speed A/D converter is in synchronization signal
Under the action of SYNC, the differential signal of other all FlexRay bus nodes is successively acquired;
S3: according to actual FlexRay physical bus Node distribution, the distributed parameter model of FlexRay bus is constructed;
S4: by the data of actual acquisition, the distributed parameter model of FlexRay bus is substituted into, calculates and obtains FlexRay bus
The terminal coupling resistance of each node.
Further, in step sl, it specifically includes:
S11: 1M~10MHz Chirp code signal source, the expression formula of the signal source are as follows:
Wherein the bandwidth B in Chirp code signal source is 10MHz, and duration T 10uS, t are time variable, and cos () is
Cosine function;
S12: when the Chirp code signal source output drive FlexRay bus node of 1M~10MHz, output is corresponding same
Walk signal SYNC.
Further, in step s 4, it specifically includes:
S41: according to the characteristic in Chirp code signal source, substituting into the measurement parameter of different FlexRay nodes respectively, by with
Lower formula (2) be calculated 1MHz, 2MHz, 3MHz ..., 10MHz amount to 10 groups of a, b numerical value: [a1,b1], [a2,b2] ...,
[a10,b10];
In formula (2), UocFor the voltage signal at FlexRay bus node, the Chirp code excited that U is 1MHz~10MHz is believed
Number, L is distance of the FlexRay bus node apart from pumping signal, and cosh () is hyperbolic cosine function, and cos () is cosine letter
Number;
S42: according to formula (3), 10 groups of a, b numerical value: [a is substituted into respectively1,b1], [a2,b2] ..., [a10,b10], it calculates
Obtain 10 groups of R0、L0、C0、G0Distribution parameter,It is denoted as [R respectively01,L01,C01,G01], [R02,L02,C02,G02] ..., [R010,
L010,C010,G010];
F is a, the corresponding frequency of b numerical value, R in formula (3)0For unit line segment resistance, L0For unit line segment inductance, C0For unit
Differential coupling capacitor, the G of line segment0For the leakage conductance of unit difference line segment;
S43: [a is substituted into respectively1,b1]、[a2,b2] and corresponding frequency f, equation group is established by formula (3), is asked
[R can be obtained in solution01,L01,C01,G01], then substitute into [a2,b2], [a3,b3], [R can be obtained in solution02,L02,C02,G02], with
This analogizes, and finally substitutes into [a10,b10], [a1,b1], [R can be obtained in solution010,L010,C010,G010];
S44: according to the communication frequency f of FlexRay bus, the corresponding R of respective communication frequency is substituted into0、L0、C0、G0Parameter,
Using the Dai Weinan principle of equal effects by the peripheral circuit equivalent predigesting of FlexRay bus node be two-port network model, to count
Calculation obtains the equivalent matched resistance of FlexRay bus node.
The present invention also provides a kind of optimization device of FlexRay bus node build-out resistor, including speed A/D converter,
High-speed DAC converter, high speed amplifier, field programmable logic device FPGA and microcontroller STM32F407;
The Chirp code letter of field programmable logic device FPGA output 1MHz~10MHz of FlexRay bus test device
Number through high-speed DAC converter and amplifier driving after, as the pumping signal of FlexRay bus, while exporting the synchronization of Chirp code
Signal SYNC;
Speed A/D converter carries out data by high-speed AD controller and adopts under the synchronization signal SYNC effect of Chirp code
Sample, sampled result are placed in the high speed dual port RAM inside field programmable logic device FPGA;
Microcontroller STM32F407 reads sampling data results, calculates in the internal distribution parameter for completing FlexRay bus
Optimization with node matching resistance calculates.
The beneficial effects of the present invention are: present invention employs a kind of sides of FlexRay bus node build-out resistor optimization
Method has the Chirp code signal of specific frequency by device transmitting, tests the voltage's distribiuting of FlexRay bus node, in conjunction with
The physical model of FlexRay bus calculates the distribution parameter for obtaining FlexRay bus, finally applies the Dai Weinan principle of equal effects pair
FlexRay bus is simplified, to calculate the equivalent matched impedance resistors for obtaining FlexRay bus.This method can obtain
The build-out resistor of accurate FlexRay bus node effectively improves the conventional method for rule of thumb selecting build-out resistor,
The problems such as to improve the communication quality of FlexRay bus, significantly reduce the bit error rate of FlexRay bus.
Detailed description of the invention
In order to keep the purpose of the present invention, technical scheme and beneficial effects clearer, the present invention provides following attached drawing and carries out
Illustrate:
Fig. 1 is the flow diagram of the method for the invention;
Fig. 2 is the distributed parameter model of FlexRay bus;
Fig. 3 is FlexRay bus distribution parameter test schematic diagram.
Specific embodiment
Below in conjunction with attached drawing, a preferred embodiment of the present invention will be described in detail.
Fig. 1 is the flow diagram of the method for the invention, as shown, excellent in FlexRay bus node build-out resistor
During change, comprising the following steps:
Step 1: each section of FlexRay bus is successively motivated in the Chirp code signal source of 1M~10MHz by test device
Point;
The expression formula in the Chirp code signal source of the 1M~10MHz used in step 1 for
Wherein the bandwidth B in Chirp code signal source is 10MHz, and duration T 10uS, t are time variable, and cos () is
Cosine function;When the Chirp code signal source output drive FlexRay bus node of 1M~10MHz, corresponding synchronous letter is exported
Number SYNC.
Step 2: when the node of Chirp code signal source forcing FlexRay bus, speed A/D converter is in synchronization signal
Under the action of SYNC, the differential signal of other all FlexRay bus nodes is successively acquired;
Step 3: according to actual FlexRay physical bus Node distribution, the distribution parameter mould of FlexRay bus is constructed
Type.Specific practice is to construct point of FlexRay bus according to actual FlexRay physical bus length, material and Node distribution
Cloth parameter model, R0For unit line segment resistance, L0For unit line segment inductance, C0For differential coupling capacitor, the G of unit line segment0For list
The leakage conductance of potential difference separated time section;Fig. 2 is the distributed parameter model of FlexRay bus.
Step 4: by the data of actual acquisition, the distributed parameter model of FlexRay bus is substituted into, calculates and obtains FlexRay
The terminal coupling resistance of each node of bus.Specific method is:
1) by following formula (2) be calculated 1MHz, 2MHz, 3MHz ..., 10MHz amount to 10 groups of a, b numerical value:
[a1,b1], [a2,b2] ..., [a10,b10];
In formula (2), UocFor the voltage signal at FlexRay bus node, the Chirp code excited that U is 1MHz~10MHz is believed
Number, L is distance of the FlexRay bus node apart from pumping signal, and cosh () is hyperbolic cosine function, and cos () is cosine letter
Number;
2): according to formula (3), substituting into 10 groups of a, b numerical value: [a respectively1,b1], [a2,b2] ..., [a10,b10], it calculates
To 10 groups of R0、L0、C0、G0Distribution parameter, be denoted as [R respectively01,L01,C01,G01], [R02,L02,C02,G02] ..., [R010,L010,
C010,G010];
F is a, the corresponding frequency of b numerical value, R in formula (3)0For unit line segment resistance, L0For unit line segment inductance, C0For unit
Differential coupling capacitor, the G of line segment0For the leakage conductance of unit difference line segment;
3): substituting into [a respectively1,b1]、[a2,b2] and corresponding frequency f, equation group is established by formula (3), is solved
[R can be obtained01,L01,C01,G01], then substitute into [a2,b2], [a3,b3], [R can be obtained in solution02,L02,C02,G02], with this
Analogize, finally substitutes into [a10,b10], [a1,b1], [R can be obtained in solution010,L010,C010,G010];
4): according to the communication frequency f of FlexRay bus, substituting into the corresponding R of respective communication frequency0、L0、C0、G0Parameter is answered
It by the peripheral circuit equivalent predigesting of FlexRay bus node is two-port network model with the Dai Weinan principle of equal effects, to calculate
Obtain the equivalent matched resistance of FlexRay bus node.Fig. 3 is FlexRay bus distribution parameter test schematic diagram.
Finally, it is stated that preferred embodiment above is only used to illustrate the technical scheme of the present invention and not to limit it, although logical
It crosses above preferred embodiment the present invention is described in detail, however, those skilled in the art should understand that, can be
Various changes are made to it in form and in details, without departing from claims of the present invention limited range.