Jump to content
OMRON Forums

libppmac.ko and usralgo


pennells

Recommended Posts

According to the training slides (Power PMAC Computer 2011-04), the libppmac.ko (or rptmac.ko) has useful math libraries for the kernel object. Is it possible for a usralgo to use these math functions and, if so, how does one configure the IDE so that it finds and links to them? I may be forced to do some of the function in a rticplc if there is no way to use these math functions. I just wanted to know if that is what I have to do.

 

This seems to be more inconsistent than I originally thought. Sometimes the math library functions (pow, sqrt, fabs, sin, exp) work and can be included in the usrAlgo and others times they do not. It seems like the only way to determine if one will or will not work is to download the assigned servo algorithm and see if that motor correctly assigns the algorithm (ie. Motor[x].Ctrl = UserAlgo.ServoCtrlAddress[x]). If the function does not work, no errors are reported but the Motor[x].Ctrl points back to the Sys.ServoCtrl. How can I determine when or why the function doesn't work.

 

As an example, in my motor0_servo function, I added the following line (where value was declared as float):

 

value = exp(2.33L); -> this one works

value = exp(2.0L); -> this one does not work

 

I can switch back and forth and the first one always works and the second one always fails. I can't for the life of me figure out how this is even remotely logical.

 

I tried again with value declared as a double and both seem to work. It would appear that there is some sort of casting issue or the header has the float library but the linked library only uses double.

 

 

I'm getting very frustrated trying to add some algorithms and then spending a lot of time trying to determine what in the algorithm make the userAlgo address fail. There has to be some explanation to what will and what won't work so I know what capabilities I can put into my servo algorithms.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Guest
This topic is now closed to further replies.

×
×
  • Create New...