Hello Guest it is April 20, 2024, 03:55:36 AM

Author Topic: plugin/wizard/external editor to automatically organise and edit tp-files  (Read 8167 times)

0 Members and 1 Guest are viewing this topic.

hi everyone,

my first post so please excuse my asking obvious questions..


ok.. i do build snowboards..using a bzt cncrouter, rhino/madcam to generate code and at the moment mach3 but plan to switch to mach 4 for continious support in the future.

my problem is that doing some sort of semi custom production, i have to manually choose from many existing (some hundreds) different single tp-files and add offsets manually, depending on client's board configuration.
That is time consuming and error prone.


So my idea is to get a friend who is a programmer at UCSD to write me either an external software, maybe to be somehow connected to mach or some sort of plugin or wizard or what ever, sorry have no bloody clue of  programming, some vb class at uni long time ago ;D ???


the design brief would be:
 -some sort of simple selection/scroll down menu to choose between relevant shape parameters (6x6x3x3x3 parameters) and offsets (ca 50 offsets)
=>then relevant existing toolpath files (relatively simple 2D files) get chosen automatically (ca 14 files to be chosen ot of a number of a couple hundred, i would think by their file name), some of them  
     summarised/integrated as defined. total output number of resulting files would be ca 4-5.
=>x/y/z offsets get added automatically into these 4-5 files as defined/chosen in scroll down
=>a great goodie would be if it could mirror single toolpaths around an axis other than 0/0, change the direction they are running (keep it clockwise), add an offset and summarise as said above, would cut down CAD/CAM  
      work to generate exiisting base file significantly, but not sure if that's possible

Also my friend said he could quite easily write something external, maybe webbased so he could use a configurator on my website, but then i would need to manually open the new changed files in mach?
Or he could write some sort of plugin that could doo all that inside of mach 3 or 4?

What do you guys think? any tips will be highly appreciated !!!


As he is no cnc/gcode guy and doesn't know anything about gcodes, i need to provide him with the relevant changes in code that need to be made automatically and the exact positions of tose added code/changes in the existing codes.
My understanding of code is quite basic as well , so i could do with some help, thanks :) ???
An abbreviated example of one of the 2D routing codes generated in Madcam for mach3 would be as follows, i left out the center part, as it is of no importance..:

G00 G49 G40.1 G17 G80 G50 G90 G64
G21
(6mm)
M6 T1
M03 S15000
G01Z30.000
G00X-1284.500Y-420.000
Z16.350
Z15.000
G01Z0.000 F100
X-1284.953Y-420.003F1500
X-1285.407Y-420.011
........
......
X-1391.500Y-645.000
Y-648.000
X-1406.500
G00Z8.175
G00Z16.350
M5 M9
M30

so my questions regarding this:
-where do i insert a global offset of let's say +5mm in x y or z direction and how would the correct spelling be? would that be the same for mach 3 and 4?
-how would i summarise the code above with another code into one tp file? (let's assume i just use the same one twice) how would then header/start and tail end look like? with no pause, with a pause after moving to a  
  predefined position, and with or without different offsets for the two parts?
- is it possible to mirror single toolpaths  around an axis other than 0/0, ( i think you do that with some sort of scaling and -1 ?) AND also change the direction they are running (keep it clockwise), add an offset and summarise as said above, would cut down CAD/CAM work to generate exiisting base file significantly, but  
  not sure if that's possible

hmm my head hurts...i really hope i managed to explain this so it makes some sense..please let me know if not  :)


thanks a lot in advance to everyone..
cheers,
andi
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #1 on: September 08, 2015, 07:19:12 AM »
hi again,

hmm not sure if no answers after a week is normal or if my questions are not clear or dumb ;)

may anyone please enlighten me?

cheers, andi

Offline Tweakie.CNC

*
  • *
  •  9,198 9,198
  • Super Kitty
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #2 on: September 08, 2015, 08:21:05 AM »
Hi Andi,

Don't despair, I think your question is clear and it is certainly not dumb.

The problem is that there are not that many people here that fully understand what you are attempting to do and they have not yet picked up on your post to provide a suitable reply.

TP will know the answer - perhaps he will respond.

