*This is the source file of my component:component compensacion_leva "Suma
un offset al eje seleccionado para generar un perfil de leva";pin in
unsigned spin-pos "Posicion del husillo en base al encoder del mismo";pin
in bit disable "Habiliacion del componente";pin in float pos-in "Posicion
que entrega el TP de LinuxCNC axis.0.motor-pos-cmd";pin out float pos-out
"Posicion con el offset ya sumado";pin in float rot-reg "Registro angular
de la leva a mecanizar, se carga desde g-code mediante m66";pin in float
desp-reg "Registro de la medida del desplazamiento de la leva para un
angulo dado, se carga desde g-code mediante m66";pin in float rad "Radio de
piedra actual";pin in bit carga "Habilitacion para cargar el
array";function _ ;license "GPL";author "Leonardo Marsaglia";;;#include
<rtapi_math.h>FUNCTION(_) {float ang [3600];float desp [3600];int i;float
pas_hpl, ant_hpl, pas_ang, ant_ang, pas_xpl, pas_ypl, ant_xpl, ant_ypl,
m_tang, m_norm, x_pm, y_pm, ang_norm, x_i, y_i, cp_x, cp_y;const float pi=
3.14159265359; i = rot_reg*10; ang[i] = rot_reg;
desp[i] = desp_reg; pas_hpl = desp[spin_pos + 1] + pos_in;
ant_hpl = desp[spin_pos - 1] + pos_in; pas_ang = ang[spin_pos + 1] *
pi/180; ant_ang = ang[spin_pos - 1] * pi/180; pas_xpl =
cos(pas_ang) * pas_hpl; pas_ypl = sin(pas_ang) * pas_hpl; ant_xpl =
cos(ant_ang) * ant_hpl; ant_ypl = sin(ant_ang) * ant_hpl; m_norm =
-1*(ant_xpl - pas_xpl) / (ant_ypl - ant_xpl); ang_norm =
atan(m_norm); x_pm = (pas_xpl + ant_xpl) / 2; y_pm = (pas_ypl
+ ant_ypl) / 2; x_i= cos(ang_norm) * rad; y_i= sin(ang_norm) *
rad; cp_x= x_i + x_pm; cp_y= y_i + y_pm; pos_out =
sqrt((cp_x*cp_x) + (cp_y * cp_y)); }*
Leonardo
2014-05-28 3:28 GMT-03:00 Leonardo Marsaglia <[email protected]>
:
> Hello Sebastian,
>
> I'm trying to make a component to add an offset to the X axis of a grinder
> to compensate the radius of the wheel and then grind lobes with the shape
> previously generated and loaded into that component.
>
> For that I need to do some trigonometric calculations inside the component.
>
> The problem is that, whatever component I try to build, no matter if it's
> mine, or if I copy and paste one of the examples on the docs I always get
> the same error message. I'm using LinuxCNC 2.5.4 on ubuntu 10.04, I
> installed the latest Live CD available on the website.
>
> This is the source code of the example component I created and I can't
> load:
>
>
>
>
>
>
>
>
>
> *component sincos;pin out float sin_;pin out float cos_;pin in float
> theta;function _; license "GPL"; // indicates GPL v2 or later;;#include
> <rtapi_math.h>FUNCTION(_) { sin_ = sin(theta); cos_ = cos(theta); }*
>
>
> Then this is the all the way through the console from installing with comp
> to the error when loading the component, also you can see that although I
> get the message that the component is not loaded, I can still see it loaded
> in hal.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *leonardo@leonardo-desktop:~$ sudo comp --install senito.comp [sudo]
> password for leonardo: make
> KBUILD_EXTRA_SYMBOLS=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc/Module.symvers
> -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0 modules
> make[1]: se ingresa al directorio «/usr/src/linux-headers-2.6.32-122-rtai»
> CC [M] /tmp/tmpOJRVte/senito.o Building modules, stage 2. MODPOST 1
> modules CC /tmp/tmpOJRVte/senito.mod.o LD [M]
> /tmp/tmpOJRVte/senito.ko make[1]: se sale del directorio
> «/usr/src/linux-headers-2.6.32-122-rtai»cp senito.ko
> /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/leonardo@leonardo-desktop:~$
> halrun halcmd: loadrt senito <stdin>:1: module 'senito' not loaded halcmd:
> show pinComponent Pins:Owner Type Dir Value Name 4 float
> OUT 0 sincos.0.cos 4 float OUT 0
> sincos.0.sin 4 float IN 0 sincos.0.theta*
>
> This happens with every component I try to load compiled with comp. When I
> install mine, I also get the following message, I colored with red the line
> that worries me about the frame size:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *leonardo@leonardo-desktop:~/Documentos$ sudo comp --install
> compensacion-leva.comp [sudo] password for leonardo: make
> KBUILD_EXTRA_SYMBOLS=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc/Module.symvers
> -C /usr/src/linux-headers-2.6.32-122-rtai SUBDIRS=`pwd` CC=gcc V=0
> modulesmake[1]: se ingresa al directorio
> «/usr/src/linux-headers-2.6.32-122-rtai» CC [M]
> /tmp/tmpSm7RJd/compensacion-leva.ocompensacion-leva.comp: In function
> ‘_’:compensacion-leva.comp:24: warning: unused variable
> ‘m_tang’compensacion-leva.comp:61: warning: the frame size of 28840 bytes
> is larger than 2560 bytes Building modules, stage 2. MODPOST 1 modules
> CC /tmp/tmpSm7RJd/compensacion-leva.mod.o LD [M]
> /tmp/tmpSm7RJd/compensacion-leva.komake[1]: se sale del directorio
> «/usr/src/linux-headers-2.6.32-122-rtai» cp compensacion-leva.ko
> /usr/realtime-2.6.32-122-rtai/modules/linuxcnc/*
> Anyway, apart from that warning when I load it the same happens as with
> all the other codes.
>
> Any ideas?
>
> Thanks for the help!
>
> Leonardo.
>
>
> 2014-05-28 0:11 GMT-03:00 Sebastian Kuzminsky <[email protected]>:
>
> On 05/27/2014 07:39 PM, Leonardo Marsaglia wrote:
>> > Hello to all.
>> >
>> > I'm in the process of compiling a module to do some calculations for
>> > machining lobes like the one Andy did a while ago.
>> >
>> > The problem is that when I inser that module, or another simple module
>> that
>> > I've made to calculate trig functions, I get the message:
>> >
>> > <stdin>:1: module 'whatever' not loaded
>>
>> Trig is already in the LinuxCNC dialect of the G-code language, i don't
>> know what you're doing exactly but maybe this is useful to you:
>>
>>
>> http://www.linuxcnc.org/docs/2.6/html/gcode/overview.html#sub:Unary-Operation-Value
>>
>>
>> That said... I don't understand the error you say you're getting.
>> Please pastebin the version of linuxcnc you're using, the module source
>> code, the commands you type to load your module, the output of halcmd,
>> and the output of dmesg.
>>
>>
>> --
>> Sebastian Kuzminsky
>>
>>
>> ------------------------------------------------------------------------------
>> Time is money. Stop wasting it! Get your web API in 5 minutes.
>> www.restlet.com/download
>> http://p.sf.net/sfu/restlet
>> _______________________________________________
>> Emc-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/emc-users
>>
>
>
>
> --
> *Leonardo Marsaglia*.
>
--
*Leonardo Marsaglia*.
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users