View previous topic :: View next topic |
Author |
Message |
zainabhamuda
Joined: 30 Nov 2019 Posts: 2
|
PID Library problem |
Posted: Sat Nov 30, 2019 5:34 pm |
|
|
Hi,
I’m designing a full bridge inverter based on unipolar modulation technique. The control is done using pic18f4431 and PIC C compiler (CCS). The code part related to generating the four signals has no problems, but I need to regulate the output voltage of the inverter using PID functions available in the PIC C compiler that are:
setup_pid(PID_MODE_PID, K1, K2, K3);
pid_get_result(set_point, input, &PIDoutput);
But the compiler is giving me error that these two functions aren’t defined . So I searched for their library where they are included to add it, but I didn’t find it neither in the compiler identifiers nor in the CCS manual.
My question is: Does anyone know a link that I can download from it the library related to the PID functions to add it the compiler. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19509
|
|
Posted: Sun Dec 01, 2019 1:26 am |
|
|
You can't.
Those functions are only for chips that have the hardware PID module. Yours
doesn't. The only chips with this are the PIC1614 15 18 & 19 (and their 'L'
variants). For all other chips you need to build your own PID functions.
The compiler doesn't offer a PID library, just support for this PID hardware. |
|
|
zainabhamuda
Joined: 30 Nov 2019 Posts: 2
|
|
Posted: Sun Dec 01, 2019 8:18 am |
|
|
Okay Ttelmah, thank you for your reply.
So I need to ask now if anybody already wrote a PID code to regulate the output of the inverter building his own functions using the CCS Compiler and kindly can send it to me. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Sun Dec 01, 2019 8:26 am |
|
|
you need to learn by doing.
PID depends upon what YOU are controlling,the feedback sources and of course update rates...
I'm certain the 20 year old PID controller for my helicopter servo won't work for you. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19509
|
|
Posted: Sun Dec 01, 2019 10:46 am |
|
|
Also, there are at least three Microchip application notes with PID
implementations. These can be translated pretty easily into CCS code. |
|
|
|