[SOLVED] axes follow other axes

More
24 Jul 2014 05:32 #49065 by andypugh
Replied by andypugh on topic axes follow other axes

my mistake to write .... problem is sum stepgen.N.position-cmd with encoder.0.position ..... encoder.0.position is out value and operation is not permitted ... there are other way to do these?


Can you explain what you want to add to what and where you want the result to go?
The following user(s) said Thank You: bkt

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

More
24 Jul 2014 12:42 - 24 Jul 2014 13:00 #49072 by bkt
Replied by bkt on topic axes follow other axes
probabily I use bad english expression...... I want to sum encoder.n.position (or count if position is not possible) to Stepgen.n.position-cmd ...... I think that: if I add encoder.n.position to Stephen.n.position I obtain an offset of axes.n ...... Is it possible to use offset comp for this pourpose?(I found this comp this morning) but I think I'm not able to use it correctly.

A doubt: if use offset comp (could you give an example or link to an example for offset comp use ), in joint mode I think there is no problem ..... but in world mode??? I'm using modified tripodkins (no error during the compiling process)
Last edit: 24 Jul 2014 13:00 by bkt. Reason: correction

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

More
24 Jul 2014 13:15 #49073 by bkt
Replied by bkt on topic axes follow other axes
I try to explain me better .... my goal catch an axes (world mode) in same condition (example press a. button) in other condition (example release the button) I won't to return to normal command position (without offset obtain by the catch) .......

if I do this in kinematics I have these problem .... the axes "master" go all time and I can only reset axes encoder .... the slave take an offset all the time but dont't won't this .... I want swiching "offset mode" "no-offset mode" randomly.

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

More
24 Jul 2014 15:23 - 24 Jul 2014 15:42 #49075 by bkt
Replied by bkt on topic axes follow other axes
########################################################################### catch axes

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL

net offmaster encoder.1.position => offset.0.offset 
net offslave axis.1.motor-pos-cmd => offset.0.in 
net offslavei stepgen.1.position-fb => offset.0.fb-in

net ypos-cmd offset.0.out => stepgen.1.position-cmd

net ypos-fb offset.0.fb-out => axis.1.motor-pos-fb

net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net min-home-y => axis.1.home-sw-in
net min-home-y => axis.1.neg-lim-sw-in


####### trash code #######
#net ypos-fb sum2.0.out => axis.1.motor-pos-fb
#net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
#########
#net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
#net ypos-cmd encoder.1.position => stepgen.1.position-cmd
#net ypos-cmd sum2.0.out => stepgen.1.position-cmd
#########
#setp axis.1.jog-enable TRUE
#setp axis.1.jog-scale 0.01
#net countY encoder.1.counts => axis.1.jog-counts

########################################################################### end catch axes

hell button:
net catch-me-02 encoder.1.reset

ok offset work in joint .... Now I'm able to push my hell of a button an see my axis.1 catch my simulated encoder encoder.1 ...... but when I release the hell button obtain a linuxcnc error "axis 1 traking error" and stop it...... I do not understand why ..... if there is no offset in then obtain an error??????

in world mode I have no solution in this moment.....
Last edit: 24 Jul 2014 15:42 by bkt. Reason: error in testing

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

More
24 Jul 2014 16:16 - 24 Jul 2014 16:17 #49077 by bkt
Replied by bkt on topic axes follow other axes
ok .... I understand .... in my project I have to change my kinematics ...... :angry:

There are other way?

I try to do this:
1-create an axis with encoder ..... is possible to insert in kinematics encoder value without create a joint?

2-add encoder/joint value to a x.axis in foward kins when encoder is activated

3- subtract encoder/joint value to x.axis in foward kins when encoder is reset.---> problem----> axes return to original position at max velocity? is possible to moderate this directly in kinematics?

thanks for any reply..
Last edit: 24 Jul 2014 16:17 by bkt. Reason: add thank

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

More
24 Jul 2014 16:25 #49078 by andypugh
Replied by andypugh on topic axes follow other axes

