[solved] when it is update the _hal - pin

More
08 Jan 2015 04:56 - 12 Jan 2015 16:52 #54729 by bkt
I have a subroutine .ngc with a pair of coordinates that update via _hal - pin . the subroutine is placed on a while loop of a program .ngc main.

everything runs perfectly on halshow see the pins that update perfectly following the commands of the custom - component .


I think it's because I did not understand how and when the trajectory planner takes into account the new pin value ..... then probably wrong to make it do what I want .

In fact, I see the pin value change, but change the coordinates actually executed only after two or three cycles under .... carry two lines of .ngc just to better understand the problem ....
where can I find appropriate doc ?
this despite the subroutine performs coordinates commanded only after two or three updates of the same .
while[#9 Ne 25]

<mysub>
M169 (custom M code that start component to refresh pin)
#9=#9+1
endwhile


......

my subroutine

o<mysub>.......

........

x#<_hal[mycomp.x]> y#<_Hal[mycomp.y>

.........
Last edit: 12 Jan 2015 16:52 by bkt.

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

More
08 Jan 2015 18:14 #54750 by bkt
p.s. I have modify title and text of post I changed the post to better explain my requests.

if I'm wrong I accept the just punishment. ;) ;)

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

More
08 Jan 2015 18:30 #54753 by ArcEye
I suspect that you are just the wrong side of interpreter look-ahead, cache etc.

Once it has read in some value / values, it acts upon them, it does not go back and check to see if they have changed.

One option would be DNC - MDI operation, with the code and algorithms determining the machine movement done in a separate process and output line by line to LCNC

For what it takes to alter the values, have a look at the recent moveoff commits by Dewey into the master

regards
The following user(s) said Thank You: bkt

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

More
08 Jan 2015 19:13 #54757 by bkt
thanks a lot ArkEye ....

I dont'understand very well your suspect .... but I insert the correct gcode that I use for Solve for my doubts of understanding....

G94 G21 G90

#89 = 0
#79 = 0
#29 = 0
#31 = 0
#99 = 0
#22 = 0


M169
M139           (segnale reset enc2 & conteggio:2 basso)
M129

G1 F20000 X0 Y-24 Z-820 
(AXIS,stop) 
G64 F190000 Z-820
M128

(M65 P0 ok)
M65 P1
M65 P0
(M64 P2 ok)

M118           (segnale reset enc2 alto)
M194
M181
M175          (signal higt for start custom comp to refresh coord value)

o112 while [#22 LT 100]




o151 if  [#<_hal[ethloop.fstop]> EQ 1]     (signal for stop by custom comp)

o<01soub> call

o190 if [#99 EQ 0]
X-400 Y-24 A105 Z-820
X-400 Y-24 A105 Z-830
(M169)

M66 P0 L3 Q1200
A105 Z-880
M169             (signal low"0" for grab new value, the work of ethloop custom comp)
M175             (signal higt"1" for start custom comp to refresh coord value)
M65 P1
A105 Z-920
A105 Z-820
M176             (signal low"0" for start custom comp to refresh coord value)
o190 endif
o191 if [#99 EQ 1]
X-400 Y-24 A105 Z-820
X-400 Y-24 A105 Z-830
(M169)

M66 P0 L3 Q1200
A105 Z-840
M169             (signal low"0" for grab new value, the work of ethloop custom comp)
M175             (signal higt"1" for start custom comp to refresh coord value)
M65 P1
(M175)
A105 Z-860
A105 Z-820
M176             (signal low"0" for start custom comp to refresh coord value)
o191 endif

#99 = [#99 + 1]
(debug, #99)
o170 if [#99 GT 1]
M129           (cycle hignt and low count)
M64 P0
#99 = 0
o170 endif

o151 endif   (THE QUESTION: now i have the right coord ............ but the next cycle of while I dont' see the change ..... I see the change only in the third cycle of while .......)


X-400 Y-24 A90 Z-820

X-400 Y-24 A90 Z-820
G64 F240000 



#22 = [#22 + 1]
o112 endwhile

M179
G4 P0.1
M169

G64 F190000 X0 Y-24 Z-820 A0

M2

subroutine...
o<01soub> sub


X-400 Y-24 A90 Z-820


X#<_hal[ethloop.fpxuno]> Y#<_hal[ethloop.fpyuno]> A#<_hal[ethloop.fpauno]> Z-880 

M65 P0
M64 P1

Z-860


X-400 Y-24 A105 Z-820
M179             (signal higt"1" for grab new value, the work of ethloop custom comp)

o<01soub> endsub

M2

see "the question" comment

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

More
08 Jan 2015 21:02 #54764 by bkt
ok ..... i have see this post with my reply ..

moveoff tester

but dont' have found the code of Dewey in git hub.... I'm not familiar with github ... now I reply to BigJon too.

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

More
08 Jan 2015 21:02 #54765 by BigJohnT
Moveoff is also in 2.7

JT

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

More
08 Jan 2015 21:10 #54772 by bkt
ok tanks .... but I need to install 2.7 in other machine ..... I have a lot of "particular" chanches in this one on 2.6 .... believed to be able to find the code , see it , and figure out if I could add one of my crock without downloading the new distro . Or do I have to wait to have a robot free ( of engines and steel ) before you take the test .

In two or three weeks I think I have a robot free to test new distro.

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

More
08 Jan 2015 21:16 #54773 by bkt
Ok I have understand github works .... tanks

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

More
08 Jan 2015 22:40 - 08 Jan 2015 22:46 #54781 by bkt
G94 G21 G90

#89 = 0
#79 = 0
#29 = 0
#31 = 0
#99 = 0
#22 = 0


M169
M139           (segnale reset enc2 & conteggio:2 basso)
M129

G1 F20000 X0 Y-24 Z-820 
(AXIS,stop) 
G64 F190000 Z-820
M128

(M65 P0 ok)
M65 P1
M65 P0
(M64 P2 ok)

M118           (segnale reset enc2 alto)
M194
M181
M175          (signal higt for start custom comp to refresh coord value)

o112 while [#22 LT 100]




o151 if  [#<_hal[ethloop.fstop]> EQ 1]     (signal for stop by custom comp)

o<01soub> call

o190 if [#99 EQ 0]
X-400 Y-24 A105 Z-820  <-------------------piece of code (A) start
X-400 Y-24 A105 Z-830
(M169)

M66 P0 L3 Q1200
A105 Z-880
M169             (signal low"0" for grab new value, the work of ethloop custom comp)
M175             (signal higt"1" for start custom comp to refresh coord value)
M65 P1
A105 Z-920
A105 Z-820
M176             (signal low"0" for start custom comp to refresh coord value)

  <-------------------piece of code (A) stop

o190 endif
o191 if [#99 EQ 1]
X-400 Y-24 A105 Z-820  <-------------------piece of code (B) start
X-400 Y-24 A105 Z-830
(M169)

M66 P0 L3 Q1200
A105 Z-840
M169             (signal low"0" for grab new value, the work of ethloop custom comp)
M175             (signal higt"1" for start custom comp to refresh coord value)
M65 P1
(M175)
A105 Z-860
A105 Z-820
M176             (signal low"0" for start custom comp to refresh coord value) 
  <-------------------piece of code (B) stop
o191 endif

#99 = [#99 + 1]
(debug, #99)
o170 if [#99 GT 1]
M129           (cycle hignt and low count)
M64 P0
#99 = 0
o170 endif

X-400 Y-24 A105 Z-820   <----------------- new piece of code start, is similar to (A) & (B)
X-400 Y-24 A105 Z-830
(M169)

M66 P0 L3 Q1200
A105 Z-820
M169             (signal low"0" for grab new value, the work of ethloop custom comp)
M175             (signal higt"1" for start custom comp to refresh coord value)
M65 P1
(M175)
A105 Z-820
A105 Z-820
M176             (signal low"0" for start custom comp to refresh coord value)   

 <----------------- new piece of code stop, is similar to (A) & (B)



o151 endif  

X-400 Y-24 A90 Z-820

X-400 Y-24 A90 Z-820
G64 F240000 



#22 = [#22 + 1]
o112 endwhile

M179
G4 P0.1
M169

G64 F190000 X0 Y-24 Z-820 A0

M2

Why if I add this piece of code ( <
new piece of code start/stop) all work perfect???? and I see my robot change trajectory after every change of my ethloop.comp?

The piece of new code is similar to (A) and (B) piece, but in this case is able to change the value in o<01soub> call immediatly ..... without this piece of code o<01soub> call is refresh after 1 or 2 cycle of while .....

I dont' understand the reason of this result.

I dont' understand this ..... some one can explane me this point? :) :)
Last edit: 08 Jan 2015 22:46 by bkt.

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

More
08 Jan 2015 23:04 #54783 by ArcEye
The short answer is that the piece of code runs whatever the value of #99

Your first conditional A was IF[#99 == 0] the second B is IF[99 == 1] so between the two the code will always be executed.

Don't know enough about the relevance of the M codes to see how they fit in

regards
The following user(s) said Thank You: bkt

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

Time to create page: 0.081 seconds
Powered by Kunena Forum