Synchronization method of vehicle lighting animation
By storing the crystal oscillator tolerance during the final inspection of the MCU production and using software to optimize the timer setting value, the problem of lamp animation asynchrony caused by the internal crystal oscillator tolerance of the MCU was solved, achieving cost savings and improved production efficiency.
Patent Information
- Application Number
- CN202310239301.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-03-13
AI Technical Summary
The tolerance of the RC crystal oscillator inside the microcontroller causes the left and right animations of vehicle lights to be out of sync. Existing solutions increase costs or reduce production efficiency and are not suitable for mass production.
By storing the crystal oscillator tolerance during the final inspection of the microcontroller production and using software to calculate the optimized timer setting value, the timer error is automatically compensated to achieve synchronization of the lighting animation.
The invention realizes reducing costs, improving circuit integration, avoiding inconsistent product functions and simplifying the batch production process while using the internal crystal oscillator of the microcontroller.
Smart Images

Figure CN116234125B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of vehicle lamp control, in particular to a synchronization method of vehicle lamp animation. BACKGROUND
[0002] At present, in order to meet market demand, more and more vehicles are equipped with Coming-Home and Leaving-Home animation functions. The function needs to be equipped with a single-chip microcomputer in the lamp and realized by software to achieve animation effects. For the single-chip microcomputer, the crystal oscillator is its heart, and the single-chip microcomputer must ensure that the crystal oscillator works first. The tolerance of the crystal oscillator will directly cause the single-chip microcomputer timer to produce errors, thereby affecting the synchronization of the vehicle lamp animation.
[0003] As shown in Figure 1 , under normal circumstances, the left and right LED light sources will be lit or extinguished synchronously when the Coming-Home and Leaving-Home animations are performed, but the left and right LED light sources are controlled by different single-chip microcomputers. Due to the existence of crystal oscillator tolerance between different single-chip microcomputers, the left and right LED light sources cannot be completely synchronized. When the lighting or extinguishing time difference between the two LED light sources exceeds 20ms, the human eye can recognize obvious asynchronization.
[0004] The single-chip microcomputer crystal oscillator includes internal and external crystal oscillators. The internal crystal oscillator type is mainly RC crystal oscillator, and the external crystal oscillator includes quartz and ceramic crystal oscillator. Compared with quartz and ceramic crystal oscillators, the RC crystal oscillator has lower cost. Therefore, the internal crystal oscillator of the single-chip microcomputer generally uses the RC crystal oscillator, but the biggest disadvantage of the RC crystal oscillator is that the crystal oscillator tolerance is large. The quartz and ceramic crystal oscillator tolerance is generally about 0.04%, and the RC crystal oscillator tolerance is generally about 1.5%.
[0005] Figure 2 The single-chip microcomputer system architecture is disclosed, and the crystal oscillator tolerance will eventually cause the output error of the single-chip microcomputer functional module. Therefore, in the case of precise timing, considering the error of the RC crystal oscillator, an external quartz crystal oscillator is generally selected in design. For example, the current vehicle lamp animation time is about 5s, the error of the external quartz crystal oscillator of the single-chip microcomputer is 5s*0.04%=2ms, and the error of the internal RC crystal oscillator is 5s*1.5%=75ms. Without crystal oscillator tolerance processing, using the internal crystal oscillator of the single-chip microcomputer or causing the human eye to observe the obvious asynchronization of the left and right animations of the lamp. Therefore, a high-precision external quartz or ceramic crystal oscillator is generally selected in normal circuit design, but this will cause the number of product components to increase and the cost to increase.
[0006] The following uses the light control of the vehicle lamp as an example to illustrate the influence of the crystal oscillator tolerance of the single-chip microcomputer on the lamp.
[0007] Figure 1The state shown is the lighting state of a lamp 1 according to design requirements. This lamp has seven independent light-emitting units. After the light-emitting unit at position 11 is illuminated, the light-emitting units at positions 12A and 12B are illuminated with a delay, followed by the light-emitting units at positions 13A and 13B, and then positions 14A and 14B. Ideally, the light-emitting units at positions 12A and 12B should illuminate synchronously, the light-emitting units at positions 13A and 13B should illuminate synchronously, and the light-emitting units at positions 14A and 14B should illuminate synchronously. However, due to the tolerance of the microcontroller crystal oscillator, the microcontroller timer may have errors, resulting in a phenomenon of asynchronous lighting on the left and right sides of the lamp. Figure 3 This is a state when the left and right are not synchronized. The light emitting unit at position 14A is on but the light emitting unit at position 14B is not on.
[0008] In summary, excessive tolerance of the microcontroller's crystal oscillator will cause the product's functional modules to fail to meet the design requirements. When using the microcontroller's internal RC crystal oscillator, if it is not processed, it will cause unacceptable asynchrony in the lighting animation.
[0009] The common solutions to the above problems are:
[0010] 1) Using an external crystal oscillator for the MCU. However, this solution increases component and hardware costs and reduces hardware integration.
[0011] 2) Test and correct the errors in each product software. First, download the theoretical timer settings to the MCU. Once the system is running, use an oscilloscope or other device to measure the actual timer output. Calculate the timing error and then correct the error by adding that value to the timer settings. However, the corrected timer settings must be re-downloaded to the MCU via software. This solution can solve the problem, but it can lead to low production efficiency, increased manual testing time, and increased costs, making it unsuitable for mass production projects.
[0012] 3) Select microcontrollers with smaller tolerances. However, this approach would render a large number of microcontrollers unusable, leading to data waste and increased costs. Calculating the animation duration as 5 seconds, to meet the 20ms animation time difference that the human eye can perceive, the tolerance of the microcontroller's internal crystal oscillator must be less than 20ms / 5s = 0.4% (±0.2%). The current tolerance of microcontroller internal crystal oscillators (±1.5%) is far from this requirement. Selecting microcontrollers with this approach would render a large number of microcontrollers unusable, potentially leading to microcontroller supply shortages and even production shutdowns. Summary of the Invention
[0013] The purpose of the present invention is to provide a synchronization method for vehicle lighting animation. While using the internal crystal oscillator of a single-chip microcomputer, the crystal oscillator tolerance is measured and the output error of the single-chip microcomputer function is optimized to meet the synchronization of the vehicle lighting animation, thereby realizing the use of the internal crystal oscillator of the single-chip microcomputer on batch lamps with animation requirements.
[0014] To achieve the above object, the present invention provides a method for synchronizing vehicle lighting animation, comprising:
[0015] Step S1, reading the crystal oscillator tolerance stored in the single chip microcomputer;
[0016] Step S2, calculating the timer setting value;
[0017] Step S3, inputting the timer setting value;
[0018] Step S4, start the timer; and
[0019] Step S5, after reading the single chip microcomputer memory and automatically calculating the optimized timer tolerance, the vehicle lighting animation is displayed.
[0020] In one embodiment, the crystal oscillator tolerance in step S1 is stored in the final inspection process of the single-chip microcomputer production, and the final inspection process of the single-chip microcomputer production includes:
[0021] Step S11, crystal oscillator tolerance test;
[0022] Step S12, storing the crystal oscillator tolerance;
[0023] Step S13, determining whether the crystal oscillator tolerance is less than the design value, if so, proceeding to step S14, if not, proceeding to step S15;
[0024] Step S14: qualified products are shipped out; and
[0025] Step S15: Unqualified products are scrapped.
[0026] In one embodiment, step S5 is specifically as follows:
[0027] Step S51, rising edge counter counting;
[0028] In step S52, the comparator determines whether the counter count is equal to the set value. If so, the process proceeds to step S53; if not, the process returns to step S51; and
[0029] Step S53: display the vehicle lighting animation.
[0030] In one embodiment, in step S2, the timer setting value is calculated by software; in step S5, the software reads the microcontroller memory and automatically calculates the optimized timer tolerance.
[0031] In one embodiment, automatically calculating the optimized timer tolerance includes compensating the timer setting using software.
[0032] The vehicle lighting animation synchronization method of the present invention has the following beneficial effects:
[0033] 1. Make rational use of microcontroller resources.
[0034] 2. Save external crystal oscillator, reduce cost, and improve circuit integration.
[0035] 3. Reduce the timer error caused by the MCU crystal oscillator tolerance to avoid product function complaints.
[0036] 4. Use simple software to read the microcontroller memory and automatically calculate to avoid repeated software downloading problems in batch production lines. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the lighting state of a lamp under design requirements is disclosed;
[0038] Figure 2 Reveals the schematic diagram of the microcontroller system architecture;
[0039] Figure 3 Revealed Figure 1 Schematic diagram of the lighting status of the lamp when there is an error in the microcontroller timer;
[0040] Figure 4 The schematic diagram of the final inspection process of single chip microcomputer production is revealed;
[0041] Figure 5 The optimized schematic diagram of the final inspection process of MCU production is revealed;
[0042] Figure 6 Reveals the common single-chip microcomputer timer usage flow chart; and
[0043] Figure 7 The optimized schematic diagram of the microcontroller timer usage process is revealed.
[0044] Reference numerals
[0045] 1: A lamp; 11, 12A, 12B, 13A, 13B, 14A, 14B: Different positions of independent light-emitting units in a lamp; 2: Single-chip microcomputer; 21: External crystal oscillator; 22: RC crystal oscillator; 23: Crystal oscillator source selection; 24: Frequency multiplication and division circuits; 25: Timer; 26: Functional module. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the invention and are not intended to limit the invention.
[0047] like Figure 6 As shown, the normal MCU timer usage process is as follows:
[0048] Step S0, calculating the timer setting value using the crystal oscillator rated frequency;
[0049] Step S3, inputting the timer setting value;
[0050] Step S4, start the timer; and
[0051] Step S5, after reading the single chip microcomputer memory and automatically calculating the optimized timer tolerance, the vehicle lighting animation is displayed.
[0052] In the normal use of a microcontroller timer, the design value must be entered before the timer is turned on. This design value is calculated based on the crystal oscillator frequency. Generally, only the nominal frequency of the crystal oscillator is used without considering the crystal oscillator's tolerance. This can lead to timing errors between the two parts of the lamp or between the left and right parts, resulting in inconsistent functions. On vehicle lamps, this manifests as out-of-sync animation on the left and right sides.
[0053] Therefore, considering the product problems caused by the crystal oscillator error within the MCU, the present invention first reads the crystal oscillator tolerance stored within the MCU, then uses software to calculate the timer setting value. The software reads the MCU memory and automatically calculates the optimized timer tolerance. This effectively avoids functional inconsistencies and also avoids the problem of repeated software downloads during mass production.
[0054] The present invention provides a method for synchronizing vehicle lighting animations, such as Figure 7 Shown, including:
[0055] Step S1, reading the crystal oscillator tolerance stored in the single chip microcomputer;
[0056] Step S2, calculating the timer setting value;
[0057] Step S3, inputting the timer setting value;
[0058] Step S4, start the timer; and
[0059] Step S5, after reading the single chip microcomputer memory and automatically calculating the optimized timer tolerance, the vehicle lighting animation is displayed.
[0060] like Figure 4As shown, the original single-chip microcomputer production final inspection process only determines whether the crystal oscillator tolerance meets the design requirements without storing it. This embodiment adds a crystal oscillator tolerance parameter storage process during the single-chip microcomputer production final inspection process. The stored parameters can be called when the single-chip microcomputer is used later. In step S1 of this embodiment, the crystal oscillator tolerance is stored in the single-chip microcomputer production final inspection process. The single-chip microcomputer production final inspection process is as follows Figure 5 Shown, including:
[0061] Step S11, crystal oscillator tolerance test;
[0062] Step S12, storing the crystal oscillator tolerance;
[0063] Step S13, determining whether the crystal oscillator tolerance is less than the design value, if so, proceeding to step S14, if not, proceeding to step S15;
[0064] Step S14: qualified products are shipped out; and
[0065] Step S15: Unqualified products are scrapped.
[0066] In this embodiment, step S5 is specifically as follows:
[0067] Step S51, rising edge counter counting;
[0068] Step S52: The comparator determines whether the counter count is equal to the set value. If so, the process proceeds to step S53; if not, the process returns to step S51.
[0069] Step S53: display the vehicle lighting animation.
[0070] For example, the two MCUs used on the left and right sides of the vehicle lamps have an internal crystal oscillator rated at 16M with a tolerance of 1%, and an internal crystal oscillator rated at 16M with a tolerance of -1%. The animation time is set to 5 seconds.
[0071] When the present invention is not used At this time, the time difference between the left and right animations = 5s × 2% = 100ms. The human eye can clearly recognize the asynchrony between the left and right animations of the lamp. Figure 3 In the case where the left animation runs faster than the right, when the light-emitting unit at position 14A is bright, the light-emitting unit at position 14B is still dark, which does not meet the design requirements. The light-emitting unit here includes an LED light source.
[0072] When using an embodiment of the vehicle lamp animation synchronization method of the present invention, the left and right lamp animation synchronization is achieved by compensating the size of the timer setting value.
[0073] The vehicle lighting animation synchronization method of the present invention has the following beneficial effects:
[0074] 1. Make rational use of microcontroller resources.
[0075] 2. Save external crystal oscillator, reduce cost, and improve circuit integration.
[0076] 3. Reduce the timer error caused by the MCU crystal oscillator tolerance to avoid product function complaints.
[0077] 4. Use simple software to read the microcontroller memory and automatically calculate to avoid repeated software downloading problems in batch production lines.
[0078] The above embodiments are merely further explanations of the present invention and are not intended to limit the present invention in any other manner. The present invention may also have various other embodiments. Those skilled in the art may make various corresponding modifications and variations based on the present invention without departing from the spirit and substance of the present invention, and such corresponding modifications and variations shall fall within the scope of protection of the present invention.
Claims
1. A method for synchronizing vehicle lighting animation, characterized in that: include: Step S1, reading the crystal oscillator tolerance stored in the single chip microcomputer; Step S2, calculating the timer setting value; Step S3, inputting the timer setting value; Step S4, start the timer; as well as Step S5, after reading the single chip computer memory and automatically calculating the optimized timer tolerance, the vehicle lighting animation is displayed; The crystal oscillator tolerance in step S1 is stored in the final inspection process of the single-chip microcomputer production, and the final inspection process of the single-chip microcomputer production includes: Step S11, crystal oscillator tolerance test; Step S12, storing the crystal oscillator tolerance; Step S13, determining whether the crystal oscillator tolerance is less than the design value, if so, proceeding to step S14, if not, proceeding to step S15; Step S14: qualified products are shipped out; and Step S15: Unqualified products are scrapped.
2. The vehicle lighting animation synchronization method according to claim 1, characterized in that: Step S5 is specifically as follows: Step S51, rising edge counter counting; In step S52, the comparator determines whether the counter count is equal to the set value. If so, the process proceeds to step S53; if not, the process returns to step S51; and Step S53: display the vehicle lighting animation.
3. The vehicle lighting animation synchronization method according to claim 1, characterized in that: In the step S2, the timer setting value is calculated by software; in the step S5, the single chip microcomputer memory is read by software and the timer tolerance is automatically calculated and optimized.
4. The method for synchronizing vehicle lighting animation according to claim 3, characterized in that: The automatically calculating the optimized timer tolerance includes compensating the timer setting using software.
Citation Information
Patent Citations
Real time clock chip, and clock calibration method and apparatus
CN106569544A
Compensation method and device for internal clock of SOC chip
CN111665434A
Control method for two or more motor vehicle control units, especially blinker or indicator light controllers, whereby the timer circuits of the two controllers are synchronized using existing control bus signals
DE10306788A1