585,981 active members*
4,140 visitors online*
Register for free
Login
Results 1 to 19 of 19
  1. #1
    Join Date
    Apr 2008
    Posts
    9

    Question I need help Simulating my code.

    Im not sure what program is best to simulate my code.

    Please see the attachemts.

    The file extension is .H but i renamed it to txt.

    I have built a program from scratch using visual basic .NET. where the

    output would be the CNC code.

    I tried using the free CNC Simulator but im still having difficulties with.

    Any help would be appreciated. Thanx in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Posts
    1220
    Modified your code. Altered all the 'L's to N1 and added G01 and this is the result.
    Attached Thumbnails Attached Thumbnails ToolPathGear.JPG  

  3. #3
    Join Date
    Apr 2008
    Posts
    9
    WOW !!! THANX ..


    Man may you post the modified code and may you please tell me what software your using to show the preview ?

  4. #4
    Join Date
    Apr 2005
    Posts
    3634
    www.ncplot.com


    .
    Attached Thumbnails Attached Thumbnails 123.JPG  
    Free DXF - vectorink.com

  5. #5
    Join Date
    Apr 2008
    Posts
    9
    Thanx Man. I still want to know what software kiwi used. His drawing shows the origin (x,y) . Which i like. If you know what program he ued please let me know.

  6. #6
    Join Date
    Jul 2003
    Posts
    1220
    I used BobCADCAM V20.
    As I use a FAGOR controller I altered to the required format by using MSword;

    N1 G01 X-30.938 Y-160
    N1 X-22.987 Y-160
    N1 X-22.444 Y-159.986
    N1 X-22.131 Y-159.969
    N1 X-21.862 Y-159.95
    N1 X-21.614 Y-159.929
    N1 X-21.381 Y-159.907
    N1 X-21.158 Y-159.884

  7. #7
    Join Date
    Apr 2008
    Posts
    9
    Thanx man, I downloaded the software.

    I opened my file and used. moved the header part (First six lines) to a text file (Cut - Paste) so that [The word Tool & call wont be affected].

    Then used the find and replace feature: Find"L(space)" Replace with "(space) (space)". Then pasted back what i cut.Then in the bobcam editor window i hit on Edit > Renumber ,then added in the G01 Manually.

    I can see youve used N1 All the way along have u used it at the very begining as well ? Anyways heres my modfied code is it correct this way ? BTW how do i run a simulation ?

    N1 BEGIN PGM NNT MM
    N2 BLK FORM 0.1 Z X+100 Y+100 Z+0
    N3 BLK FORM 0.2 X+200 Y+200 Z+100
    N4 TOOL DEF 1 L+0 R+10
    N5 TOOL CALL 1 Z S1 F1
    N6 M6
    N7 X+89 Y+89 Z+101 F1 M3
    N8 X+201 F1
    N9 Y-160
    N10 Z-1
    N11 G01 X-30.938 Y-160
    N12 X-22.987 Y-160
    N13 X-22.444 Y-159.986
    N14 X-22.131 Y-159.969

  8. #8
    Join Date
    Jul 2003
    Posts
    1220
    I deleted all the lines down to your main code line N11. Didn't examine them for errors.
    I could have just deleted the L instead of converting to a line number (N????)

    To simulate :Edit/Select All...........Edit/Geometry from NC

  9. #9
    Join Date
    Jul 2003
    Posts
    1220
    The first 5 lines will vary, depending on the controller.
    For lines with comments my FAGOR controller requires a ';' where others use '('
    Using line numbers (N????) is optional.

  10. #10
    Join Date
    Apr 2008
    Posts
    9
    Thanx for your reply man, I have one question regarding the Workpiece.

    Quick Intro:-

    I have built a Spur gear Calculator program using Visual Basic .NET



    Now Basically this window is under CNC code.

    The highlighted items show the dimensions of the workpiece.



    Now if im to draw my gear using BobCAD-CAM where should the fixture holding the workpiece be located at ?




    Please see the attachments for the code.

    This code is different from the one i posted earlier.
    Attached Files Attached Files

  11. #11
    Join Date
    Jul 2003
    Posts
    1220
    You have done well with your calculator. Does it calculate a involute path?

    I'm thinking a 3 axis vertical mill.
    I would think the centre of the gear would be the origin X0 Y0 and the piece would be held with a bolt at this point or held with a vice or lathe chuck which is fixed to the table.

  12. #12
    Join Date
    Apr 2008
    Posts
    9
    Quote Originally Posted by Kiwi View Post
    You have done well with your calculator. Does it calculate a involute path?

    I'm thinking a 3 axis vertical mill.
    I would think the centre of the gear would be the origin X0 Y0 and the piece would be held with a bolt at this point or held with a vice or lathe chuck which is fixed to the table.
    This program is specifically for spur gears calculations.




    Now Basically what i want to do is tie the input machining parameters with the offset i got(Tool path CNC Code - see picture below).



    The purpose of that is to move the centre of the gear to the centre of the workpiece.




    Regarding the same input parameters that i input back in post # 10 this

    would be my output (not the tool path generated).

    .

    So basically from the above picture you can see that when i apply both both new offset equations for the gear the values of a=b=0 on the other hand when i apply them for the pinion the value of a = (Distance Centre; Distance from the centre of the gear to the centre of the pinion), and b=0.

    Moving to the CNC Window:



    Hitting the OK button:



    And now this is how i managed to write the first couple of lines my CNC Code header. *Note the values used in the machining parameters in the following pictures are different from the one ive been taking pictures of.















    I could have used my old CNC code the one showing here:



    But as i mentioned i want to do the translation so that after the code is saved from my program all i have to do is upload and run program. Any help is welcomed.

  13. #13
    Join Date
    Jul 2003
    Posts
    1220
    If you generate the profile for one tooth with the centre of the gear as X0 Y0 you can rotate the C axis (NOT rotary table) the degrees for one tooth and then repeat the code until all done.

  14. #14
    Join Date
    Apr 2008
    Posts
    9
    Basically From the drawing u can see this is what i have done.

    Problem: Code is being executed but i dont know its location and will part of the teeth be executed in the workpiece and the other part in the air.

    Resolution or attempt to fix the problem: I created a New Gear offset which means a new CNC code from the equations shown above. Which basically means ive related the new CNC code to the old offset i got + the machining paramemeters inorder to shift/translate the centre of the gear to the centre of the workpiece.


    For the same Case i will show a drawing for the "Old CNC Code"






    Again this is when combining the Old CNC code with the input parameters.





  15. #15
    Join Date
    Apr 2006
    Posts
    3498
    good job you are doing...love to see ur progress...keep up posting

  16. #16
    Join Date
    Apr 2008
    Posts
    9
    Quote Originally Posted by Khalid View Post
    good job you are doing...love to see ur progress...keep up posting
    Thanx Khalid. Basically Im having difficulties implementing the equations that relate the CNC code to the workpiece. It seems that my old cnc code seems ok and centres the gear to the origin but by that i have not achieved my goal by relating it to the input machining parameters.

  17. #17
    Join Date
    Jul 2003
    Posts
    1220
    If I were cutting a gear, I would mount the workpiece on the table and set the origin in the controller to the centre of the part.
    Only if I was to cut more than one gear would offset any code.

  18. #18
    Join Date
    Apr 2008
    Posts
    9
    Thanx , Basically im manufacturing a gear and a pinion. Well i'll give it a shot on the CNC by next week and see what happens :-)

  19. #19
    Join Date
    Apr 2006
    Posts
    3498
    I did programming in Visual Basic in my college life...a long time ago...(i am only 30 years old)...i made Stress analysis and graphical softwares including logic games... i also did Database programming keeping SQL as backend and MS access database front end in visual basic...but now it has long long timee...
    I wish i could help u but time do not permit me...may be some one Programming guru here will help u in this matter,..

    By the way, frankly speaking i love 2 see ur work..

Similar Threads

  1. Wierd NC Code and G-Code
    By Tazzer in forum Uncategorised CAM Discussion
    Replies: 10
    Last Post: 01-09-2012, 08:07 PM
  2. learning g code or cad-cam code output?
    By slow_rider in forum G-Code Programing
    Replies: 3
    Last Post: 02-28-2010, 03:48 AM
  3. G-code for beginners - want to learn G-code
    By FPV_GTp in forum G-Code Programing
    Replies: 7
    Last Post: 11-18-2008, 06:25 AM
  4. Simulating TurboCNC code
    By kombayotch in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 4
    Last Post: 03-10-2006, 04:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •