[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109152136B - Gray scale increasing method of LED lamp - Google Patents

Gray scale increasing method of LED lamp Download PDF

Info

Publication number
CN109152136B
CN109152136B CN201811010366.1A CN201811010366A CN109152136B CN 109152136 B CN109152136 B CN 109152136B CN 201811010366 A CN201811010366 A CN 201811010366A CN 109152136 B CN109152136 B CN 109152136B
Authority
CN
China
Prior art keywords
pwm
frequency
gray scale
period
duty ratio
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.)
Active
Application number
CN201811010366.1A
Other languages
Chinese (zh)
Other versions
CN109152136A (en
Inventor
陈志曼
黄荣丰
陆神房
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Yajiang Photoelectric Equipment Co Ltd
Original Assignee
Guangzhou Yajiang Photoelectric Equipment 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 Guangzhou Yajiang Photoelectric Equipment Co Ltd filed Critical Guangzhou Yajiang Photoelectric Equipment Co Ltd
Priority to CN201811010366.1A priority Critical patent/CN109152136B/en
Publication of CN109152136A publication Critical patent/CN109152136A/en
Application granted granted Critical
Publication of CN109152136B publication Critical patent/CN109152136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/10Controlling the intensity of the light
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/30Semiconductor lamps, e.g. solid state lamps [SSL] light emitting diodes [LED] or organic LED [OLED]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses a gray scale increasing method of an LED lamp, which comprises the following steps of; s1, setting the refresh frequency of PWM, and using the PWM frequency as the frequency of original PWM; s2, calculating the number N of the periods required by reducing the PWM frequency according to the frequency of the required PWM and the original PWM frequency, and taking the total period containing N periods as a new PWM; and S3, distributing the duty ratio or the gray scale of each period in the new PWM according to the duty ratio or the gray scale of the period needing PWM and outputting. Compared with the prior art, the gray scale increasing method of the LED lamp disclosed by the invention has the advantages that before PWM is output every time, the gray scale variation quantity of the LED lamp is changed according to the period required by PWM frequency reduction so as to form a new PWM period, so that the aim of increasing the gray scale of the PWM while the refreshing frequency of the PWM is reduced is fulfilled. The problem that the gray scale of the LED lamp is difficult to increase at present is solved, and a method capable of increasing the gray scale of the LED lamp is provided.

Description

Gray scale increasing method of LED lamp
Technical Field
The invention relates to the field of lamps, in particular to a method for increasing gray scale of an LED lamp through PWM dimming and frequency division.
Background
At present, most of LED lamps use MCU to control PWM for dimming, and when PWM is used for dimming, the frequency of PWM is in inverse proportion to the period of PWM, that is, the lower the frequency of PWM is, the larger the period is, and the more the corresponding dimming gray scale is. The LED lamp is wide in application range and scene, and when a theatrical performance is carried out, a low refreshing frequency is needed to record a stripe feeling highlighting effect appearing on high-definition photographic equipment. Under the condition of the existing method for realizing 2-path PWM dimming by splitting a 32-bit timer through an MCU, the maximum period of one path of PWM is 65535, namely 16-bit maximum gray scale, if the frequency of the PWM is forcibly reduced, the period value is larger than the maximum period of the PWM, so that data overflow cannot normally dim, and the conventional method for reducing the refreshing frequency of the PWM can be realized by a clock frequency division method, but the method can only reduce the refreshing frequency of the PWM and cannot increase the gray scale. In order to meet the practical requirement, a method for increasing the gray scale of the LED lamp is needed.
Disclosure of Invention
The invention provides a method for increasing the gray scale of an LED lamp, aims to solve the problem that the gray scale of the LED lamp is difficult to increase at present, and provides a method for increasing the gray scale of the LED lamp.
In order to achieve the above object, the present invention provides a method for increasing the gray scale of an LED lamp, comprising the following steps;
s1, setting the refresh frequency of PWM, and using the PWM frequency as the frequency of original PWM;
s2, calculating the number N of the periods required by reducing the PWM frequency according to the frequency of the required PWM and the original PWM frequency, and taking the total period containing N periods as a new PWM;
and S3, distributing the duty ratio or the gray scale of each period in the new PWM according to the duty ratio or the gray scale of the period needing PWM and outputting.
Compared with the prior art, the gray scale increasing method of the LED lamp disclosed by the invention has the advantages that before PWM is output every time, the gray scale variation quantity of the LED lamp is changed according to the period required by PWM frequency reduction so as to form a new PWM period, so that the aim of increasing the gray scale of the PWM while the refreshing frequency of the PWM is reduced is fulfilled. Specifically, the invention provides a method for increasing the gray scale by PWM frequency division applied to an LED lamp. The PWM is a periodic pulse adjustable signal, and for an STM32F103VE chip, when the clock frequency of the PWM is 72MHz, the refresh frequency of the PWM is 1200Hz, and the period of the PWM is: 60000, which is understood to mean that the LED level with maximum dimming level of 60000 is refreshed 1200 times in 1 second, and as shown in model fig. 1, the value of a single cycle ranges from 0 to 60000, with 1200 such cycles in 1 second. If the duty ratio of a single period is set to be 30%, if 3 periods are combined into one period, and 3 duty ratios are combined into one duty ratio, the duty ratio in the new period is still kept unchanged, the brightness is also kept unchanged, but the refreshing frequency of the PWM is changed from original 1/3, from original 1200Hz to 400Hz, and the period is changed from original 60000 to 180000, which is the accumulated total gray scale, and the actual output is output according to the original 60000 upper limit. If all the duty ratios are 105% as the duty ratios of 35% in the periods 1 to 3, then the total duty ratio is sequentially filled in each period, which becomes 100% in the period 1, 5% in the period 2, 0% in the period 3, 100% in the period 4, 5% in the period 5, and 0% in the period 6, and the duty ratios are filled in sequence, and then the data filling can be started in the next period.
Drawings
FIG. 1 is a flow chart of a gray scale increasing method of an LED lamp according to the present invention;
fig. 2 is a model diagram of an embodiment of a gray scale increasing method for an LED lamp according to the present invention.
Detailed Description
As shown in fig. 1, the method for increasing the gray scale of the LED lamp of the present invention includes the following steps; s1, setting the refresh frequency of PWM, and using the PWM frequency as the frequency of original PWM; s2, calculating the number N of the periods required by reducing the PWM frequency according to the frequency of the required PWM and the original PWM frequency, and taking the total period containing N periods as a new PWM; and S3, distributing the duty ratio or the gray scale of each period in the new PWM according to the duty ratio or the gray scale of the period needing PWM and outputting.
Compared with the prior art, the gray scale increasing method of the LED lamp disclosed by the invention has the advantages that before PWM is output every time, the gray scale variation quantity of the LED lamp is changed according to the period required by PWM frequency reduction so as to form a new PWM period, so that the aim of increasing the gray scale of the PWM while the refreshing frequency of the PWM is reduced is fulfilled. Specifically, the invention provides a method for increasing the gray scale by PWM frequency division applied to an LED lamp. The PWM is a periodic pulse adjustable signal, and for an STM32F103VE chip, when the clock frequency of the PWM is 72MHz, the refresh frequency of the PWM is 1200Hz, and the period of the PWM is: 60000, which is understood to mean that the LED level with maximum dimming level of 60000 is refreshed 1200 times in 1 second, and as shown in model fig. 1, the value of a single cycle ranges from 0 to 60000, with 1200 such cycles in 1 second. If the duty ratio of a single period is set to be 30%, if 3 periods are combined into one period, and 3 duty ratios are combined into one duty ratio, the duty ratio in the new period is still kept unchanged, the brightness is also kept unchanged, but the refreshing frequency of the PWM is changed from original 1/3, from original 1200Hz to 400Hz, and the period is changed from original 60000 to 180000, which is the accumulated total gray scale, and the actual output is output according to the original 60000 upper limit. If all the duty ratios are 105% as the duty ratios of 35% in the periods 1 to 3, then the total duty ratio is sequentially filled in each period, which becomes 100% in the period 1, 5% in the period 2, 0% in the period 3, 100% in the period 4, 5% in the period 5, and 0% in the period 6, and the duty ratios are filled in sequence, and then the data filling can be started in the next period.
The step S1 of the method for increasing the gray scale of the LED lamp includes the following steps; s11, setting the lowest PWM refresh frequency according to the maximum PWM clock frequency which can be supported by the MCU; and S12, taking the set lowest PWM refreshing frequency as the frequency of the original PWM. In the invention, the selected PWM refreshing frequency can be one group or a plurality of groups, the lowest PWM refreshing frequency is taken as the frequency of the original PWM, and the frequency of the original PWM is taken as the basis of PWM frequency conversion.
The step S2 of the method for increasing the gray scale of the LED lamp includes the following steps; s21, determining the frequency needing PWM according to the PWM frequency needing to be reduced; s22, calculating the multiple relation between the frequency of the needed PWM and the frequency of the original PWM; s23, determining the number N of the periods required by reducing the PWM frequency according to the calculated multiple relation; s24, the total period including N periods is used as the new PWM. In the present invention, since the PWM frequency conversion is calculated based on the original PWM frequency, the reduced PWM frequency must be a multiple of the original PWM frequency. In the 1098Hz example, the frequency of the decrease must correspond to 1098/N, where N is a positive integer. Assuming that N is equal to 3, the reduced frequency is 1098/3 ═ 366Hz, so the number of cycles N required is 3.
The step S3 of the method for increasing the gray scale of the LED lamp includes the following steps; s31, determining the duty ratio or gray scale of the PWM period according to the duty ratio or gray scale of the PWM period needing to be reduced; s32, the duty ratio or gray scale of the period needing PWM is the duty ratio or gray scale of the period of new PWM; and S33, determining the duty ratio or gray scale of each period in the total period according to the duty ratio or gray scale of the period of the new PWM and outputting. In an embodiment of the present invention, 3 cycles are combined into one cycle, 3 duty cycles are combined into one duty cycle, the duty cycle in the new cycle is still kept unchanged, and the brightness is also kept unchanged, but the refresh frequency of PWM is changed from original 1/3, from original 1200Hz to 400Hz, and the cycle is changed from original 60000 to 180000, which is the integrated total gray scale, and the actual output is still output according to the original 60000 upper limit.
The step S33 of the method for increasing the gray scale of the LED lamp includes the following steps; s331, determining the sum of the duty ratio or the gray scale of each period in the total period according to the duty ratio or the gray scale of the period of the new PWM; and S332, sequentially redistributing the duty ratio or the gray scale of each period in the total period according to the total duty ratio or the gray scale to output. In one embodiment of the present invention, if the duty cycles 1 to 3 are 35%, if all the duty cycles are added up to 105%, then filling up the total duty cycle in sequence for each cycle becomes cycle 1 to 100%, cycle 2 to 5%, cycle 3 to 0%, similarly cycle 4 to 100%, cycle 5 to 5%, and cycle 6 to 0%, and when filling up the duty cycles, the data filling up must be started for the next cycle after filling up in sequence.
The step S1 of the method for increasing the gray scale of the LED lamp further includes the following steps; s13, setting a timer interrupt consistent with the original PWM frequency; s14, the original PWM is output at the timer interrupt. In the present invention, in order to ensure that the PWM period is changed without delay and the PWM frequency is changed, the PWM dimming is put into the timer interrupt T1 for refresh.
As shown in fig. 2, a preferred embodiment of the present invention is as follows.
Step 1, setting one or more groups of the lowest PWM refresh frequency PWM1 and PWM2 according to the MCU; setting a timer interrupt T1 consistent with the PWM refresh frequency; let all PWM outputs go out at timer interrupt T1.
An STM32F103VE chip of ST manufacturer is selected, the highest clock main frequency of the chip is 72000000Hz, a timer T2 is divided into two paths of PWM which are PWM1 and PWM2 respectively, and the maximum period of the PWM is 65535, namely the current mainstream 16-Bit maximum dimming range. According to a PWM refresh frequency calculation formula: the refresh frequency of PWM is equal to the clock frequency of PWM/period of PWM, and when the clock of PWM is not divided, i.e. the clock frequency of PWM is identical to the clock frequency of MCU, then the minimum refresh frequency of PWM1 and PWM2 is: 72000000/65535 ≈ 1098 (integer numbers for the sake of illustration of the following calculation), whereas when the refresh frequency of PWM1 and PWM2 is lower than 1098, the period of PWM1 and PWM2 is larger than 65535, so that the overflow cannot be normally dimmed. So in the case of PWM1 and PWM2 at the maximum period 65535, its lowest refresh frequency is 1098 Hz. The interrupt frequency of the T1 timer was set to 1098 Hz. To ensure that the PWM period is changed without a delay that would cause the PWM frequency to change, the PWM1 and PWM2 are dimmed to the timer interrupt T1 refresh.
Step 2: and calculating according to the PWM frequency required to be reduced and the original PWM frequency, and calculating the number N of cycles required to be reduced.
Since the PWM frequency conversion of the present invention is calculated based on the original PWM frequency, the reduced PWM frequency must be a multiple of the original PWM frequency. In the 1098Hz example, the frequency of the decrease must correspond to 1098/N, where N is a positive integer. Assuming that N is equal to 3, the reduced frequency is 1098/3 ═ 366Hz, so the number of cycles N required is 3.
And step 3: and calculating the total duty ratio or the total gray scale according to the duty ratio or the gray scale of the period required by PWM, and then sequentially redistributing the duty ratio or the gray scale to output.
Assuming that the duty ratio is 80% at a certain moment when the PWM frequency is 1098Hz, and 3 periods of 1098Hz are required for down-conversion to 366Hz, so the sum of the duty ratios of the consecutive periods of 3 periods of 1098Hz is 3 × 80% — 240%, then the 3 periods are sequentially filled with 240%, the duty ratio of the first period is 100%, the duty ratio of the second period is 100%, and the duty ratio of the third period is 40%, and since there is no gap connection between the 3 periods, the refresh frequency of the PWM is changed from 1098Hz to 366 Hz.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (3)

1. A gray scale increasing method of an LED lamp is characterized by comprising the following steps;
s1, setting the refreshing frequency of the PWM, and taking the set refreshing frequency of the PWM as the frequency of the original PWM; in particular, the method comprises the following steps of,
s11, setting the lowest PWM refresh frequency according to the maximum PWM clock frequency which can be supported by the MCU;
s12, taking the set lowest PWM refresh frequency as the frequency of the original PWM;
s13, setting a timer interrupt consistent with the original PWM frequency;
s14, outputting the original PWM when the timer is interrupted;
s2, calculating the number N of the periods required by reducing the PWM frequency according to the frequency of the required PWM and the original PWM frequency, and taking the total period containing N periods as a new PWM;
s3, distributing the duty ratio or gray scale of each period in the new PWM according to the duty ratio or gray scale of the period needing PWM to output; specifically, S31, determining the duty ratio or the gray scale of the period requiring PWM according to the duty ratio or the gray scale of the PWM period requiring reduction;
s32, the duty ratio or gray scale of the period needing PWM is the duty ratio or gray scale of the period of new PWM;
and S33, determining the duty ratio or gray scale of each period in the total period according to the duty ratio or gray scale of the period of the new PWM and outputting.
2. The method for increasing the gray scale of an LED lamp as claimed in claim 1, wherein said step S2 comprises the following steps;
s21, determining the frequency needing PWM according to the PWM frequency needing to be reduced;
s22, calculating the multiple relation between the frequency of the needed PWM and the frequency of the original PWM;
s23, determining the number N of the periods required by reducing the PWM frequency according to the calculated multiple relation;
s24, the total period including N periods is used as the new PWM.
3. The method for increasing the gray scale of an LED lamp as claimed in claim 1, wherein said step S33 comprises the following steps;
s331, determining the sum of the duty ratio or the gray scale of each period in the total period according to the duty ratio or the gray scale of the period of the new PWM;
and S332, sequentially redistributing the duty ratio or the gray scale of each period in the total period according to the total duty ratio or the gray scale to output.
CN201811010366.1A 2018-08-31 2018-08-31 Gray scale increasing method of LED lamp Active CN109152136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811010366.1A CN109152136B (en) 2018-08-31 2018-08-31 Gray scale increasing method of LED lamp

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811010366.1A CN109152136B (en) 2018-08-31 2018-08-31 Gray scale increasing method of LED lamp

Publications (2)

Publication Number Publication Date
CN109152136A CN109152136A (en) 2019-01-04
CN109152136B true CN109152136B (en) 2020-08-18

Family

ID=64825921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811010366.1A Active CN109152136B (en) 2018-08-31 2018-08-31 Gray scale increasing method of LED lamp

Country Status (1)

Country Link
CN (1) CN109152136B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110996449B (en) * 2019-11-29 2021-12-21 广州市雅江光电设备有限公司 PWM pulse width modulation method and device
CN113851074B (en) * 2020-06-28 2023-07-28 深圳市明微电子股份有限公司 LED driving pulse modulation method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1462992A (en) * 2002-05-28 2003-12-24 友达光电股份有限公司 Method for driving plasma display with variable frequency of displaying frames
CN103606356A (en) * 2013-11-06 2014-02-26 深圳市华星光电技术有限公司 Liquid crystal display device and backlight driving method thereof
CN105846797A (en) * 2016-03-21 2016-08-10 广州视源电子科技股份有限公司 Method and device for generating PWM (pulse-Width modulation) signal
CN108053791A (en) * 2017-12-14 2018-05-18 苏州科达科技股份有限公司 The pulse modulation method and device of video frame drive signal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101512050B1 (en) * 2008-01-25 2015-04-16 삼성디스플레이 주식회사 Local dimming method of light source back-light assembly for performing the method and display apparatus having the back-light assembly

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1462992A (en) * 2002-05-28 2003-12-24 友达光电股份有限公司 Method for driving plasma display with variable frequency of displaying frames
CN103606356A (en) * 2013-11-06 2014-02-26 深圳市华星光电技术有限公司 Liquid crystal display device and backlight driving method thereof
CN105846797A (en) * 2016-03-21 2016-08-10 广州视源电子科技股份有限公司 Method and device for generating PWM (pulse-Width modulation) signal
CN108053791A (en) * 2017-12-14 2018-05-18 苏州科达科技股份有限公司 The pulse modulation method and device of video frame drive signal

Also Published As

Publication number Publication date
CN109152136A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
CN109429411B (en) Light modulation controller and backlight module having the same
CN204244540U (en) There is light-emitting component power supply circuit and the control circuit wherein of dimming function
CN109152136B (en) Gray scale increasing method of LED lamp
CN105764204B (en) A kind of PWM light-dimming methods and PWM light modulating devices
JP2001308710A (en) Modulation circuit, and picture display device and modulation method using the same
CN113707078B (en) Driving device, display control chip, display device and display control method
US9736901B2 (en) LED scanning array driver chip and regulation method capable of self-regulating brightness linear change
CN108053791B (en) The pulse modulation method and device of video frame driving signal
CN114067731A (en) Low gray scale correction method and device for LED display screen and brightness correction system
CN107347222A (en) Dimming driving circuit and its control method
WO2021103799A1 (en) Method and device for pulse-width modulation (pwm)
JPH1145782A (en) Dimmer monitor control system
CN113597043B (en) Initial lighting grade method and system for fixed lamp, storage medium and lamp system
CN110853578B (en) Voltage compensation method and device
CN106817805A (en) Indicate lamp control method and device
US8841852B2 (en) Illumination apparatus with signal filters
JP2011113794A (en) Led lighting apparatus and illuminating device
CN110958742B (en) Method for improving color temperature switching consistency and lighting system
CN112135389A (en) Method, system and device for balancing flickering frequency of breathing lamp
KR101562613B1 (en) System and Method for generating Pulse Width Modulation signal
JP3032699B2 (en) Trigger circuit of dimmer
JP2023054926A (en) Led driving device
CN116721627B (en) Data signal processing method and data signal processing device
JPH09251893A (en) Illumination device
CN109587896A (en) LED gray level control unit and LED array driving system

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
GR01 Patent grant
GR01 Patent grant