DC what is the voltage? Alternating current ac explanation

D.C(DC - Direct Current) - electric current that does not change its magnitude and direction over time.

In reality, direct current cannot maintain a constant value. For example, at the output of rectifiers there is always a variable ripple component. When using galvanic cells, batteries or accumulators, the current value will decrease as energy is consumed, which is important under heavy loads.

Direct current exists conditionally in those cases where changes in its constant value can be neglected.

DC component of current and voltage. DC

If you consider the shape of the current in the load at the output of rectifiers or converters, you can see ripples - changes in the current value that exist as a result of the limited capabilities of the rectifier filter elements.
In some cases, the magnitude of the ripples can reach quite large values ​​that cannot be ignored in the calculations, for example, in rectifiers without the use of capacitors.
This current is usually called pulsating or pulsed. In these cases, a constant DC and a variable A.C. components.

DC component- a value equal to the average current value over a period.

AVG- abbreviation Avguste - Average.

AC component- periodic change in current value, decrease and increase relative to the average value.

It should be taken into account when calculating that the value of the pulsating current will not be equal to the average value, but to the square root of the sum of the squares of two values ​​- the constant component ( DC) and the root mean square value of the variable component ( A.C.), which is present in this current, has a certain power and is summed with the power of the constant component.

The above definitions, as well as terms A.C. And DC can be used equally for both current and voltage.

The difference between direct current and alternating current

According to associative preferences in the technical literature, pulsed current is often called constant, since it has one constant direction. In this case, it is necessary to clarify that we mean direct current with an alternating component.
And sometimes it is called variable, for the reason that it periodically changes its value. Alternating current with a constant component.
Usually the component that is larger in magnitude or that is most significant in the context is taken as a basis.

It should be remembered that direct current or voltage is characterized, in addition to direction, by the main criterion - its constant value, which serves as the basis of physical laws and is decisive in the calculation formulas of electrical circuits.
The DC component, as an average value, is only one of the parameters of alternating current.

For alternating current (voltage), in most cases, an important criterion is the absence of a direct component when the average value is zero.
This is the current that flows in capacitors, power transformers, power lines. This is the voltage on the windings of transformers and in the household electrical network.
In such cases, the constant component can only exist in the form of losses caused by the nonlinear nature of the loads.

DC current and voltage parameters

It should immediately be noted that the outdated term “current strength” is no longer used often in modern domestic technical literature and is considered incorrect. Electric current is characterized not by force, but by the speed and intensity of movement of charged particles. Namely, the amount of charge passed per unit time through the cross section of the conductor.
The main parameter for direct current is the magnitude of the current.

The unit of current measurement is Ampere.
The current value is 1 Ampere - the charge moves 1 Coulomb in 1 second.

The unit of measurement for voltage is Volt.
The voltage value is 1 Volt - the potential difference between two points of the electric field required to perform work of 1 Joule when passing a charge of 1 Coulomb.

For rectifiers and converters, the following parameters for constant voltage or current are often important:

Pulsation range voltage (current) - a value equal to the difference between the maximum and minimum values.
Ripple factor- a value equal to the ratio of the effective value of the alternating component of AC voltage or current to its constant component DC.

234 rebounds, 2 of them this month

Biography

AC/DC(abbreviated from the English alternating current/direct current alternating/direct current) Australian rock band formed in Sydney (Australia) in November 1973 by brothers Malcolm and Angus Young.

Together with bands such as Led Zeppelin, Black Sabbath and Deep Purple AC/DC often considered as pioneers of hard rock and heavy metal. The musicians themselves classified their music as rock and roll, since it is based on rhythm and blues with a highly distorted sound of rhythmic and solo guitars.

The band went through several line-up changes before the band's first album, High Voltage, was released in 1975. The band's line-up remained unchanged until bassist Mark Evans was replaced by Cliff Williams in 1977. On February 19, 1980, lead singer and songwriter Bon Scott (Ronald Belford "Bon" Scott) died after choking on his own vomit as a result of extreme alcohol intoxication. The group had every chance of breaking up, but soon a replacement for Scott was found in the person of former Geordie vocalist Brian Johnson. A year later, the group released their best-selling album, Back in Black.

The team has sold over 200 million albums worldwide, including 68 million albums in the United States. The most successful album, Back in Black, sold more than 22 million in the United States and more than 42 million abroad. Generally, AC/DC is the most successful and famous rock band from Australia. AC/DC They are ranked number four on VH1's 100 Greatest Artists of Hard Rock and number seven on MTV's "Greatest Heavy Metal Band Of All Time" list.

Name

Malcolm and Angus Young came up with the name for their band after seeing the acronym "AC/DC" on the back of their sister Margaret's sewing machine. "AC/DC" is an abbreviation for "alternating current/direct current", which indicates that the device can use the specified types of energy. The brothers felt the name symbolized the band's raw energy and live performance energy, and the name stuck.

In some cultures, "AC/DC" is slang for bisexuals; The musicians claimed that they were unaware of the existence of this meaning until a taxi driver drew attention to this fact early in their career. Some religious leaders argue that the group's name should be understood as "Anti-Christ/Devil's Child", "Anti-Christ/Death to Christ" ) or “After Christ/Devil Comes”.

"AC/DC" is spelled, but the band is also known as "Acca Dacca" in Australia. The name led to the emergence of tribute groups using similar names: BC/DC from the province of British Columbia (Canada); AC/DSHE, a women's group from San Francisco; Swedish AB/CD and some others.

It is known that the group performed several times for the Freeride Entertainment team in films about Mountain Bike, from the Disorder series (in parts 4 and 5, currently there are 9 of them)

Story

