A_Tareq
Newbie level 4
Hi ,
or Hi Mr. Peter (tpetar),
I have PIC18F45k22 with DAC MCP4922, I need to design a feedback controller for my INverter 12V Dc to out put of max 9v peak AC 50Hz, sinewave, I use LC filters and at the output to make read by PICMICROPIC 18f45k22 at AN2 channel , I use feedback gain of =0.1 and a noninverting level shifter .In my circuit I also use external ac voltage source of 0.6v peak Approx 50Hz again level shifted and at channel AN0 I make it read and then in my code I generate err signal, and then I neeed to implement the controller in C code, My Compiler is MIKRO C for PIC , I use only C code donot know good assembly,
I designed the controller for my inverter in Z domain, it works perfect in simulation with MATLAB:
here is the TF in z domain :
0.78834*10*( z^2 - 1.808*z + 0.968)
____________________________________
Z*( z^2 - 0.9583*z - 0.04167 )
my triangular or modulating signal has 10kHz freq so mosfets are switched at that freq and peak to peak is 4V, sample time for z domain in the above controller i have 100uS,
Now the Problem starts here: I could not write my C code for this Z domain TF , what Primarly I need is just to write C code for any given order( higher than
2) in Z domain, where the order of numerator is less than or equal to the Order of Denominator
I use Simulation Software Proteus before I breadboard my project.
So , you have the knowledge, so please help me with that.
Thanks
A_tareq
or Hi Mr. Peter (tpetar),
I have PIC18F45k22 with DAC MCP4922, I need to design a feedback controller for my INverter 12V Dc to out put of max 9v peak AC 50Hz, sinewave, I use LC filters and at the output to make read by PICMICROPIC 18f45k22 at AN2 channel , I use feedback gain of =0.1 and a noninverting level shifter .In my circuit I also use external ac voltage source of 0.6v peak Approx 50Hz again level shifted and at channel AN0 I make it read and then in my code I generate err signal, and then I neeed to implement the controller in C code, My Compiler is MIKRO C for PIC , I use only C code donot know good assembly,
I designed the controller for my inverter in Z domain, it works perfect in simulation with MATLAB:
here is the TF in z domain :
0.78834*10*( z^2 - 1.808*z + 0.968)
____________________________________
Z*( z^2 - 0.9583*z - 0.04167 )
my triangular or modulating signal has 10kHz freq so mosfets are switched at that freq and peak to peak is 4V, sample time for z domain in the above controller i have 100uS,
Now the Problem starts here: I could not write my C code for this Z domain TF , what Primarly I need is just to write C code for any given order( higher than
2) in Z domain, where the order of numerator is less than or equal to the Order of Denominator
I use Simulation Software Proteus before I breadboard my project.
So , you have the knowledge, so please help me with that.
Thanks
A_tareq