patch3 against master attached










> So I found one problem with the g10 l2 patch :
> p-1 is accepted as p0 even if I check for p < 0
> The reason is when the p number is converted to an integer:
>
 > p_int = (int) (block->p_number + 0.0001);
>
> -1 +.0001 is (rightfully) truncated to zero.
> If I remove the  +0.0001 then -1 stays -1 and the error is
> caught.
> My question is the reason for the 0.0001 and can I remove
 > it without problems ?

so my answer to this (found on the net) is:

(block->p_number >= 0) ? p_int = (int) (block->p_number +0.5)
    :p_int = (int) (block->p_number -0.5);

this rounds the float value to the nearest integer 
value whether negative or positive.

Seems to work fine.
now that block->p_number is reliable converted to a 
integer is throwing an error if the P value is a float
still worthwhile?
Unless someone sees a problem I will commit this to master soon.

Also I've read the manual on g10 L2 and L20
but still don't completely understand .

L20 SETS the coordinate to the value in the g code.
gui says x0 y0 z0
issue g10 l20  p1 x1y0 z0
gui says x1 y0 z0
issue g10 l20 p1 x3 y0 z0
gui says x3 y0 z0

That makes sense though I think the manual is not clear.

L2 OFFSETS the coordinate system by the value in the g code.

gui says x0 y0 z0
issue g10 l2 p1 x2 y0 z0
gui says x-2 y0 z0 
issue g10 l2 p1 x3 y0 z0
so far so good..
gui says x -3 y0 z0
ok so I take this to mean l2 offsets the coordinate system
by the value in the g code but referenced from machine 
coordinate origin. 
is this right?
What I expected (from the manual and it made sense to me)
that l2 would offset by gcode value referenced from itself.
meaning 
gui says x0 y0 z0

issue g10 l2 p1 x2 y0 z0

gui says x-2 y0 z0 
issue g10 l2 p1 x1 y0 z0


gui says x-3 y0 z0 
issue g10 l2 p1 x1 y0 z0



gui says x-4 y0 z0 

so in trial this is not what happens.
Why would one use l2 instead of l20?

I think we should change the wording of the manual 
to make this clearer.
Thoughts?

Chris M
                                          

Attachment: g10_l2_p0_patch3
Description: Binary data

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to