Brothers Angus (born March 31, 1955; at the request of Atlantic Records, Angus's official birth year was incorrectly stated as 1959), Malcolm (born January 6, 1953) and George Young (George Young) were born in Glasgow (Scotland) and as children along with their family went to Sydney. George started playing guitar first and became a member of the most successful Australian band of the 60s, The Easybeats. They were the first local rock band to have an international hit with "Friday on My Mind" in 1966. Malcolm soon followed in his brother's footsteps, becoming the guitarist for the Newcastle band The Velvet Underground (not to be confused with the New York band The Velvet Underground).

Early years

After gaining their first musical experience, Malcolm and Angus formed AC/DC, inviting vocalist Dave Evans, bass guitarist Larry Van Kniedt and drummer Colin Burgess into the group. The group debuted on December 31, 1973 at Sydney's Checkers bar.

The original line-up changed frequently; the band went through several drummers and bassists throughout 1974. In September 1974, AC/DC replaced Dave Evans with the charismatic Bon Scott (born July 9, 1946 in Kirrimer, Scotland), lead singer of The Spectors in 1966. The real success of the group began with this event. With Evans, AC/DC recorded a single consisting of three songs: "Rockin" in the Parlour", "Show Business" and "Can I Sit Next to You Girl". The latter two were also recorded with Scott.

Angus Young's sister encouraged him to wear the school uniform he wore at Ashfield Boys High School in Sydney to concerts. He later wore this uniform at all the band's concerts.

With regular appearances on the Australian popular music television show Countdown, between 1974 and 1978 the band became one of the country's best known and most popular bands. AC/DC During these years they released a number of successful albums and singles, including the timeless rock 'n' roll anthem "Its a Long Way to the Top (If You Wanna Rock "n" Roll)." -roll]).

World famous

The group signed an international contract with Atlantic Records and began to actively tour the UK and Europe, achieving fame and gaining experience performing in the wings of famous rock bands of the time, such as Alice Cooper, Black Sabbath, KISS, Cheap Trick, Nazareth, Foreigner, Thin Lizzy and The Who. AC/DC's third Australian album, Dirty Deeds Done Dirt Cheap, was released in 1976.

The invasion and wave of popularity of punk rock in 7678. The group survived well due to their crude and provocative lyrics and, in part, due to the fact that in the British music press of the time they were classified as punk bands. They achieved success on the British rock scene thanks to their powerful and controversial live shows, and Angus Young quickly became famous due to his provocative behavior on stage, which, among other things, led to the group being banned from performing at several British concert venues .

Produced by Mutt Lange, the 1979 album Highway to Hell catapulted the band to the top of the world's rock music charts of all time. The album undoubtedly became the most popular of the group's discography at the time of its release. Many of the album's songs are still frequently heard on the radio, and the title track has become one of the most famous songs in the history of rock music.

Death of Bon Scott

Bon Scott died on February 19, 1980. He left another party and stayed overnight in the car of his friend Allistair Kinnear. He found Bon dead the next day. The official cause of death was hypothermia, although the most common version to this day is that Bon Scott choked on his own vomit. These rumors are supported by many contradictions in the official story of his death, which also gives rise to many theories about conspiracy, the musician's murder and a heroin overdose.

The group members initially planned to stop their musical activities as part of AC/DC, but later decided that Bon Scott would like the group to continue. The musicians tried several candidates for the vocalist position, and in the end there were two candidates left: Terry Slesser and Brian Johnson. Johnson during this period tried to restore his group Geordie, but performing two songs in public AC/DC and Tina Turner ("Whole Lotta Rosie" (Let There Be Rock) and "Nutbush City Limits", respectively) impressed the participants AC/DC and a few days later they informed Johnson that he was the new singer of the group.

"Back in Black"

Together with Brian Johnson, the group completed the songs unfinished due to Bon's death, and recorded the album Back in Black, also produced by Lang. Back in Black, released in 1980, became the band's best-selling album and one of the most significant in hard rock history. Among all the hits on the album, the song of the same name, written in memory of Bon Scott, and "You Shook Me All Night Long", are considered by many to be the quintessence of music AC/DC and even hard rock in general.

The next album, For Those About to Rock (We Salute You), released in 1981, also sold very well and was well received by critics. The composition of the same name on the album, ending with the thunder of firing guns, became the culmination and final number of most subsequent concerts. AC/DC.

The band produced 1983's Flick of the Switch without Lang. Drummer Phil Rudd left the band due to personal differences with the rest of the band, reportedly caused by problems with alcohol. In his place, after an anonymous audition, they took Simon Wright, a former member of the group Tytan. In 1985, with a new lineup, the group recorded the less successful album Fly on the Wall, produced by the Young brothers. Along with this album, the band released a series of music videos of the band performing five of the album's ten songs in a bar, using various special effects, including an animated fly.

In 1986, AC/DC returned to the charts with the title track of Who Made Who, the soundtrack to the Stephen King film Maximum Overdrive. The album also contained two new instrumentals and hits from previous albums. In February 1986, the group was inducted into the Australian Record Industry Association Hall of Fame. The band released their 1988 album Blow Up Your Video with original producers Harry Vanda and George Young. This album sold better than the previous one and entered the UK top twenty singles chart with the song "Heatseeker".

After the release of Blow Up Your Video, Wright left the band and was replaced by session musician Chris Slade. Johnson was unable to participate in the band's work for several months, so the Young brothers wrote the songs for the next album themselves, as they did for all subsequent ones. In 1990, the album The Razor's Edge was released. It became very successful for the group and contained the hits "Thunderstruck" and "Money Talks". The album became multi-platinum, entered the top ten of the US charts (2nd place) and twenty singles in Great Britain.

In 1994, Phil Rudd returned to the group. Chris Slade's departure, in this regard, was amicable and was mainly due to the band members' strong desire to have Rudd back. According to Angus Young, Slade was the best musician in AC/DC, but the desire to see Phil in the group was stronger. As a member of 1980-1983, the group recorded the album Ballbreaker in 1995 with hip-hop and heavy metal producer Rick Rubin and Stiff Upper Lip in 2000.

After the release of these albums, the group signed a long-term contract for several albums with Sony BMG, which began to be released under the Epic Records label.

Recent years and recognition

In March 2003, AC/DC was inducted into the Rock and Roll Hall of Fame in New York City and performed their hits "Highway to Hell" and "You Shook Me All Night Long" with Aerosmith's Steve Tyler. In May 2003, Malcolm Young was awarded the Ted Albert Award for his "outstanding contribution to Australian music". That same year, the Recording Industry Association of America (RIAA) updated its album sales estimates from 46.5 million to 63 million, making AC/DC fifth group in US history to sell the most albums after The Beatles, Led Zeppelin, Pink Floyd and the Eagles. In addition, Back in Black was certified double diamond (20,000,000 copies sold), making it the sixth best-selling album in US history. In 2005, the album sold 21 million copies, which brought it to fifth position.

In July 2003, the band performed together with The Rolling Stones at Sarsfest, a concert dedicated to the fight against the SARS epidemic in Toronto, Canada.

On 1 October 2004, Corporation Lane in Melbourne was officially renamed ACDC Lane in honor of the group (street names in Melbourne cannot contain the "/" character). The street is next to Swanston Street, where the band recorded their video for the 1975 hit "Its a Long Way to the Top" in the back of a truck. There is also another street in the world named after the group AC/DC, in Spain, in the city of Legan (LeganГ©s), near Madrid “Calle de AC/DC”, not far from the streets named after the rock groups Iron Maiden and Rosendo (Spanish rock band).

A set of two was released in March 2005 DVD discs, "Family Jewels", containing a music video and concert clips. The first disc was from the Bon Scott era (with concert footage filmed ten days before Scott's death), the second contained footage from the Brian Johnson era.

On August 28, 2008, the single "RocknRoll Train" was released. On October 20, 2008, AC/DC released their new album Black Ice, which a week after its release topped the charts in 29 countries. The band sold 5 million copies of the album worldwide in its first week. There were 6 albums in the Australian Top 50 at the beginning of November AC/DC. Among those who spoke enthusiastically about the new album was Australian poet and writer John Kinsella, who noted the album's "smart, sharp, in its own way brilliant" lyrics.

At the end of October, the band went on a North American tour, inviting The Answer as support acts.

Influence on rock music

AC/DC is mentioned by many contemporaries and later musicians and bands of rock and metal music as an influence on their work. Among them: Anthrax, Bon Jovi, The Darkness, Def Leppard, Dio, Dokken, Dream Theater, Faster Pussycat, Iron Maiden, Great White, Guns N" Roses, Hanoi Rocks, Journey, Megadeth, Metallica, Nirvana, Mötley Crüe, Ozzy Osbourne, Poison, Ratt, Rhino Bucket, Saxon, Scorpions, Skid Row, Supagroup, Tool, Twisted Sister, UFO, Van Halen, Whitesnake, Wolfmother, Y&T.

Many punk rock, hardcore punk, grunge, garage rock and alternative rock artists and groups have also celebrated AC/DC how it influenced them. Although the group was initially criticized by British punk rockers of the late 70s, many musicians from this movement paid tribute to AC/DC for the high energy of the music, a thorough and anti-commercial (although many may argue with this) approach to rock music.

Influence AC/DC it's hard to overestimate Australian music. Relatively speaking, every Australian rock band that appeared in the mid-70s and later was influenced by AC/DC. To Australian bands who have cited influences on them AC/DC, include, for example, Airbourne, Blood Duster, Frenzal Rhomb, INXS, Jet, The Living End, Midnight Oil, Powderfinger, Silverchair, You Am I.

Pulse converters and power electronics in general have always remained something sacred for most amateurs and professionals in the field of electronics development. The article covers perhaps the most interesting topic among DIYers and fans of alternative energy - the formation of a sinusoidal voltage/current from a constant one.

I think many of you have probably seen advertisements or read articles containing the phrase “pure sine”. This is exactly what we will talk about, but not about the marketing component, but about exclusively technical implementation. I will try to explain as clearly as possible the operating principles themselves, standard (and not so standard) circuit solutions, and most importantly, we will write and analyze software for the STM32 microcontroller, which will generate the necessary signals for us.

Why STM32? Yes, because now this is the most popular MK in the CIS: there is a lot of educational information in Russian on them, there are a lot of examples, and most importantly, these MKs and debugging tools for them are very cheap. I’ll tell you straight - in a commercial project I would only install the TMS320F28035 or a similar DSP from the Piccolo series from TI, but that’s a completely different story.

One thing is important - STM32 allows you to stably control simple “household” power converters on which the fate of the world does not depend on the operation of any nuclear power plant or data center.

This is the picture of control signals that needs to be obtained in order to convert direct current into alternating current. And yes - this is exactly the sine! Like in that movie: “Do you see the gopher? - No. - And he is...”

Interested to know how a sinus is formed? Would you like to know how kilowatts of energy are pumped into oil? Then welcome to the cut!

1. Topologies for generating a sinusoidal signal

If you ask a crowd of electronics engineers: “How can you generate a sinusoidal signal?”, then proposals with a dozen different methods will pour in, but which one do we need? Let's start from the original task - we need to turn, for example, 380V 10A into an alternating voltage of 230V. In general, this is a “classic” case, we can see it in any good on-line UPS or inverter. It turns out that we need to convert about 4 kW of power, and with good efficiency at that, not bad, right? I think such a condition will reduce the number of options for “drawing” the sine. So what do we have left?

In power converters up to 6-10 kW, two main topologies are used: a full bridge and a “half bridge” with a through neutral. They look in the following way:

1) Topology with through neutral

This topology is most often found in budget UPSs with a sine wave output, although such authorities as APC and GE do not hesitate to use it even at fairly high powers. What motivates them to do this? Let's look at the advantages and disadvantages of this topology.

Pros:

  • The minimum possible number of power transistors, which means losses are 2 times less and the cost of the device is also lower
  • Through zero. This simplifies the certification process, especially CE and ATEX. This is due to the fact that a through zero allows input protection systems (for example, RCDs) to also operate if an accident occurs in the output circuits after the converter
  • Simple topology, which allows us to minimize the cost of the product with small
    and medium-scale production

Minuses:

  • The need for a bipolar power supply. As you can see, ±380V and another zero must be supplied to the inverter circuit
  • Double the number of high voltage capacitors. High-voltage capacitors of large capacity and with low ESR at powers from 3-4 kW begin to range from 20 to 40%
    component costs
  • The use of electrolytic capacitors in the “divider”. They dry out, it is almost impossible to select capacitors with the same parameters, and if you consider that the parameters of electrolytes change during operation, then it is pointless. You can replace it with film, but it’s expensive
The main pros and cons have been identified, so when is this topology needed? My subjective opinion: at powers up to 500-1000 W, when the fundamental requirement is cost, not reliability. An obvious representative of such consumer goods are stabilizers from A-Electronics: they’re cheap, they work somehow, and that’s okay. For 60% of consumers in our country this is sufficient and affordable. Let's draw conclusions.

2) Bridge topology

