# Turn square wave of any duty cycle to a square wave with a 50% duty cycle

#### icantalktosneks

Joined Apr 23, 2021
36
Is there a way of turning a square wave signal of any duty cycle to a square wave with a 50% duty cycle (and same frequency)?

I'm trying to make a self-oscillating tesla coil driven with a PWM signal with a duty cycle of 50%. The PWM signal drives a full-bridge inverter, while the feedback signal is obtained via an antenna. But the feedback signal I receive doesn't have the same duty cycle. Is there a way of changing its duty cycle to 50% to drive the tesla coil?

For example, shown above in green is the actual signal I need to drive the tesla coil. The signal in red is the feedback signal I'm receiving.

I've also attached the ltspice simulation for clarity.

#### Attachments

• 5.4 KB Views: 4

#### Alec_t

Joined Sep 17, 2013
14,014
Is the feedback signal frequency fixed (albeit with varying duty cycle)? If so you could frequency-double it, then use the doubled frequency to clock a toggling latch to get back the original frequency with 50% duty cycle.

#### StefanZe

Joined Nov 6, 2019
191
You could divde the frequency by 2 (toggle on one of the flanks) and then use a PLL to double the frequency.
The output of the PLL should be your desired frequency with a 50% duty cycle

#### crutschow

Joined Mar 14, 2008
33,370
you could frequency-double it
How would you do that so the output FF gives a 50% duty-cycle?

#### crutschow

Joined Mar 14, 2008
33,370
You could divde the frequency by 2 (toggle on one of the flanks) and then use a PLL to double the frequency.
Why half the frequency?
I would think the PLL would operate with the PWM signal as is for its input.

#### Alec_t

Joined Sep 17, 2013
14,014
How would you do that
PLL if the frequency is not fixed. But if the feedback signal is a fixed known value then a simple pulse generator could do the job.

#### BobTPH

Joined Jun 5, 2013
8,157
I'm trying to make a self-oscillating tesla coil driven with a PWM signal with a duty cycle of 50%
Why?

What is the oscillator frequency and the driving frequency? Are they related?

#### StefanZe

Joined Nov 6, 2019
191
Why half the frequency?
I would think the PLL would operate with the PWM signal as is for its input.
Most PLLs need a duty cycle of 40-60%.

#### StefanZe

Joined Nov 6, 2019
191
Why?

What is the oscillator frequency and the driving frequency? Are they related?
The oscillator frequency is the self resonance frequency of the tesla coil. The driving frequency should be equal to the self resonance frequency in this case.

#### BobTPH

Joined Jun 5, 2013
8,157
Then it is not self oscillating. A self-oscillating coil would not be driven another oscillator, it would be part of the oscillator circuit.

Can you explain why you would drive it with a square wave at its resonant frequency? That does not sound right to me.

A traditional Tesla coil is driven by a sharp pulse (capacitor discharging through a spark gap) at a much lower frequency than the resonance.

#### StefanZe

Joined Nov 6, 2019
191
Then it is not self oscillating. A self-oscillating coil would not be driven another oscillator, it would be part of the oscillator circuit.

Can you explain why you would drive it with a square wave at its resonant frequency? That does not sound right to me.

A traditional Tesla coil is driven by a sharp pulse (capacitor discharging through a spark gap) at a much lower frequency than the resonance.
You can drive a tesla coil without the capacitor, but you need to know the resonance frequency.