Trixbox quickstart guide1.0.0 Overview :Trixbox is an end to end digital control system design tool to perform simulations, generate controlcoefficients and control code that can be directly used with microprocessor. This tool is intended as a help togenerate the code for discrete (digitally) controlled power supplies/motor drives.Trixbox is a web based app. Hence no downloads, no upgrades etc are required. It does not requireknowledge of advanced control system design techniques and allows the user to get a workable solutionquickly without trial and error and without dealing with complex equations.Trixbox also allows users to simulate their own code while configuring the system (PWMmodulation) in almost every conceivable mode.Having said that trixbox is no substitute for experience and physical insight that may be required on a case tocase basis. Trixbox is not traditional simulation software where circuits or systems are drawn and simulated tothe last nanosecond. It’s an end to end design tool which handles many (most common) modes and systems.However every single case and quirk cannotbe handled. It is meant as an auxiliary to our consulting services.Note: Trixbox works best in fire fox and google chrome. Internet Explorer is not supported and will crash.
2.0.0 Key Features:1. Supports many topologies (presently all derived from the buck topology and boost topology)2. Automatic generation of control coefficients3. C Code generation for digital control system for fixed point DSC4. Various control and system operation modes (VSI, CSI, DCM, CCM, VMC, CMC, PCMC)5. Advanced control system design methods (description below)6. User Programmable dynamic triggering strategy7. System level simulation of user code interaction2.0.1 Description of featuresTrixbox works in 2 modes standard mode and user code modeIs the standard mode end to end control system design takes place? Starting from physical systemlevel parameters the gains are calculated, plots are generated and C code I generated withinstructions to integrate the C files.In the user code mode the user can write his/her own custom code, configure the system in a muchwider variety of ways such as variable period, valley current mode, dynamically change the on time, offtime etc.In essence any generic switching pattern can be used to drive the system and the subsequent resultscan be observed. In this mode only time domain simulation plots are generated.The sample files are the same for both the modes. Some of the data contained in the sample fileswhich may be modified by the user may or may not be relevant. However it may be left as it is ordeleted.
2.1.0 Standard mode:The following features are relevant for the standard mode and are described below.2.1.1 Topologies supportedVarious common topologies derived from the buck topology are supported. These are1. Buck2. Sync Buck3. Push Pull4. Full Bridge for inverters5. Full Bridge DC DC converter6. Phase Shift full bridge7. Half bridge for inverter8. Half bridge for DC DC9. Current fed push pull10. Boost11. Synchronous BoostBy doing slight modifications, dynamics of topologies such as series and parallel resonant circuitscan also be simulated.However the code needs to be modified to accommodate some more effects. (Needslittle customization)Other dynamic systems such as various kinds of motors can also be simulated and code generated• Servo motor drives (speed and position control) (DC, BLDC, PMSM and ACIM)• Linear actuators /solenoids (needs little customization)
In addition in conjunction with the trixbox software customized solutions can be obtained forfollowing systems(Simulation, control system design and fixed point or floating point microprocessor based code forvarious operating mode for the following systems)1. Buck topology (and derived topologies such as half bridge, full bridge, push pull, phase shift fullbridge, forward)2. Boost topology (and derived systems)3. Buck Boost topology (and derived systems such as Flyback)4. LLC series and parallel resonant topologies5. Servo motor drives (Speed and position control)6. Power factor correction using various algorithms7. BLDC, DC, AC induction, PMSM motor (censored and sensor less speed and position control)8. Linear electromagnetic actuators9. Electro capacitive motors and actuatorsThe complete list of projects and algorithms that we have experience is provided under services andtechnology.www.controltrix.com/service.htmlwww.controltrix.com/tech.html2.1.2 Automatic generation of control coefficientsThe control coefficients are generated algorithmically based on the user parameters. Various checksare also performed to ensure that the coefficients will give desired performance.
2.1.3 C code generationThe C code for digital implementation is automatically generated by trixbox software. The C code and someother relevant pieces can be easily combined to get a working code fairly quickly and easily.The C code snippets that are generated are as followsPreprocessing of ADC signals• C code performing calculations• Converting Q15 to Duty or phase values (modulation) for various topologies• Definitions of various constants (# define)• A readme file that describes how to combine the various code snippets2.1.4 Modes supportedVarious modes are supported for the relevant topologies. These are listed belowConduction modes1. Simulation and design for discontinuous current conduction mode in asynchronous topologies2. Simulation and design for continuous current conduction modeSource1. Voltage source (where the objective is to control the output voltage)2. Current source (where the objective is to control the inductor current)Control modes1. Voltage mode control2. Average Current mode control3. Peak Current mode control2.1.5 Advanced mathematical models and simulation techniquesTrixbox uses advanced algorithms to ensure better performance for your system. Some of key advantages are
as follows1. Models the physical reality better than the averaged models. Performs ideal switched simulation2. Fast proprietary simulation compared to most traditional solvers such as RungeKutta based ones.3. Code is executed and simulated in lock step (like actual system).4. Handles many digital system related quirks like zero order hold, computational delays and deadtime.5. Analytical averaged model frequency domain simulation. (No numerical instabilities and consequentincomprehensible results) as compared to traditional simulation software.2.1.6 User programmable triggering strategyTriggering the ADC at the correct instant is an important aspect of all digitally controlled Power systems. Trixboxallows the user to program the triggering strategy. The trigger point is thus calculated based on the user code.In the standard mode the switching period is fixed. The program that the user needs to write to describe thetrigger point needs to be in PYTHON syntax.Note: The syntax is mostly like C, except special care needs to be paid to indentation. Refer to followingsection for the valid format. Also for security reasons, use of special symbols and string operations areprohibited.2.2.0 User code execution modeThe user code execution mode allows the user to try out any customized code, and how it will interact withthe entire system and look at the performance.The user can configure the system in many ways.Essentially limits on Ton, Toff and period and other limiting conditions may be put. Under these limitingconditions, the user code is executed.The user code should be written in python syntax. Many special symbols and keywords are not allowed in thecode for security reasons.PYTHON is a strongly typed language. Special emphasis has to be made regarding indentation. It isrecommended that TAB is used for indenting the code.
Only time domain plots are executed when the system is in User code execution mode as (any non linear codecan also be put down by the user and frequency response will be invalid as the condition for Linear timeinvariant system may get violated).In some of the topologies when the circuit is reduced to the basic topology, the effective switchingfrequency may be different (Usually two times). This has to be kept in mind when setting limits etc.Such topologies are center tapped secondary side, current doublers secondary side, Full Bridge for inverter.Other topology also needs correction.2.2.1 Limiting modesThe user can configure the system into various limiting modes. The code that gets executed is restricted bythese modes. This allows the user to simulate variable on time, off time and PWM time.List of modes is presented .Some modes are not mutually exclusive. There is considerable overlapFixed or variable frequency1. Fixed Period or Fixed frequency mode: This is the typical mode where the period is configured andremains fixed. On time and off time may change2. Variable period or frequency modePeak Current and valley current1. Peak current based Ton reset modeActive state of the pwm is started as usual. As soon as the current hits a preset value, the PWM output is turnedinactive. When the Current is below a certain limit the state is active. When the current hits a certain limit, thePWM is made inactive for the rest ofthe period (or some other condition that again starts the timer).The peak current limit can beprogrammatically set in every interrupt.This operation is similar to cycle by cycle current limiting and peak current mode control and is also useful inhysteresis mode2. Valley current based Period set mode
The PWM runs as usual determined by perhaps other modes. As soon as the current goes below a specifiedthreshold, the period is terminated and a new switching cycle starts. This mode is useful for valley currentcontrol mode and hysteresis based control.In addition minimum and maximum limits may be placed on Ton, Toff and the period. These limits serve aslimiting conditions. These conditions may be enabled and disabledThese limiting conditions supersede any calculations that are made and take precedence. The enabling anddisabling of limits and specifying the limit values may be performed by setting the appropriate values in the‘.xlsx’ file. (please refer to getting started section).For e.g.If the maximum Ton is set to a certain value and if the current does not hit the peak value, under normalcircumstances 100 % duty will be reached. However with a maximum Ton set, the ontime will be limited to that value.3.0.0 Getting startedTrixbox is very easy to use. To start with, the user has to download a couple of files, modify them with their ownparameters and upload them.3.1.0 Input:The first file is a Excel (.xlsx) file with parameter values such as passive components, feedback network etc.You may download a sample .xlsx file from under the help tab, modify the parameter values and save it as.csv(comma delimited) file and upload in the designated space. The parameter description is provided inAppendix 3.0All parameters are not necessary and the order of the various parameters can also be changed. In factsome of the parameters may be not applicable in some of the modes. It is advisable to start from a fresh.xlsx file (found under the help tab) and modifies the relevant fields. You may even delete those which arenot required
The second (.txt) file input has a number of sections. The user may edit them based on the formatsspecified. Each section begins with xxxx<Sectionname>start and ends with xxxx<Sectionname>stopAnything written outside of the respective sections is ignored. Please do not write the keywords which specifystart and stop of a section anywhere else.The operating conditions in .xlsx file represent the time varying quantities like desired voltage (Vref), Loadcurrent (Io) , input voltage (Vin) for voltage source (where the primary control objective is output voltage).The files are essentially excel files where the data can be specified in various formats. The formats are specifiedin Appendix 1.0 at the end of this document.These are required to perform time domain simulations.The sections in .txt file are code snippets for dynamic triggering strategy. In a digital power control system thechoice of triggering the ADC (the point in the switching cycle the waveforms are sampled is very critical). Thispiece of code is directly executed for simulation. Example code snippets are specified in Appendix 2.0 thatcan be used for dynamic triggering.Also the same file can be modified to incorporate user defined code.In the user code mode the code also needs to be written as part of the ‘.txt’ file.The specified format is presented in Appendix 4.0Many parameters or sections in either .xlsx file may not be required for some particular operation. Thesevalues may be left as they are in the sample files.3.2.0 Output:Once all the data has been entered, submit should be pressed. The plots may need to be refreshed asbrowser may cache old data.The tool generates the following output:1. Bode plots for loop gain (phase margin and gain margin) for both analog and digital equivalent circuits.2. Bode plot for closed loop (closed loop performance)
3. Disturbance rejection (inverse of output impedance for voltage source and output impedance forcurrent source) bode plot (the system performance when changes in load take place. It’s an absolutemetric. The higher the value the, more robust the system is. Details in later sections.4. Time domain simulation plots include (Ripple content in voltage and current waveform,average Output Voltage, Average inductor current, Average topside mosfet current in equivalent buck/boosttopology, Average bottomside mosfet current in equivalent buck/boost topology circuit), In the beta version,these plots are limited in terms of number of points that can be simulated. The time domain simulations areonly performedfor the discrete (digital) power system.5. All the results are available in the form of the download zip file which may be plotted using aspreadsheet program such as Microsoft excel or goggle spreadsheets or open office. The data is all commaseparated values (x0, y0) (x1, y1) etc…6. Automatically generated code files i. .c code file, that needs to be integrated into your system by defining proper macros ii. .h Parameter file with control coefficients iii. Code for modulation (converting the output of the C code to duty etc) Needs to be copy pasted iv. Readme with instructions v. Log file to report any errors etc..7. The download files include, the data for all the plots, c pseudo code files (which have to be modified basedon your processor by adding macros and specific libraries for multiply etc).8. A generated readme file with description for which c file (pseudo code) needs to be used in themicrocontroller. The readme file also describes some code snippets that needs to be copy pastedinto the c file. These code snippets are basically related to modulation strategies.More code snippets for preprocessing current will be added in due course9. Readme file and log file :Please look at the readme file and log file. The readme file is dynamically generated based on thesystem. A brief overview is presented for what you should be looking for:
The generated pseudo code is in controlcode.cii. The modulation pseudo code is in mod.ciii. If secondary side modulation is required , the secondarydutygen.c has the code forsynchronous rectificationiv. The control coefficients are present in defs.hv. Various output data are present in different files in the download.zip.A description of the data in each of the filesoutputxx.txt is provided in the table below. Plot Xaxis data ( Yaxis data ( 2nd File num num 1st column) column) Plot description legend Output xx.txt xx = 01,02,03… output01.txt 1 log 10 (f) Gain in dB Loop gain bode plot [gain] Analog system loop Frequency 20 log10 (gain) Vo(s)/Verr(s) for Voltage gain magnitude (Hz) source (primary control objective output voltage) Io(s)/Ierr(s) for Current source (primary control objective is output current)
output02.txt 2 log 10 (f) Angle (degrees) Loop gain bode plot [phase] Analog system loop Frequency Vo(s)/Verr(s) for Voltage gain phase (Hz) source (primary control objective output voltage) Io(s)/Ierr(s) for Current source (primary control objective is output current)output03.txt 1 log 10 (f) Gain in dB Loop gain bode plot [gain] Digital system loop Frequency 20 log10 (gain) Vo(s)/Verr(s) for Voltage gain magnitude (Hz) source (primary control objective output voltage) Io(s)/Ierr(s) for Current source (primary control objective is output current)output04.txt 2 log 10 (f) Angle (degrees) Loop gain bode plot [phase] Digital system loop Frequency Vo(s)/Verr(s) for Voltage gain phase (Hz) source (primary control objective output voltage) Io(s)/Ierr(s) for Current source (primary control objective is output current)output05.txt 3 log 10 (f) Gain in dB Closed Loop gain bode plot Closed loop Analog Frequency 20 log10 (gain) [gain] gain (Hz) Vo(s)/Vref(s) for Voltage magnitude source (primary control objective output voltage) Io(s)/Iref(s) for Current
source (primary control objective is output current)output06.txt 4 log 10 (f) Angle (degrees) Closed Loop gain bode plot Closed loop Analog Frequency [phase] gain phase (Hz) Vo(s)/Vref(s) for Voltage source (primary control objective output voltage) Io(s)/Iref(s) for Current source (primary control objective is output current)output07.txt 3 log 10 (f) Gain in dB Closed Loop gain bode plot Closed loop digital Frequency 20 log10 (gain) [gain] gain magnitude (Hz) Vo(s)/Vref(s) for Voltage source (primary control objective output voltage) Io(s)/Iref(s) for Current source (primary control objective is output current)output08.txt 4 log 10 (f) Angle (degrees) Closed Loop gain bode plot Closed loop Digital Frequency [phase] gain phase (Hz) Vo(s)/Vref(s) for Voltage source
(primary control objective output voltage) Io(s)/Iref(s) for Current source (primary control objective is output current)output09.txt 5 log 10 (f) log(|Io(s)/Vo(s)|) for Disturbance rejection[gain] Analog system Frequency voltage source disturbance (Hz) (primary control Higher this value the stiffer rejection magnitude objective output the stiffer and better the voltage) system log(|Io(s)/Vo(s)|) for voltage source log(|Vo(s)/Io(s)|) for (primary control objective voltage source output voltage) (primary control Also the inverse of output objective output impedance current) log(|Vo(s)/Io(s)|) for voltage source (primary control objective output current) Output impedanceoutput10.txt 5 log 10 (f) log(|Io(s)/Vo(s)|) for Disturbance rejection[gain] Digital system Frequency voltage source Higher this value the stiffer disturbance (Hz) (primary control the stiffer and better the rejection objective output system magnitude voltage) log(|Io(s)/Vo(s)|) for voltage source log(|Vo(s)/Io(s)|) for (primary control objective voltage source output voltage) (primary control Also the inverse of output objective output impedance
current) log(|Vo(s)/Io(s)|) for voltage source (primary control objective output current) Output impedance output11.txt 6 Time (s) Inductor Current ripple Current ripple vs time (delta IL) pk to pk (A) output12.txt 7 Time (s) Output Voltage ripple Voltage ripple vs time (delta Vo) pk to pk (V) output13.txt 8 Time (s) Average output voltage Average voltage vs time (V) output14.txt 9 Time (s) Average inductor Average current vs time current (A) output15.txt 10 Time (s) Average Topside Average Topside Mosfet Mosfet current (A). current vs time (equivalent Buck/boost ckt) output16.txt 11 Time (s) Average Bottom Mosfet Average Bottomside Mosfet current (A) current vs time (equivalent Buck/boost ckt) output17.txt 12 Time (s) Rising current slope A/s Rising current slope vs time output18.txt 13 Time (s) Falling current slope A/s Falling current slope vs time output19.txt 14 Time (s) Peak current (A) Peak current vs time output20.txt 15 Time (s) Valley current (A) Valley current vs time4.0.0 Future additions Other converter topologies of the buck boost family Better UI Detailed Documentation5.0.0 Appendix 1: Input file formatsFormats for simulation time domain series.
There are multiple formats in which the Signals like reference voltage Vref, output current Io etc can beuploaded.For some special waveforms like sine wave, square wave etc there is a templatized version where writingonly a few lines and uploading it will generate the correct waveform internally.5.1.0 General rules 1. The first line specifies what type of wave is being generated. Sinewave, rectified sinewave, square wave, triangle wave (also almost a sawtooth wave), an interpolated wave, 2. constant or a simple time vs voltage sequence can be generated in a periodic or non 3. periodic manner. 4. Instead of letting the user just upload time value pairs, some common functions like sine, square etc have been provided which can be used in a parametric form. 5. Some assume a periodic wave needs to be generated. If a non periodic wave is required, enter a non zero very small value for frequency such as 0.1 or 0.01 Hz. 6. The .xlsx file must be opened and entries must be entered in successive lines in the space provided. 7. Save the file in .csv (comma delimited) format and upload it in the designated space. 8. The points generated will always be at the system sampling frequency used in simulation. 9. It assumes that changes in these variables time sequences always occur aligned to PWM edges. The period is always the PWM period. 10. So if PWM period is 10us and 500 points need to be generated then the system will only simulate for a duration of 5ms. 11. The number of points takes precedence over simulation time.
So even if the simulation time is larger than the time represented by number of points, the systemwill truncate before that.5.2.0 Formats:5.2.1 Sine wave/rectified sinewaveTo generate a sine wave, enter the values in the space provided under operating conditions in .xlsx file.e.g. to generate a sine wave of 100 Hz, 10 amplitude, pi/2 rad phase lag , DC offset 0 and 500 pointsenter the values in the space provided in a .xlsx file under operating conditions as below.WAVEFORM (type / shape): sineFREQUENCY (in Hz): 100AMPLITUDE (in SI units): 10PHASE (in radians): -1.159DCOFFSET (in SI units): 0NUMPOINTS (Number of points): 500Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.e.g. to generate a rectified sine wave of 100 Hz, 10 amplitude, pi/2 rad phase lag , DC offset 0 and 500points enter the values in the space provided in a .xlsx file under operating conditions as below.WAVEFORM (type / shape): rectsineFREQUENCY (in Hz): 100AMPLITUDE (in SI units): 10PHASE (in radians): -1.159DCOFFSET (in SI units): 0NUMPOINTS (Number of points): 500Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.
5.2.2 Square WaveTo generate a square wave, enter the values in the space provided under operating conditions in .xlsxfile.e.g. to generate a square wave of 100 Hz, 10 amplitude, phase advance by 0.001 s, DC offset 0, 500points and 30% duty, enter the values in the space provided in a .xlsx file under operating conditionsas below.WAVEFORM (type / shape): squareFREQUENCY (in Hz): 100AMPLITUDE (in SI units): 10PHASE (in seconds): -1.159DCOFFSET (in SI units): 0NUMPOINTS (Number of points): 500DUTY (between 0 and 1): 0.3Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.5.2.3 Triangle WaveTo generate a triangular wave, enter the values in the space provided under operating conditions in.xlsx file.e.g. to generate a triangle wave of 100 Hz, 10 amplitude, phase advance by 0.001 s, DC offset 0, 500points and 30% duty, enter the values in the space provided in a .xlsx file under operating conditionsas shown below. In this case the upward slope will be for 30% of the period and downward slope willbe for 70%.WAVEFORM (type / shape): squareFREQUENCY (in Hz): 100AMPLITUDE (in SI units): 10PHASE (in seconds): -1.159DCOFFSET (in SI units): 0NUMPOINTS (Number of points): 500DUTY (between 0 and 1): 0.3Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.
5.2.4 Subsampled sequenceSubsample sequence allows you to generate interpolated waveforms while specifying only a fewpoints.It basically performs parabolic interpolation between points, where the interpolation needs to bedisabled to generate discontinuous waveforms like steps and jagged ones.e.g. To generate a non periodic ramp passing though (0, 1) and (1, 2) and (2, 3) enter the values in thespace provided under operating conditions in .xlsx file.So instead of specifying many points, it will fit a curve through these 3 points and generate 500 pointsbased on the system sampling frequency.WAVEFORM (type / shape): subsampledFREQUENCY (in Hz): 0.01NUMPOINTS (Number of points): 500Time:value:continuity: 0, 1, 1Time:value:continuity: 1, 2, 1Time:value:continuity: 2, 3, 1Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.5.2.5 Arbitrary wave periodically sampled as a time, value pairTo enter brute force time versus amplitude in the rawest form use this. With this any arbitrarywaveform can be entered but it is also the most cumbersome. You may use some spreadsheetsoftware and then copy the data to the .xlsx. To enter 100 Hz wave with arbitrary shape enter asfollows: The sampling period is still determined by the PWM period in data set 1 as given in generalinstructions given above.In this format no interpolation (curve fitting or smoothening) is performed. The user may still entertime and value pair where time values may still be arbitrary.So if sampling period is 100us and user enter the values in the space provided under operatingconditions in .xlsx file.
WAVEFORM (type / shape): simpleseqFREQUENCY (in Hz): 100Time:value:continuity: 0, 0Time:value:continuity: 0.001, 1Time:value:continuity: 0.004, 2Time:value:continuity: 0.005, 3So for the first 10 samples (time interval of 100us between successive samples) the value will be 0.Next 30 samples the value will be 1.Next 10 samples value will be 0.This allows the user to not have to enter values for all possible data point. Without having to worryabout entering time as a multiple of PWM period. This considerably condenses the data that needsto be entered especially for waveforms with significant flat areas such as 6 step.e.g.WAVEFORM (type / shape): simpleseqFREQUENCY (in Hz): 100NUMPOINTS (Number of points): 500Time:value:continuity: 0.0001, 1Time:value:continuity: 0.0004, 4Time:value:continuity: 0.0005, 3Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.5.2.6 Constant To enter a constant, enter the values in the space provided under operating conditions in .xlsx file. E.g. To enter a constant of 10 amplitude and 500 points enter as follows. WAVEFORM (type / shape): Constant AMPLITUDE (in SI units): 10 NUMPOINTS (Number of points): 500 Note: Save the given .xlsx file in .csv (comma delimited) format before uploading.
6.0.0 Appendix 2.0: Dynamic triggering strategyUse itrig variable when referring to current loop. Usevtrig variable when referring to voltage loop.The syntax of the code should be like python language.Indentation is especially important in python. Always use tab for indentation.Any complex code may be written to accommodate triggering strategy.However string operations and many special characters are not allowed to be used.In the sample file a dummy code is already present. This may be modified as required<tab>itrig = 0Some rudimentary error reporting has been implemented. The errors get written in the log file.All units here are based on Q15 or fraction scale.32767 is 100 % or full effective period. (For topologiesDefault value is 0.Sample code for dynamic triggering e.g. 1: This will trigger at the start of the PWM period<Tab>itrig = 0Sample code for dynamic triggering e.g. 2: The below code will trigger @ 25 % of the period.<Tab>itrig = 8191Sample code for dynamic triggering e.g. 3: The below code will trigger at 50% of the duty<Tab>itrig = Duty/2Sample code for dynamic triggering e.g. 4: The following code will trigger at 10% of period beforethe duty. If duty is 50 % then the below code will trigger at 40%.itrig = Duty – 3276Similarly for changing voltage loop triggering use vtriginstead of itrig.
7.0.0 Appendix 3.0: Parameter descriptionThe following section describes all the parameters that are used to describe the system and arepresent in the ..xlsx fileAll values should be input in standard metric/SI units such as Henries, farads, seconds, ohms, volts,amperes and wattsNot all parameters may be required in all situations. The original values which are the default maybe left as they are if they are not required.7.1.0 TOPOLOGY AND SYSTEM DESCRIPTIONThe following section describes the various topology specific parameters that are usedto specify the system7.1.1 Primary topology PRMRY_TPLGYSelect the topology on the primary side.Enter the respective number in the .xlsx file in respective place Reserved 0 Buck 1 Synchronous 2 Push pull 3 4 Full bridge (for inverter) Full bridge (for DC DC) 5 Half Bridge for inverter 6 Phase Shift Full Bridge 7 Forward 8 Series resonant xx(not supported in beta version)* 9xx Half Bridge (for DCDC) 10 Current fed push pull 11 Boost 0 (in boost family mode) Synchronous Boost 1 (in boost family mode)
7.1.2 Secondary topology SCNDRY_TPLGYSelect the topology on the secondary side.For non isolated converters select not applicable.Enter the respective number in the .xlsx file in respective place Center tap rectifier 0 Current Doubler rectifier 1 Centre tap Synchronous rectifier 2 Current Doubler Synchronous rectifier 3 Voltage Doubler half bridge rectifier 4 Full bridge rectifier 5 Not applicable (N/A) -17.1.3 Primary control objective PRMY_CNTRL_OBJSelect primary control objective. If the goal is to control output voltage (irrespective of loadcurrent) select output voltage. If the goal is to control the output current (where the output voltageis determined by external factors).Enter the respective number in the .xlsx file in respective place output voltage 0 output current 17.1.4 Secondary control objective SCNDRY_CNTRL_OBJSelect Secondary control objective.E.g. usage Power factor correction output voltage. Not applicable in beta version.Enter the respective number in the .xlsx file in respective place
Output voltage 0 Output current 1 Not applicable -17.1.5 Control mode CONTROL_MODESelect Control strategy. Voltage mode control if only voltage feedback is taken. Peak current mode ifcomparator action is used to limit Duty. Refer standard texts on the above. For Current sourceconverters (where primary control objective is current) only average current mode is valid.Enter the respective number in the .xlsx file in respective place Voltage mode control 0 Average current mode control 1 Peak current mode control 27.1.6 Transformer turn ratio TURNS_RATIOA transformer is used in topologies like push pull, forward etc. Enter the turn ratio primary tosecondary.E.g. If primary number of turns is 10 and secondary is 4 then enter 10/4 = 2.5 * Note: For center tapconfiguration on the secondary side, the turn ratio to be entered is ratio of primary side to turns inone of the legs of the secondary side.7.1.7 Parallel modules or interleaved phases NUM_PAR_PHASESIn many topologies there are multiple phases running in parallel. Enter the number of parallelmodules or phases.These phases must have a common input as well as common output point.
7.2.0 PASSIVE COMPONENTSThe following section describes various passive components in the system7.2.1 Nominal value of inductance INDUCTANCEIf there are multiple paralleled modules / inductors enter the per phase inductance. If the secondaryside is current doubler circuit in some converters like Full Bridge, push pull etc, then only put thevalue of inductance of one of the phases. Does not support inductor saturation in beta release. Forcurrent fed push pull topology, enter the primary side inductance7.2.2 Output capacitance CAPACITANCEThe total output capacitance in the L-C plant. If multiple phases are present then enter the totalcapacitance at the point of load.7.2.3 Lumped series resistance LSRThe Lumped series resistance needs to be measured for the system using the following steps1. Provide constant duty such that output voltage is near operating point voltage for DC –DC application.2. Slowly increase load while measuring output voltage.3. The output voltage will droop with increasing load.4. The V vs I slope provide the lumped resistance.Refer documentation for more details7.2.4 Equivalent series resistance ESRIf multiple equivalent capacitors are present in the output. Enter value ESR/n where n is thenumber of capacitors.
7.3.0 INPUT VOLTAGEThe following sections describes the min and max input voltages7.3.1 Maximum input voltage VIN_MAXMax input voltage allowed by the converter before it enters over voltage protection7.3.2 Nominal input voltage VINThe generated code can handle wide range of input voltages but specify nominal input voltage. E.g. Ifallowed input voltage is 36-75 V then enter 55 which is somewhere in between.7.3.3 Minimum input voltage VIN_MINMinimum input voltage where the system is expected to operate reliably without entering undervoltage protection7.4.0 DSP CONFIG PARAMETERSDSP configuration specific parameters7.4.1 PWM switching frequency in Hz PWM_FREQ7.4.2 PWM clock frequency PWM_CLK_FREQPWM clock frequency determines the resolution of the PWM and plays a very important role inquantization7.4.3 Voltage loop execution rate in Hz VLOOP_INTFREQThe rate at which the voltage loops code is executed.
7.4.4 Current loop execution rate in Hz ILOOP_INTFREQThe rate at which the current loop code is executed.7.4.5 Deadtime as a fraction of PWM Period DEADTIME_FRACTIONDead time for synchronous converters.E.g. if deadtime is 1 us and period is 10 us then enter 1/10 =0.1. Enter a small value like 0.001 if notusing deadtime.7.5.0 COMPUTATION DELAYComputational delays to be modeled in the analysis is provided here7.5.1 Computational delay of the innermost loop in s INNR_LOOP_DLYThe inner most loop, in current mode control is current loop, in voltage mode control or peak currentmode control it is the voltage loop. The time between signals is sampled and duty ratio to change iscaptured in this parameter. Should be less than the relevant interrupt period / or relevant executionloopFor e.g. PWM switching period is 10 us , The sampling for feedback takes place @ 1us and the duty isupdated at the end of the period then enter 9us.(Time between sampling and actual updating ofduty). This parameter is used only for generation of bode plots.Typical values could be about half of the interrupt period or execution period when thetriggering or ADC sampling is performed properly.Worst case scenario could be 1 interrupt period.The delay is determined in real time for simulation purposes.
7.5.2 Computational delay of the outer loop in s OUTR_LOOP_DLYThe outer most loop, in average current mode control it is voltage loop. The time between signals issampled and duty ratio to change is captured in this parameter. Should be less than the relevantinterrupt period / or relevant execution loopFor e.g. PWM switching period is 10 us, The sampling for feedback takes place @ 1us and the duty isupdated at the end of the period then enter 9us.(Time between sampling and actual updating of duty). For other cases it is not relevant. This entryshould be less than the relevant interrupt period.This parameter is used only for generation of bode plots.Typical values could be about half of the interrupt period or execution period when thetriggering or ADC sampling is performed properly.Worst case scenario could be 1 interrupt period.The delay is determined in real time for simulation purposes.7.6.0 ADC AND PWM INTERFACE PARAMETERS7.6.1 Voltage feedback cutoff frequency VFBK_BWThe voltage feedback circuit will have a finite bandwidth. Voltage can only be measured reliablywithout attenuation up to certain frequencies this effects the simulation and calculation of gains.Disabled in beta version.7.6.2 Manipulator bandwidth of the system MANIP_BWLimited implementation in beta version. Should be less than or equal to PWM frequency.This factor decides how fast the manipulated input (e.g. steering wheel in a car) can be made to move.For most buck converter using switch based drives, it is about the PWM frequency used.
However for some topologies like LLC resonant, where the transformer output is connected toa bulk capacitor, the rate of change of applied voltage to the equivalent L-C plant is determineby the transformer + capacitor circuit. Hence it becomes very critical when designing controlsystem.It needs to be measured experimentally:1. Give a step change in the manipulated input. Manipulated signal = (Drive signal such as duty ratio,reference in peak current mode and period in LLC resonant circuit)2. The output voltage is then measured.3. By using manipulator BW = 1/2/π/τ where τ is the time taken to reach 60 % of the change in thevoltage applied to the LC plantFor e.g. consider an LLC circuitThe system is controlled by changing the frequency or period of the PWM. Suppose the period ischanged from 5 to 4.5 micro seconds as a step change suddenly. The resulting voltage on thecapacitor bank on the secondary side also changes.The voltage applied to the LC plant at the output (Not the LLC impedance on the primary side) is thevoltage across the capacitor bank after the rectifier on the secondary side. If the voltage changesfrom 4.5 V to a final value of 5 V in 1ms then, on the scope measure the time taken by the system toreach 0.63* (5 - 4.5) = 0.325 V change from the initial level.Suppose this time is found to be 700 us Then the manipulator bandwidth is given by1/2/π/700e-6 ~ 250Hz.This is like your steering wheel. The system cannot respond any faster than the steering wheel can beturned. If the steering wheel turns too slowly, it doesn’t matter how good the driver is.In performing the control system design, low manipulator bandwidth is required to be handled.
7.6.3 Triggered or Average TRIG_OR_AVGIndicates that the ADC feedback is triggered at a certain instant or the averaged quantity(Significant R-C time constant feedback network is present) is used for current measurement. Triggered 0 Average 17.7.0 DESIRED SPEC7.7.1 Maximum allowable steady state voltage errorVERROR_STEADYSTATE_MAXSuppose the voltage needs to be 5 V with +/- 1% regulation. Then, enter 5 *0.01 = 0.05 V. This is themaximum steady state error that can be tolerated.It cannot be less than 0.1% because the ADC resolution is fixed at 10 bits (~0.1 %).Suppose the voltage needs to be 5 V with +/- 1% regulation. Then, enter 5 *0.01 = 0.05 V. This is themaximum steady state error that can be tolerated.It cannot be less than 0.1% because the ADC resolution is fixed at 10 bits (~0.1 %)7.8.0 ADC7.8.1 Base voltage for output voltage VOUT_BASEEnter the base voltage for the output voltage when using 10 bit ADC, the amount of actual voltagethat will generate full range ADC readout (1023) in the microprocessor.When there are offsets involved in the feedback path, then it can be defined as delta V / (1 unitchange in 10 bit ADC reading) * 1024e.g. 12V reads 700 counts in ADC and no offsets are present in the feedback circuit then EnterVbase as 12/700*1024 = 17.55 VIf there is a 512 count offset. ( 0 V will still read as 512) and 12 V reads as 700Delta V is 12 V
Delta ADC counts is (700 -512) = 188Enter Vbase as 12/188*1023 = 60. 5 VDo not enter 07.8.2 Base Current used to calculate all current quantities IBASEBase current which is used to normalize all current quantities. Used in average current mode controlWhen using 10 bit ADC, the amount if actual voltage that will generate a full range ADC readout in themicroprocessor.When there are offsets involved in the feedback path, then it can be defined as delta I /(1 unit changein 10 bit ADC reading) * 1024Suppose e.g. 12 A reads 700 counts in ADC and no offsets in the feedback ckt then, Enter base as12/700*1024 = 17.55 VIf there is a 512 count offset. (0 A will still read as 512) and 12 A read 700 Delta I is 12A DeltaADC counts is (700 -512) 188 Enter I base as 12/188*1023 = 60.5 AI base may not be relevant for voltage mode control, yet enter some positive value. I base is alsoused for peak current mode control.For this mode, In the above calculations replace ADC with DAC counts. Presently works for 10 bitDAC!! Do not enter zero even if it is N/A.7.8.3 Base voltage for Input voltage VIN_BASEEnter the base voltage for input voltage. The base voltage is defined as below. When using 10 bit ADC,the amount of actual voltage that will generate a full range ADC readout (1023) in the microprocessor.When there are offsets involved in the feedback path, then it can be defined as delta V /(1 unit changein 10 bit ADC reading) * 1024
e.g. 12V reads 700 counts in ADC and no offsets are present in the feedback circuit then EnterVbase as 12/700*1024 = 17.55 VIf there is a 512 count offset. ( 0 V will still read as 512) and 12 V reads as 700Delta V is 12 VDelta ADC counts is (700 -512) = 188Enter Vbase as 12/188*1023 = 60.5 V Do notenter 07.8.4 Operating point output voltage in Discontinuous Conduction ModeOP_VOUTThe control system when the system is in discontinuous conduction mode of operation (inasynchronous converters) will be designed around this operating point.The control system will behave as designed only around this point.The farther the system state moves from this point, more and more the system will behave in adifferent manner.7.8.5 Operating point Duty ratio for Discontinuous Conduction ModeOP_DUTYEstimated operating point duty ratio in Discontinuous conduction mode (DCM) operation ofasynchronous converters.Disabled in beta version. Enter some value between 0 and 220.127.116.11 Operating point Current for discontinuous conduction modeOP_CURRENTThe control system when the system is in Discontinuous conduction mode of operation (inasynchronous converters) is designed around this operating point current.
The control system will behave as designed only around this point. The farther the system statemoves from this point, more and more the system will behave in a different manner.7.9.0 DRIVE LIMITSParameters to limit the drive between maximum and minimum values7.9.1 Maximum duty ratioDUTY_MAXThe drive to the equivalent buck/boost converter will be limited to this number. Used to generatecode and time domain simulation. Enter a number between (0 and 1) to limit the drive.DMax should be > DMin7.9.2 Minimum duty ratio DUTY_MINThe drive to the equivalent buck/boost converter will be limited to this number. Used togenerate code and time domain simulation.Enter a number between (0 and 1) to limit the drive. DMaxshould be > DMin7.9.3 Maximum currentref I_MAXThe drive in peak current mode control to the equivalent buck/boost converter will be limited to thisnumber. Used to generate code and time domain simulationEnter a number between (0 and 1) to limit the drive. DMaxshould be > DMin7.9.4 Minimum currentref I_MINThe drive in peak current mode control to the equivalent buck/boost converter will be limited to thisnumber. Used to generate code and time domain simulation. Enter a number between (0 and 1) tolimit the drive. DMax should be > DMin
7.10.0 INITIAL VALUESInitial values of state variables7.10.1 Vo initial value VOUT_INITInitial value of output voltage for time domain simulation7.10.2 IL initial value IL_INITInitial value of inductor current for time domain simulation7.11.0 CONFIDENCE LEVELS OR ACCURACY7.11.1 Confidence factor in voltage measurement VOUT_ACCThis parameter is called decoupling. The decoupling is performed for all converters operating incontinuous conduction mode of operation. For peak current mode control this is N/A. This factor isused to judge the tolerance of the system in the simulation.Practical values are 0.9 to 1.1. 1 is ideal case (in real systems it’s never so)0.9 means that the estimated or measured value of voltage is only 90% of the actual voltage1.1 means that the estimated or measured value of voltage is 110% of the actual voltage7.11.2 Confidence factor in Equivalent series resistance andcapacitance TAU_CZ_ACCThe ESR and capacitance have a time constant that effects (complicates) the dynamics and limits thesystem performance. It can be compensated if it is somewhat known. Enter 0.01 if it is almostunknown, Enter 1 if it is perfectly known. Enter 0.8 if the estimated value is 20% less than actual valueEnter 1.2 if the estimated value is 20% more than actual value Practical values 0.7 to 0.9 or 1.1 to 18.104.22.168.3 Confidence factor in Lumped resistance RP_ACCThe value of lumped resistance (which was experimentally measured) may be underestimating oroverestimate. This uncertainty is captured here Enter 1 if it is perfectly known. Enter 0.8 if the
estimate is 20 % less than the actual one Enter 1.2 if the estimate is 20 % more than the actual one.Practical value may fall in the following ranges (0.7-0.9) and (1.1 to 1.3)7.12.0 PLOTTING AND DATA VISUALIZATION7.12.1 Number of points in the range (Fmin and F max) spaced logarithmicallyBODE_NUM_POINTSFor the bode plot generation the data for the bode plots will be generated for approximately thesemany instances. A typical number could be in the range of 100 to 3007.12.2 Minimum frequency for bode plot generation BODE_FMINMinimum frequency or lower limit of bode plots7.12.3 Maximum frequency for bode plot generation BODE_FMAXMaximum frequency or upper limit of bode plots7.13.0 SIMULATION7.13.1 Simulation time in s SIM_TIMETime for which the simulation will run. Enter less than 10000 PWM cycles for response in reasonabletime frame. e.g. for a converter operating @ 100 KHz frequency, we can enter 0.1 s Enter less than400*switching frequency for beta version.7.14.0 ROOTS EIGEN VALUES OR POLES7.14.1 F1 Desired pole, eigenvalue or root of characteristic equation. F1 >F2 >F3ROOT17.14.2 F2 Desired pole, eigenvalue or root of characteristic equation. F1 >F2 >F3ROOT27.14.3 F1 Desired pole, eigenvalue or root of characteristic equation. F1 >F2 >F3ROOT3
Guidelines in choosing the value of F1, F2 and F3Keep F1 < 1/7th the sampling and the code execution frequency. F1 < 1/10th the samplingfrequency is even better 1. Keep separation between F1, F2 and F3 to account for parameter tolerances. A factor of 2 to 3 or more between them would suffice e.g. 900,300, and 100 2. All frequencies F1, F2 and F3 should be different from one another 3. In some cases only 1 or 2 roots may be required. Even then enter some value different. 4. For voltage mode control for voltage source converter F1 becomes the cutoff 5. For current mode control for voltage source converter F2 becomes the voltage loop bandwidth, crossover freq etc. 6. For peak current mode control F1 is voltage loop bandwidth, crossover frequency etc. 7. For current mode control for current source F1 is the current loop bandwidth, crossover freq etc. 8. In some modes not all F1, F2 and F3 are required. The user may still enter them.7.15.0 MODE PARAMETERS 1 = ENABLED and 0 =DISABLEDIn the user code mode the following parameters are used7.15.1 Enable/Disable fixed period modeFIXED_PERIODWhen this mode is enabled the period or switching frequency is always fixed. The user code may setthe duty as a fraction of this value. In this mode Ton + Toff (the time of PWM activeand inactive states) is always constant specified. ENABLED 1 DISABLED 07.15.2 Enable/Disable Cycle by cycle peak current limit mode IPEAK_TON_RESETWhen this mode is enabled the system enters cycle by cycle peak current limit mode. At the onsetof the period, the PWM is driven to active state as usual. When the current crosses a limit, (whichmay be set dynamically and programmatically) the PWM is driven inactive where it remains till theend of the PWM period. This mode may be operated with or without FIXED_PERIOD and
IVALLEY_TOFF_RESET. ENABLED 1 DISABLED 07.15.3 Cycle by cycle valley current limit mode IVALLEY_TOFF_RESETWhen this mode is enabled, the PWM period is reset whenever the valley current falls below a limit.The limit may be changed programmatically and dynamically by the user code. When the eventoccurs the PWM is driven to an active state. This mode works with and without enablingFIXED_PERIOD. ENABLED 1 DISABLED 07.16.0 LIMIT PARAMETERS 1= LIMIT and 0 =DISABLEDThese parameters enable and disable the min and max values. If these parameters are enabledthen the respective time quantity is bounded. For e.g. if TONMAX is enabled, then TON will always beless than Tonmax limit set next. Though user code may also do some software protection to limitthese values, Sometimes a hardware limit is desirable. The following parameters are mainly used forprotection purposes in real systems.7.16.1 Enable PWM active state (Ton) minimum limit TONMINIf enabled, will limit the minimum Ton (time of PWM active state) to TONMIN_VAL. ENABLED 1 DISABLED 07.16.2 Enable PWM active state (Ton) maximum limit TONMAXIf enabled, will limit the minimum Ton (PWM active state) to TONMAX_VAL
ENABLED 1 DISABLED 07.16.3 Enable PWM inactive state (Toff) minimum limit TOFFMINIf enabled, will limit the minimum Toff (PWM inactive state) to TOFFMIN_VAL ENABLED 1 DISABLED 07.16.4 Enable PWM inactive state (Toff) maximum limit TOFFMAXIf enabled, will limit the maximum Toff (PWM inactive state) to TOFFMAX_VAL ENABLED 1 DISABLED 07.16.5 Enable PWM period (Tpwm) minimum limit TPWMMINIf enabled, will limit the minimum Tpwm (PWM period) to TPWMMIN_VAL. Only valid whenFIXED_PERIOD is DISABLED. ENABLED 1 DISABLED 07.16.6 Enable PWM period (Tpwm) maximum limit TPWMMAXIf enabled, will limit the maximum Tpwm (PWM period) to TPWMMAX_VAL. Only valid whenFIXED_PERIOD is DISABLED. ENABLED 1 DISABLED 0
7.17.0 LIMITING VALUESThe following parameters allows the user to specify the limits on Ton, Toff and Tpwm. These valuesbecome relevant when the respective LIMIT parameters are enabled. All values are in seconds.These limits are typically relevant for safety and protection of the system. They only come intoeffect when the corresponding LIMIT parameter is ENABLED.7.17.1 Lower limit of Ton TONMIN_VAL7.17.2 Upper limit of Ton TONMAX_VAL7.17.3 Lower limit of Toff TOFFMIN_VAL7.17.4 Upper limit of Toff TOFFMAX_VAL7.17.5 Lower limit of Tpwm TPWMMIN_VAL7.17.6 Upper limit of Tpwm TPWMMAX_VAL7.18.0 ADC AND INTERFACE PARAMETERSThese are required to simulate the effect of quantization due to ADC bit resolution7.18.1 Digital to analog converter/comparator input DAC_FULLRANGEFull range counts of the DAC used for comparing in peak and valley current mode. For 10 bit it is 1024and so and so forth. Essentially in peak current and valley current mode, the reference has to be saidprogrammatically. The reference number (in software) needs to be converted to a analog signal by adigital to analog convertor for cycle by cycle limit. This parameter captures the resolution of the DAC.
7.18.2 Analog digital convertor full range ADC_FULLRANGEFull range counts of the ADC used for sampling feedback signals. For 10 bit ADC it is 1024 and so andso forth. In any digital control system, the analog feedback has to be sampled and converted intodigital value. The resolution of the sampling process is governed by this parameter.8.0.0 Appendix 4.08.1.0 User code format (Only relevant for user code simulation mode)In the user code mode, the user can simulate his own code. The following section describes the codeformat.The code has to follow PYTHON syntaxSome key features are as followsPython is a strongly typed language which means that indentation (space at the start of each line isvery critical)The code has to be properly indented.The code should not contain special characters such as ; ‘ ,” .characters such as ‘[‘ and ‘]’square brackets are allowedThe code should be a mathematical code. No string or shell utility based operations are allowedThe only variables allowed are Vrbl,Vrbl and so on till Vrbl. Vrbl isan array of size 200.
The user code is essentially a function that gets called every interrupt.In conjunction with the physical system model, the entire system is thus simulated.In the PYTHON programming language, variables have local scope by default. So any variable stored will bewiped off every time the function is called. Hence it is impossible to implement anything with memory withinthese rules. Therefore an array Vrbl is passed to the function. Any values stored in the Vrbl array remains as itis next time the function is called.The code structure is typically as followsThe various real world signal feedback are copied into local variables. User codewhere various calculations etc may be performed.Finally the outputs are dumped into another set of variables which are returned by the function toperform simulation.An example code is provided here<tab> Vrbl = 3000<tab> Toncounts = Vrbl<tab> Toffcounts = 6700<tab> Tpwmcounts= 10000<tab> DutyQ15 = 10000<tab> Ipkrefcounts = 0<tab> Ivlrefcounts = 0<tab> ilooptrigQ15 = 0<tab> vlooptrigQ15 = 0
The variables which are returned such as ‘Toncounts’ , ’Toffcounts’ automatically get declared whenthey are called unlike a typical C implementation. Hence these assignment statements before returnsuch asToncounts = 1000 etc are critical.The right hand side of the assignment statement may change based on user desire, but the left handside of the = sign should remain as they are.Essentially all the user has to write the code, and get the numbers into a set of variables such asVrbl ,Vrbl…Then these values may be assigned to the return group of variables likeToncounts etc.The system should be handling any valid user code under the framework defined for usercode.8.2.0 Description of return group of variablesThe following is the list of return variables and their description.8.2.1 Toncounts :The on time Ton in counts. E.g. if Ton is 1us and PWM resolution is 1ns thenToncounts will be 1000.Toncounts is at the same scale as duty registers such PDCx in microchip processorsdspic33fjxxgsxxx
8.2.2 Toffcounts :The off time Toff in counts.E.g. if Toff is 1us and PWM resolution is onces then Toffcounts will be 1000.Toffcounts is at the same scale as duty register.Toffcounts is at the same scale as duty registers such PDCx in microchip processorsdspic33fjxxgsxxx8.2.3 Tpwmcounts :The time period in countsE.g. if Toff is 1us and PWM resolution is 1ns then Toffcounts will be 1000.Toffcounts is at the same scale as period register.8.2.4 DutyQ15 : Duty value as a fraction expressed in Q15 format.E.g. If duty ratio needs to be 0.5 then DutyQ15 will be 163838.2.5 Ipkrefcounts : Peak current value as counts in the systemWhen using mode that requires DAC based peak current, then the value used in DAC registerE.g. If 1A corresponds to 1024 counts in user hardware system, then to enter 0.5 A as the peak limitthe value should be 5128.2.6 Ivlrefcounts : Valley current value as counts in the systemWhen using mode that requires DAC based valley current, then the value used in DAC register. E.g. If 1Acorresponds to 1024 counts in user hardware system, then to enter 0.5 A as the valleyLimit the value should be 512.
8.2.7 ilooptrigQ15 : Trigger value as a fraction of period for current samplingThe ADC for current related quantities are triggered and measured at this instant. It isexpressed as a fraction of the period Q15 format.E.g. suppose the current needs to be triggered at 10 % of the period (Tpwm value). Then this variableshould be round (32768 * 0.1) = 32778.2.8 vlooptrigQ15 : Trigger value as a fraction of period for voltage samplingThe ADC for voltage related quantities are triggered and measured at this instant. It isexpressed as a fraction of the period Q15 format.E.g. suppose the voltage needs to be triggered at 10 % of the period (Tpwm value). Then this variableshould be round (32768 * 0.1) = 3277