CN108255115A - A kind of bus type direct current generator and its control method - Google Patents

A kind of bus type direct current generator and its control method Download PDF

Info

Publication number
CN108255115A
CN108255115A CN201810128878.1A CN201810128878A CN108255115A CN 108255115 A CN108255115 A CN 108255115A CN 201810128878 A CN201810128878 A CN 201810128878A CN 108255115 A CN108255115 A CN 108255115A
Authority
CN
China
Prior art keywords
module
motor
main control
feet
bus
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.)
Withdrawn
Application number
CN201810128878.1A
Other languages
Chinese (zh)
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.)
WUHU LANREN INTELLIGENT TECHNOLOGY Co Ltd
Original Assignee
WUHU LANREN INTELLIGENT TECHNOLOGY Co Ltd
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 WUHU LANREN INTELLIGENT TECHNOLOGY Co Ltd filed Critical WUHU LANREN INTELLIGENT TECHNOLOGY Co Ltd
Priority to CN201810128878.1A priority Critical patent/CN108255115A/en
Publication of CN108255115A publication Critical patent/CN108255115A/en
Withdrawn legal-status Critical Current

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
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02KDYNAMO-ELECTRIC MACHINES
    • H02K11/00Structural association of dynamo-electric machines with electric components or with devices for shielding, monitoring or protection
    • H02K11/20Structural association of dynamo-electric machines with electric components or with devices for shielding, monitoring or protection for measuring, monitoring, testing, protecting or switching
    • H02K11/21Devices for sensing speed or position, or actuated thereby
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02KDYNAMO-ELECTRIC MACHINES
    • H02K11/00Structural association of dynamo-electric machines with electric components or with devices for shielding, monitoring or protection
    • H02K11/20Structural association of dynamo-electric machines with electric components or with devices for shielding, monitoring or protection for measuring, monitoring, testing, protecting or switching
    • H02K11/21Devices for sensing speed or position, or actuated thereby
    • H02K11/215Magnetic effect devices, e.g. Hall-effect or magneto-resistive elements
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02KDYNAMO-ELECTRIC MACHINES
    • H02K11/00Structural association of dynamo-electric machines with electric components or with devices for shielding, monitoring or protection
    • H02K11/30Structural association with control circuits or drive circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P7/00Arrangements for regulating or controlling the speed or torque of electric DC motors
    • 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/25257Microcontroller

Abstract

The present invention relates to a kind of bus type direct current generator and its control methods, including the power module for being used to power, the power module is connected with main control module, coder module, motor drive module, the main control module connect to control motor with the motor drive module, the main control module is connect with the coder module for measuring speed and position, the main control module is connected with voltage detection module and carries out voltage detecting, the main control module is connected with LED module for showing various lamp effects, the main control module is connected with bus interface for inputting and transmitting power supply and signal, the control module of direct current generator is directly mounted to motor rear portion, it is radiated by motor housing to driving chip.Bus DC MOTOR CONTROL proposed by the present invention is simple, it is only necessary to which up to 253 equipment can be controlled by sending serial ports instruction, can be cascaded and concatenated by three lines, wiring is simple, can arbitrarily switch steering engine pattern and velocity mode, be widely used.

Description

