I have to regulate a sinusoidal current in an inductor.
I have only a DC supply.
There are many ways to do it like using stepper motor driver to regulate step wise sinusoidal in 1/256th step mode.
For a specific application, I want to regulate the current by changing the duty cycle of the input PWM to a half-bridge.
If I can generate PWM pulses with a changing duty cycle in sinusoidal way then I'll be able to regulate the current.
I tried using a BeagleBone and an Arduino to generate PWM with a sinusoidal duty cycle, but wasn't able to do that. Mistakenly I had uploaded wrong drawing, now corrected.
I don't have waveform now to upload. But I can paste the beaglebone code I tried.
import Adafruit_BBIO.PWM as PWM import time import math Ain1 = "P9_14" duty=50 # initial value sin_frequency=100 pwm_frequency=10000 pwm_period = 1.0/pwm_frequency print("pwm period : ", pwm_period ) PWM.start(Ain1,0) PWM.set_frequency(Ain1, pwm_frequency) PWM.set_duty_cycle(Ain1, 0) count=0 no_pulses=(0.5*pwm_frequency)/(sin_frequency) print("number of pulses : ", no_pulses) a=1 while True: duty= abs(10.0*math.sin((3.14*count)/(no_pulses))) PWM.set_duty_cycle(pin, duty) time.sleep(0.1*pwm_period) count=count+1 print(duty) if count>=no_pulses: count = 0 duty=0 PWM.stop(Ain1) pwm.stop(Ain2) PWM.cleanup() print("Closed the pwm")