anybody have the source code of the PID component?

More
10 May 2012 00:42 #19951 by awesomepanda
I want to write a controlling component.Even though it's difficult, I think the PID component is a good example for me.If anybody have the source code of the PID component ,please show me.

Thanks!

Best Regards!

Please Log in or Create an account to join the conversation.

More
10 May 2012 02:27 #19953 by cmorley
you can get all the source code. here is the instruction :
wiki.linuxcnc.org/cgi-bin/wiki.pl?Instal..._or_8_04_from_source

Please Log in or Create an account to join the conversation.

More
11 May 2012 13:12 #20001 by andypugh
awesomepanda wrote:

I want to write a controlling component.Even though it's difficult, I think the PID component is a good example for me.If anybody have the source code of the PID component


This is an Open Source project, so the source is freely available to all.
The specific component you want is here:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...89d8c917be31f9a1efa6
It lives in src/hal/components in the source tree.
You probably want to read:
linuxcnc.org/docs/2.4/html/hal_comp.html
As that pid component is written in straight C so the important parts are wrapped in support code. The whole component would be about 30 lines written in comp.

Please Log in or Create an account to join the conversation.

More
14 May 2012 13:04 #20076 by awesomepanda
Thank for offering me convenience.

I know we can use "comp" to create hal component easily.But I want to use C to write a component.

I have read the source code of the PID component written by C .It's using some header files like: #include "rtapi.h",#include "rtapi_app.h",#include "rtapi_string.h",#include "hal.h" and so on.

Although I can guess the use of some functions offered in header files,some is difficult to guess their use.If I can't know the use of the functions exactly,it's imposible to write my component with C .

Can some people offer a list of the funtions and their use in the header files that I mentioned above.

I never heard "git" before ,and not familiar with it.It seems that andypugh offered me the source code of the PID component by using it.Can I find the header files there ?I tried ,failed.

Best Regards!

Please Log in or Create an account to join the conversation.

More
14 May 2012 13:28 #20078 by andypugh
awesomepanda wrote:

I know we can use "comp" to create hal component easily.But I want to use C to write a component.

Why? I write a lot of drivers for LinuxCNC, I use comp wherever possible, not just for convenience, but for maintainability.

Can some people offer a list of the funtions and their use in the header files that I mentioned above.

The documentation is the source code, in this case. Your only choice is to download the source, and read it. (or look at it on gitweb)

I never heard "git" before ,and not familiar with it.It seems that andypugh offered me the source code of the PID component by using it.Can I find the header files there ?I tried ,failed.

git.linuxcnc.org
click "tree" for the LinuxCNC version you are interested in.
look in src/rtapi

Please Log in or Create an account to join the conversation.

More
14 May 2012 13:29 #20079 by BigJohnT
awesomepanda wrote:

Can some people offer a list of the functions and their use in the header files that I mentioned above.
Best Regards!


There is no list of functions and their use you simply have to read and understand the source code. If your a C programmer this should be a trivial task.

John

Please Log in or Create an account to join the conversation.

More
14 May 2012 13:37 #20080 by andypugh
Some of the rtapi functions are documented at the bottom of this page under rtapi calls:
www.linuxcnc.org/docview/html/

Please Log in or Create an account to join the conversation.

Time to create page: 0.158 seconds
Powered by Kunena Forum