Bridge topology... probably the most understandable and most common topology in power converters, and most importantly, accessible to developers even with little experience. After 10 kW you will not find anything else other than a single- or three-phase bridge. Why is he so loved?

Pros:

  • Very high reliability. It is mainly due to the quality of the power transistor control system and does not depend on component degradation
  • The input capacitance required is several times, or even an order of magnitude less. It is only necessary to provide the calculated ESR value. This allows the use of film capacitors while maintaining cost. Film capacitors - do not dry out, perform better in harsh temperatures, the working life is an order of magnitude higher than that of electrolytes
  • Minimum voltage ripple on transistors, which means you can use transistors with lower voltages
  • Simplicity and clarity of operating algorithms. This leads to a significant reduction in time for product development, as well as for its commissioning.

Minuses:

  • An increased number of power transistors means more serious cooling is required. An increase in the price of transistors, but due to the smaller number of capacitors this is rather a plus
  • Increased driver complexity, especially with galvanic isolation requirements
As you can see from the real disadvantages of the bridge topology, there is only an increased requirement for cooling the transistors. Many will think: “More heat is generated, which means the efficiency is lower!” Not quite so... Due to reduced EMF emissions and a more “tough” control system, the efficiency of the two topologies is approximately equal.

In 70% of cases I have to use a bridge circuit not only in DC/AC inverters, but also in other converters. This is due to the fact that I design mainly industrial solutions and increasingly for European customers, and there it is customary to provide a 5-15 year guarantee for expensive industrial devices. The classic requirement: “We want a piece of hardware that can be guaranteed for 10 years,” there is no choice anymore. Of course, when people want a device with the lowest price, then it is necessary to start from a specific task when choosing a topology.

A short summary: this article will provide software for the operation of a bridge converter (H-bridge or Full Bridge), but the principle of sine generation is the same for all topologies. The code can also be adapted for the 1st topology, but you are on your own.

2. Formation of alternating current using a bridge converter

First, let's look at how a bridge converter generally works. We look at the circuit and see transistors VT1-VT4. They allow us to apply one or another potential to our abstract load (a resistor, for example). If we open transistors VT1 and VT4, we get the following: VT4 connects one end of the load to negative (GND), and transistor VT1 connects to +380V, a potential difference “380V - 0V” appears across the load, which is not zero, which means through current will begin to flow to the load. I think everyone remembers that scientists agreed - the current flows “from plus to minus.” We get this picture:

What did we get by opening VT1 and VT4? We have connected our load to the network! If the resistor was replaced with a light bulb, it would simply light up. And we didn’t just turn on the load, but determined the direction of the current flowing through it. It is very important! What happened at that time with VT2 and VT3? They were closed... completely... tightly... What would happen if, after all, VT2 or VT3 were also open? Let's look:

Let's assume that transistors VT1, VT4 and VT2 have opened. Let's remember Ohm's law, look at the channel resistance of high-voltage transistors, for example, IPP60R099P7XKSA1 and see 0.1 Ohm, we have 2 of them in series - which means the resistance of the circuit VT1 and VT2 is about 0.2 Ohm. Now let's calculate the current that will flow through this circuit: 380V / 0.2 Ohm = 1900A. I think everyone understands that this is a short circuit? I also think everyone understands why VT2 and VT3 should be closed?

This “phenomenon” is called - through current. And it is with him that the big war is going on in power electronics. How to avoid it? Create a control system whose algorithm will strictly prohibit the simultaneous opening of an extra transistor.

Why then are transistors VT2 and VT3 needed? Remember I wrote that the direction of the current is very important? Let's remember what alternating current is. Actually this is a current that has something variable, in this case the direction of the current. We have a current flowing in our socket that changes its direction 100 times per second. Let's now close VT1 and VT4, and then open transistors VT2 and VT3 and get this picture:

As you can see, the direction of the current (indicated by arrows) has changed to the opposite. Using a bridge allowed us to change the direction of the current, what does this mean? Yes, we got AC!

Please note that the bridge has two diagonals: the first diagonal is formed by VT1+VT4, and the second diagonal is formed by VT2+VT3. These diagonals work in turn, switching the current first in one direction and then in the other.

So we got alternating current, you say, but not everything is so simple... We have a standard - mains voltage. It is standardized by two main parameters: voltage and frequency. Let's deal with frequency for now, because the voltage issue is simple and purely circuit-technical.

And so the frequency... what is known about it is that it is 50 Hz (sometimes 60 Hz in the States). The signal period is 20 ms. The sine wave is symmetrical in this case, which means our 2 half-waves (positive and negative) have the same duration, that is, 10 ms + 10 ms. I hope everything is clear here.

What does this mean in physical sense? Yes, the fact is that we need to change the direction of the current in the load every 10 ms. We get that first the VT1+VT4 diagonal is open for 10 ms, and then it closes and the VT2+VT3 diagonal opens for the next 10 ms.

What does it mean to open a transistor and what signal to send to it?

Let's digress a little to the principle of transistor control. I am using insulated gate N-channel field effect transistors (Mosfet).

“Open transistor” is a transistor, the gate (G) of which was supplied with a positive potential (+10..18V) relative to the source (S) and the transistor changed the resistance of the channel (S-D) from infinitely large (2-100 MOhm) to small (usually 0.1 - 1 Ohm). That is, the transistor began to conduct current.

A “closed transistor” is a transistor whose gate (G) is pulled towards the source (S) and its resistance changes from small to infinitely large. That is, the transistor has stopped conducting current.

To better familiarize yourself with the operating principle of a field-effect transistor or IGBT, I advise you to read a couple of chapters in Semenov’s book “Fundamentals of Power Electronics” or another source, maybe Wikipedia for starters.

For control, we supply a signal with Pulse Width Modulation or the more familiar abbreviation - PWM. The peculiarity of this signal is that it has 2 states: lower voltage (GND) and upper voltage (VCC), that is, by applying it to the gate of the transistor, we either open it or close it - nothing else is given. I also advise you to read more about PWM, because I described it to you superficially for the lazy.


And so, in order for our bridge to change the direction of the current every 10 ms, we need to apply a PWM signal to it, the period of which is 20 ms and the duty cycle is 50%. This means that out of 20 ms, our shoulder is open half the time (10 ms) and conducts current, and the other half is closed. We need to apply such PWM to all keys, but with one condition - we apply direct PWM to the VT1+VT4 diagonal, and inverse PWM to the VT2+VT3 diagonal. To put it more cleverly, the signal supplied on the diagonals should have a shift of 180 0. I think at this moment your head is racing trying to understand the text, so let’s look at its visual representation:

Now everything is clear? No? Then in more detail... As you can see, I specifically noted the moments of opening and closing of transistors: they open at “plus” and close at “minus”. Also, the signals are opposite, that is, inverse: when the blue signal is “plus”, then the green signal is “minus”. We apply a blue signal to one diagonal, and a green signal to the other - as can be seen on the oscillogram, our diagonals never open at the same time. Alternating current is ready!

Look at the period. I specifically showed an oscillogram from the controller outputs so that my words were not an abstraction. The signal period is 20 ms, one diagonal is open for 10 ms and creates a positive half-wave, the other diagonal is also open for 10 ms and creates a negative half-wave. Now I hope everyone understands, and if you still don’t understand, write to me in PM, I’ll give you an individual lesson on your fingers. To confirm my words, the oscillogram shows our treasured 50 Hz! It’s just too early to relax...

We received alternating current with a frequency of 50 Hz, but in the outlet we have a sine wave, and here a meander is not the case. Formally, you can apply a meander to the output and power most loads with it, for example, a switching power supply doesn’t care: sine or meander. That is, you already have enough to turn on laptops, phones, TVs, phones and other things, but if you connect an AC motor, then everything will be very bad - it will start to heat up and its efficiency will be noticeably less, and in the end it will most likely burn out. Do you think you don't have engines at home? What about the refrigerator compressor? What about a heating circulation pump? The latter generally burn as if they were made of wood. The situation is the same with deep-well pumps for wells, and with many other things in general. It turns out that the sinusoidal signal at the output of an inverter, stabilizer or UPS is still important. Well, we need to create it! Now a complete brain explosion will begin...

