[SOLVED] axes follow other axes

More
25 Jul 2014 01:06 #49101 by bkt
Replied by bkt on topic axes follow other axes
other .... in my c++ code I can link this:
#include <linuxcnc/canon.hh>

there is the same of

import emccanon
...
emccanon.STRAIGHT_TRAVERSE(line,x0+delta,y0,z0,0,0,0,0,0,0)


????

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

More
25 Jul 2014 01:13 #49102 by andypugh
Replied by andypugh on topic axes follow other axes

other .... in my c++ code I can link this:
#include <linuxcnc/canon.hh>

there is the same of

import emccanon


I think so. Does it work?

You probably do want to be working at the canon layer, rather than the MDI layer.

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

More
25 Jul 2014 02:40 #49105 by bkt
Replied by bkt on topic axes follow other axes
I don't now .... at the moment I study this new precious information ....

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

More
26 Jul 2014 02:26 - 26 Jul 2014 02:28 #49141 by bkt
Replied by bkt on topic axes follow other axes
I'm little bit confusing ... git.linuxcnc.org/gitweb?p=linuxcnc.git;a...80e5de935e15;hb=HEAD here we use these function inkinematitcs
107 int rtapi_app_main(void) {
 108     int result;
 109     comp_id = hal_init("5axiskins");
 110     if(comp_id < 0) return comp_id;
 111 
 112     haldata = hal_malloc(sizeof(struct haldata));
 113 
 114     result = hal_pin_float_new("5axiskins.pivot-length", HAL_IO, &(haldata->pivot_length), comp_id);
 115     if(result < 0) goto error;
 116 
 117     *(haldata->pivot_length) = 250.0;
 118 
 119     hal_ready(comp_id);
 120     return 0;
 121 
 122 error:
 123     hal_exit(comp_id);
 124     return result;
 125 }

and in the header of function there is this link
99 #include "hal.h"

but in linuxcnc.org/docs/html/hal/components_es.html#_hal_api_calls we talk about

hal_pin_bit_new.3hal
hal_pin_bit_newf.3hal
hal_pin_float_new.3hal
hal_pin_float_newf.3hal
hal_pin_new.3hal
hal_pin_s32_new.3hal
hal_pin_s32_newf.3hal
hal_pin_u32_new.3hal


In my deltakinematics I have to use
include "3hal.h"

?????
Last edit: 26 Jul 2014 02:28 by bkt. Reason: missing link

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

More
26 Jul 2014 03:01 #49142 by bkt
Replied by bkt on topic axes follow other axes
please try to tell me if I understood the use of pin hal
.....fowardkins.....

 pos->tran.x = joint[0] - (haldata->encoder1offset) .....

 .....inversekind.....

 joint[0] = pos->tran.x + (haldata->encoder1offset) .....

 ...........................
 ...........................

 int comp_id;
 int rtapi_app_main(void) {
     int result;
     comp_id = hal_init("mykinemaics");
     if(comp_id < 0) return comp_id;
  
     haldata = hal_malloc(sizeof(struct haldata));

  /* is correct this???? */   result = hal_pin_float_new("mykinemaics.encoder1offset", HAL_IO, &(haldata->encoder1offset), comp_id);




    hal_ready(comp_id);
     return 0;
 error:
    hal_exit(comp_id);
    return result;
}

in hal file instead imposed ENCODER_RATIO (or only one encoder with SCALE + encoder reset pin) and set adequately limit3. With limt3 I avoid that when pressed encoder.reset there is the following error axes...

I can use another
hal_pin_bit_new.3hal  /* or more correcly hal_pin_new.hal ???*/
for swich on end swich off offset with:
if ((haldata->myswich == 1){pos->tran.x = joint[0] - (haldata->encoder1offset)}
else {pos->tran.x = joint[0] .......}

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

More
26 Jul 2014 03:03 #49143 by andypugh
Replied by andypugh on topic axes follow other axes

include "3hal.h"


You probably don't even need that, as "comp" needs hal.h to create pins when making hal components, so probably automatically includes it.
However, there is no harm in including hal.h in your own kins file.

I think the .3hal actually just indicates which sectoion of the documentation it belongs in

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

More
26 Jul 2014 03:05 - 26 Jul 2014 03:06 #49145 by andypugh
Replied by andypugh on topic axes follow other axes

pos->tran.x = joint[0] - (haldata->encoder1offset)


HAL pins are always pointers, as they get moved around so that they point at the same bit of shared memory. (In practice the HAL "net" command just changes a set of pointers to all point at the same memory location)

So, you need
pos->tran.x = joint[0] - *(haldata->encoder1offset)
Last edit: 26 Jul 2014 03:06 by andypugh.
The following user(s) said Thank You: bkt

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

More
26 Jul 2014 22:02 #49173 by bkt
Replied by bkt on topic axes follow other axes
In order to try to connect hal pin to my kinematic, I write this two line in my hal file:
net enable_encoder1 motion.digital-in-00 => mydeltakins_catch.enable_encoder1

setp mydeltakins_catch.encoder1_offset encoder.1.position

The pin in my kinematic is write in this way .... (bit pin and float pin)
if((res = hal_pin_float_new("mydeltakins_catch.encoder1_offset", HAL_IO, &(haldata->encoder1_offset),comp_id)) != 0) goto error;
    if((res = hal_pin_bit_new("mydeltakins_catch.enable_encoder1", HAL_IO, &(haldata->enable_encoder1),comp_id)) != 0) goto error;

I don't Understand why linux cnc send me this error: value for 'encoder.1.position' invalid for float.

encoder.1.position is pin out float and mydeltakins_catch.encoder1_offset is pin IO float ... there are the same type of value ..... Why encoder.1.position is invalid??????

Obviously I must have misunderstood something .... but I do not know what.

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

More
26 Jul 2014 22:14 #49174 by bkt
Replied by bkt on topic axes follow other axes
it may be that the error is because I use sim_encoder and then encoder.1 .... I have not phisically connect the encoder to In pin.....

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

More
27 Jul 2014 00:35 #49175 by bkt
Replied by bkt on topic axes follow other axes
no ... I just try ... I connect a phisical encoder and error not change ....

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

Time to create page: 0.136 seconds
Powered by Kunena Forum