A kind of bus type direct current generator and its control method
Technical field
The present invention relates to DC MOTOR CONTROL field, specifically a kind of bus type direct current generator and its control method.
Background technology
Direct current generator is widely used in industrial production and life, particularly DC speed-reducing, passes through different decelerations Than, the output torque and speed of the direct current generator that can arbitrarily arrange in pairs or groups, and most DC speed-reducing is by external driving Device is driven, and with encoder motor wiring it is increasingly complex and all motor data acquisition and driving output by External drive module processing, the possible processing capacity of individual module is insufficient, and multiple modules are again bulky, and wiring is complicated, exists The problems such as wiring circuit contact is bad, and parameter of electric machine information collection is difficult.
Dalian Guangyang Science & Technology Engineering Co., Ltd in moral sea et al. application《Bus type intelligent motor》, Publication No. CN101150272, publication date 20080326, it is proposed that a kind of bus type intelligent motor, including become one motor, watch Driver, encoder and radiator are taken, motor is controlled by FPGA on-chip integration systems and industry ethernet, although can be very Good solves the problems, such as the integration of motor and bus intelligent control, but cost is excessively high, system complex, subtracts suitable for application in small-sized On speed motor.
Zhou Dingxiang of DEC Dongfeng Electric Machinery Co., Ltd. et al. applications《A kind of motor based on CAN bus Controller parameter changes system and method》, Publication No. CN102662397A, publication date 20120912 discloses a kind of profit The method changed with CAN bus and read electric machine controller parameter, but do not refer to the integrated peace of electric machine controller and motor Dress does not refer to that the instruction in motor operation course sends and receives and the cascade Mach-Zehnder interferometer of motor.
Invention content
The technical problems to be solved by the invention are to propose a kind of bus type direct current generator and its control method, utilize Serial ports monobus transmitting data information, by motor drive module and motor control module integrated installation to direct current generator rear portion, energy The enough rotating speed by bus cascade Mach-Zehnder interferometer motor and position.
The technical problems to be solved by the invention are realized using following technical scheme:
A kind of bus type direct current generator, including be used for power power module, the power module be connected with main control module, Coder module, motor drive module, the main control module connect to control motor, the master with the motor drive module Control module connect with the coder module be used for measuring speed and position, the main control module be connected with voltage detection module into Row voltage detecting, the main control module are connected with LED module for showing various lamp effects, and the main control module is connected with bus and connects Mouth is used to inputting and transmitting power supply and signal.
The main control module uses the main control chip of model STM8S003, and 19 feet of the main control chip are configured as half Duplexing single bus mode, 19 feet of the main control chip are connected with 3rd resistor, and the 3rd resistor is far from the main control chip One end be connected with 1 foot of first interface, 2 feet of the first interface are connected with main power source VM, and 3 feet of the first interface connect Ground, 1 foot, 2 feet, 3 feet of the first interface are correspondingly connected with 1 foot, 2 feet, 3 feet of second interface.
The coder module includes the first Hall and the second Hall, and 3 feet of first Hall are connected with second resistance Digital power VCC is followed by, 3 feet of first Hall are also attached to 14 feet of the main control chip, 3 feet of second Hall It is connected to 13 feet of the main control chip.
The main control module is connected with the motor drive module provides drive signal, and the motor drive module is connected with The two poles of the earth of direct current generator, the motor drive module select different driving chips according to different powers of motor.
All circuit modules are placed in same PCB, and the PCB is the round PCB with centre bore, the PCB's Outer diameter is identical with motor outer diameter, and the one side for being equipped with the motor drive module is bonded with motor bottom, the coder module Two Hall sensor fronts in 90 degree angles perpendicular to PCB installations, the rear shaft of motor is cased with circle codification magnet, described The outer surface of the one side of the Hall sensor closely circle codification magnet.
A kind of control method of bus direct current generator, including step:
S1 it) initializes;
S2) static operating parameter is read;
S3) bus reception, decoding, verification and response;
S4) motor period PWM wave controls.
The step S1) include:
S11) house dog initializes;
S12) FLASH is initialized;
S13) timer initializes;
S14) GPIO is initialized;
S15) ADC is initialized;
S16) initialization of (a) serial ports are configured to single line serial port pattern.
The step S2) static operating parameter be stored in the EEPROM regions of the main controller module, according to prior Setting is sequentially written in parameter list, pid parameter, maximum speed including motor, peak torque, by each operating parameter from EEPROM Area is loaded into RAM areas and is controlled for motor.
The step S3) it acquisition instruction and is decoded constantly from bus in a manner that serial ports is received and interrupted, when matching During the machine ID or broadcast ID, master controller receives this instruction, is advised after receiving a complete instruction by scheduled verification It is then verified, motor operation is carried out according to order after confirmation instruction is errorless and is responded, the content of response includes motor shape Parameters in state, parameter of electric machine table.
The step S4) using pid algorithm control motor, input variable is the orthogonal volume acquired by the coder module Code parameter, the PWM wave duty ratio of the output variable motor drive module in order to control, controlling cycle is set by timer, one In a controlling cycle, the instruction assigned by bus is received, adjusts control parameter, changes the speed target value in pid algorithm control Or position target value, realize the speed control of motor and position control.
The beneficial effects of the invention are as follows:
The mode cascade machine of single line serial port, wiring is succinct, and control is simple, controls the size up to 253;
By module postposition to motor rear portion, integrated degree is high, small;
Internal various operating parameters can be changed and power off preservation, setting is convenient;
PID control, can accurately output speed and position, control accuracy is high.
Description of the drawings
The present invention is further described with reference to the accompanying drawings and examples.
Fig. 1 is the systematic schematic diagram of the present invention;
Fig. 2 is the bus interface circuit figure of the present invention;
Fig. 3 is the main control module circuit diagram of the present invention;
Fig. 4 is the coder module circuit diagram of the present invention;
Fig. 5 is the power module circuitry figure of the present invention;
Fig. 6 is the motor drive module circuit diagram of the present invention;
Fig. 7 is the voltage detection module circuit diagram of the present invention;
Fig. 8 is the LED module circuit diagram of the present invention;
Fig. 9 is the scheme of installation of the present invention;
Figure 10 is the control flow chart of the present invention.
Specific embodiment
In order to be easy to understand the technical means, the creative features, the aims and the efficiencies achieved by the present invention, below it is right The present invention is expanded on further.
Systematic schematic diagram as shown in Figure 1:
A kind of bus type direct current generator, including the power module 101 for being used to power, the power module 101 is connected with master Control module 102, coder module 103, the supply logic power of motor drive module 104 and power power-supply, wherein logic power are 3.3V the or 5V power supplys obtained after input voltage decompression, power power-supply is defeated for the motor chip to motor drive module 104 Enter power supply, the main control module 102 connect to control motor with the motor drive module 104, the main control module 102 and For measuring speed and position, the main control module 102 is connected with voltage detection module 105 for the connection of coder module 103 Voltage detecting is carried out, the main control module 102 is connected with LED module 106 for showing various lamp effects, the main control module 102 Bus interface 107 is connected with for inputting and transmitting power supply and signal.
Main control module circuit diagram as shown in Figure 3:
The main control module 102 includes main control chip U1, and the model STM8S003 of the main control chip U1, is common 8 microcontrollers are gathered around there are two external timer and a timer internal, 6 ADC channels, 1 UART serial ports, and are encapsulated Compact, particularly QFN20 encapsulation only has 3*3mm sizes, can be easily embedded in inside motor as motor master control.
Power module circuitry figure as shown in Figure 5:
The power module 101 employs common 5V decompression chip SPX5205-5.0 as decompression chip, the power supply Module 101 includes decompression chip U2, and input capacitance includes the 7th capacitance C7, the 8th capacitance C8, and output capacitance includes the 4th capacitance C4, the 5th capacitance C5,1 foot of the decompression chip U2 are connected with input power VM, and the range of input power VM is 6-16V, institute The parameter of input capacitance the 7th capacitance C7 and the 8th capacitance C8 is stated as 35V47uf, for voltage stabilizing and filtering, the output capacitance the The capacitance of four capacitance C4 is 10uf, and the capacitance of the 5th capacitance C5 is 0.1uf, for filtering out the fluctuation of logic power VCC.
Bus interface circuit figure as shown in Figure 2:
The input power VM is inputted by the bus interface 107, and the bus interface 107 includes first interface P3 and the The 2 foot input powers of 1 foot input serial ports the bus signals SIG, the first interface P3 of two interface P4, the first interface P3 The 3 feet ground connection of VM, the first interface P3,1 foot of the second interface P4,2 feet, 1 foot of 3 feet and the first interface P3,2 Foot, 3 feet are correspondingly connected with.
Voltage detection module circuit diagram as shown in Figure 7:
The voltage detection module 105 employs resistor voltage divider network, and the input power VM is connected with the 6th resistance R6 After be serially connected with the 7th resistance R7 after be grounded, the 7th resistance R7 one end remotely connects 16 feet of the main control chip U1, 16 feet of the main control chip U1 are configured as third ADC channel, for obtaining the voltage value VOLT after dividing, the 6th electricity The parameter of resistance is 100K/1%, and the parameter of the 7th resistance is 10K/1%, so the 6th resistance R6 and the 7th resistance R7 Resistance value ratio for A, since the ADC precision of the main control chip U1 is 1024 resolution ratio, so formula can be passed through:
VM=VOLT/1024*VCC* (A+1)
The voltage value of input power is calculated, be internally provided with ceiling voltage in main control chip limits with minimum voltage Value, output can be cut off in electric voltage exception by being compared by the limitation voltage value for sampling the actual voltage value being calculated and setting, Carry out voltage detecting and protection.
19 feet of the main control chip U1 for serial ports emit pin UART1_TX, when the main control chip U1 19 feet by with When being set to half-duplex monofilar mode, 19 feet of the main control chip U1 are configured as transmission state when sending serial data, The I/O port of a standard is not shown as during transmission data, so vacantly input or open-drain output high level must be configured to, 19 feet of the main control chip U1 are connected with the one end of 3rd resistor R3, the 3rd resistor R3 far from the main control chip U1 and connect 1 foot of first interface P3 is connected to, the effect of the 3rd resistor R3 is for buffering level, when logic power is 3.3V and data When level is 5V, the 3rd resistor R3 can be used as dropping resistor.
Coder module circuit diagram as shown in Figure 4:
The coder module 103 includes the first Hall P1 and low pressure can be used in the second Hall P2, the model of the Hall Type 44E Halls, 3 feet of the first Hall P1 are connected with pull-up resistor second resistance R2, first Hall for signal pins 3 feet of P1 are also attached to 14 feet of the main control chip U1, and the master control core is connected to after the 3 feet pull-up of the second Hall P2 The 1 of the 2 feet ground connection of 13 feet of piece U1, the first Hall P1 and the second Hall P2, the first Hall P1 and the second Hall P2 Foot connection logic power VCC.When Hall surface passes through magnetic field, signal pins level can be pulled low, signal pins behind no magnetic field Can be raised, generate signal pulse, 13 feet and 14 feet of the main control chip U1 correspond respectively to the first passage of timer 1 with Timer 1 is configured to orthogonal coding input pattern by second channel, and channel 1 is used to be used as orthogonal input pin with channel 2, The phase difference judgement of the signal pulse transmitted according to two Halls is rotating forward or reversion, and coding is counted to get according to signal pulse Device rotation amount selects the round magnetic coder of 13 poles to be mounted on the output shaft of motor to acquire motor rotation parameter.
The main control module 102 is connected with the motor drive module 104 provides drive signal, the motor drive module 104 are connected with the two poles of the earth of direct current generator, and the motor drive module 104 selects different driving cores according to different powers of motor Piece, the decelerating motor used in this example is 370 decelerating motors, small, is commonly applied to the fields such as model, electric pushrod, Electric current is less than 2A, so select motor drive module according to demand, the motor chip chosen in this example is DRV8870, peak value Electric current is 3.6A, follow current 2A, and is capable of providing overvoltage, overcurrent, overheat protector, meets the driving requirement of motor.
The motor drive module 104 includes the 6 feet connection pole piece installation first of motor chip U3, the motor chip U3 7 feet that 8 feet of hole PAD1, the motor chip U3 connect the second pole piece mounting hole PAD2, the motor chip U3 connect one It is grounded after 1/2W current sampling resistors R5, the 4 feet connection logic power VCC of the motor chip U3, the current sampling resistor For setting maximum protection electric current Imax, formula is R5:
Imax=VCC/ (10*R5)
The resistance value of current sampling resistor R5 described in this example is 0.2R, and precision 1% is protected when logic power is 3.3V Shield electric current is arranged to 1.65A.The 5 feet connection driving power VM of the motor chip U3 provides voltage, the motor to motor The 1 foot ground connection of chip U3.
The motor chip U3 is common H bridge motor chips, and the logical of motor is controlled by the H bridges that internal metal-oxide-semiconductor forms Disconnected and current direction:
Input signal is IN1 and IN2, and when two input signals are 0, it is 0 to export, and motor does not connect electricity;
When input IN1 is 1, when input IN2 is 0, motor is rotated forward with maximum speed;
When input IN1 is 0, when input IN2 is 1, motor is inverted with maximum speed;
When input IN1 is 1, when input IN2 is 1, motor the two poles of the earth are equivalent to and are directly connected, the electromagnetic induction inside motor Cause motor that can soon stall, show as braking;
When one end of input signal be 0, the other end be PWM wave when, motor obtain voltage with the duty ratio of PWM wave increasing Add and increase, realize the speed-regulating function of motor.
2 feet of the U3 of the motor chip connect the 12 foot input signal IN1 of the main control chip U1, the motor chip 12 feet and 17 feet that 3 feet of U3 connect 17 foot the input signal IN2, the main control chip U1 of the main control chip U1 correspond to determine When device 21 channel and 2 channels, PWM wave output mode can be configured as, for the speed regulating control to motor.
LED module circuit diagram as shown in Figure 8:
The LED module 106 employs three color RGB lamps of 4 feet, and the tri- color anode of R, G, B of the LED module corresponds to respectively 7 feet, 11 feet, 10 feet of the main control chip U1 are connected, the GND ends ground connection of the LED module is drawn by main control chip U1GPIO Foot directly supplies electric drive, and the color of LED can be arbitrarily controlled under normal use, when master control discovery mistake or encounters low pressure high pressure, When overcurrent, LED module output red alarm lamp reminds user that mistake occurs.
Scheme of installation as shown in Figure 9:
The lower half of DC speed-reducing 1 is reduction box, and lower half is the direct current generator of driving, and the bottom of direct current generator is Two electrode plates 7 and the encoder installation output shaft stretched out, all circuit structures are designed in above PCB2, two of motor Pole piece 7 passes through the pole piece mounting hole reserved on PCB2 and is welded on PCB2, and main control chip 3 is placed on the back side of PCB2 and makes a call to three Anti- glue carries out water-proofing treatment, and motor drive ic 5 is also disposed in the back side of PCB2 and chip surface is made to be close to the bottom of motor Shell simultaneously smears heat dissipating silicone grease, is radiated using shell, eliminates the space of installation cooling fin, makes entire bus motor tighter Gather compact, the opposite installation in front of PCB2 is convenient to be connected in series each bus motor, two suddenly there are two the bus hub 8 of 3P That sensor 4 is perpendicular to PCB2 surfaces and is in 90 degree of angles installations for obtaining quadrature coding pulse, and magnet can be used 13 The circle codification magnet 9 of pole, is sleeved in the installation axle of motor, the surface of Hall sensor 4 closely 9 surface of circle codification magnet, PCB2 surfaces are also equipped with LED light 6 and imitate displaying and fault warning into portable lighter.
Control flow chart as shown in Figure 10:
A kind of control method of bus direct current generator, including step:
S1 it) initializes;
S2) static operating parameter is read;
S3) bus reception, decoding, verification and response;
S4) motor period PWM wave controls.
The step S1) include:
S11) house dog initializes:The maximum of house dog feeds dog time interval and is set as 100ms, when 100ms is not generated also " feeding dog " action, then automatically reset microcontroller, and the effect of house dog is to prevent microcontroller in the process of running due to software BUG Or hardware interference generate can not anticipation error, may cause to crash, program fleet, the application of house dog is when program is normal During operation, constantly " dog can be fed ", that is, the value in resetting house dog register, when an error occurs, program can not be reset This value, house dog just automatically reset, and restart chip, and motor operation environment is complicated, is easily interfered, and need pair to be possible to Situations such as crash of generation, is prevented, it should be noted that the output of motor should be closed and wait for next time by restarting rear program Instruction.
S12) FLASH is initialized:The every operating parameter and setup parameter of bus motor are stored in EEPROM areas, need Initialization is carried out to EEPROM regions could read parameters.
S13) timer initializes:Initialization including external timer 1,2 and timer internal 4, by external timer 1 Channel 1 and channel 2 be configured to orthogonal coding input, the pulse transmitted by two Hall sensors changes inside timer 1 Register value, be by the phase difference decision for comparing two signals plus umber of pulse or subtract umber of pulse, reduction ratio I, coding magnetic The relationship of iron series P and motor encoder resolution ratio A can be expressed as:A=I*P*2, if reduction ratio I is 34:1, magnet number of poles P It is 13, then motor encoder resolution ratio is 884, represents one circle of motor output shaft rotation, and encoder obtains 884 pulses.It will be outer The channel 1 and channel 2 of portion's timer 2 are configured to PWM output modes, by control timer 2 about channel 1 and channel 2 Duty cycle parameters carry out speed governing to motor.Timer internal 4 is configured to 8 automatic heavily loaded patterns, divider ratio is set, often 0.1ms triggers a timer interruption, and a bus data processing is carried out after 3 timer interruptions occur, is being occurred 50 times A motor PWM operation and output are carried out after timer interruption, then bus data response speed can be ensured in 0.3ms, motor Response speed ensures the control accuracy of motor in 5ms.
S14) GPIO is initialized:The GPIO of three-color LED control port is initialized, is set as recommending output mode pattern.
S15) ADC is initialized:ADC initialization is carried out to voltage detecting port.
S16) initialization of (a) serial ports, and it is configured to single line serial port pattern:Initialization of (a) serial ports include the baud rate of UART communications, number According to position, stop position, check bit setting, all serial ports being mounted on monobus only have identical setting that can be normally carried out leading to News, serial ports are configured as single line serial port pattern so that entire communication transfer only needs single line to complete, and is further simplified bus electricity The installation wire rod quantity of machine.
The step S2) static operating parameter be stored in the EEPROM regions of the main controller module, according to prior Setting is sequentially written in parameter list, and the parameter list of motor includes two parts, and a part is static variable, the ID including motor, Communication baud rate, pid parameter, maximum speed, peak torque, they are stored in the EEPROM regions of main control chip, can be with power down Storage, another part is dynamic variable, and real time position, speed, voltage including motor, they are stored in the RAM of main control chip Region, with the operation real-time change of motor.Static parameter only motor power-up initializing or change static parameter during It can be read and write, when motor initializes, it is necessary first to unlock EEPROM areas, then add the operating parameter of needs from EEPROM areas It is downloaded to RAM areas to control for motor, then locking EEPROM areas does not allow arbitrarily to read, likewise, during change static parameter It needs first to unlock EEPROM areas, then by parameter read-in EEPROM areas, then locks EEPROM.
The step S1) and step S2) only run once when powering on, entire motor is initialized.
The step S3) in a manner that serial ports is received and interrupted acquisition instruction and reception buffer number is stored in constantly from bus In group, the timing signal that is generated by timer 4 is often crossed 0.3ms and is decoded to receiving the data in buffer number group, when matching During the machine ID or broadcast ID, master controller receives this instruction, is advised after receiving a complete instruction by scheduled verification Then verified and with check bit data comparison, confirm that instruction according to order motor operation and respond after errorless, when When bus data is write instruction, the content of response includes the state of motor, when bus data is requests data reading, response Content include requested parameter of electric machine table in parameters.
The step S3) in communications protocol content be it is fixed, it is all be mounted in bus bus direct current generator and The main controller of control motor need to all be communicated according to fixed communications protocol, and the protocol contents of communication include frame head, ID, data, school Position and postamble are tested, when detecting frame head code, id information is continued to and is matched with internal ID, is matched as self ID or broadcast ID When, show that this information needs are read, wherein unconditionally performing order when matching broadcast ID, being included in data information needs The parameter that the parameter or needs to be changed is read, by established rule it is calculated after data have been received check code and with reception Check bit compares, and judges that data are effective when identical, and motor can carry out parameter change according to valid data, otherwise judge data invalid Request retransmits instruction.Communications protocol drafts the accuracy that ensure that communication process, prevents motor maloperation.
The step S4) using pid algorithm control motor, using position model or increment type PID algorithm, input variable is served as reasons The orthogonal coding parameter of coder module acquisition, the PWM wave duty ratio of the output variable motor drive module in order to control, Controlling cycle is set by timer 4, primary using 5ms controls in this example, that is, the renewal frequency of 200HZ, in a control In period processed, the instruction assigned by bus is received, the target velocity or target angle of control parameter, usually motor is adjusted, changes Become the speed target value or position target value in pid algorithm control, realize the speed control of motor and position control.
The step S4) in about speed control and position control switching essentially consist in move duration difference, when total When the instruction that line is sent includes movement duration, expression needs motor to be operated in steering engine pattern, and the target component given is target position Parameter is put, decelerating motor is equivalent to a rotatable steering engine at any angle at this time;When the movement duration for the instruction that bus is sent When being 0, expression needs motor to be operated in speed-regulating mode, and the target component given is target velocity parameter, at this time decelerating motor phase When in a constant speed motor, pid algorithm ensure that its speed does not change with the variation of load.
The step S3) and the step S4) execution is recycled in main program, it constantly inquires bus data and carries out motor Operation exports.
Basic principle, main feature and the advantages of the present invention of the present invention has been shown and described above.The technology of the industry Personnel are it should be appreciated that the present invention is not limited to the above embodiments, and what is described in the above embodiment and the description is only the present invention Principle, without departing from the spirit and scope of the present invention, various changes and improvements may be made to the invention, these variation and Improvement all fall within the protetion scope of the claimed invention.The claimed scope of the invention is by appended claims and its equivalent Object defines.