3. Generating a sinusoidal waveform using PWM

To be honest, I don’t know how to present this section at accessible language. In case someone doesn’t understand, I ask you to either google it further, or write in a comment or PM - I’ll try to explain it to you personally. The eyes are afraid, but the hands are doing...

Let's see what a regular sine graph looks like:

We see 2 axes: one axis with a period of pi, pi/2 and beyond, the second with an amplitude from -1 to +1. In our problem, the period is measured in seconds and is 20 ms or 10 ms for each half-wave. Everything is simple and clear here, but with amplitude it’s more fun - just take it as an axiom that our amplitude is from 0 to 1000. This is the duty cycle value that the microcontroller sets, that is, 100 is 10%, 500 is 50%, 900 is 90 %. I think the logic is clear. In the next chapter you will understand why from 0 to 1000, but for now let’s rebuild our graph to fit our values:

This is what the sine graph of a smoker looks like, which corresponds to our task. As you can see, I did not indicate the negative half-cycle, because In our case, it is implemented not using a sinusoidal signal, but by changing the direction of the current by switching the diagonals of the bridge.

On the X axis we have time, and on the Y axis we have the duty cycle of our PWM signal. We need to draw a sine using PWM. Do we remember geometry at school, how did we make graphs? That's right, point by point! How many points? Let's build a sine over several points O1(0,0) + O2(5,1000) + O3(10,0) + O4(15, -1000) + O5(20, 0) and get the following sine:

We built it and see that, in principle, this signal is more similar to a sine than a regular meander, but it’s still not a sine yet. Let's increase the number of points. This, by the way, is called “signal discreteness” or in this case “PWM discreteness”. How can I find out the coordinates of these points? With the extreme ones it was simple...

Calculation of values ​​for forming a sine

As I said above, our sine is quite symmetrical. If we build 1/4 of the period, that is, from 0 to 5 ms, then by duplicating this piece further, we can build the sine for an infinitely long time. And so the formula:


And so in order:
  • n - duty cycle value at a given discrete point
  • A is the signal amplitude, that is, the maximum duty cycle value. For us it's 1000
  • pi/2 - 1/4 of the sine period falls into pi/2, if we count 1/2 of the period, then pi
  • x - step number
  • N - number of points
For example, let’s make it convenient to use the condition that we have 5 points. It turns out we have 1 step = 1 ms, this will make it easy to build a graph. The sampling step is calculated simply: the period in which we build the graph (5 ms) is divided by the number of points. Let's bring the formula to human form:


We get a sampling step of 1 ms. Let’s write out the formula for calculating the duty cycle, for example, in Excel and get the following table:

Now we will return to our sine graph and plot it again, but for a larger number of points and see how it changes:

As we can see, the signal is much more like a sine, even taking into account my skill in drawing, or rather the level of laziness)) I think the result does not require explanation? Based on the construction results, we derive the axiom:

The more points, the higher the signal sampling, the more ideal the sinusoidal signal shape


And so, how many points will we use... It is clear that the more, the better. How to count:
  1. For this article I’m using an old STM32F100RBT6 microcontroller (STM32VL-Discovery debugging), its frequency is 24 MHz.
  2. We count how many ticks a period of 20 ms will last: 24,000,000 Hz / 50 Hz = 480,000 ticks
  3. This means that half of the period lasts 240,000 ticks, which corresponds to a frequency of 24 kHz. If you want to increase the carrier frequency, take a faster stone. Our ears will still hear 24 kHz, but for tests or a piece of hardware standing in the basement it will do. A little later I plan to transfer to F103C8T6, and there it is already 72 MHz.
  4. 240,000 ticks... It logically suggests 240 points for half the period. The timer will update the duty cycle value every 1000 ticks or every 41.6 µs
We decided on the discreteness of the PWM; 240 points per half period is enough with a margin to get a signal shape at least no worse than in the network. Now we calculate the table, also in Excel, as the simplest option. We get the following graph:

The source of the table and values ​​can be found at the link - .

4. Control of a bridge converter to generate a sine wave

We received a sine table and what to do with it? We need to transmit these values ​​with a certain sampling step, which is known to us. It all starts with the timer being initialized - time 0, duty cycle zero. Next, we count the sampling step of 41.66 μs and write the PWM value from Table 13 (0.13%) into the timer, count another 41.66 μs and record 26 (0.26%), and so on for all 240 values. Why 240? We have 120 steps for 1/4 period, but we need to draw 1/2 period. The duty cycle values ​​are the same, only after they have reached 1000 we write it in reverse order and get the sine decay. At the output we will have the following oscillogram:

As you can see, we received a bunch of PWM values ​​in a clearly defined period and its duration is: 240 steps x 41.66(!) μs = 9998.4 μs = 9.9984 ms ~ 10 ms. We obtained half a period for a network frequency of 50 Hz. As you can see, there are again two signals and they are in antiphase, which is exactly what is needed to control the diagonals of the bridge. But excuse me, where is the sine, you ask? The moment of truth has come! Let's now feed the signal from the output of the microcontroller to a low-pass filter. I made a simple low-pass filter using RC circuits with nominal values ​​of 1.5 kOhm and 0.33 μF (I just had them on hand) and got the following result:

Voila! Here it is our long-awaited sine! The red beam of the oscilloscope is the signal before the low-pass filter, and the yellow beam is the signal after filtering. The low-pass filter cut off all frequencies above 321 Hz. We still have the main signal of 50 Hz, and of course its harmonics with a small amplitude. If you want to perfectly clean the signal, then make a low-pass filter with a cutoff frequency of about 55-60 Hz, but for now this is not important, we just needed to check whether we got a sine or not. By the way... my oscilloscope synchronization is turned on for the yellow beam (arrow on the right of the screen) and we see its frequency at the bottom of the screen - ideal 50 Hz. What more could you ask for? That's it, all that remains is to decide what signal and where to send it. Let's look at this picture:

If you look at the very first oscillogram in the article, you will see that the signal in yellow and blue better have the same phase, that is, they become positive at the same time and open the transistors. These 2 signals open the VT1+VT4 diagonal. Accordingly, 2 other signals also have the same phase and open a different diagonal. Now we not only change the direction of the current, but also set the amplitude using PWM so that it changes according to a sinusoidal law. Now let's look at the same circuit, but with currents:

As you can see, the current through the load flows in the opposite direction, changing direction with a frequency of 50 Hz, and the modulated PWM supplied to transistors VT1 and VT2 allows you to draw a sinusoidal signal shape in half waves.

The LPF (low frequency filter) is made on inductance L1 and capacitor C2. I advise you to consider the cutoff frequency for this filter to be less than 100 Hz, this will minimize voltage ripple across the output.

For dessert, I’ll show you part of the circuit diagram of a real device with a similar topology and filter, it’s large, so download the PDF.

5. Fighting through currents

I don’t think it’s a secret to anyone that nothing is perfect? It’s the same with Mosfets, they have a number of disadvantages and we will look at one of them - large gate capacitance. That is, in order to open the transistor we need to not only apply voltage, but also charge the capacitor with this same voltage, so the rise and fall of the signal is delayed. This leads to the fact that a moment in time may arise at the signal boundary when one transistor has not yet completely closed, and the other has already begun to open.

I advise you to read more about this phenomenon, for example, in this article. I'll just tell you how to deal with it. So that the transistors have time to close normally before the next arm opens, dead-time is introduced between the control signals, or, more simply put, a time delay. In our case, such a delay will be introduced between the control signals on transistors VT3 and VT4, because They are the ones who provide half-wave switching. Transistors with modulated PWM (VT1 and VT2) already have such delays - the sine starts with a duty cycle of 0% and also ends at 0%. This delay is 1 sampling step long, that is, 41.6 µs.

And so - we need to implement the dead time between the blue and green beam/signal. On any controller, such a delay can be done programmatically, but this is not good - the program will freeze or be delayed, and blah blah blah, your device and apartment are already on fire. Therefore, only hardware should be used in power electronics. On all specialized motor controls, hardware deadtime is provided on all PWM outputs and channels, but the STM32 is still a general-purpose MK, so everything is simpler here, but it will perform our function.

We will need the TIM1 timer, only it can insert a hardware delay between signals, in the section on writing software I will tell you how to do this, but now let’s look at the result and what should be there:

To see the delay, we “stretch” the signal on an oscilloscope, because it has a short duration of about 300 ns. The required deadtime must be calculated for each specific task in order to protect the transistors from through currents. The delay duration is configured when initializing (setting) the TIM1 timer. This delay is present at both the leading and falling ends of the signal.

6. Writing firmware for the STM32 microcontroller

Here we come to probably the most important and interesting part. We have analyzed the physics of the process, the principle of operation seems to be clear, the required minimum of protection has also been determined - all that remains is to implement all this in real hardware. For this I use the STM32VL-Discovery board, by the way, I received it back in 2011 at a time when ST gave out debugs for free at their conferences and since then it has been packed - I opened the package only a couple of months ago, it seems that the expiration date has not passed))) My “stand” for writing code looks like this:

