attempt to divide by zero

More
06 Feb 2019 05:45 #125788 by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thanks for your response ,
I am reassured that the problem does not come from me, I mechanic and computer is not easy for me, that 's why I make my program in gcode, it' s a language that I know.
I will try to find another solution.
I made this machine, a machine to cut the gears and I retrofit a fanuc milling machine.
  i find linuxcnc genial, i have a mazak lathe and a cincinati milling machine, but linuxcnc is really the best.
regards
jf

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

More
06 Feb 2019 09:55 #125794 by rodw
Replied by rodw on topic attempt to divide by zero
There is a way to access a hal pin from gcode but I remember the documentation is in a very obscure place and I can't for the life of me find it for you :(

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

More
06 Feb 2019 11:23 #125796 by MaHa

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

More
06 Feb 2019 11:35 #125797 by rodw
Replied by rodw on topic attempt to divide by zero

Have a look here and No.20
linuxcnc.org/docs/2.7/html/remap/remap.html#remap:ini-features


Thank you. I told you its obscure. Section 20 is actually a bit further down and is exactly what I wanted to share.
linuxcnc.org/docs/2.7/html/remap/remap.h...ap:referto-hal-items

So jf, by referencing the pin name that is connected to the motion.analog-out.nn you should be able to work with gcode variables you are familiar with.

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

More
06 Feb 2019 13:15 #125801 by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thank you very much, but I do not understand what I have to do, it exceeds my skills

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

More
06 Feb 2019 13:32 - 06 Feb 2019 13:35 #125803 by Todd Zuercher
Does this g-code work for you?
(o<MortaiseuseDiviseur> sub)
g54g17g90g21
g0z0
g0y0
g0 a-10
g0 a0
#2=6

M66 E0 L0

#2=#5399 (_nb_division)
o102 if [#2 EQ 0]
(MSG, Error Nbre de Devisions=0)
m2
0102 else
#3=[360/#2] (angle 360/ nbre de rainure)
o102 endif
M66 E1 L0
#4=#5399 (_Prof)
#6=[#4/0.05] (calcul du  nbre passe)
M66 E2 L0 (longueur)
#7=#5399
M66 E3 L0 (retour)
#8=#5399

o100repeat[#1]
o101 repeat[#6]   (nbre de passe)
g91 g1 y0.05 f200 (profondeur de passe constante de 0.1mm)
g90 g1 z-[#7]f25000
g91y-.7
g90 g0 z0
g91g0y.7
o101 endrepeat
g0g90y0
(m0)
g0y[-#8]
g0g91a[#3]
o100endrepeat
g0z0
g0y0
g0a0
g0g90a-10
g0a0
g0 y-150
(o<MortaiseuseDiviseur> endsub)
m2
Last edit: 06 Feb 2019 13:35 by Todd Zuercher.

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

More
06 Feb 2019 16:54 #125828 by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thank you very much i test tomorow

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

More
06 Feb 2019 21:24 #125877 by rodw
Replied by rodw on topic attempt to divide by zero

thank you very much, but I do not understand what I have to do, it exceeds my skills


The following variables should exist in your g code
#<_hal[pyvcp.diviseur]>
#<_hal[pyvcp.profondeur]>
#<_hal[pyvcp.Longueur]>
#<_hal[pyvcp.retour]>

So where you have
M66 E0 L0
#2=#5399 (_nb_division)
You might be able to replace it with
#2 = #<_hal[pyvcp.diviseur]>

And likewise remove the other M66 /#5399 commands and use
#4 = #<_hal[pyvcp.profondeur]>
#7 = #<_hal[pyvcp.Longueur]>
#8 = #<_hal[pyvcp.retour]>

I'm not sure that these pins will be there in a subroutine though so they might need to be passed as parameters to the subroutine.

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

More
07 Feb 2019 14:50 #125927 by jefsaro
Replied by jefsaro on topic attempt to divide by zero
hello ,
i test , but i think i make a mistake , when a change it's ok in parameter , but i 'am error , parameter is not defined.
regards
jf
Attachments:

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

More
07 Feb 2019 19:31 #125945 by rodw
Replied by rodw on topic attempt to divide by zero

hello ,
i test , but i think i make a mistake , when a change it's ok in parameter , but i 'am error , parameter is not defined.
regards
jf


Remove the spaces in the variable name in your gcode file and it might have a better chance of working :ohmy:

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

Time to create page: 0.134 seconds
Powered by Kunena Forum