News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

PWM feedback and variable frequency

Started by Abdullah, Aug 31, 2025, 06:04 PM

Previous topic - Next topic

Abdullah

Hello everyone I need A program for HPWM 7khz to 40khz if input volt is > 100
then HPWM = 7KHZ else 20khz if input volt is > 150 then HPWM = 10KHZ else 20khz
if input volt is > 200 then HPWM = 15KHZ else 20khz if input volt is > 250 then HPWM = 20KHZ else 20khz if input volt is > 300 then HPWM = 40KHZ else 20khz and output volt control to the duty cycle as A feedback using 16f684

Pepe

I think you should do it and in any case ask for help if something doesn't work. Without effort and research, you can't learn new things. It's very easy to ask and have others solve your problems.

Stephen Moss

I agree with @Pepe
Are you sure that what (from your question) your want to do is the correct approach? Do you even understand PWM?

I ask because ususally the PWM frequcny is fixed and you adjust the cycle to change the amount of energy/voltage output, if you change the frequency then the duty factor changes as well to get the same energy out (50% modulation depth at 10Khz is not the same enery as 50% at 20Khz), that is a lot of refactoring.

Also, it looks like you fallback postion which I presum is for < 100V is 20KHz, and you say > 250V is also 20KHz, perhaps there is a reason for it but it does not seem logical to use the same frequency for both. 

Abdullah

Yes Sir but I don't know how can feedback work and how can variable frequency can work and how l can create variable frequency in difference state because I don't know about that I need a demo to learn because I don't have a teacher to teach me about positron compiler I am only a new student you all are my teachers I have a small idea how to make a pwm but I don't know what is the command of variable frequency and feedback to control out put volt sorry for disturbing

Abdullah

Quote from: Stephen Moss on Aug 31, 2025, 07:53 PMI agree with @Pepe
Are you sure that what (from your question) your want to do is the correct approach? Do you even understand PWM?

I ask because ususally the PWM frequcny is fixed and you adjust the cycle to change the amount of energy/voltage output, if you change the frequency then the duty factor changes as well to get the same energy out (50% modulation depth at 10Khz is not the same enery as 50% at 20Khz), that is a lot of refactoring.

Also, it looks like you fallback postion which I presum is for < 100V is 20KHz, and you say > 250V is also 20KHz, perhaps there is a reason for it but it does not seem logical to use the same frequency for both. 
Yes sir this is idea for boost converter using in Soler inverter input 100V to 400V and output 230V AC. booster good work with to Soler panels in 7khz and good work in 20khz in 4 panels

Abdullah

Quote from: Abdullah on Aug 31, 2025, 08:15 PM
Quote from: Stephen Moss on Aug 31, 2025, 07:53 PMI agree with @Pepe
Are you sure that what (from your question) your want to do is the correct approach? Do you even understand PWM?

I ask because ususally the PWM frequcny is fixed and you adjust the cycle to change the amount of energy/voltage output, if you change the frequency then the duty factor changes as well to get the same energy out (50% modulation depth at 10Khz is not the same enery as 50% at 20Khz), that is a lot of refactoring.

Also, it looks like you fallback postion which I presum is for < 100V is 20KHz, and you say > 250V is also 20KHz, perhaps there is a reason for it but it does not seem logical to use the same frequency for both. 
Yes sir this is idea for boost converter using in Soler inverter input 100V to 400V and output 230V AC. booster good work with to Soler panels in 7khz and good work in 20khz in 4 panels
I have a booster and I check it that's work in 7khz to 40khz with defrance input volt

charliecoutas

Surely solar panels produce DC? Is the frequency you talk about that of a DC to AC converter? The frequencies seem a bit low but it seems possible? So as the DC input from the panels change, the DC to AC converter also changes frequency? Then another converter changes it to AC mains frequency? Just a few thoughts....

Charlie

Abdullah

Quote from: charliecoutas on Today at 07:36 AMSurely solar panels produce DC? Is the frequency you talk about that of a DC to AC converter? The frequencies seem a bit low but it seems possible? So as the DC input from the panels change, the DC to AC converter also changes frequency? Then another converter changes it to AC mains frequency? Just a few thoughts....

Charlie
Yes sir I'm use A boost converter the convert DC voltage 100 to 300 into 350v DC voltage and A use DC to AC converter H brigh AC 230 volt AC 50hz
So I need a demo code they work 100 to 300v DC of Soler panels 2 panels to 6 panels boost converter maintain DC voltage and still output 350v DC

Abdullah

Sorry for All teachers because my poor English language I speak only Urdu

Fanie

Making mains power off solar is not that simple.  There are a lot of factors to keep in check, the frequency, mains voltage regulation, the output sine wave has to be monitored and switched all in check with a possibly changing/varying DC input voltage (ie clouds etc) as well as monitoring the current supplied by the inverter in case of shorts and over current situations.
Unless you plan to make a very crude and basic inverter (for what ?) the 16F684 is not going to make it.