CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PID Library problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zainabhamuda



Joined: 30 Nov 2019
Posts: 2

View user's profile Send private message

PID Library problem
PostPosted: Sat Nov 30, 2019 5:34 pm     Reply with quote

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: 19549

View user's profile Send private message

PostPosted: Sun Dec 01, 2019 1:26 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Dec 01, 2019 8:18 am     Reply with quote

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: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Dec 01, 2019 8:26 am     Reply with quote

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: 19549

View user's profile Send private message

PostPosted: Sun Dec 01, 2019 10:46 am     Reply with quote

Also, there are at least three Microchip application notes with PID
implementations. These can be translated pretty easily into CCS code.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group