CN105911921A - Multipath steering engine control method based on 52-series single-chip microcomputer - Google Patents

Multipath steering engine control method based on 52-series single-chip microcomputer Download PDF

Info

Publication number
CN105911921A
CN105911921A CN201610428812.5A CN201610428812A CN105911921A CN 105911921 A CN105911921 A CN 105911921A CN 201610428812 A CN201610428812 A CN 201610428812A CN 105911921 A CN105911921 A CN 105911921A
Authority
CN
China
Prior art keywords
intervalometer
initial value
port
value
timing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610428812.5A
Other languages
Chinese (zh)
Other versions
CN105911921B (en
Inventor
常坤
武风波
刘海强
马文凯
李荣荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Science and Technology
Original Assignee
Xian University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian University of Science and Technology filed Critical Xian University of Science and Technology
Priority to CN201610428812.5A priority Critical patent/CN105911921B/en
Publication of CN105911921A publication Critical patent/CN105911921A/en
Application granted granted Critical
Publication of CN105911921B publication Critical patent/CN105911921B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25432Multiplex

Abstract

The invention relates to a multipath steering engine control method based on a 52-series single-chip microcomputer. The method comprises the steps of: (1) establishing a control framework; (2) according to a standard steering engine with the period of 20 ms and the pulse width of 0.5-2.5 ms, carrying out timing time distribution, ensuring that the duration time of the high level of each path of steering engine is 0.5-2.5 ms, dividing ports to be controlled into a plurality of port groups, and ordering the plurality of port groups; (3) changing levels of ports of all port groups into low levels; (4) carrying out initialization configuration on a T0 timer and a T1 timer; (5) carrying out assignment on the T0 timer and the T1 timer; and (6) traversing all the port groups until interruptions of the T0 timer and the T1 timer are closed.

Description

A kind of multichannel servos control method based on 52 series monolithics
Technical field
The invention belongs to robot application control field, be specifically related to a kind of single based on 52 series The multichannel servos control method of sheet machine.
Background technology
Along with society development in science and technology is rapid, the function of processor is ceaselessly promoting, performance The most optimised, and apply the single-chip microcomputer of 52 series in a lot of year in every profession and trade owing to not having There is the port carrying pwm, so the application in a lot of fields is limited by very large, especially It is the field of robot, does not has the pwm of multichannel that 52 series monolithics have been blocked in the most certainly By degree robot outdoors;But 52 series monolithics are due at the aspect such as price and stability Advantage reluctantly not by market;How 52 series monolithics are applied at multimachine rudder On the panel of machine, and then reduction cost becomes a urgent problem.
Summary of the invention
Goal of the invention: the problem that the present invention is directed to the existence of above-mentioned prior art makes improvement, i.e. originally A kind of multichannel servos control methods based on 52 series monolithics of disclosure of the invention, it can make 52 series monolithics not having pwm delivery outlet realize pinpoint accuracy multichannel adjustable pwm ripple, can To utilize these pwm ripples that can regulate to control multichannel steering wheel, make the function of 52 series more Add is perfect.
Technical scheme: a kind of multichannel servos control methods based on 52 series monolithics, including Following steps:
(1) building control framework, this control framework includes:
T0 interrupt module: give successively in T0 intervalometer according to the break sequence set and need to control Port compose initial value;
T1 interrupt module: give successively in T1 intervalometer according to the break sequence set and need to control Port compose initial value;
Intervalometer timing initial value comparison module, is used for judging T0 intervalometer and T1 intervalometer initial value Size, according to the timing initial value of intervalometer of result of the comparison change low priority;
Servos control module, is used for depositing and change T0 intervalometer and the required control of T1 intervalometer The timing initial value of the port of system;
(2) being 20ms according to the cycle, pulse width is that 0.5ms~2.5ms standard steering wheel enters Row timing distributes, and the high level lasting time of every road steering wheel is 0.5ms~2.5ms, so After the port controlled will be needed to be divided into multiple port set, and the plurality of port set is arranged Sequence, each port set includes two ports, and this port two is respectively by T0 intervalometer and T1 Timer Controlling;
(3) level of the port of all of the port group is become low level;
(4) T0 intervalometer and T1 intervalometer are carried out initial configuration, simultaneously T0 intervalometer Just value difference initialized with T1 intervalometer is less than 0.5ms;
(5) T0 intervalometer and T1 intervalometer are carried out assignment;
(51) control TO intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 becomes high level, at the beginning of composing for T0 intervalometer simultaneously Value, T0 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(52) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 becomes high level, at the beginning of composing for T1 intervalometer simultaneously Value, T1 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(53) obtained by the relatively middle step (51) of intervalometer timing initial value comparison module T0 intervalometer initial value and the size of T1 intervalometer initial value that obtains of step (52), logical Cross the initial value that result of the comparison changes the high level of low priority T1 intervalometer
(531) if T0 intervalometer initial value is more than T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T1, T1 Time time;
(532) if T0 intervalometer initial value is equal to T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T2, T2 Time time;
(532) if T0 intervalometer initial value is less than T1 intervalometer initial value, then T0 is exchanged With the interrupt priority level of T1, T0 intervalometer initial value is re-started assignment, its value etc. It is that T1 is fixed that the T0 intervalometer initial value obtained in step (52) deducts the value of T3, T3 Time device enter interrupt time to tax initial value start time time;
(54) control T0 intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 is changed into low level by high level, simultaneously fixed for T0 Time device carry out secondary assignment, T0 intervalometer secondary assignment equal to 2.5ms deduct T0 timing Device initial value;
(55) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 is become low level from high level, and to T1 timing Device carries out secondary assignment, and T1 intervalometer secondary assignment is equal to 2.5ms-T1 intervalometer initial value;
(6) travel through all of port set, repeat step (51)~(55), until T0 is fixed Time device and T1 timer interruption close till.
Further, step (2) if in the quantity of port of required control be odd number, many A remaining road port is randomly assigned to T0 intervalometer or T1 intervalometer.
Further, if the quantity of the port of required control is odd number, an extra road Port need not compare initial value.
Beneficial effect: a kind of multichannel steering wheel controls based on 52 series monolithics disclosed by the invention Method processed has the advantages that
1, cheap and good stability 52 series monolithics are applied to robot and control neck Territory, cost-effective;
2, may apply to other fields needing pwm simultaneously;
3, the range of application of 52 single-chip microcomputers is expanded further.
Detailed description of the invention:
Below the detailed description of the invention of the present invention is described in detail.
Specific embodiment 1
A kind of multichannel servos control method based on 52 series monolithics, comprises the following steps:
(1) building control framework, this control framework includes:
T0 interrupt module: give successively in T0 intervalometer according to the break sequence set and need to control Port compose initial value;
T1 interrupt module: give successively in T1 intervalometer according to the break sequence set and need to control Port compose initial value;
Intervalometer timing initial value comparison module, is used for judging T0 intervalometer and T1 intervalometer initial value Size, according to the timing initial value of intervalometer of result of the comparison change low priority;
Servos control module, is used for depositing and change T0 intervalometer and the required control of T1 intervalometer The timing initial value of the port of system;
(2) being 20ms according to the cycle, pulse width is that 0.5ms standard steering wheel is when being timed Between distribute, the high level lasting time of every road steering wheel is 0.5ms, then will need control end Mouth is divided into multiple port set, and is ranked up the plurality of port set, each port set bag Including two ports, this port two is respectively by T0 intervalometer and T1 Timer Controlling;
(3) level of the port of all of the port group is become low level;
(4) T0 intervalometer and T1 intervalometer are carried out initial configuration, simultaneously T0 intervalometer Just value difference initialized with T1 intervalometer is less than 0.5ms;
(5) T0 intervalometer and T1 intervalometer are carried out assignment;
(51) control TO intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 becomes high level, at the beginning of composing for T0 intervalometer simultaneously Value, T0 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(52) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 becomes high level, at the beginning of composing for T1 intervalometer simultaneously Value, T1 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(53) obtained by the relatively middle step (51) of intervalometer timing initial value comparison module T0 intervalometer initial value and the size of T1 intervalometer initial value that obtains of step (52), logical Cross the initial value that result of the comparison changes the high level of low priority T1 intervalometer
(531) if T0 intervalometer initial value is more than T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T1, T1 Time time;
(532) if T0 intervalometer initial value is equal to T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T2, T2 Time time;
(532) if T0 intervalometer initial value is less than T1 intervalometer initial value, then T0 is exchanged With the interrupt priority level of T1, T0 intervalometer initial value is re-started assignment, its value etc. It is that T1 is fixed that the T0 intervalometer initial value obtained in step (52) deducts the value of T3, T3 Time device enter interrupt time to tax initial value start time time;
(54) control T0 intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 is changed into low level by high level, simultaneously fixed for T0 Time device carry out secondary assignment, T0 intervalometer secondary assignment deducts step (53) equal to 2.5ms The T0 intervalometer initial value obtained;
(55) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 is become low level from high level, and to T1 timing Device carries out secondary assignment, and T1 intervalometer secondary assignment obtains equal to 2.5ms-step (53) T1 intervalometer initial value;
(6) travel through all of port set, repeat step (51)~(55), until T0 is fixed Time device and T1 timer interruption close till.
Further, step (2) if in the quantity of port of required control be odd number, many A remaining road port is randomly assigned to T0 intervalometer or T1 intervalometer.
Further, if the quantity of the port of required control is odd number, an extra road Port need not compare initial value.
Specific embodiment 2
Roughly the same with specific embodiment 1, differ only in:
Being 20ms according to the cycle in step (2), pulse width is that 2.5ms standard steering wheel is carried out Timing distributes, and the high level lasting time of every road steering wheel is 2.5ms.
Specific embodiment 3
Roughly the same with specific embodiment 1, differ only in:
Being 20ms according to the cycle in step (2), it is fixed that pulse width is that 1ms standard steering wheel is carried out Time the time distribution, the high level lasting time of every road steering wheel is 1ms.
Above embodiments of the present invention are elaborated.On but the present invention is not limited to State embodiment, in the ken that art those of ordinary skill is possessed, also Can make a variety of changes on the premise of without departing from present inventive concept.

Claims (3)

1. a multichannel servos control method based on 52 series monolithics, it is characterised in that Comprise the following steps:
(1) building control framework, this control framework includes:
T0 interrupt module: give successively in T0 intervalometer according to the break sequence set and need to control Port compose initial value;
T1 interrupt module: give successively in T1 intervalometer according to the break sequence set and need to control Port compose initial value;
Intervalometer timing initial value comparison module, is used for judging T0 intervalometer and T1 intervalometer initial value Size, according to the timing initial value of intervalometer of result of the comparison change low priority;
Servos control module, is used for depositing and change T0 intervalometer and the required control of T1 intervalometer The timing initial value of the port of system;
(2) being 20ms according to the cycle, pulse width is that 0.5ms~2.5ms standard steering wheel enters Row timing distributes, and the high level lasting time of every road steering wheel is 0.5ms~2.5ms, so After the port controlled will be needed to be divided into multiple port set, and the plurality of port set is arranged Sequence, each port set includes two ports, and this port two is respectively by T0 intervalometer and T1 Timer Controlling;
(3) level of the port of all of the port group is become low level;
(4) T0 intervalometer and T1 intervalometer are carried out initial configuration, simultaneously T0 intervalometer Just value difference initialized with T1 intervalometer is less than 0.5ms;
(5) T0 intervalometer and T1 intervalometer are carried out assignment;
(51) control TO intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 becomes high level, at the beginning of composing for T0 intervalometer simultaneously Value, T0 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(52) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 becomes high level, at the beginning of composing for T1 intervalometer simultaneously Value, T1 intervalometer initial value is the timing initial value that in servos control module, this road port is corresponding;
(53) obtained by the relatively middle step (51) of intervalometer timing initial value comparison module T0 intervalometer initial value and the size of T1 intervalometer initial value that obtains of step (52), logical Cross the initial value that result of the comparison changes the high level of low priority T1 intervalometer
(531) if T0 intervalometer initial value is more than T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T1, T1 Time time;
(532) if T0 intervalometer initial value is equal to T1 intervalometer initial value, then fixed to T1 Time device initial value re-start assignment, the T1 timing that its value obtains equal to step (52) It is to start to tax initial value during the entrance interruption of T0 intervalometer that device initial value deducts the value of T2, T2 Time time;
(532) if T0 intervalometer initial value is less than T1 intervalometer initial value, then T0 is exchanged With the interrupt priority level of T1, T0 intervalometer initial value is re-started assignment, its value etc. It is that T1 is fixed that the T0 intervalometer initial value obtained in step (52) deducts the value of T3, T3 Time device enter interrupt time to tax initial value start time time;
(54) control T0 intervalometer by T0 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T0 is changed into low level by high level, simultaneously fixed for T0 Time device carry out secondary assignment, T0 intervalometer secondary assignment equal to 2.5ms deduct T0 timing Device initial value;
(55) control T1 intervalometer by T1 interrupt module and enter interruption, by the first end In mouth group, the timer-operated port of T1 is become low level from high level, and to T1 timing Device carries out secondary assignment, and T1 intervalometer secondary assignment is equal to 2.5ms-T1 intervalometer initial value;
(6) travel through all of port set, repeat step (51)~(55), until T0 is fixed Time device and T1 timer interruption close till.
A kind of multichannel steering wheel controls based on 52 series monolithics the most according to claim 1 Method processed, it is characterised in that step (2) if in the quantity of port of required control be strange Number, a unnecessary road port is randomly assigned to T0 intervalometer or T1 intervalometer.
A kind of multichannel steering wheel controls based on 52 series monolithics the most according to claim 2 Method processed, it is characterised in that if the quantity of the port of required control is odd number, extra One road port need not compare initial value.
CN201610428812.5A 2016-06-16 2016-06-16 A kind of multichannel steering engine control method based on 52 series monolithics Expired - Fee Related CN105911921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610428812.5A CN105911921B (en) 2016-06-16 2016-06-16 A kind of multichannel steering engine control method based on 52 series monolithics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610428812.5A CN105911921B (en) 2016-06-16 2016-06-16 A kind of multichannel steering engine control method based on 52 series monolithics

Publications (2)

Publication Number Publication Date
CN105911921A true CN105911921A (en) 2016-08-31
CN105911921B CN105911921B (en) 2019-03-05

Family

ID=56751296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610428812.5A Expired - Fee Related CN105911921B (en) 2016-06-16 2016-06-16 A kind of multichannel steering engine control method based on 52 series monolithics

Country Status (1)

Country Link
CN (1) CN105911921B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203209832U (en) * 2013-04-15 2013-09-25 南通富力机电设备有限责任公司 Reference and pulse control circuit based on PWM waves of single chip microcomputer
CN103869728A (en) * 2012-12-18 2014-06-18 苏州工业园区新宏博通讯科技有限公司 Steering engine control device
CN104898474A (en) * 2015-04-01 2015-09-09 华南理工大学 MCU-based multichannel uniform servo pulse generation method
CN105302168A (en) * 2015-11-19 2016-02-03 江西洪都航空工业集团有限责任公司 Low-cost electric steering engine control method based on single-chip microcomputer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103869728A (en) * 2012-12-18 2014-06-18 苏州工业园区新宏博通讯科技有限公司 Steering engine control device
CN203209832U (en) * 2013-04-15 2013-09-25 南通富力机电设备有限责任公司 Reference and pulse control circuit based on PWM waves of single chip microcomputer
CN104898474A (en) * 2015-04-01 2015-09-09 华南理工大学 MCU-based multichannel uniform servo pulse generation method
CN105302168A (en) * 2015-11-19 2016-02-03 江西洪都航空工业集团有限责任公司 Low-cost electric steering engine control method based on single-chip microcomputer

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
付丽等: ""单片机控制的多路舵机用PWM波产生方法"", 《驱动控制》 *
刘歌群等: ""用单片机产生7路舵机控制PWM波的方法"", 《机械与电子》 *
吴华波等: ""基于单片机AT89LP4052的舵机控制器的设计"", 《安徽电气工程职业技术学院学报》 *
李霞等: ""基于AVR单片机的电动舵机控制器设计"", 《单片机与嵌入式系统应用》 *
杨成等: ""基于STC89c52单片机的舵机控制系统设计"", 《计算机技术应用》 *
韩庆瑶等: ""基于AVR单片机的多舵机控制系统设计及仿真"", 《计算机测量与控制》 *

Also Published As

Publication number Publication date
CN105911921B (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN102130640B (en) Multishaft synchronous servo driving system and synchronous control method thereof
US9058789B2 (en) Synchronous processing system and semiconductor integrated circuit
CN103500506B (en) A kind of detection method of multichannel special duty route conflict
CN104881983B (en) Household electrical appliances self-learning method, household electrical appliances self learning system and household electrical appliances
CA2287721A1 (en) Router device and label switched path control method using upstream initiated aggregation
CN103527293A (en) Urea injection control method and unit
CN104035901A (en) TTCAN bus timing and data transmitting method
CN103197966A (en) Semiconductor data processing device, time-triggered communication system, and communication system
CN105911921A (en) Multipath steering engine control method based on 52-series single-chip microcomputer
CN103914416A (en) Regulating direct memory access descriptor execution
CN103593987A (en) Artery coordination control method conducted on the basis of multi-intersection signal machine
US10302978B2 (en) Liquid crystal display panel and driving method thereof
CN104118776A (en) Card conveying device and card conveying method for device for printing codes on intelligent cards
CN112541947B (en) Assembling method, equipment and storage medium based on machine vision
CN104598302B (en) AADL model schedulability verification methods based on resource contention model
CN104834629B (en) The central processing unit of bus-type
CN103402062B (en) CCD driver' s timing generation method and driver' s timing generating apparatus thereof
CN105894079A (en) Clock scrambling circuit
CN103971652A (en) Image processing method and image processing device
CN103425058A (en) Timing method, central processing unit and electronic device
CN105302640B (en) A kind of management of timeslice and control device and its management and control method
CN104570737B (en) PID controller parameter method for selecting based on random algorithm
CN102684585B (en) Method for controlling multiple two-phase stepping motors in real time
CN110456737B (en) Automatic task deployment method and device for robot
CN106651998A (en) Canvas-based animation playing speed adjusting method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Chang Kun

Inventor after: Li Rongrong

Inventor after: Wu Fengbo

Inventor after: Liu Haiqiang

Inventor after: Ma Wenkai

Inventor before: Chang Kun

Inventor before: Wu Fengbo

Inventor before: Liu Haiqiang

Inventor before: Ma Wenkai

Inventor before: Li Rongrong

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190305

Termination date: 20200616

CF01 Termination of patent right due to non-payment of annual fee