Claims (10)

1. a kind of bus type direct current generator, including the power module (101) for being used to power, it is characterised in that:The power module (101) main control module (102), coder module (103), motor drive module (104), the main control module (102) are connected with It connect to control motor, the main control module (102) and the coder module with the motor drive module (104) (103) for measuring speed and position, the main control module (102) is connected with voltage detection module (105) and carries out voltage for connection Detection, the main control module (102) are connected with LED module (106) for showing various lamp effects, and the main control module (102) is even Bus interface (107) is connected to for inputting and transmitting power supply and signal.
2. a kind of bus type direct current generator according to claim 1, it is characterised in that:The main control module (102) uses The main control chip of model STM8S003,19 feet of the main control chip are configured as half-duplex single bus mode, the master control 19 feet of chip are connected with 3rd resistor (R3), and the one end of the 3rd resistor (R3) far from the main control chip is connected with first 1 foot of interface (P3), 2 feet of the first interface (P3) are connected with main power source VM, and 3 feet of the first interface (P3) are grounded, 1 foot, 2 feet, 3 feet of the first interface (P3) are correspondingly connected with 1 foot, 2 feet, 3 feet of second interface (P4).
3. a kind of bus type direct current generator according to claim 2, it is characterised in that:Coder module (103) packet The first Hall (P1) and the second Hall (P2) are included, 3 feet of first Hall (P1) are connected with second resistance (R2) and are followed by number Power supply VCC, 3 feet of first Hall (P1) are also attached to 14 feet of the main control chip, 3 feet of second Hall (P2) It is connected to 13 feet of the main control chip.
4. a kind of bus type direct current generator according to claim 1, it is characterised in that:The main control module (102) and institute The connected offer drive signal of motor drive module (104) is stated, the motor drive module (104) is connected with the two of direct current generator Pole, the motor drive module (104) select different driving chips according to different powers of motor.
5. a kind of bus type direct current generator according to claim 1, it is characterised in that:All circuit modules are placed on same In block PCB (2), the PCB (2) is the round PCB with centre bore, and the outer diameter of the PCB (2) is identical with motor outer diameter, peace One side equipped with the motor drive module (104) is bonded with motor bottom, and two Halls of the coder module (103) pass Sensor (4) front is installed in 90 degree of angles perpendicular to PCB, and the rear shaft of motor is cased with circle codification magnet (9), and the Hall passes The outer surface of the one side of sensor (4) the closely circle codification magnet (9).
6. a kind of control method of bus direct current generator, it is characterised in that:Including step:
S1 it) initializes;
S2) static operating parameter is read;
S3) bus reception, decoding, verification and response;
S4) motor period PWM wave controls.
7. a kind of control method of bus direct current generator according to claim 6, it is characterised in that:The step S1) packet It includes:
S11) house dog initializes;
S12) FLASH is initialized;
S13) timer initializes;
S14) GPIO is initialized;
S15) ADC is initialized;
S16) initialization of (a) serial ports are configured to single line serial port pattern.
8. a kind of control method of bus direct current generator according to claim 6, it is characterised in that:The step S2) Static operating parameter is stored in the EEPROM regions of the main controller module, and parameter list is sequentially written according to set in advance, Each operating parameter is loaded into RAM areas for motor by pid parameter, maximum speed including motor, peak torque from EEPROM areas Control.
9. a kind of control method of bus direct current generator according to claim 6, it is characterised in that:The step S3) it adopts The mode interrupted is received with serial ports acquisition instruction and to decode constantly from bus, when matching the machine ID or broadcast ID, master control Device processed receives this instruction, is verified after receiving a complete instruction by scheduled verification rule, confirms instruction nothing Motor operation is carried out according to order after accidentally and is responded, the content of response includes the items in motor status, parameter of electric machine table Parameter.
10. a kind of control method of bus direct current generator according to claim 6, it is characterised in that:The step S4) it adopts Motor is controlled with pid algorithm, input variable is the orthogonal coding parameter acquired by the coder module, and output variable is in order to control The PWM wave duty ratio of the motor drive module, controlling cycle are set by timer, in a controlling cycle, are received by total The instruction that line is assigned adjusts control parameter, changes speed target value or position target value in pid algorithm control, realizes motor Speed control and position control.
CN201810128878.1A 2018-02-08 2018-02-08 A kind of bus type direct current generator and its control method Withdrawn CN108255115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810128878.1A CN108255115A (en) 2018-02-08 2018-02-08 A kind of bus type direct current generator and its control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810128878.1A CN108255115A (en) 2018-02-08 2018-02-08 A kind of bus type direct current generator and its control method