Tweakie.
PEACE

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #3 on: September 08, 2015, 09:12:10 AM »
What you are asking is a HUGE undertaking for Gcode applications.  It is BEST left to the Cad side to do what you want. In that realm you would want o be a parametric style Cad like solid works where you can recreate the entire aspect of the object with a single input of a new value.

Basically you want to take a basic shape then stretch or shrink or change it in specific ways defined by the customer. ??

NOW could it be DONE on the Gcode side ?? SURE it can with parametric /conditional Gcode with subs.  IF you think YOUR Head head hurts thinking about it try programming it (;-).

Mach3 and Mach4 are totally different dogs in respect to how it would work in each of them.  Mach3 is very limited in that it does NOT do conditional Gcode. AND Mach4 is NOT far enough developed to insure that it actually would work correctly.

YOU need to talk to one of the CAD manf like Solid Works.  Your project would best be attacked as a 3d object . They work in that realm every day and fully understand what you need/require.

You are NOT the first surboard/snowboard manf that has wanted to do this(;-).  


I THINK what you are looking for is BOARDCAD. It is a free software design program. (;-)

(;-) TP

« Last Edit: September 08, 2015, 09:24:56 AM by BR549 »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #4 on: September 08, 2015, 09:38:34 AM »
Quote
where do i insert a global offset of let's say +5mm in x y or z direction and how would the correct spelling be? would that be the same for mach 3 and 4?

First have an understanding of offsets, the attached should help, but only you can know where to put it.

RICH

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #5 on: September 08, 2015, 09:59:36 AM »
Think I agree with TP on using CAD / CAM to do.

I aware of, but do not use Rhino or Madcam, so can't be of any help on their application.

Sometimes it's easier to just adjust a base design than to try to piece together and modify a bunch of stuff. You spend more time fixing than creating new.
The high end software is costly and I am going to assume that is not in your budget.

Sorry no simple answer to your complex desire.

BTW,
There are some  25000 users of this site and maybe someone will surprise you. Just never know...........

RICH
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #6 on: September 08, 2015, 11:38:01 AM »
thanks guys..was getting nervous;)
R549 you have misunderstood what i meant, i should try to explain it more simply, sorry.
no i am not trying to shrink or scale g code. it's actually just a little programm inside or outside of mach that automatically edits gcode-txt files, it:
chooses the right (postprocessed) toolpath-txt-files out of a couple of hundred txt files by their name, depending on chosen options in scroll down menu.
summarises some of them (just putting one txt behind the other in one single text file?.. maybe gcode-autostart the next one after running the one before, but not essential)
entering some global offsets into those txt files depending on choice in scroll down menu.

as a bonus: mirror some and change direction of toolpath, but that's just a nice to have. i was told mirroring can be done with a scaling command and using -1 as a variable/degree.
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #7 on: September 08, 2015, 11:46:46 AM »
oops wasnt done typing yet..
if someone could help me  how to correctly edit the txt files/how to spell that new code bits and where to put them exactly, that would be of great help:

-how to enter global offsets correctly in a code like above..
-how to summarize (with pause between parts at a toolchange position or with autostart? changes to headers and foots in code?)
- how to mirror and change direction if possible?

thanks guys, highly appreciated
andi

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #8 on: September 08, 2015, 01:41:08 PM »
I understood exactly what you were referring too (;-). There is NOTHING simple about what you want to do. I do parametric conditional SUB programming all the time for FAMILIES of parts where as the PART is defined by the required parameter (options). It can take 100's of hours to create the master CODE. After that it is as simple as inputting a new #var to change what you are creating on the machine.

You may want to take a look at BoardCad.  

(;-) TP
« Last Edit: September 08, 2015, 01:46:40 PM by BR549 »

Offline RICH

*
  • *
  •  7,427 7,427
    • View Profile
Re: plugin/wizard/external editor to automatically organise and edit tp-files
« Reply #9 on: September 08, 2015, 10:19:56 PM »
Hey...hey  there TP,

I thought you were joking about the BoardCad.  :D
Darn there is free program for it and andiabel should have a look.

andiabel,
Posted  basic info you need to understand about global offsets. Read and apply the knowledge if even needed.
I may also suggest that you  purchase CNC Programing Handbook by Smid.
More info on gcode in that book and how to use it than any guidance that we can provide.

RICH