SEPIC Converter with Power Factor correction with LTSpice

Thread Starter

Simsphilly

Joined May 27, 2019
3
Hello,
I'm new to this forum and I have registered as I believe I could receive some great tips from you all.

I have the objective to design a SEPIC converter with power factor correction using LTSPice.
I would like to design it using the coding (ASCII file) and not using the schematic.
I'm having trouble to find documentation on how to code the power factor correction and PWM for my circuit.
I do have coded my circuit with all components but I'm stuck with the PWM/PFC loop control.
I do not find any documentation about ASCII codes. I only learned it the basics from my teacher last term in class. No control loop though.

Would anyone know where to find such documentation to code in a ASCII file?

Thank you in advance for your feedback.
 

Papabravo

Joined Feb 24, 2006
21,225
You need to do a better job of defining your requirements.
Let us start with output power, voltage, and current
Design efficiency of the conversion process
Input power, voltage, and current
Where is the power factor correction to be applied, and more importantly why do you think this will be necessary
Using the ASCII text file for this design is a highly dubious choice. It will definitely prevent you from achieving your goal efficiently.

My recommendation(s)
  1. First make it work, i.e. use the schematic
  2. Then make it elegant/portable/ whatever, by editing the text file
 

crutschow

Joined Mar 14, 2008
34,412
Why on earth would you want to make the design so much more difficult by not using schematic capture for the simulation.o_O
I started out with Spice using text input encoded on punch cards on an IBM mainframe, well before schematic capture was available, and I would never want to go back, anymore than I would want to go back to my slide rule.
Schematic capture makes the simulation at least an order of magnitude simpler to do.
 

Thread Starter

Simsphilly

Joined May 27, 2019
3
Dear Papabravo and crutschow,

Thank you very much for your feedback. Much appreciated. Unfortunately, the coding part without using the schematic is a requirement from my professor for my research. It has a training purpose.
I have already design my SEPIC PFC using Matlab and it works fine.
I have posted in this forum to know if you would know where I could find DOCUMENTATION about ASCII text file in order to code the "Current Loop Feedforward" control which helps achieving PFC and PWM. I have attached a screenshot of my Matlab schematic where you can see the control loop that drive my gate signal
This is this control loop that I'm trying to code into LTspice.

Would you know if a documentation exists that would explain how to code the different part you can see in my control loop for gate signal?

Thank you again

Sims
Screen Shot 2019-05-28 at 12.05.09 PM.png
 

crutschow

Joined Mar 14, 2008
34,412
It's not clear what type of elements you expect to represent with the "ASCII text"?
Do you want to simulate with actual electrical elements such as resistors, capacitors, transistors and IC's?
If so, I can't understand why your professor would want you to use an ancient technique of ASCII text to perform that function, which would serve no useful learning purpose.
It's like being told to use a slide-rule instead of a calculator.
You might try looking up "Spice simulator syntax" for some info on how Spice used to be coded.
 

Thread Starter

Simsphilly

Joined May 27, 2019
3
Thank you for your feedback.
Yes I do 100% agree with you... I wish I was allowed to use the schematic.
But I can't argue with him on this.

If you look at my gate's control, I'm trying to code it and I would see it like this (like I would do with C code)

CODE:

measure abscise of AC input signal |Vac|

1) upper branch
-Apply gain K on this magnitude
- 1 minus K*|Vac|

2) lower branch
-Apply gain K on this magnitude
-Subtract current i-L1
-do proportional integration

3) connection upper and lower branch
- Sum of both output
- Compare result with a specific triangle waveform (>=) i.e if > then apply 1 to gate, if not apply 0 to gate.
- output goes into gate and this will control my duty cycle that will constantly adjust due to my AC input signal.

I would like to type this into my text file. I don't know the syntax of it. It should be somehow similar to coding in Matlab I believe.
I will be looking at "Spice simulator syntax" per your recommendation.

My prof is convinced this is the simplest way to do using some "if" conditions. Though schematic sounds more appropriate to me as you suggest.

Hope this make some sense to you.

Thank you again.
 

Papabravo

Joined Feb 24, 2006
21,225
Dear Papabravo and crutschow,

Thank you very much for your feedback. Much appreciated. Unfortunately, the coding part without using the schematic is a requirement from my professor for my research. It has a training purpose.
I have already design my SEPIC PFC using Matlab and it works fine.
I have posted in this forum to know if you would know where I could find DOCUMENTATION about ASCII text file in order to code the "Current Loop Feedforward" control which helps achieving PFC and PWM. I have attached a screenshot of my Matlab schematic where you can see the control loop that drive my gate signal
This is this control loop that I'm trying to code into LTspice.

Would you know if a documentation exists that would explain how to code the different part you can see in my control loop for gate signal?

Thank you again

Sims
View attachment 178417
You professor is being a horse's rear end for no discernible pedagogical purpose, and you may quote me on that.
 

Papabravo

Joined Feb 24, 2006
21,225
Thank you for your feedback.
Yes I do 100% agree with you... I wish I was allowed to use the schematic.
But I can't argue with him on this.

If you look at my gate's control, I'm trying to code it and I would see it like this (like I would do with C code)

CODE:

measure abscise of AC input signal |Vac|

1) upper branch
-Apply gain K on this magnitude
- 1 minus K*|Vac|

2) lower branch
-Apply gain K on this magnitude
-Subtract current i-L1
-do proportional integration

3) connection upper and lower branch
- Sum of both output
- Compare result with a specific triangle waveform (>=) i.e if > then apply 1 to gate, if not apply 0 to gate.
- output goes into gate and this will control my duty cycle that will constantly adjust due to my AC input signal.

I would like to type this into my text file. I don't know the syntax of it. It should be somehow similar to coding in Matlab I believe.
I will be looking at "Spice simulator syntax" per your recommendation.

My prof is convinced this is the simplest way to do using some "if" conditions. Though schematic sounds more appropriate to me as you suggest.

Hope this make some sense to you.

Thank you again.
This would make some kind of rudimentary sense if there was a software package that could do something with that input. Other than that you and your professor would have to agree that if such a package exists this is what the input might look like. You should be careful about making this proposal next he will ask you to implement such a simulator so he can take all the credit for it. If I were you I would tell him to pound sand and find another less mercenary teacher and mentor.

If you have access to Matlab, you may also have Simulink which may or may not provide an avenue for expressing such systems in a way that can be usefully evaluated. If you don't have access to Simulink there may be a freeware alternative.
 

crutschow

Joined Mar 14, 2008
34,412
Spice seems to be an inappropriate choice for what your prof wants.
I'm beginning to suspect he really doesn't understand what Spice is for or how it functions.
SPICE stands for "Simulation Program with Integrated Circuit Emphasis".
Note the bolded words.
It is not a general purpose or functional simulator.
 

Papabravo

Joined Feb 24, 2006
21,225
Spice seems to be an inappropriate choice for what your prof wants.
I'm beginning to suspect he really doesn't understand what Spice is for or how it functions.
SPICE stands for "Simulation Program with Integrated Circuit Emphasis".
Note the bolded words.
It is not a general purpose or functional simulator.
Excellent point. A professor cannot be expected to know every software package out there. We all know how overworked and underpaid they are. Especially the ones doing the teaching.
 
Top