Summary of the invention
In view of the deficiency that prior art exists, the object of the invention is, a kind of Electrical Bicycle is provided to simulate the technical solution of moment-assistant sensing and controlling system and implementation method, adopt the power-assisted dynamic acquisition device of the some magnetic substances including the arrangement of belt matrix, magnetic substance goes in ring matrix and multiple Hall element when relatively rotating, the sequential of magnetic substance as prescribed triggers multiple Hall element, it is corresponding with central axis speed that multiple Hall element produces the impulse singla triggering generation, by micro controller system (CPU), the impulse singla collected is identified, process, judge the real-time speed of foot-operated (central axis) thus, calculated with mathematical model is utilized to provide the outputting power of motor, realize the intellectuality of power-assisted sensing, system is passed through when riding to gather foot-operated real-time speed, and be gradient recognizer by the gesture module of employing integration 3 axle gyroscope, 3 axle accelerators, the gradient recognizer road gradient detected in dynamic operation provides the motor output power of corresponding increase, realizes the intellectuality of power-assisted sensing.
For achieving the above object, the present invention adopts such scheme to realize: Electrical Bicycle simulation moment-assistant sensing and controlling system, comprise liquid crystal display display instrument module, function selection key module, brake signal load module, simulation moment-assistant dynamic acquisition device and electric machine controller, it is characterized in that, the velocity measuring structure that simulation moment-assistant dynamic acquisition device adopts three Hall elements and annular magnetic steel array to form, for the collection of the monitor signal of foot-operated direction and speed; System is by simulating moment-assistant dynamic acquisition device to stretcher speed, acceleration monitoring, real-time control brushless motor controller is to the output of power of motor, thus realize the effect of simulation moment-assistant sensing, simulation moment-assistant dynamic acquisition device adopts and is integrated with the gyrostatic MPU6050 gesture module of 9 axle simultaneously, in order to monitor the attitude of riding cycle, according to road gradient situation, output power of motor is adjusted, thus obtain better Consumer's Experience;
Described simulation moment-assistant dynamic acquisition device is made up of boosting disk framing member and simulation moment-assistant dynamic acquisition circuit card;
Described boosting disk framing member comprises rotating disk, price fixing, bearing and magnet steel; Rotating disk is plate-like cavity body, and its inner cavity configuration comprises at the bottom of rotating disk, rotating disk wall, hollow shaft and belt magnet steel clamping band;
Center of turntable is hollow shaft, the outside dimension of hollow shaft and bearing inner ring dimensional fits; The aperture of its axle center hole and electrical bicycle middle shaft dimensional fits;
The magnet steel clamping band that goes in ring is positioned at the inner bottom surface at the bottom of rotating disk, and its shape is a belt flange, and the upper plane of the flange that goes in ring is higher than the inner bottom surface at the bottom of rotating disk, and the annular diameters of the magnet steel clamping band that goes in ring is greater than hollow shaft external diameter, and outer annular diameter is less than rotating disk wall internal diameter; Belt magnet steel clamping band includes the blind hole that a group goes in ring, equi-spaced apart arranges, each blind hole internal fixtion cylindrical magnet steel;
Price fixing is plate-like cavity body, and its inner cavity configuration comprises at the bottom of price fixing, price fixing wall, bearing frame and through wires hole; Price fixing center is bearing frame;
Inner bottom surface at the bottom of price fixing is divided into three sector regions by gusset, one of them sector region A is as the installation site of simulation moment-assistant dynamic acquisition circuit card, through wires hole is positioned at sector region A and closes on upper edge, and through wires hole controls the outlet of cable as simulation moment-assistant dynamic acquisition circuit card;
Rotating disk, price fixing, bearing together with alinco assembled, bearing assemble between the hollow shaft and the bearing frame of price fixing of rotating disk, the internal diameter of bearing frame and outer race diametric fit; The outer shroud of bearing is inlaid in the internal diameter of bearing frame, and the inner ring sleeve of bearing is contained on hollow shaft;
Rotating disk coordinates with price fixing, rotating disk wall internal diameter and price fixing wall external diameter bearing fit; Aperture and the electrical bicycle middle shaft of the axle center hole of hollow shaft closely cooperate;
Described simulation moment-assistant dynamic acquisition circuit card is arranged in the sector region A of price fixing, components and parts on simulation moment-assistant dynamic acquisition circuit card comprise the fixing Hall element ES732 in single chip computer AT 89C16, three terminal regulator LM1117-3.3V, three intervals, a gesture module MPU6050(gyroscope), output voltage interface J2 and Resistor-Capacitor Unit;
On described simulation moment-assistant dynamic acquisition circuit card, three described Hall element ES732 are respectively the first Hall element A, the second Hall element B and the 3rd Hall element C, the sensitive surface center of three Hall element ES732 is on same camber line, the sensitive surface center of each Hall element ES732 and price fixing axial connecting line, formed two fan-shaped, the angle of sensitive surface center respectively and between the line in price fixing axle center of every two adjacent Hall element ES732 is 5 degree;
The axle center of 24 described magnet steel on described rotating disk on same circle, each magnet steel axle center and disk axes line, formed 23 fan-shaped, the angle between every two adjacent magnet steel axle center and disk axes line is 15 degree;
The center of circle of the center of circle of the circle at the place, sensitive surface center of three Hall element ES732 and the circle at place, 24 magnet steel axle center all on same axial line, this axial line and electrical bicycle middle shaft axial line;
When rotating disk rotates with bicycle middle shaft, the position of price fixing immobilizes, and the orientation of three described Hall element ES732 remains unchanged; 24 magnet steel in rotating disk are along the track annular movement of its place circle, wherein the sensitive surface of each magnet steel is successively through the sensitive surface of three Hall element ES732, a moment that the sensitive surface of magnet steel is corresponding with the sensitive surface of Hall unit ES732 part, trigger Hall element ES732, Hall element ES732 internal circuit produces induced voltage impulse singla;
The sensitive surface of 24 magnet steel i.e. activation schedule that overlaps with the sensitive surface of three Hall element ES732 is:
Rotating disk rotate forward namely ride advance time turn to time, trigger the first Hall element A, the second Hall element B and the 3rd Hall element C successively;
During rotating disk reversion, trigger the 3rd Hall element C, the second Hall element B, the first Hall element A successively;
Induce voltage pulse signal to single chip computer AT 89C16, single chip computer AT 89C16 extracts relevant direction and speed data accordingly as the data calculating power line voltage dutycycle PWM, after DA conversion, output voltage signal, electric machine controller is in this, as the signal source of control system;
Bearing data extracting method: by the rotation direction of rotating disk, gathers three described Hall element ES732 energizing signal orders by single chip computer AT 89C16 and obtains;
Speed data extracting method: by the rotation of rotating disk, gathers three described Hall element ES732 trigger signal interval time datas by single chip computer AT 89C16 and obtains;
Be arranged on the gesture module MPU6050(gyroscope on described dynamic acquisition circuit card) attitude be: coordinate X keeps level, coordinate Z keeps vertical, single chip computer AT 89C16 using the signal data of collection now as the data of its position balance, the initial condition judged using these data as program;
Simulation moment-assistant dynamic acquisition device circuit treater centered by single chip computer AT 89C16, utilizes gesture module MPU6050(gyroscope) attitude knowability, through I
2c bus communicates with single chip computer AT 89C16, in this, as gradient recognizer;
The SCL port of single chip computer AT 89C16, SDL port connect SCL port, the SDL port of gesture module MPU6050 respectively, SCL with SDL is the data that communicate of I2C and clock line;
Three general purpose I of single chip computer AT 89C16/O port PIO0_6, PIO0_7 is connected three Hall element ES732 respectively with PIO0_12;
The PWM output port PIO0_0 of single chip computer AT 89C16 connects output voltage interface J2 through resistance R3.
The implementation method of described Electrical Bicycle simulation moment-assistant sensing and controlling system, it is characterized in that, gathered signal identifies through single chip computer AT 89C16 by simulation moment-assistant dynamic acquisition device, judge and process, single chip computer AT 89C16 selects the vehicle of input according to button simultaneously, gear information determines fundamental voltage output valve, again according to wheel disc rotary speed data, utilize calculated with mathematical model output pwm signal, finally export to electric machine controller by after pwm signal integration, brake signal is inputted by brake signal load module, last by motor controller controls electric machine operation state, described method comprises the steps:
A) first, Electrical Bicycle simulation moment control system switches on power;
B) moment-assistant dynamic acquisition device is simulated by three Hall element ES732 Real-time Collections by bicyclist's foot-driven wheel disc rotary speed data, single chip computer AT 89C16 constantly inquires about the interval data information of three Hall impulse singlas, single chip computer AT 89C16 judges wheel disc rotary speed data by the interval data information of three Hall impulse singlas, then, calculated with mathematical model is utilized to go out output voltage dutycycle PWM, the signal input part of electric machine controller is outputted to by the PWM output port of single chip computer AT 89C16, electric machine controller exports the magnitude of voltage controlling motor and depends on output voltage dutycycle PWM, output voltage dutycycle PWM determines the rotating speed of motor,
The output voltage dutycycle PWM exported due to the PWM output port PIO0_0 of single chip computer AT 89C16 and wheel disc rotating speed linearly proportional relation, setting up according to its corresponding relation the math modeling calculating PWM is:
PWM = y+z--------------------------------------------------------(1)
In formula (1): PWM: output voltage dutycycle, unit: %
Y: be the output voltage dutyfactor value (SpeedLevel) corresponding with velocity variations; Unit: %
Z: basic output voltage dutyfactor value (OutputBase); Unit: %
y = (ka×60)÷ws + kb;-------------------------------------------(2)
In formula (2):
Ka: be the scalefactor value of this transformational relation;
Its span is: 26 ~ 48, and when speed is 26km/h, the value of ka is 26, and when speed is 6km/h, the value of ka is 48;
Kb: be the correction corresponding with velocity variations;
Its span is: 0 ~ 20, and when speed is 6km/h, the value of kb is 0, and when speed is 26km/h, the value of kb is 20;
Ws: be calculate adjacent two magnet steel when running in its circular trace, pass in succession through the relational expression of same Hall element center-point time used, unit: ms;
ws = 3600×a×π×D÷(b×c×S) ----------------------------(3)
In formula (3):
A--the wheel disc number of teeth
B--the flywheel number of teeth
C--magnet steel number
S--moving velocity, unit: Km/h;
D--wheel value footpath, unit: m;
In programming, utilize above-mentioned math modeling to calculate, realize wheel disc rotation speed change corresponding with output voltage dutycycle PWM;
To ride the requirement of Electrical Bicycle comfort level for meeting all kinds of crowd, especially according to 7 kinds of proportioning parameters that 7 kinds of different flywheel teeth arrays of mountain bike, the configuration of highway car cone pulley structure become, 7 gears being set by 7 kinds of proportioning parameter values;
7 corresponding corresponding data of gear, wherein the 7th grade of value of 26 inches of vehicles is as shown in the table:
The value preparation method of basic output voltage dutyfactor value z is: 7 gears arranged by vehicle type structure, 7 corresponding corresponding speeds of gear, and obtain from the observed data of riding, wherein the span of 26 inches of vehicle z is as shown in the table:
Data are kept in single chip computer AT 89C16 internal storage, the basic output voltage dutyfactor value z that the different automobile types of choice menus display in liquid crystal display display instrument, gear option are corresponding different respectively, the coding of function selection key module is corresponding with basic output voltage dutyfactor value z, select vehicle, gear by button operation liquid crystal display display instrument choice menus, when single chip computer AT 89C16 drives according to wheel disc, wheel velocity, vehicle and gear data select the basic output voltage dutyfactor value z participating in calculating;
C) once single chip computer AT 89C16 judges that the interval data of three Hall impulse singlas meets the valve limit of power-assisted request, simulation moment-assistant dynamic acquisition device exports real-time speed data by liquid crystal display display instrument module, shows real-time speed state by liquid crystal display display instrument;
Valve limit gauge is fixed: in 0.1 second, magnet steel continuous trigger first Hall element A, a second Hall element B and the 3rd Hall element C, single chip computer AT 89C16 obtain the impulse singla sent by three different Hall element ES732 respectively, is and reaches valve limit;
D) single chip computer AT 89C16 inputs given power-assisted gear information according to key-press module, utilizes calculated with mathematical model to go out power line voltage dutycycle PWM, connects electric machine controller, the power of regulation and control electric machine controller by exporting handle voltage interface;
If e) perform steps d) after, the real-time speed data of liquid crystal display display instrument display reach requirement, then maintain this mode of operation;
If f) perform steps d) after, the real-time speed data of liquid crystal display display instrument display do not reach requirement, then by function selection key module input key information, change, improve speed stage; Single chip computer AT 89C16 inputs given power-assisted gear information according to key-press module, re-uses calculated with mathematical model and goes out electric power output voltage dutycycle PWM, then exports handle voltage to electric machine controller by output voltage interface J2, the power of regulation and control electric machine controller;
G) function of moment-assistant collector identification rotating is simulated, single chip computer AT 89C16 judges, identifies the forward and backward state of rotating disk by the order of the impulse singla of the first Hall element A, the second Hall element B and the 3rd Hall element C collected, calculate result, rotating disk has output signal when rotating forward, otherwise non-output signal;
H) by figure's knowability of attitude mould MPU6050, through I
2c communication port is to single chip computer AT 89C16, learn the gradient of operation, on the basis of former power-assisted gear, the magnitude of voltage outputting to the input end of electric machine controller is increased during upward slope, namely automatically increasing the horsepower output of electric machine controller when going up a slope, during descending, automatically reducing the magnitude of voltage of the input end outputting to electric machine controller.
Beneficial effect of the present invention: system acquisition human body is ridden data, and realizing the significant increase of people's engine efficiency, is man-machine perfect perfect match.Comfortable riding is the best product that sport health is integrated, and is also the revolutionary creativity and innovation of Electrical Bicycle.Electrical Bicycle intelligence power-assisted sensing system is the high-end product of R & D design for high-end assistance type bicycle (based on mountain region vehicle), and it is a kind of manpower and the electric power total solution in conjunction with the mutual sensing of power.Radical function is the comfort level promoting bicyclist, reduce motor wearing and tearing simultaneously, lifting motor service life, engaged gears can be effectively prevent to there being tooth depth speed motor and clash into the possibility of beating tooth, because manual power assisting is without transient large current discharge, avoid the impact of lithium cell heavy-current discharge, significantly improve life-span and the mileages of continuation of battery.This system has dynamic gradient discernibility simultaneously, make bicyclist also comfortable without tired sense as level road when going up a slope, particularly mountain bike is when speed change, manual power assisting can many grades of cooperations, reach optimum motor horsepower output and effective labour-saving power-assisted state, realize foot-operated comfortable easily riding and reach the best ability that continues.
In a word, this system by gathering foot-operated real-time speed when riding, detects the resistance physical quantity that the road gradient in dynamic operation is formed, utilizes math modeling to provide the outputting power of motor intelligently, realize the intellectuality of power-assisted sensing.
Detailed description of the invention
For a more clear understanding of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments:
As shown in Fig. 1 to Figure 20, Electrical Bicycle simulation moment-assistant sensing and controlling system comprises liquid crystal display display instrument module, function selection key module, brake signal load module, simulation moment-assistant dynamic acquisition device and electric machine controller, the velocity measuring structure that simulation moment-assistant dynamic acquisition device adopts three Hall elements and annular magnetic steel array to form, for the collection of the monitor signal of foot-operated direction and speed; System is by simulating moment-assistant dynamic acquisition device to stretcher speed, acceleration monitoring, real-time control brushless motor controller is to the output of power of motor, thus realize the effect of simulation moment-assistant sensing, simulation moment-assistant dynamic acquisition device adopts and is integrated with the gyrostatic MPU6050 gesture module of 9 axle simultaneously, in order to monitor the attitude of riding cycle, according to road gradient situation, output power of motor is adjusted, thus obtain better Consumer's Experience;
Simulation moment-assistant dynamic acquisition device is made up of boosting disk framing member and simulation moment-assistant dynamic acquisition circuit card;
Boosting disk framing member comprises rotating disk 1, price fixing 2, bearing 3 and magnet steel 4; Rotating disk 1 is plate-like cavity body, and its inner cavity configuration to comprise at the bottom of rotating disk 11, rotating disk wall 12, hollow shaft 13 and belt magnet steel clamping band 14;
Rotating disk 1 center is hollow shaft 13, the outside dimension of hollow shaft 13 and bearing 3 inner ring dimensional fits; The aperture of its axle center hole 1301 and electrical bicycle middle shaft 5 dimensional fits;
The magnet steel clamping band 14 that goes in ring is positioned at the inner bottom surface of at the bottom of rotating disk 11, its shape is a belt flange, go in ring flange upper plane higher than at the bottom of rotating disk 11 inner bottom surface, the annular diameters of magnet steel clamping band 14 of going in ring is greater than hollow shaft 13 external diameter, and outer annular diameter is less than rotating disk wall 12 internal diameter; Belt magnet steel clamping band 14 includes the blind hole 1401 that a group goes in ring, equi-spaced apart arranges, the cylindrical magnet steel 4 of each blind hole 1401 internal fixtion one;
Price fixing 2 is plate-like cavity body, and its inner cavity configuration to comprise at the bottom of price fixing 21, price fixing wall 22, bearing frame 23 and through wires hole 24; Price fixing 2 center is bearing frame 23;
At the bottom of price fixing, the inner bottom surface of 21 is divided into three sector regions by gusset, one of them sector region A is as the installation site of simulation moment-assistant dynamic acquisition circuit card, through wires hole 24 is positioned at sector region A and closes on upper edge, and through wires hole 24 controls the outlet of cable as simulation moment-assistant dynamic acquisition circuit card;
Rotating disk 1, price fixing 2, bearing 3 and magnet steel 4 are assembled together, and bearing 3 is assemblied between the hollow shaft 13 of rotating disk 1 and the bearing frame 23 of price fixing 2, and the internal diameter of bearing frame 23 coordinates with bearing 3 outer annular diameter; The outer shroud of bearing 3 is inlaid in the internal diameter of bearing frame 23, and the inner ring sleeve of bearing 3 is contained on hollow shaft 13;
Rotating disk 1 coordinates with price fixing 2, rotating disk wall 12 internal diameter and price fixing wall 22 external diameter bearing fit; Aperture and the electrical bicycle middle shaft 5 of the axle center hole 1301 of hollow shaft 13 closely cooperate.
Dynamic acquisition circuit card is arranged in the sector region A of price fixing 2, the Hall element ES732 that components and parts comprise single chip computer AT 89C16, three terminal regulator LM1117-3.3V, three intervals are fixed on simulation moment-assistant dynamic acquisition circuit card, gesture module MPU6050 gyroscope, output voltage interface J2 and a Resistor-Capacitor Unit;
On described simulation moment-assistant dynamic acquisition circuit card, three described Hall element ES732 are respectively the first Hall element A, the second Hall element B and the 3rd Hall element C, the sensitive surface center of three Hall element ES732 is on same camber line, the sensitive surface center of each Hall element ES732 and price fixing 2 axial connecting line, formed two fan-shaped, the angle of sensitive surface center respectively and between the line in price fixing 2 axle center of every two adjacent Hall element ES732 is 5 degree;
The axle center of 24 on rotating disk 1 described magnet steel 4 on same circle, each magnet steel 4 axle center and rotating disk 1 axial connecting line, formed 23 fan-shaped, the angle between every two adjacent magnet steel 4 axle center and rotating disk 1 axial connecting line is 15 degree;
The center of circle of the center of circle of the circle at the place, sensitive surface center of three Hall element ES732 and the circle at place, 24 magnet steel 4 axle center all on same axial line, this axial line and electrical bicycle middle shaft 5 axial line;
When rotating disk 1 rotates with bicycle middle shaft, the position of price fixing 2 immobilizes, and the orientation of three described Hall element ES732 remains unchanged; 24 magnet steel 4 in rotating disk 1 along its place circle track annular movement time, wherein, the sensitive surface of each magnet steel 4 is successively through the sensitive surface of three Hall element ES732, a moment that the sensitive surface of magnet steel 4 is corresponding with the sensitive surface of Hall unit ES732 part, trigger Hall element ES732, Hall element ES732 internal circuit produces induced voltage impulse singla;
The sensitive surface of 24 magnet steel 4 i.e. activation schedule that overlaps with the sensitive surface of three Hall element ES732 is:
Rotating disk 1 rotate forward namely ride advance time turn to time, trigger the first Hall element A, the second Hall element B and the 3rd Hall element C successively;
Rotating disk 1 reverses constantly, triggers the 3rd Hall element C, the second Hall element B, the first Hall element A successively;
Induce voltage pulse signal to single chip computer AT 89C16, single chip computer AT 89C16 extracts relevant direction and speed data accordingly as the data calculating power line voltage dutycycle PWM, after DA conversion, output voltage signal, electric machine controller is in this, as the signal source of control system;
Bearing data extracting method: by the rotation direction of rotating disk 1, gathers three described Hall element ES732 energizing signal orders by single chip computer AT 89C16 and obtains;
Speed data extracting method: by the rotation of rotating disk 1, gathers three described Hall element ES732 trigger signal interval time datas by single chip computer AT 89C16 and obtains;
Be arranged on the gesture module MPU6050(gyroscope on described simulation moment-assistant dynamic acquisition circuit card) attitude be: coordinate X keeps level, coordinate Z keeps vertical, single chip computer AT 89C16 using the signal data of collection now as the data of its position balance, the initial condition judged using these data as program;
Simulation moment-assistant dynamic acquisition device circuit treater centered by single chip computer AT 89C16, utilizes gesture module MPU6050(gyroscope) attitude knowability, through I
2c bus communicates with single chip computer AT 89C16, in this, as gradient recognizer;
The SCL port of single chip computer AT 89C16, SDL port connect SCL port, the SDL port of gesture module MPU6050 respectively, SCL with SDL is the data that communicate of I2C and clock line;
Three general purpose I of single chip computer AT 89C16/O port PIO0_6, PIO0_7 is connected three Hall element ES732 respectively with PIO0_12;
The PWM output port PIO0_0 of single chip computer AT 89C16 connects output voltage interface J2 through resistance R3.
As shown in Figure 14 to Figure 16,
After energising, when first magnet steel 4 triggers the first Hall element A, the position of the second Hall element B and the 3rd Hall element C is in gap;
When first magnet steel 4 triggers the second Hall element B, the position of the first Hall element A and the 3rd Hall element C is in gap;
When first magnet steel 4 triggers the 3rd Hall element C, the position of the first Hall element A and the second Hall element B is in gap;
In the present embodiment:
(1) Presentation Function and content comprise:
1. battery electric quantity display: by gathering the dynamic change of supply voltage value, provides 5 segmentations display (only making Presentation Function) of electricity.
2., by the selection of function key, realize different displaying contents
(1) speed display: after other Fumction display item stablizes 5 seconds, return default speed display, the impulse singla provided by riding speed Hall element calculates riding speed.The speed of display will select different wheel footpaths by function key, as 22 inch, 24 inch, 26 inch, 27 inch, 28 inch, obtains by MCU treater the true velocity that different automobile types rides.
(2) speed display can carry out English system and metric system translation function
Speed display and accumulative mileage display change English system and metric system by Fumction display key, i.e. mile and kilometer.
(3) vehicle display: as: 22 inch, 24 inch, 26 inch, 28 inch, select current ridden vehicle by function selecting key.
(4) mileage display: after start switches on power each time, the mileage display of riding before power cut-off, automatic clear after second time start.Mileage is calculated by the number of the wheel footpath of vehicle and the Hall velocity pick-up signal of collection.
(5) power-assisted gear display: amount to display 7 grades, namely power-assisted is divided into 7 gears.Chosen by function selecting key, select after power-assisted gear Presentation Function in function key, by raising key and down key selection gear.The 6th grade is defaulted as after start.
(2) liquid crystal display display instrument also has following function
1, to lower end to power-assisted collector (by controller junction line) transmit data functionality: under different power-assisted gears (1-7 shelves), pass to the different gear signal of lower end simulation moment-assistant dynamic acquisition device by agreement to carry out instruction simulation moment-assistant dynamic acquisition device and export different magnitudes of voltage (PWM dutycycle), realize regulation and control electric machine controller horsepower output number.This is the core of man-machine mixing sensor-based system, reaches real-time power-assisted, without delayed power-off, does not step on that sky is ridden, easily comfortable effect.
2., brake signal conduction function: the function that the protocol signal passing to the final voltage value output of lower end simulation moment-assistant dynamic acquisition device by gathering brake signal (IO is that ground connection drags down level) treater stops power of motor exporting.
3, power-on button: realize powering on and opening and power-off shutdown system function by start button, after energising, backlight glimmers after three times and enters normal condition, and after power-off, backlight extinguishes.LCD display is along with on and off simultaneously.
4, function of swiping card: swiped the card by RF principle, realizes powering on and opening and power-off shutdown system function, and after energising, backlight glimmers after three times and enters normal condition, and after power-off, backlight extinguishes.The function that safe opening is antitheft is played by swiping the card.
The apolegamy of child and parent card: first read master card (backlight glimmer twice instruction) after powering on for the first time and then match two subcards (after success, backlight flicker once indicates) in five seconds,
5, have simultaneously and identify that load powers on front and back short-circuit protection function.When there is load short circuit condition, backlight indicator lamp is using the frequency scintillation 10 times of per minute 80 times as instruction.
Liquid crystal display display instrument is the display section of Electrical Bicycle force aid system.Mainly realize real-time speed display, travelled distance, gear selection, information about power, wheel diameter information, and force aid system power control function.
Input comprises:
1. button: 3 buttons, raises key (K1), function key (K2), down key (K3);
2. electric quantity monitoring: geometric ratio voltage inputs, according to voltage detecting electric quantity of power supply;
3. to test the speed input: external interrupt inputs, the number of turns is rotated in monitoring;
4. brake signal: level input signal, the input of monitoring braking conditions;
5. to swipe the card coil: external interrupt inputs, read EM4100 card number data;
6. power supply monitoring: comparator interrupts, monitoring power failure condition;
Output comprises:
1. liquid crystal display: display mileage, electricity, speed, gear information;
2. communication: pulse exports, exports gear and selects and brake information;
3. backlight: level exports, prompting power supply exports situation;
4. Energy control: level exports, controls the supply of controller for electric vehicle power supply;
Function declaration:
The Primary Actor of key scan: button,
Flow process: 30ms detects once, key-press input detected, and record key assignments sends into menu/parameter configuration;
The Primary Actor of electric power detection: electric quantity monitoring,
Success flow process: 10s detects once, according to AD value division 6 grades of electricity, sends into menu/parameter configuration;
The Primary Actor of velocity measuring: speed inputs,
Success flow process: interrupt producing once, record twice time between interruptions, computation speed and mileage send into menu/parameter configuration;
The Primary Actor that brake signal detects: brake signal;
Success flow process:
30ms detects once, low level detected, sends into communication and exports transmission;
The Primary Actor that Card Reader controls: coil of swiping the card
Success flow process:
Interrupting detecting incoming signal, judging validity according to reading in EM4100 card number, send into control logic;
The Primary Actor of power protection: power supply monitoring
Success flow process: comparator interrupts detecting, and Power supply interrupts, then Power supply fault after opening 100us, sends into control logic;
Control logic
Initial condition: detect storing keys card number situation in EEPROM
Success flow process: do not have card number information, be switched to master card learning state;
Substitute flow process: master card card number is effective, subcard card number and secondary subcard card number invalid, be switched to subcard card number learning state;
Master card, subcard or secondary subcard card number are effective, are switched to normal working;
Master card learning state:
Success flow process: receive correct card number message, be stored as master card card number, switching state is to subcard learning state;
Subcard learning state:
Success flow process: receive new card number message, be stored as subcard card number, switching state is to secondary subcard learning state;
Secondary subcard learning state:
Success flow process: receive new card number message, be stored as secondary subcard card number, switching state is to off-mode;
Substitute flow process: receive subcard card number message, switching state is to off-mode; 5s does not receive effective card number message, and switching state is to off-mode;
Off-mode:
Success flow process: receive subcard card number message, switching state is to mode of operation;
Substitute flow process: receive secondary subcard card number message, switching state is to mode of operation;
Mode of operation:
Success flow process: short in function key, is switched to gear selection function state, the flicker of gear numeral;
Substitute flow process
Length, by function key, is switched to automobile type configuration mode state, the dimension figure flicker of wheel footpath;
Receive subcard card number message, switching state is to off-mode;
Receive secondary subcard card number message, switching state is to off-mode;
Receive power fail message, switching state is to off-mode;
Gear selection function state:
Success flow process: shortly press rise key, gear increases by one grade, until most high tap position (seven grades);
Substitute flow process: short in down key, gear reduces one grade, until lowest gear (a grade); Short in function key, be switched to speed unit selection mode, present speed unit glimmers, and gear information comes into force, and stored in EEPEOM, and cancels flicker; 5s is without any actuation of keys, and gear information comes into force, and stored in EEPROM, returns mode of operation; Receive subcard card number message, abandon gear information amendment, switching state is to off-mode; Receive secondary subcard card number message, abandon gear information amendment, switching state is to off-mode; Receive power fail message, abandon gear information amendment, switching state is to off-mode.
Speed unit selection mode:
Success flow process: shortly press rise key, speed unit is switched to pattern made in Great Britain;
Substitute flow process: short in down key, speed unit is switched to metric mode; Short in function key, be switched to mileage unit selection mode, the flicker of current mileage unit, speed unit is selected to come into force, and stored in EEPROM, and cancels flicker; 5s is without any button operation, and speed unit is selected to come into force, and stored in EEPROM, returns mode of operation; Receive subcard card number message, abandon speed unit and select information amendment, switching state is to off-mode; Receive secondary subcard card number message, abandon speed unit and select information amendment, switching state is to off-mode; Receive power fail message, abandon speed unit and select information amendment, switching state is to off-mode.
Mileage unit selection mode;
Success flow process: shortly press rise key, mileage unit is switched to pattern made in Great Britain;
Substitute flow process: short in down key, mileage unit is switched to metric mode; Short in function key, be switched to normal working, current mileage unit comes into force, stored in EEPROM; 5s is without any button operation, and mileage unit selects to come into force, and stored in EEPROM, returns mode of operation; Receive subcard card number message, abandon the amendment of mileage unit, switching state is to off-mode; Receive secondary subcard card number message, abandon the amendment of mileage unit, switching state is to off-mode; Receive power fail message, abandon the amendment of mileage unit, switching state is to off-mode.
Automobile type configuration mode state; (vehicle can be selected successively: 22 types, 24 types, 26 types, 28 types)
Success flow process: shortly press rise key, wheel footpath size raises a rank, until most bull wheel footpath (28 type);
Substitute flow process: short in down key, wheel footpath size lowers a rank, until most small-wheel-diameter (22 type); Short in function key, when front-wheel footpath, size Selection comes into force, and stored in EEPROM, returns mode of operation; Long by function key, when front-wheel footpath, size Selection comes into force, and stored in EEPROM, delete card number information, switching state is to master card learning state;
5s is without any button operation, and when front-wheel footpath, size Selection comes into force, and stored in EEPROM, returns mode of operation;
Receive subcard card number message, abandon wheel footpath modification of dimension, switching state is to off-mode;
Receive secondary subcard card number message, abandon wheel footpath modification of dimension, switching state is to off-mode;
Receive master card card number message, abandon wheel footpath modification of dimension, switching state is to subcard learning state;
Receive power fail message, abandon wheel footpath modification of dimension, switching state is to off-mode;
Parameter stores
Success flow process: power on correct reading EEPROM parameter information, uses EEPROM data parameters;
Substitute flow process: power on and read EEPROM parameter information mistake, each parameter of initialization; When parameter comes into force, parameter information is in EEPROM;
Communication exports:
Success flow process: when brake signal is effective, output duty cycle 50% cycle is 2ms square wave 21, and interval 1s repeats 3 times;
Substitute flow process: when brake signal is invalid, after gear information comes into force, output duty cycle 50% cycle is 2ms square wave gear value, and interval 1s repeats 3 times;
When brake signal is effective, after gear information comes into force, after brake signal is invalid, output duty cycle 50% cycle 2ms square wave gear value, interval 1s repeats 3 times;
Display and control
1. initial condition
Success flow process: only display current electric quantity information;
2. master card learning state:
Success flow process: when not learning master card card number, speed numeral display position display " 00 " is flashed, and flicker frequency is 1s;
Substitute flow process: during the card number success of study master card, speed numeral display position display " 01 ", stops flashing for 2 seconds;
3. subcard learning state:
Success flow process: when not learning subcard card number, gear numerical monitor position display " 00 " is flashed, and flicker frequency is 1s;
Substitute flow process: during the card number success of study subcard, gear numerical monitor position display " 01 ", flash rate is 1s;
4. secondary subcard learning state:
Success flow process: when not learning secondary subcard card number, speed numeral display position display " 01 " is flashed, and flicker frequency is 1s;
Substitute flow process: during the card number success of study master card, speed numeral display position display " 02 ", stops flashing for 2 seconds;
5. off-mode:
Success flow process: only display current electric quantity information;
6. mode of operation:
Success flow process: display current electric quantity information, real time speed information, start mileage information, gear select information, vehicle information;
7. gear selection mode:
Success flow process: display current electric quantity information, real time speed information, start mileage information, vehicle information are not all glimmered, and gear information is glimmered, flicker frequency 1Hz;
8. speed unit selection mode
Success flow process: display current electric quantity information, real time speed information, start mileage information, vehicle information, gear information are not all glimmered, and speed unit is glimmered, flicker frequency 1Hz;
9. mileage unit selection mode
Success flow process: display current electric quantity information, real time speed information, start mileage information, gear information are not all glimmered, and mileage unit glimmers, flicker frequency 1Hz;
10. automobile type configuration state:
Success flow process: display current electric quantity information, real time speed information, start mileage information, vehicle information are not all glimmered, the flicker of vehicle numeral, flicker frequency 1Hz;
Backlight control
Success flow process: during power-off, backlight is extinguished;
Substitute flow process: when power supply is successfully opened, backlight is first glimmered three times, and frequency is 1Hz, then Chang Liang;
When power fail occurs, backlight flicker ten times, flicker cycle is 750ms;
During master card learning success, backlight flicker secondary, flicker frequency is 1Hz;
During subcard learning success, once, flicker frequency is 1Hz to backlight flicker;
During secondary subcard learning success, once, flicker frequency is 1Hz to backlight flicker;
Power supply exports:
Success flow process: under initial condition, master card learning state, subcard learning state, secondary subcard learning state, off-mode, power-off;
Substitute flow process: under mode of operation, gear selection mode, speed unit selection mode, mileage unit selection mode, automobile type configuration state, electric power starting.
According to the above description, the solution of the present invention can be realized in conjunction with art technology.