probabily I use bad english expression...... I want to sum encoder.n.position (or count if position is not possible) to Stepgen.n.position-cmd


OK. encoder.n.position is an output pin. This is a valid thing to set the input pin of a sum2 component.
stepgen.n.position-cmd is an input pin, and is not suitable for driving the input of a sum2 component.
You need to connect the sum2 component input to whatever data _source_ drives the stepgen.n.position-cmd pin. This probably means using a "net" statement with the same signal as is used elsewhere in the HAL to control the stepgen.

Are you using "encoder_ratio" ?

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

More
24 Jul 2014 16:30 #49079 by andypugh
Replied by andypugh on topic axes follow other axes

ok .... I understand .... in my project I have to change my kinematics ...... :angry:

I am not sure that you do.

But then I am really unclear on what you are trying to do.

1-create an axis with encoder ..... is possible to insert in kinematics encoder value without create a joint?

Yes, encoders can exist freely in HAL without being associated with a joint.

It might help to draw a data-flow diagram, like:
www.infolytica.com/en/applications/ex002...%20in%20SIMULINK.png
But with HAL components for each block.

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

More
24 Jul 2014 22:19 #49091 by bkt
Replied by bkt on topic axes follow other axes
I realized a delta robot, working well .... I realized too a vision system (with opencv) which captures the position of a product moving on a conveyor belt ... I have to put the product on another conveyor belt which moves to step of 100mm .... every time conveyor belt stop, I reset the encoder, so the next time the conveyor belt moves, the robot will follow its motion while going to deposit the product. Follow the conveyor belt that moves to step of 100mm is not the rules ... sometimes i move the robot with real cartesian coordinates.

I hope I explained myself... although my bad English and google transalte :laugh: :laugh:

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

More
25 Jul 2014 00:05 #49098 by andypugh
Replied by andypugh on topic axes follow other axes

I realized a delta robot, working well .... I realized too a vision system (with opencv) which captures the position of a product moving on a conveyor belt


That all sounds rather clever.

I think that you will have to do it in the kinematics.

You have an XYZ position defined by G-code, and you also have an X (?) offset from the conveyor belt.

In HAL you only have access to the joint positions, so offsets there will not have the right effect. You need to insert the cartesian-space offset before the joint positions are calculated, so this does seem like something that would need to be done in the kinematics.

You can, however, rate-limit the offset in the HAL layer using the "limit3" component.

So, perhaps your kins would have an external offset pin (see git.linuxcnc.org/gitweb?p=linuxcnc.git;a...80e5de935e15;hb=HEAD for an example of how to create a HAL pin for a kinematics module).

Then in HAL you can use encoder_ratio to calculate the offset value, then pass it through a limit3 function and then connect to the kinematics offset HAL pin.

Alternatively, consider driving the robot without using G-code. You could write your own controller that issues NML commands. For example in Python:
import linuxcnc
cmd = linuxcnc.command()
...
cmd.teleop_vector(x + delta, y, z)

www.linuxcnc.org/docs/2.6/html/common/py..._linuxcnc_command_tt


Or, if that doesn't work. possibly emccanon, but that is only in 2.6 onwards I think
import emccanon 
...
emccanon.STRAIGHT_TRAVERSE(line,x0+delta,y0,z0,0,0,0,0,0,0)
The following user(s) said Thank You: bkt

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

More
25 Jul 2014 00:54 #49099 by bkt
Replied by bkt on topic axes follow other axes
actually I utilize a c++ code with a thread. The thread send mdi command to linuxcnc, like this:
command = "axis-remote --mdi 'G94 G21 G90 G61'";
          system(command.toStdString().c_str());

But mdi command is not enought to do what I need .... when I command the discarge position on conveyor belt, and conveyor decides to go on, I need to have the offset automatically whitout send other command...... I think that: first I try to use limit3 .... If don't work .... I have a real problem :laugh: :laugh:

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

Time to create page: 0.102 seconds
Powered by Kunena Forum