Now let's go through the connection. Since I need to generate two signals with different frequencies, I had to use the PWM outputs on different timers. TIM1 generates a signal that sets the fundamental frequency of 50 Hz and supplies it to transistors VT3 and VT4. PWM channel No. 3 + its complementary output is used. Yes, yes, in STM32 hardware deadtime can only be configured between the normal and complementary output of one channel, which I really didn’t like. The process of sine formation itself is transferred to the TIM2 timer, there is no need for a delay (I wrote earlier why) and it is quite suitable for generating a modulated signal on VT1 and VT2.

Outputs used:

  • PA10 is a regular PWM output, channel No. 3 of the TIM1 timer, which generates 50 Hz to transistor VT3
  • PB15 - complementary output of channel No. 3 of the TIM1 timer, which is supplied to transistor VT4
  • PA0 is the output of PWM channel No. 1 of the TIM2 timer. Provides a modulated signal to VT1
  • PA1 is the output of PWM channel No. 2 of the TIM2 timer. Provides a modulated signal to VT2
The project was implemented in the Keil 5 environment; it will be attached to the archive at the end of the article. I hope it’s not worth telling how to create a project and similar obvious things; if such questions arise, then I advise you to look at how to do it on Google or on YouTube. All code is written in CMSIS (registers), because... It is simply a sin to use any additional levels of abstraction in the converter control system! For ST, these are SPL libraries and more relevant HALs. For fun, I worked with both of them, the conclusion is complete rubbish. HAL is generally incredibly slow and is simply not suitable for applications with hard real-time. In some critical moments, the registers were many times faster; by the way, I found more than one article on this on the Internet.

Some will probably ask: “Why not use DMA?” This can and should be done, but this article is more of an informational nature, and the MK itself does not do anything complicated in terms of calculations, so there’s definitely no limit to the performance of the kernel. DMA is good, but you can do without DMA without any potential problems. Let's clarify what we need to do in the program:

  1. Create an array with our 240 sine points
  2. Configure the clock circuits to a frequency of 24 MHz by selecting an external quartz resonator source
  3. Set the TIM1 timer to generate 50 Hz PWM with deadtime enabled
  4. Configure TIM2 to generate PWM with a carrier frequency of 24 kHz
  5. Set up a TIM6 timer that generates interrupts at 24 kHz. In it we will send the next duty cycle value from the table to the TIM2 timer, and also alternate the generation of half-waves
Nothing complicated, right? Then let's go...

6.1. Creating a sine table

Everything is simple here, a regular array. The only thing worth remembering is that we have 120 points from 0 to 1000. We need to add another 120 points to the table, but in the reverse order:

Uint16_t sin_data = (13,26,39,52,65,78,91,104,117,130,143,156,169,182,195,207,220,233,246,258, 271,284,296,309,321,333,346,358,370,382 ,394,406,418,430,442,453,465,477,488,500, 511,522,533,544,555,566,577,587,598,608,619,629,639,649,659,669,678,688,697,707, 71 6,725,734,743,751,760,768,777,785,793,801,809,816,824,831,838,845,852,859,866, 872,878,884,891,896,902,908,913,918,923,928,93 3,938,942,946,951,955,958,962,965, 969,972,975,978,980,983,985,987,989,991,993,994,995,996,997,998,999,999,999,1000, 999,999, 999,998,997,996,995,994,993,991,989,987,985,983,980,978,975,972,969,965, 962,958,955,951,946,942,938,933,928,923,918,913,908, 902,896,891,884,878,872,866, 859,852,845,838,831,824,816,809,801,793,785,777,768,760,751,743,734,725,716,707, 697,688,678,669 ,659,649,639,629,619,608,598,587,577,566,555,544,533,522,511,500, 488,477,465,453,442,430,418,406,394,382,370,358,346,333,321 ,309,296,284,271,258, 246,233,220,207,195,182,169,156,143,130,117,104,91,78,65,52, 39,26,13);

6.2. Setting up the clock system

The clock setting in STM32 is very flexible and convenient, but there are several nuances. The sequence itself looks like this:

1) Switch to clocking from the built-in RC chain (HSI) to external quartz (HSE), then wait for the readiness flag

RCC->CR |= ((uint32_t)RCC_CR_HSEON); // Enable HSE while (!(RCC->CR & RCC_CR_HSERDY)); // Ready start HSE
2) The controller's Flash memory works somewhat slower than the kernel; for this purpose, we adjust the flash clocking. If this is not done, the program will start, but will periodically crash: a couple of kW and unstable software are incompatible things.

FLASH->ACR = FLASH_ACR_PRFTBE | FLASH_ACR_LATENCY; // Clock Flash memory
3) We set dividers for the system clock bus (AHB) and for the peripheral buses, of which there are two: APB1 and APB2. We need the maximum frequency, so we don’t divide anything and make the division coefficients equal to 1.

RCC->CFGR |= RCC_CFGR_HPRE_DIV1; // AHB = SYSCLK/1 RCC->CFGR |= RCC_CFGR_PPRE1_DIV1; // APB1 = HCLK/1 RCC->CFGR |= RCC_CFGR_PPRE2_DIV1; // APB2 = HCLK/1
4) We adjust the frequency multiplier (PLL) prescaler, which stands in front of it and divides the quartz frequency by 2. We get that 8 MHz is divided by 2 and we get 4 MHz. Now we need to multiply them by 6 so that the output is 24 MHz. Before writing registers, let's first erase their contents just in case.

RCC->CFGR &= ~RCC_CFGR_PLLMULL; // clear PLLMULL bits RCC->CFGR &= ~RCC_CFGR_PLLSRC; // clearn PLLSRC bits RCC->CFGR &= ~RCC_CFGR_PLLXTPRE; // clearn PLLXTPRE bits RCC->CFGR |= RCC_CFGR_PLLSRC_PREDIV1; // source HSE RCC->CFGR |= RCC_CFGR_PLLXTPRE_PREDIV1_Div2; // source HSE/2 = 4 MHz RCC->CFGR |= RCC_CFGR_PLLMULL6; // PLL x6: clock = 4 MHz * 6 = 24 MHz
5) Now you need to turn on the frequency multiplier (PLL) and wait for the readiness flag:

RCC->CR |= RCC_CR_PLLON; // enable PLL while((RCC->CR & RCC_CR_PLLRDY) == 0) () // wait till PLL is ready
6) And finally, we configure the clock source for the system bus (AHB) - the output of our frequency multiplier, which has the coveted 24 MHz. First we clear the contents of the register, set the required bit and wait for the ready flag:

RCC->CFGR &= ~RCC_CFGR_SW; // clear SW bits RCC->CFGR |= RCC_CFGR_SW_PLL; // select source SYSCLK = PLL while((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_1) () // wait till PLL is used
As a result, we get the following clock setting function:

Void RCC_Init (void)( RCC->CR |= ((uint32_t)RCC_CR_HSEON); // Enable HSE while (!(RCC->CR & RCC_CR_HSERDY)); // Ready start HSE FLASH->ACR = FLASH_ACR_PRFTBE | FLASH_ACR_LATENCY; // Cloclk Flash memory RCC->CFGR |= RCC_CFGR_HPRE_DIV1; // AHB = SYSCLK/1 RCC->CFGR |= RCC_CFGR_PPRE1_DIV1; // APB1 = HCLK/1 RCC->CFGR |= RCC_CFGR_PPRE2_DIV1; // APB2 = HCLK/1 RCC->CFGR &= ~RCC_CFGR_PLLMULL; // clear PLLMULL bits RCC->CFGR &= ~RCC_CFGR_PLLSRC; // clearn PLLSRC bits RCC->CFGR &= ~RCC_CFGR_PLLXTPRE; // clearn PLLXTPRE bits RCC->CFGR |= RCC_CFGR_PLLSRC_PREDIV1; // source HSE RCC->CFGR |= RCC_CFGR_PLLXTPRE_PREDIV1_Div2; // source HSE/2 = 4 MHz RCC->CFGR |= RCC_CFGR_PLLMULL6; // PLL x6: clock = 4 MHz * 6 = 24 MHz RCC->CR |= RCC_CR_PLLON ; // enable PLL while((RCC->CR & RCC_CR_PLLRDY) == 0) () // wait till PLL is ready RCC->CFGR &= ~RCC_CFGR_SW; // clear SW bits RCC->CFGR |= RCC_CFGR_SW_PLL; // select source SYSCLK = PLL while((RCC->CFGR & RCC_CFGR_SWS) != RCC_CFGR_SWS_1) () // wait till PLL is used )

6.3. Setting the TIM1 timer and “dead time”

I'll bring general setup timer, it is described in detail in the reference manual - I advise you to read the purpose of each register. Yes, and there are basic articles on working with PWM on the Internet. My code itself is quite well commented, so I’ll just give you the code for the TIM1 timer initialization function, and the most interesting points let's look at:

Void PWM_50Hz_Init (void)( RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; // enable clock for TIM1 RCC->APB2ENR |= RCC_APB2ENR_IOPAEN; // enable clock for port A RCC->APB2ENR |= RCC_APB2ENR_IOPBEN; // enable clock for port B RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // enable clock for alternative gpio /************************************** Setting PA10 ** ************************************/ GPIOA->CRH &= ~GPIO_CRH_CNF10; // setting out alternative push-pull for PWM GPIOA->CRH |= GPIO_CRH_CNF10_1; GPIOA->CRH &= ~GPIO_CRH_MODE10; GPIOA->CRH |= GPIO_CRH_MODE10; // gpio speed 50 MHz /************ ***************** Setting PB15 ************************************** ********/ GPIOB->CRH &= ~GPIO_CRH_CNF15; // setting complementary for CH3N GPIOB->CRH |= GPIO_CRH_CNF15_1; GPIOB->CRH &= ~GPIO_CRH_MODE15; GPIOB->CRH |= GPIO_CRH_MODE15; / /gpio speed 50 MHz /******************************** Config PWM channel *************** ********************************/ TIM1->PSC = 480-1; // div for clock: F = SYSCLK / TIM1->ARR = 1000; // count to 1000 TIM1->CR1 &= ~TIM_CR1_CKD; // div for dead-time: Tdts = 1/Fosc = 41.6 ns TIM1->CCR3 = 500; // duty cycle 50% TIM1->CCER |= TIM_CCER_CC3E | TIM_CCER_CC3NE; // enable PWM complementary out TIM1->CCER &= ~TIM_CCER_CC3NP; // active high level: 0 - high, 1 - low TIM1->CCMR2 &= ~TIM_CCMR2_OC3M; TIM1->CCMR2 |= TIM_CCMR2_OC3M_2 | TIM_CCMR2_OC3M_1; // positiv PWM TIM1->BDTR &= ~TIM_BDTR_DTG; // clear register TIM1->BDTR |= TIM_BDTR_DTG_2 | TIM_BDTR_DTG_1 | TIM_BDTR_DTG_0; // value dead-time TIM1->BDTR |= TIM_BDTR_MOE | TIM_BDTR_AOE; // enable generation output /************************************************ **********************************/ TIM1->CR1 &= ~TIM_CR1_DIR; // count up: 0 - up, 1 - down TIM1->CR1 &= ~TIM_CR1_CMS; // aligned on the front signal TIM1->
Our duty cycle is fixed and never changes, just like the frequency. It is this timer that sets the time and sequence of operation of the diagonals:

TIM1->CCR3 = 500; // duty cycle 50%
The duration of the “dead time” pause depends heavily on the TDTS time parameter, which is configured here:

TIM1->CR1 &= ~TIM_CR1_CKD; // div for dead-time: Tdts = 1/Fosc = 41.6 ns
Its duration is 1 tick clock frequency. If you look in the reference manual, you can see that CKD bits can, for example, make Tdts equal to 2, 8 ticks, etc.

The pause time itself is set here:

TIM1->BDTR |= TIM_BDTR_DTG_2 | TIM_BDTR_DTG_1 | TIM_BDTR_DTG_0;
If you open reference manual RM0041, you will see these formulas for calculating DT. As you can see, the Tdts parameter is fundamental there:

6.4. Setting the TIM2 timer, generating a sine

Here everything is even simpler; there is probably no point in explaining something in the settings, because the comments are already redundant. If you have any questions, I’m waiting for them in the comments.

Void PWM_Sinus_Init (void)( RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; // enable clock for TIM2 RCC->APB2ENR |= RCC_APB2ENR_IOPAEN; // enable clock for port A RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; // enable clock for alternative gpio /*********************************** Setting PA0 ***************** **********************/ GPIOA->CRL &= ~GPIO_CRL_CNF0; // setting out alternative push-pull for PWM1_CH1 GPIOA->CRL |= GPIO_CRL_CNF0_1; GPIOA->CRL &= ~GPIO_CRL_MODE0; GPIOA->CRL |= GPIO_CRL_MODE0; // gpio speed 50 MHz /************************** **** Setting PA1 *************************************************/ GPIOA->CRL &= ~GPIO_CRL_CNF1; // setting out alternative push-pull for PWM1_CH1 GPIOA->CRL |= GPIO_CRL_CNF1_1; GPIOA->CRL &= ~GPIO_CRL_MODE1; GPIOA->CRL |= GPIO_CRL_MODE1; // gpio speed 50 MHz /*** ************************ Config PWM channel *********************** ************/ TIM2->PSC = 0; // div for clock: F = SYSCLK / TIM2->ARR = 1000; // count to 1000 TIM2->CCR1 = 0; / / duty cycle 0% TIM2->CCR2 = 0; // duty cycle 0% TIM2->CCER |= TIM_CCER_CC1E; // enable PWM out to PA8 TIM2->CCER &= ~TIM_CCER_CC1P; // active high level: 0 - high, 1 - low TIM2->CCER |= TIM_CCER_CC2E; // enable PWM complementary out to PA9 TIM2->CCER &= ~TIM_CCER_CC1P; // active high level: 0 - high, 1 - low TIM2->CCMR1 &= ~(TIM_CCMR1_OC1M | TIM_CCMR1_OC2M); TIM2->CCMR1 |= TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC2M_2 | TIM_CCMR1_OC2M_1; // positive PWM1_CH1 and PWM1_CH2 /*************************************************** ************************************/ TIM2->CR1 &= ~TIM_CR1_DIR; // count up: 0 - up, 1 - down TIM2->CR1 &= ~TIM_CR1_CMS; // aligned on the front signal: 00 - front; 01, 10, 11 - center TIM2->CR1 |= TIM_CR1_CEN; // start count )

6.5. Configuring TIM6 timer interrupts

We set the timer itself to a frequency of 24 kHz:

Void TIM6_step_init (void)( RCC->APB1ENR |= RCC_APB1ENR_TIM6EN; // enable clock for basic TIM6 TIM6->PSC = 1-1; // div, frequency 24 kHz TIM6->ARR = 1000; // count to 1000 TIM6 ->DIER |= TIM_DIER_UIE; // enable interrupt for timer TIM6->CR1 |= TIM_CR1_CEN; // start count NVIC_EnableIRQ(TIM6_DAC_IRQn); // enable interrupt TIM6_DAC_IRQn )

6.6. Implementation of the main control algorithm

The main events occur in the interrupt generated by the TIM6 timer. An interrupt is generated every 41.66 µs, if you remember this is our sampling step. Accordingly, the interrupt writes the duty cycle value from the table to the register CCRx. This interrupt also determines which diagonal is currently being drawn by inverting the flag sin_status after each half cycle. We display 240 points, invert the flag, which causes control to pass to another channel, when it has already drawn, the flag is inverted again and everything repeats. Main algorithm code:

Void TIM6_DAC_IRQHandler(void)( TIM6->SR &= ~TIM_SR_UIF; if(sin_status == 0)(TIM2->CCR1 = sin_data;) if(sin_status == 1)(TIM2->CCR2 = sin_data;) sin_step++; if (sin_step >= 240)( sin_step=0; sin_status = sin_status ? 0: 1; ) )

Results

Download the project, compile it and upload it to your microcontroller and get a working inverter. All you have to do is make a bridge and send signals to it:

I posted one of my bridge diagrams a little earlier in PDF, you can use it as much as you like, I hope it will help you in mastering power electronics.

I hope you liked the article. If you have any questions about using this code in real hardware, I will be glad to answer them. Also, please do not take this code as something ready-made; this is the core of the converter, which implements the main function. You can add all the bells and whistles yourself. The bare core of the project will allow you to understand how it works and not spend a lot of time disassembling the code.

Among the species electric current distinguish:

D.C:

Designation (-) or DC (Direct Current).

Alternating current:

Symbol (~) or AC (Alternating Current).

In the case of direct current (-), the current flows in one direction. Direct current is supplied, for example, by dry batteries, solar panels and batteries for devices with low current consumption. For the electrolysis of aluminum, electric arc welding and the operation of electrified railways, high-power direct current is required. It is created using AC rectification or using DC generators.

The technical direction of the current is that it flows from the contact with the “+” sign to the contact with the “-” sign.

In the case of alternating current (~), a distinction is made between single-phase alternating current, three-phase alternating current and high-frequency current.

With alternating current, the current constantly changes its magnitude and direction. In the Western European power grid, the current changes its direction 50 times per second. The frequency of change of oscillations per second is called the frequency of the current. The unit of frequency is hertz (Hz). Single-phase alternating current requires a voltage conductor and a return conductor.

Alternating current is used on the construction site and in industry to operate electrical machines such as hand sanders, electric drills and circular saws, as well as for job site lighting and construction site equipment.

Three-phase alternating current generators produce alternating voltage with a frequency of 50 Hz on each of their three windings. This voltage can supply three separate networks and use only six wires for forward and return conductors. If you combine the return conductors, you can limit yourself to only four wires

The common return wire will be the neutral conductor (N). As a rule, it is grounded. The other three conductors (outer conductors) are abbreviated LI, L2, L3. In the German grid, the voltage between the outer conductor and the neutral conductor, or ground, is 230 V. The voltage between two outer conductors, for example between L1 and L2, is 400 V.

High-frequency current is said to occur when the oscillation frequency is significantly higher than 50 Hz (15 kHz to 250 MHz). Using high-frequency current, you can heat conductive materials and even melt them, such as metals and some synthetic materials.

Today, if you look around, almost everything you see is powered by electricity in one form or another.
Alternating current and direct current are the two main forms of charge that power our electrical and electronic world.

What is AC? Alternating current can be defined as a stream electric charge, which changes its direction at regular intervals.

The period/regular intervals at which AC changes its direction is its frequency (Hz). Marine vehicles, spacecraft, and military equipment sometimes use 400 Hz AC. However, for most of the time, including indoor use, the AC frequency is set to 50 or 60 Hz.

What is DC?(Symbol on electrical appliances) D.C is a current (flow of electric charge or electrons) that flows in only one direction. Subsequently, there is no frequency associated with DC. DC or direct current has zero frequency.
AC and DC power sources:

AS: Power plants and alternating current generators produce alternating current.

DC: Solar panels, fuel cells, and thermocouples are the main sources for DC production. But the main source of DC current is AC conversion.

Application of AC and DC current:

AC is used to power refrigerators, home fireplaces, fans, electric motors, air conditioners, televisions, food processors, washing machines, and almost all industrial equipment.

DC is mainly used to power electronics and other digital equipment. Smartphones, tablets, electric cars, etc. LED and LCD TVs also run on DC, which is converted from regular AC power.

Why AC is used to transmit electricity. It is cheaper and easier to produce. AC at high voltage can be transported hundreds of kilometers without much power loss. Power plants and transformers reduce the voltage to (110 or 230 V) to transmit it to our homes.

Which is more dangerous? AC or DC?
DC is believed to be less dangerous than AC, but there is no definitive proof. There is a misconception that contact with high voltage AC is more dangerous than contact with DC. In fact, it's not about voltage, it's about the amount of current passing through the human body. Direct and alternating current can be fatal. Do not insert fingers or objects into outlets or gadgets and high power equipment.

Today there is adaptive xenon on sale with lamps and AC and DC ignition units. This is the same xenon, but it has some differences that you, as a buyer and user, should definitely be aware of. This material is dedicated to AC and DC xenon, features, differences and much more that will be useful to know.

Introductory part about xenon AC and DC

At first glance, it is impossible to distinguish between AC and DC ignition units. Their main difference is that AC are ignition units that have alternating current, and DC are direct. The difference between these two xenons can be noticed during their operation, or more precisely during ignition and maintenance of the glow discharge. The flickering of the lamps is indicated by the DC ignition units.

In order to specifically understand the differences between AC and DC xenon, you need to know their design. Such kits differ strikingly in terms of their operating principle, which is most important for of this device in lighting technology for cars. As already noted, their operating principle is visible at the moment the xenon lamp is ignited and combustion is maintained. In order to form an electric arc between the electrodes in the lamp bulb, a powerful pulse is required, that is, a current of up to 25,000 V.

After the source starts burning, to maintain the functioning of the lamp, a continuous supply of current with a voltage of 80-85 V is necessary, and this is monitored by a controller, which is built into the ignitor’s ballast. This is the standard operating principle of xenon lamp ignition units. AC units have an ignitor (inverter) and a stably operating stabilizer, unlike DC kits.

DC ignition unit kits: lamp ignition principle

Adaptive ignition units and xenon lamps with direct current DC have a significantly lower cost, light weight and small dimensions. They provide a single and non-cyclic discharge, which often leads to a jitter of the electric arc and flickering of the light of the xenon source. In order to properly activate the xenon lamp, a second pulse is required, which takes an additional few seconds while waiting for the current to be supplied again. Note that the DC system is much better in quality than halogen, but is still inferior to AC kits with alternating current.

AC ignition unit kits: lamp ignition principle

Xenon ignition units and lamps with alternating current AC work much more stable and better, since they are equipped with a special stabilizer that equalizes the voltage. AC units create pulses of the required frequency and power, which ensures uninterrupted and stable light output from the lamps. In order to create an oscillation amplitude in AC blocks and lamps, special ignitors (sometimes may be called inverters) are used, which ensure the conversion of low-voltage current into a high-voltage pulse and vice versa. Thus, from the vehicle’s on-board network voltage of 12 V (sometimes 24 V), a current of 25,000 V is generated, which guarantees ignition of the xenon emitter in a matter of seconds. It is worth noting that the AC units have two-way communication with xenon lamps, so if the light starts to go out, the unit provides a high-voltage pulse so as not to lead to deactivation of the emitter. Thus, the adaptive xenon AC kits operate more stably, and there are no flickering lamps or voltage surges.

OptionsAC unitsDC blocks
Current VariableConstant
Starting impulse One powerful pulse of 25,000 V, which ensures instant ignition of the xenon lamp. The lamp lights up instantly, there is no flickering or reduction in light brightness.Sometimes the starting pulse does not completely activate the electric arc, and therefore you have to wait for a second reaction, which takes much longer and the lamp light flickers.
Weight They have more weight than direct current units due to their design features.They are characterized by maximum lightness and therefore do not create pressure on the headlight unit.
Dimensions There are different dimensions, depending on the generation.The blocks have almost identical dimensions.
Design They have an ignitor (inverter) and a stabilizer.There is no inverter and voltage stabilizer.
Form factor There are standard sizes and slim ones, for use in cars with a small engine compartment.Almost all ignition units have standard sizes, but are smaller in format than ordinary AC units.
Sound signal They have a special sound signal, which fades over time and notifies the driver that the xenon is suitable for use and the car is about to start moving.DC ignition units do not provide an audible signal to the driver, meaning you have to wait longer to start driving.
Lamps For use exclusively with AC lamps. If you connect a block with DC lamps, the glow is not activated, since the block does not create the special polarity that is necessary for the operation of DC lamps.Must be used exclusively with DC lamps. If you connect the unit to lamps with alternating current AC, then the wear of both the lamps and the lighting product increases. In addition, the light of AC lamps will “tremble” due to the lack of stability in the arc discharge.
Duration of operation Using lamps and speaker units, the set will last an average of 2500-3000 hours.Using DC lamps and units, the headlights will be usable for 1500-2000 hours.
Defectiveness percentage On average 2% defective.On average 5% defective.
Reliability The units are highly reliable and stable, do not allow short circuits and guarantee uninterrupted lighting of the xenon lamp.Reliability, compared to AC ignition units, is slightly reduced, not to mention the stability of operation and uninterrupted lighting of the xenon emitter.
Resistance to temperature changes The blocks are highly resistant to temperature changes, the housing is securely and hermetically sealed, and the elements that are most susceptible to failure when exposed to moisture are hidden.It is worth noting that DC and AC units are identical in temperature resistance. In addition, thanks to high-quality sealant, constant voltage blocks are not susceptible to moisture.
Price Due to the fact that AC ignition units are equipped with additional components, they are an order of magnitude more expensive than DC devices.They cost much less than AC ignition units because important components such as a voltage regulator are missing.

Be carefull!

It often happens that when purchasing ignition units from unscrupulous sellers, for example at bazaars, or in basement stores, buyers encounter fraud. Many people cheat and install a dummy inverter into DC ignition units and pass them off as AC, naturally at an order of magnitude higher cost. That is why, purchase adaptive xenon kits only from trusted sellers who guarantee high quality products and always provide a guarantee for any purchased kits.

Having heard the music of this group at least once, it is impossible to forget it or confuse it with something else. Stunning sound, frantic energy, unforgettable vocals - this is all AC/DC, a cult rock band originally from Australia, which has become a true legend of heavy metal and hard rock. It is surprising that the band has continued to exist since 1971, and at the end of the summer of 2015, the musicians, who were over 60, gathered on a large tour of Canada and the USA, which proves that it is too early to write off this amazing rock band. and they can still “set the heat.”

The Making of a Rock Legend

William and Margaret Young, native Scots who moved to Australia in 1963, had nine children in total, including three sons - George, Malcolm and Agnus. Surprisingly, they were all extremely talented musically. The first brother to get involved in rock music was the eldest, George. He and friends founded the Easybeats, a teenage rock band, which attracted the attention of the younger Youngs to music. Malcolm, and then Agnus, picked up the guitar and discovered real talent, learning at record speed.

After several unsuccessful attempts to participate in musical groups, Malcolm Young comes up with the idea of ​​​​creating his own group, and his younger brother Agnus enthusiastically supports this idea. The brothers found vocalist Dave Evans through an advertisement in a newspaper, and acquaintances of the young Youngs were invited to play drums and bass guitar.

The future rock legends came up with the name of their group, or rather, found it, quite quickly: the inscription “AC/DC”, which means “alternating-direct current”, was often placed on household appliances, such as a vacuum cleaner or an electric sewing machine, where my sister saw it Young brothers, Margaret. This name seemed original, sonorous and very apt to friends, and was unanimously accepted by all members of the group.

Since Malcolm and Agnus approached the creation of the group very seriously, they also decided to come up with some kind of original stage image. And here they were again helped by Margaret, who, like the parents of the young people, was very supportive of them in organizing their own musical group. She came up with the original “highlight” of the group: performing in school uniform. Thanks to this fateful idea, Angus Young is recognized by his short school pants, tie and funny cap, which he always wears at the band’s concerts to this day.

The group held its debut performance on the last day of 1973, and the Chequers bar was chosen as the place where the quintet played for the first time. From that moment on, a hard rock band began its existence, which was destined to become a world legend and gain great amount fans and followers.

Career: gains and losses

In 1974, there were numerous changes in the group's lineup, with several drummers and bass players being replaced. And the most important and fateful replacement of that time in AC/DC was the change of vocalist. Dave Evans refused to go on stage at one of the performances; something urgently needed to be done, and then the band's driver Bon Scott proposed his candidacy, who, by luck, was in the right place at the right time. After the performance, Bon was taken into the team on a permanent basis. The new vocalist's real name was Ronald Belford Scott, and he turned out to be an unusually charismatic and energetic young man, moreover, endowed with extraordinary musical talent and vocal abilities. With him, the group's business quickly went uphill. Later, the British magazine Classic Rock ranked him first in its list of the 100 Greatest Frontmen of All Time.


The group writes several fairly successful songs and in 1975 releases its first album, “High Voltage”. Although the album did not take leading places, it was nevertheless a good bid for popularity. In the same year, AC/DC released their second album, entitled T.N.T., which translated means “trinitrotoluene”. This album was a considerable success, but, like the first, it was officially released only in Australia. World fame was yet to come.


The band members understand that in order to truly “spread their wings” they need to expand the boundaries of their influence. They are actively working in this direction, and soon sign an international contract with Atlantic Records, which allows AC/DC to finally break out of Australia. They begin to conquer the stages of Great Britain and Europe with old hits, however, without forgetting about new ones: in 1976, “Dirty Deeds Done Dirt Cheap” was released - the third record of the group, which had quite good success. After this, the group members decide to move to the UK. They actively perform, communicate with the media and fans, gradually gaining more and more popularity.


Work is in full swing. The albums “Let There Be Rock” (1977), “Powerage” (1978), and “Highway to Hell” (1979) were released one after another. The latter brings AC/DC to the peak of popularity and to the top of the world charts. Most of the compositions on this album are absolute hits to this day, rightfully considered one of the best songs in the history of world rock. It seems that nothing can overshadow the wild success of young energetic performers... As it turned out, this was not the case.

On February 19, 1980, a terrible tragedy occurs - the band's lead singer, the brilliant Bon Scott, suddenly dies. By official version this was due to alcohol abuse. The group is simply crushed.


Having lost their “voice”, “AC/DC” are thinking about ending their career, but decide to keep the band, believing that this is what the cheerful Bon Scott would like. The friends get back on their feet after the shock, and after several listens they find an unusually talented vocalist - Brian Johnson. The rock band seems to get a second wind and they begin to work tirelessly.

In the same year, the legendary album “Back in Black” was released, the cover of which was decided to be black, in memory of the former lead singer and faithful friend. The album was a dizzying success; it would later become the best-selling album in the group's history and be awarded double diamond status.

Over the next few years, the rock band has been very productive. With a magnificent “golden lineup” (Malcolm and Agnus Young, Cliff Williams (guitar, bass), Brian Johnson (vocals), Phil Rudd (drums)), they write and play their best hits, record a huge number of albums, and perform at concerts around all over the world, winning the most prestigious music awards.


In 2003, the legendary group was inducted into the Hall of Fame, and also took an honorable 5th place in the United States in terms of the number of albums sold in history. In the group's homeland, Australia, a street was named in their honor.

The inexhaustible energy of the group is admirable, which, despite its “considerable age,” never ceases to delight fans. AC/DC released excellent albums (2008 and 2014), which were greeted with jubilation by admirers of their work and sold out in huge quantities.


And neither the illness of Malcolm Young, who was forced to leave the group in 2014, nor minor problems with the law of Phil Rudd, could break the spirit of the legendary AC/DC. These are the real rockers, who will undoubtedly surprise their fans more than once, outwitting many young bands.

Sooner or later, every person is forced to face a situation where it is necessary to get to know electricity more closely than in physics lessons at school. A starting point for this could be: breakdown of electrical appliances or sockets, or just a sincere interest in electronics on the part of a person. One of the main questions to consider is how direct and alternating current are designated. If you are familiar with the concepts: electric current, voltage and amperage, you will easier to understand, what is discussed in this article.

Electrical voltage is divided into two types:

  1. constant (dc)
  2. variable (ac)

The designation for direct current is (-), for alternating current the designation is (~). The abbreviations ac and dc are well-established and are used along with the names “constant” and “variable”. Now let's look at what is their difference. The fact is that constant voltage flows only in one direction, which is where its name comes from. And a variable, as you already understood, can change its direction. In particular cases, the direction of the variable may remain the same. But, in addition to the direction, its magnitude can also change. In a constant, neither magnitude nor direction changes. Instantaneous AC current value call its value, which is taken at a given moment in time.

In Europe and Russia, the accepted frequency is 50 Hz, that is, it changes its direction 50 times per second, while in the USA, the frequency is 60 Hz. Therefore, equipment purchased in the United States and in other countries may burn out with different frequencies. Therefore, when choosing equipment and electrical appliances, you should carefully ensure that the frequency is 50 Hz. The higher the frequency of the current, the greater its resistance. You can also notice that in the sockets in our house it is AC that flows.

In addition, alternating electric current is divided into two more types:

  • single-phase
  • three-phase

For single-phase, a conductor is required that will conduct voltage and a return conductor. And if we consider a three-phase current generator, it produces an alternating voltage with a frequency of 50 Hz on all three windings. A three-phase system is nothing more than three single-phase electrical circuits, out of phase relative to each other at an angle of 120 degrees. By using it, you can simultaneously provide energy three independent networks, using only six wires, which are needed for all conductors: forward and reverse, to conduct voltage.

And if you, for example, have only 4 wires, then there will be no problems either. You will only need to connect the return conductors. By combining them, you get a conductor called neutral. It is usually grounded. And the remaining external conductors are briefly designated as L1, L2 and L3.

But there is also a two-phase one, it is a complex of two single-phase currents, in which there is also a direct conductor for conducting voltage and a reverse one, they are shifted in phase relative to each other by 90 degrees.

Application

Because DC only flows in one direction, its use is usually limited to low-energy-dense media, such as found in regular batteries, batteries for low-power appliances such as flashlights or phones, and batteries that use solar energy. But a constant source is needed not only for charging small batteries; high-power direct current is used to operate electrified railways, in the electrolysis of aluminum or in arc welding, as well as others. industrial processes.

To generate direct current of such strength, special generators are used. It can also be obtained by converting an alternating variable; for this, a device is used that uses an electron tube, it is called a kenotron rectifier, and the process itself is referred to as rectification. A full-wave rectifier is also used for this. In it, unlike a simple lamp rectifier, there are vacuum tubes, which have two anodes - dual-anode kenotrons.

If you don’t know how to determine which pole direct current flows from, remember: it always flows from the “+” sign to the “-” sign. The first sources of direct current were special chemical elements, they are called galvanic. Later people invented batteries.

Variable is used almost everywhere, in everyday life, for the operation of household electrical appliances powered from a home outlet, in factories and factories, on construction sites and many other places. Electrification of railway tracks can also be done on DC voltage. So, the voltage travels along the contact wire, and the rails are a return electrical conductor. About half of all railways in our country and the CIS countries operate according to this principle. But, in addition to electric locomotives that operate only on constant and only alternating current, there are also electric locomotives that combine the ability to operate on both one type of electricity and another.

Alternating current is also used in medicine

For example, darsonvalization is a method of applying electricity at high voltage to the outer integument and mucous membranes of the body. Through this method Patients have improved blood circulation, improved tone of venous vessels and the body's metabolic processes. Darsonvalization can be either local, in a specific area, or general. But local therapy is more often used.

Thus we learned that There are two types of electric current: direct and alternating, they are also called ac and dc, so if you say one of these abbreviations, you will definitely be understood. In addition, the designation of direct and alternating current in the diagrams looks like (-) and (~), which makes them easier to recognize. Now, when repairing electrical appliances, you will no doubt say that they use alternating voltage, and if you are asked what current is in the batteries, you will answer that it is constant.

Publications on the topic