Publications (1)

Publication Number Publication Date
CN108255115A true CN108255115A (en) 2018-07-06

Family

ID=62744803

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810128878.1A Withdrawn CN108255115A (en) 2018-02-08 2018-02-08 A kind of bus type direct current generator and its control method

Country Status (1)

Country Link
CN (1) CN108255115A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710478A (en) * 2018-12-28 2019-05-03 努比亚技术有限公司 A kind of serial ports switching method, device and mobile terminal
CN109932998A (en) * 2019-03-19 2019-06-25 上海烟草集团有限责任公司 A kind of packing machine operating parameter restoration methods and system
CN112198818A (en) * 2019-07-08 2021-01-08 浙江宇视科技有限公司 Control method, device and equipment of stepping type driving structure and storage medium
CN112614257A (en) * 2020-12-11 2021-04-06 上海闻泰信息技术有限公司 Vehicle key, vehicle and vehicle lock control system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710478A (en) * 2018-12-28 2019-05-03 努比亚技术有限公司 A kind of serial ports switching method, device and mobile terminal
CN109932998A (en) * 2019-03-19 2019-06-25 上海烟草集团有限责任公司 A kind of packing machine operating parameter restoration methods and system
CN112198818A (en) * 2019-07-08 2021-01-08 浙江宇视科技有限公司 Control method, device and equipment of stepping type driving structure and storage medium
CN112198818B (en) * 2019-07-08 2022-05-13 浙江宇视科技有限公司 Control method, device and equipment of stepping type driving structure and storage medium
CN112614257A (en) * 2020-12-11 2021-04-06 上海闻泰信息技术有限公司 Vehicle key, vehicle and vehicle lock control system

