The dcs of steering wheel and method
Technical field
The present invention relates to automatic machinery people's technical field, particularly relate to dcs and the side of a kind of steering wheel
Method.
Background technology
Steering wheel is applied on boats and ships the earliest, due to its corner can continuous control, be widely used in intelligent carriage and machine
The fields such as people.Most of steering gear control systems use centerized fusion method, i.e. by a controller produce a road or
Multi-channel PWM signal drives steering wheel to rotate.Controller needs execution route to plan, calculates the target location of each steering wheel, motion speed
Degree etc. control parameter, and produce the driving steering wheel rotation of corresponding pwm signal, simultaneously need to gather the feedback signal side of each road steering wheel
Just real-time tracking regulation, makes each steering wheel reach the target location specified with optimum performance.
But, centerized fusion method exists following not enough: 1. when steering wheel quantity is more, system controls difficulty increase, connects
Line is complicated;2. when steering wheel installation site is remote, control system capacity of resisting disturbance reduction etc.;3. the controller of control system processes institute
Some control functions, take resource more, burden weight;4. the steering wheel limited amount that control system controls, is difficult to extension, works as steering wheel
When quantity is more, it is impossible to meet requirement.
Summary of the invention
Goal of the invention: the present invention is directed to the problem that prior art exists, it is provided that the dcs of a kind of steering wheel.
Technical scheme: the dcs of steering wheel of the present invention includes:
Host computer, for when steering wheel is needed to be controlled by host computer, sends servos control parameter to communication controller
With corresponding communication id, it is additionally operable to, when host computer needs to obtain steering wheel state, send steering wheel state to communication controller and obtain
Instruction and corresponding communication id, and for updating steering wheel state according to communication id after receiving steering wheel status data;
Communication controller, is provided with several PORT COM, for mapping out destination interface ID and purpose rudder according to communication id
Machine ID, and the data transmission sent with host computer by purpose steering wheel ID is to the communication terminal corresponding for destination interface ID mapped out
Mouthful, the communication id being additionally operable to steering wheel status data and the correspondence returned by steering wheel is uploaded to host computer;
Some groups of steering wheels, one group of steering wheel is connected to communication controller by a PORT COM, and steering wheel is for according to communication
The purpose steering wheel ID that controller sends mates, and carries out servos control when the match is successful according to servos control parameter, also
Steering wheel state for sending according to communication controller obtains instruction and returns current status data.
Further, described host computer includes:
Path planning unit, for needing the steering wheel execution route controlled to plan;
Instruction signal generating unit, obtains instruction for the steering wheel needing acquisition state generates state;
Control parameter generating unit, for the coordinates measurement servos control parameter according to planning;
Packet generation unit, for by controlling the servos control parameter that parameter generating unit generates, adding its correspondence
Communication id generates packet, and the state by instruction signal generating unit generates that is additionally operable to obtains instruction, adds that the communication id of its correspondence is raw
Become packet;
Data transmission unit, sends to communication controller for the packet generated by packet generation unit, is additionally operable to
Receive steering wheel status data and corresponding communication id that communication controller returns;
Matching unit, for the communication id received by data transmission unit, obtains with sending steering wheel state to communication controller
Communication id corresponding to instruction fetch mates, if unanimously, then the match is successful, and otherwise it fails to match;
The unit that state updates, for when the match is successful for matching unit, updates the state of steering wheel corresponding to communication id.
Further, described communication controller includes:
First transmission unit, the data for host computer and communication controller are transmitted;
First map unit, for, from the packet that the first transmission unit receives, extracting communication id, and according to communication
ID maps out destination interface ID and purpose steering wheel ID;
First packet generation unit, generates packet for the data sent by host computer and purpose steering wheel ID, and
Send to the second data transmission unit;
Second transmission unit, for sending the packet of the first packet generation unit to the destination interface ID mapped out
Corresponding PORT COM, is additionally operable to receive steering wheel status data and the corresponding steering wheel ID that steering wheel is returned by PORT COM;
Second map unit, the end of the PORT COM used when the steering wheel ID that the second transmission unit is received and reception
Mouth ID, is mapped as communication id;
Second packet generation unit, the steering wheel status data packing for the communication id that will map and reception generates data
Bag, and send to the first transmission unit.
Further, described steering wheel includes:
Data transmission unit, for receiving the data that communication controller sends, and returns steering wheel shape to communication controller
State data and corresponding steering wheel ID;
Matching unit, for going out purpose steering wheel ID from the extracting data received, and is carried out with No. ID of current steering wheel
Coupling, if unanimously, then the match is successful, and otherwise it fails to match;
Servos control unit, at matching unit, the match is successful, and when the data received are servos control parameters, according to
Steering wheel is controlled by this servos control parameter;
Steering wheel state acquiring unit, at matching unit, the match is successful, and the data received are that the acquisition of steering wheel state refers to
When making, the status data of current steering wheel is sent to data transmission unit.
Further, described host computer passes through RS422 connecting communication controller, and often group steering wheel is by a RS485 bus
Connecting communication controller.
The distributed control method of steering wheel of the present invention includes step:
S1, when steering wheel is needed to be controlled by host computer, send servos control parameter and corresponding to communication controller
Communication id;
S2, communication controller map out destination interface ID and purpose steering wheel ID according to communication id, and by purpose steering wheel ID
Number with host computer send data send to the PORT COM corresponding for destination interface ID mapped out, wherein, communication controller sets
There are several PORT COM;
The purpose steering wheel ID that S3, steering wheel send according to communication controller mates, when the match is successful according to steering wheel
Controlling parameter and carry out servos control, wherein, steering wheel one has some groups, and one group of steering wheel is connected to communication by a PORT COM
Controller;
S4, when host computer needs to obtain steering wheel state, send steering wheel state to communication controller and obtain instruction and corresponding
Communication id;
S5, communication controller map out destination interface ID and purpose steering wheel ID according to communication id, and by purpose steering wheel ID
Number with host computer send data send to the PORT COM corresponding for destination interface ID mapped out;
The purpose steering wheel ID that S6, steering wheel send according to communication controller mates, when the match is successful according to communication
The steering wheel state that controller sends obtains instruction and returns current status data;
Steering wheel status data and the communication id of correspondence that steering wheel is returned by S7, communication controller are uploaded to host computer;
S8, host computer update steering wheel state according to communication id after receiving steering wheel status data.
Further, step S1 specifically includes:
S11, when steering wheel is needed to be controlled by host computer, to need control steering wheel execution route planning;
S12, according to planning coordinates measurement servos control parameter;
S13, by generate servos control parameter plus its correspondence communication id generate packet;
S14, the packet generated by number send to communication controller;
Step S4 specifically includes:
S41, when host computer need obtain steering wheel state time, generate steering wheel state obtain instruction;
S42, by steering wheel state obtain instruction and correspondence communication id generate packet;
S43, the packet generated by number send to communication controller;
Step S8 specifically includes:
S81, the communication id that will receive, enter with sending communication id corresponding when steering wheel state obtains instruction to communication controller
Row coupling, if unanimously, then the match is successful, and otherwise it fails to match;
S82, when the match is successful, update the state of steering wheel corresponding to communication id.
Further, step S2 specifically includes:
S21, communication controller receive the data of host computer transmission;
S22, from receive packet, extract communication id, and map out destination interface ID and purpose according to communication id
Steering wheel ID;
S23, the servos control parameter sent by host computer and purpose steering wheel ID generate packet;
S24, the packet of generation is sent to the PORT COM corresponding for destination interface ID mapped out;
Step S5 specifically includes:
S51, communication controller receive the data of host computer transmission;
S52, from receive packet, extract communication id, and map out destination interface ID and purpose according to communication id
Steering wheel ID;
S53, the steering wheel state sent by host computer obtain instruction and purpose steering wheel ID generates packet;
S54, the packet of generation is sent to the PORT COM corresponding for destination interface ID mapped out;
Step S7 specifically includes:
S71, communication controller receive steering wheel status data and the steering wheel ID of correspondence that steering wheel is returned by PORT COM;
The port id of the PORT COM used when S72, communication controller are by the steering wheel ID received and reception, is mapped as communication
ID;
The steering wheel status data packing of the communication id mapped and reception is generated packet by S73, communication controller, and sends
To host computer.
Further, step S3 specifically includes:
S31, steering wheel receive the data that communication controller sends;
S32, steering wheel go out purpose steering wheel ID from the extracting data received, and mate with No. ID of current steering wheel,
If consistent, then the match is successful, and otherwise it fails to match;
S33, the match is successful, and when the data received are servos control parameters, according to this servos control parameter to steering wheel
It is controlled;
Step S6 specifically includes:
S61, steering wheel receive the data that communication controller sends;
S62, steering wheel go out purpose steering wheel ID from the extracting data received, and mate with No. ID of current steering wheel,
If consistent, then the match is successful, and otherwise it fails to match;
S63, the match is successful, and the data received are steering wheel states when obtaining instruction, by the status data of current steering wheel
Send to data transmission unit.
Further, described host computer passes through RS422 connecting communication controller, and often group steering wheel is by a RS485 bus
Connecting communication controller.
Beneficial effect: compared with prior art, its remarkable advantage is the present invention:
1. difficulty is low, wiring is simple in control;
2. long transmission distance, capacity of resisting disturbance are strong;
3. the occupied resource of host computer is few, and burden is light;
4. can control steering wheel quantity many and be prone to extension;
5. relaying low cost.
Accompanying drawing explanation
Fig. 1 is the system block diagram of an embodiment of the dcs of the steering wheel that the present invention provides;
Fig. 2 is the cell schematics of host computer in Fig. 1;
Fig. 3 is the cell schematics of communication controller in Fig. 1;
Fig. 4 is the cell schematics of steering wheel in Fig. 1;
Fig. 5 is the schematic flow sheet of an embodiment of the distributed control method of the steering wheel that the present invention provides;
Fig. 6 is servos control schematic flow sheet;
Fig. 7 is the schematic flow sheet of steering wheel state data acquisition.
Detailed description of the invention
As it is shown in figure 1, the dcs of the steering wheel of the present embodiment includes: host computer, communication controller and some
Group steering wheel (having three groups in figure, often group has N number of steering wheel).Host computer passes through RS422 connecting communication controller, and often group steering wheel is by one
Individual RS485 bus connecting communication controller.Wherein, host computer is for when steering wheel is needed to be controlled by host computer, to communication
Controller sends servos control parameter and corresponding communication id, is additionally operable to when host computer needs to obtain steering wheel state, to communication
Controller sends the acquisition instruction of steering wheel state and corresponding communication id, and logical for basis after receiving steering wheel status data
News ID updates steering wheel state;Communication controller is provided with several PORT COM, for mapping out destination interface ID according to communication id
With purpose steering wheel ID, and purpose steering wheel ID is sent corresponding to the destination interface ID mapped out with data that host computer sends
PORT COM, be additionally operable to the steering wheel status data that returned by steering wheel and corresponding communication id be uploaded to host computer;One group of steering wheel
Being connected to communication controller by a PORT COM, steering wheel is carried out for the purpose steering wheel ID sent according to communication controller
Coupling, carries out servos control when the match is successful according to servos control parameter, is additionally operable to the steering wheel sent according to communication controller
State obtains instruction and returns current status data.In native system, host computer the most directly participates in the actual control of steering wheel, but will
The control of steering wheel is independently realized by the control circuit of steering wheel itself, so the resource that servos control takies host computer greatly reduces,
Alleviate the burden of host computer.
As in figure 2 it is shown, host computer includes path planning unit, instruction signal generating unit, controls parameter generating unit, packet
The unit that signal generating unit, data transmission unit, matching unit and state update.Wherein, path planning unit is for controlling needs
The steering wheel execution route planning of system;Instruction signal generating unit obtains instruction for the steering wheel needing acquisition state generates state;Control
Parameter generating unit processed is for the coordinates measurement servos control parameter according to planning;Packet generation unit will be for controlling parameter
Signal generating unit generate servos control parameter, add its correspondence communication id generate packet (such as, in Fig. 1,1-1 represents logical
News ID, the port id of 1 expression PORT COM above, 1 expression steering wheel ID below), it is additionally operable to generate instruction signal generating unit
State obtain instruction, add its correspondence communication id generate packet;Data transmission unit is for by packet generation unit
The packet transmission generated, to communication controller, is additionally operable to receive steering wheel status data and corresponding the leading to that communication controller returns
News ID;Matching unit, for the communication id received by data transmission unit, refers to sending the acquisition of steering wheel state to communication controller
The communication id of order correspondence mates, if unanimously, then the match is successful, and otherwise it fails to match;State update unit for
When joining units match success, update the state of steering wheel corresponding to communication id, when it fails to match, abandon data.
As it is shown on figure 3, communication controller include the first transmission unit, the first map unit, the first packet generation unit,
Second transmission unit, the second map unit, the second packet generation unit.Wherein, the first transmission unit for host computer and leads to
The data transmission of news controller;First map unit, for the packet from the first transmission unit reception, extracts communication id,
And (such as, communication id is 2-1, maps out PORT COM to map out destination interface ID and purpose steering wheel ID according to communication id
Port id is 2, and purpose steering wheel ID is 1);First packet generation unit is for the data sent by host computer and purpose steering wheel
No. ID generates packet, and sends to the second data transmission unit;Second transmission unit is for by the first packet generation unit
Packet send to the PORT COM corresponding for destination interface ID mapped out, be additionally operable to receive steering wheel returned by PORT COM
Steering wheel status data and corresponding steering wheel ID;Second map unit is for the steering wheel ID received by the second transmission unit and reception
The port id of the PORT COM of Shi Caiyong, is mapped as communication id;Second packet generation unit for will map communication id and
The steering wheel status data packing received generates packet, and sends to the first transmission unit.
As shown in Figure 4, steering wheel includes that data transmission unit, matching unit, servos control unit, steering wheel state obtain list
Unit.Wherein, data transmission unit is for receiving the data that communication controller sends, and returns steering wheel state to communication controller
Data and corresponding steering wheel ID;Matching unit for going out purpose steering wheel ID from the extracting data received, and with current steering wheel
No. ID mate, if unanimously, then the match is successful, and otherwise it fails to match;Servos control unit is for mating at matching unit
Success, and when the data received are servos control parameters, according to this servos control parameter, steering wheel is controlled;Steering wheel state obtains
Take unit for the match is successful at matching unit, and the data received are steering wheel states when obtaining instruction, by the shape of current steering wheel
State data send to data transmission unit.
As it is shown in figure 5, the distributed control method of the steering wheel of the present embodiment includes step:
S1, when steering wheel is needed to be controlled by host computer, send servos control parameter and corresponding to communication controller
Communication id.
Concrete, step S1 includes: S11, when steering wheel is needed to be controlled by host computer, holds needing the steering wheel controlled
Row path planning;S12, according to planning coordinates measurement servos control parameter, including the parameter such as target location, speed;S13, general
The servos control parameter generated generates packet plus the communication id of its correspondence;S14, the packet generated by number send to communication
Controller.
Such as, as shown in Figure 6, when host computer needs to be controlled the steering wheel that communication id is 2-1, this steering wheel is performed
Path planning;Coordinates measurement servos control parameter according to planning;The servos control parameter generated is added the communication of its correspondence
ID2-1 generates packet;The packet generated by number sends to communication controller.
S2, communication controller map out destination interface ID and purpose steering wheel ID according to communication id, and by purpose steering wheel ID
Number with host computer send data send to the PORT COM corresponding for destination interface ID mapped out, wherein, communication controller sets
There are several PORT COM.
Concrete, step S2 includes: S21, communication controller receive the data of host computer transmission;S22, from receive data
Bao Zhong, extracts communication id, and maps out destination interface ID and purpose steering wheel ID according to communication id;S23, by host computer send
Servos control parameter and purpose steering wheel ID generate packet;S24, the packet of generation is sent to the destination mapped out
The PORT COM that mouth ID is corresponding.
Such as, as shown in Figure 6, communication controller receives the data of host computer transmission;From the packet received, extract
Communication id 2-1, mapping out destination interface ID according to 2-1 is 2 and purpose steering wheel ID is 1;The servos control that host computer is sent
Parameter and purpose steering wheel No. ID 1 generate packet;The packet generated is sent to PORT COM 2.
The purpose steering wheel ID that S3, steering wheel send according to communication controller mates, when the match is successful according to steering wheel
Controlling parameter and carry out servos control, wherein, steering wheel one has some groups, and one group of steering wheel is connected to communication by a PORT COM
Controller.
Concrete, step S3 specifically includes: S31, steering wheel receive the data that communication controller sends;S32, steering wheel are from reception
Extracting data go out purpose steering wheel ID, and mate with No. ID of current steering wheel, if unanimously, then the match is successful, otherwise
It fails to match;S33, the match is successful, and when the data received are servos control parameters, according to this servos control parameter to steering wheel
It is controlled.
Such as, as shown in Figure 6, steering wheel 2-1 receives the data that communication controller sends;Mesh is gone out from the extracting data received
Steering wheel ID be 1, and mate with No. ID 1 of current steering wheel, if unanimously, then the match is successful, and otherwise it fails to match;?
It is made into merit, and when the data received are servos control parameters, according to this servos control parameter, steering wheel is controlled.
S4, when host computer needs to obtain steering wheel state, send steering wheel state to communication controller and obtain instruction and corresponding
Communication id.
Concrete, step S4 specifically includes: S41, when host computer needs to obtain steering wheel state, generates steering wheel state and obtains
Instruction;S42, by steering wheel state obtain instruction and correspondence communication id generate packet;S43, the packet generated by number send
To communication controller.
Such as, as it is shown in fig. 7, when the steering wheel state that host computer needs acquisition communication id to be 2-1, generate steering wheel state and obtain
Instruction fetch;Steering wheel state is obtained instruction and 2-1 generates packet;The packet generated by number sends to communication controller.
S5, communication controller map out destination interface ID and purpose steering wheel ID according to communication id, and by purpose steering wheel ID
Number with host computer send data send to the PORT COM corresponding for destination interface ID mapped out.
Concrete, step S5 specifically includes: S51, communication controller receive the data of host computer transmission;S52, from receive
In packet, extract communication id, and map out destination interface ID and purpose steering wheel ID according to communication id;S53, by host computer
The steering wheel state sent obtains instruction and purpose steering wheel ID generates packet;S54, the packet of generation is sent to mapping out
PORT COM corresponding for destination interface ID.
Such as, as it is shown in fig. 7, communication controller receives the data of host computer transmission;From the packet received, extract
Communication id is 2-1, and mapping out destination interface ID according to communication id 2-1 is 2 and purpose steering wheel ID is 1;Host computer is sent
Steering wheel state obtains instruction and purpose steering wheel No. ID 1 generates packet;The packet generated is sent to PORT COM 2.
The purpose steering wheel ID that S6, steering wheel send according to communication controller mates, when the match is successful according to communication
The steering wheel state that controller sends obtains instruction and returns current status data.
Concrete, step S6 specifically includes: S61, steering wheel receive the data that communication controller sends;S62, steering wheel are from reception
Extracting data go out purpose steering wheel ID, and mate with No. ID of current steering wheel, if unanimously, then the match is successful, otherwise
It fails to match, abandons data;S63, the match is successful, and the data received are steering wheel states when obtaining instruction, by current steering wheel
Status data and current steering wheel ID send to data transmission unit.
Such as, as it is shown in fig. 7, steering wheel receives the data that communication controller sends;Purpose is gone out from the extracting data received
Steering wheel ID is 1, mates with No. ID of current steering wheel, if unanimously, then the match is successful, and otherwise it fails to match, abandons data;
The match is successful, and the data received are steering wheel states when obtaining instruction, by status data and the steering wheel No. ID 1 of current steering wheel
Deliver to data transmission unit.
Steering wheel status data and the communication id of correspondence that steering wheel is returned by S7, communication controller are uploaded to host computer.
Concrete, step S7 specifically includes: S71, communication controller receive the steering wheel shape that steering wheel is returned by PORT COM
State data and corresponding steering wheel ID;The port of the PORT COM used when S72, communication controller are by the steering wheel ID received and reception
ID, is mapped as communication id;The steering wheel status data packing of the communication id mapped and reception is generated data by S73, communication controller
Bag, and send to host computer.
Such as, as it is shown in fig. 7, communication controller receives steering wheel status data and the rudder that steering wheel is returned by PORT COM 2
Machine ID 1;The port id 2 of the PORT COM used when communication controller is by the steering wheel ID 1 received and reception, is mapped as communication
ID 2-1;The steering wheel status data packing of the communication id 2-1 mapped and reception is generated packet by communication controller, and sends extremely
Host computer.
S8, host computer update steering wheel state according to communication id after receiving steering wheel status data.
Concrete, step S8 specifically includes: the communication id that S81, host computer will receive, and sends steering wheel with to communication controller
State obtains communication id corresponding when instructing and mates, if unanimously, then the match is successful, and otherwise it fails to match, abandons data;
S82, when the match is successful, update the state of steering wheel corresponding to communication id.
Such as, as it is shown in fig. 7, the communication id 2-1 that host computer will receive, obtain with sending steering wheel state to communication controller
Communication id 2-1 corresponding during instruction fetch mates, if unanimously, then the match is successful, and otherwise it fails to match;When the match is successful,
Update the state of steering wheel corresponding for communication id 2-1.
Above disclosed only one preferred embodiment of the present invention, it is impossible to limit the right model of the present invention with this
Enclose, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is contained.