c++ grab in position signal
pin out bit kontrol = 0;
and change it to 0 from 1 value in the case 0 and 1 statement ...... kontrol not change at all similar to your commandfinished .....
motion.in-position works only ngc file?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Still don't know why you need this, or how you will use it.
One command will not execute until the previous one completes, even directly using the MDI window of Axis.
If it does not complete, most likely there will be a following error and it will switch off anyway.
axis-remote hacks into Axis and does things without any user interaction, but does it the same way.
People doing this type of thing are usually either attempting a DNC type code injection or simply using LCNC to control something other than a standard machine
and doing all the calculations elsewhere. An example was someone using it to align an astronomical telescope.
regards
I honestly do not understand what you mean .... after this eexperience I realized that the telescopes are aligned in a joint mode or something like that .... so that the signal motion.in-position for me is not helpful.
Yesterday I read some post that tell about c++ api .... and now I think is possible to write somethings that help me to trace
emcStatus->motion.traj.position.tran.x
Please Log in or Create an account to join the conversation.
You have just dropped in that you are using a deltakins machine in world mode.
I think to be of any further use, I really do need to know exactly what you are trying to do and with what.
Otherwise any suggestions I make may be only partially successful or just plain wrong.
regards
Please Log in or Create an account to join the conversation.
emcStatus->motion.traj.position.tran.x
is possibile to have in c++ program? in which mode?
Please Log in or Create an account to join the conversation.
really if i use motion.joint.pos-CMD and FD and compare it whit a little tollerance (+\- 0.003 mm forma e/sample} i can whit your code send sugusr1 signal...
I expect that is all motion.in-position does, compare axis.N.motor-pos-cmd to axis.N.motor-pos-fb or similar.
is possibile to have in c++ program? in which mode?
You need to tell me what you are doing, all I know is that you are killing threads when an axis reaches a commanded position.
I don't know what the program creating the threads does, what the machine is or why any of this is necessary.
It might not be necessary and there could be a far simpler way to achieve it all, if I had any idea what the end goal was.
regards
Please Log in or Create an account to join the conversation.
expect that is all motion.in-position does, compare
axis.N.motor-pos-cmd to axis.N.motor-pos-fb or similar
I don't understand very well your world .... but in the code you suggested I add
pin in float sig1; -- > connect to axis...fd
pin in float sig2; -- > connect to axis...cmd
than in if statement I compare it with a little tolerance (sig1 <= sig2+0.003 || sig1>= sig2-0.003) ..... than send kill command..... in this way the time gap generated by physical motion is won and the signal is sent anyway.
I have built a delta robot than in world mode go to 150000mm/min, in joint mode up to 30000 grad/min (I don't know the max vel in this case).... when it stop, send kill command ----> new mdi command. and go again ..... I have only very few time to do this.
the MDI command is sent by qthread ..... my first idea it is use kernel signal to sincronise qthread MDI command sender with linuxcnc...... now finnaly I test this and the result is quite good but not really good.
I read in some Google old post about
emcStatus->motion.traj.position.tran.x
I need to sent a MDI command by my Qthread and I need by linuxcnc a response at the end of execution ...... at the end of physical execution my Thread sends an other MDI command. the velocity of my delta robot is very fast ..... the commands have to follow them selves without pause...
that all folks .....
note: sorry but sometime I can not understand the post because I can not english very well.....
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
So you have a delta robot, which may or may not look like this, kvarc.extra.hu/step/motor/emc/emckinematics.html, but works on the same principle.
You get a position from opencv and want to move the robot to that position.
You send a mdi command using axis-remote from a QThread. Then you terminate that thread when the command has finished, using a system call.
The only reason I can think of for this, is that the threads waiting for it to be finished will be woken if it is deleted, so you must be using it as a signal to send the next position data?
The first question I have, is how many moves in advance does your program know?
Does it have several stacked or only get the next one when the previous one has completed?
What I am thinking of is whether the commands could all be done inside a linuxcnc component and your program just puts the data where it can be read.
I think reading from a file is where you started, but it was too slow?
That could be via a serial connection, socket server, shared memory address etc
regards
Please Log in or Create an account to join the conversation.
write and read a file is too slow .. i try wit use M1xx custom command ... the end-hand move to max 150000mm/min a pause of 0.1sec or less, seems a long time .....
is possible both the way I think ... the solution than it consumes fewer resources and less time is the best....
Yes is possible write some partial G-code or similar too in a component and than sent it some couple of quote ....
Now I need from linuxcnc a signal of feedback when trjectory planner end the mdi code previously send by Qthread.
The situation in similir to this:
Qthread send --->mdi xyz command---->wayting for reply
linuxcnc--->when end the previous mdi xyz command ---> send a reply to Qthread
Qthread send --->mdi xyz command---->wayting for reply
linuxcnc--->when end the previous mdi xyz command ---> send a reply to Qthread
Qthread send --->mdi xyz command---->wayting for reply
linuxcnc--->when end the previous mdi xyz command ---> send a reply to Qthread..... until stop command.
note: my kinematics it's similar to kvark .... but the math it's quite different .... at least same result .... and I have some added function ... nothing of special.
emcStatus-motion.traj.position.tran.x
For use of emcStatus in Qt c++ I have not find nothing about how to declare emcStatus in my Qhtread.h file ... of course I insert
#include <linuxcnc/emc.hh>
#include <linuxcnc/emcpos.h>
#include <linuxcnc/nml.hh>
#include <linuxcnc/emc_nml.hh>
I have some doubts on the time to acquire (on my QThread) the signal "motion.traj.position.tran.x" and compare it with the quote computed and than commanded axis remote --mdi
I'm very curious of the results obtained using emcStatus on Qt ... if you want to suggest how to declare emcStatus in my .h file ... I would try.
I know it might not be the best solution .... so all the others that want to suggest will be tested physically.
Thank you very much.
Please Log in or Create an account to join the conversation.