Similar Documents

Publication Publication Date Title
CN108255115A (en) A kind of bus type direct current generator and its control method
CN106707888B (en) Programmable control module and system, control method with the control module
EP2212879B1 (en) Led light controller system and method
US6801004B2 (en) System and method of controlling cooling fan speeds
CN102437800B (en) Direct current motor servo driver
WO2010104499A1 (en) Determining identifying information of a cooling fan
CA3051242A1 (en) Power regulation for lighting fixtures
CN201639593U (en) PSE power supply module with two paths of network ports
CN208060972U (en) A kind of bus type direct current generator
CN105550096A (en) Systems and methods for communicating data via light pulses
CN109951113A (en) Motor driver, automation equipment and automatic control system
CN102419625A (en) Heat dissipation system and fan controlling device
Kanagamalliga et al. A ZigBee and embedded based security monitoring and control system
US11895745B2 (en) Remote power delivery for distributed lighting with integrated data transmission
CN205138410U (en) Generator monitoring system
Ahmed et al. Sustainable powered microcontroller-based intelligent security system for local and remote area applications
CN107942697B (en) Highly-integrated intelligent home system mainly based on combustible gas detection
CN105573513A (en) Control module for a human-machine dialogue system
CN205680150U (en) A kind of remote door access intelligence control system
CN206953009U (en) The joint control of new class human nature robot
CN207636976U (en) Pulse output card
CN220795910U (en) AFC universal gating system
CN104539198B (en) Multichannel brushless motor controller
CN210111885U (en) Servo motor driver and gate device
JP2021533724A (en) Digitally addressable lighting interface (DALI) compatible communication device and corresponding method for sending messages through the communication bus.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180706