587,862 active members*
3,333 visitors online*
Register for free
Login
Results 1 to 18 of 18
  1. #1
    Join Date
    Mar 2004
    Posts
    1543

    Favorite Camsoft trick

    This is an advanced trick that works for CNC Pro. I spend nearly all my time editing logic after the initial setup work on a new machine. I found going through CNCSetup to edit the logic files cumbersome at best.

    First, a little explanation of how Camsoft Pro writes your setup files. CNCSetup saves an ASCII file as a *.cbk when you do a file save. It writes a whole bunch of ASCII *.fil files when you do a file restore. When CNC.exe loads it reads these files, not the *.cbk.

    The files I found of most interest are:
    Mcode.fil - your Mcodes
    Gcode.fil - your Gcodes
    Macro.fil - your macros
    inputio.fil - your interrupts for input changes
    startup.fil - initial startup logic

    Because these files are ASCII, you can edit these files directly with any text editor. I just use notepad. I made my CNC machine control window slightly less than full screen and put shortcut links to each of these files visible in the unused area.

    With the control still running, I can bring up any logic file of interest to examine the logic. An edit can then be made. You can just click "file save" in your editor, exit CNC.exe and reload CNC.exe to try the new logic.

    When I have the new logic right, I load CNCSetup and do a save to write a new *.cbk. In my case CBKs are saved with a date and version in the name e.g.. Mazak 11 10 05 a.cbk. I also put a HUGE number of comments with date right in my logic. Really saves time when you want to change something a year later. Or, in my case, the next week.

    Of course, if you screw up some file structure, you can REALLY hose things up. So, be careful and make sure you understand everything before trying this yourself.

    Karl

  2. #2
    Join Date
    Apr 2005
    Posts
    5
    Hey Karl,

    Thats a good idea. This is the kind of stuff I read CNC Zone for.

    billy

  3. #3
    Join Date
    Mar 2003
    Posts
    4826
    Speed up your Galil card. This is described in the Galil manual under the TM command.

    The default servo update rate is 1000 microseconds, but even with standard firmware, this can be reduced to as little as 375 microseconds on the DMC1842, which is what I opted for, since there is no penalty. The cards can run even faster, but then you lose some programming options with it.

    The reasons to do this? Better response time of the servos and of the onboard I/O.

    This is a quite simple adjustment to program into the Galil card, but it makes for a lot of changes in your various settings in your Camsoft setup. The servos have to be retuned since the PID is way out of wack by doing this, and your motor speed, acc/dec settings have to be multiplied by .375 (or whatever unit you have opted for), and the feedrate variable has to be set in startup.fil as
    \73=37.5
    Again, the exact value of this factor would be contingent upon the update rate you have decided to use. You did leave \73 attached to the feedrate variable, right?

    It is a good idea to do a final check of your system, to make sure that a programmed move that should take exactly one minute to execute, actually takes exactly one minute, no more, no less. This is very critical in setup of a lathe, since an improperly proportioned feedrate variable will result in thread cutting that is off pitch.

    In my system, I actually found that I had to adjust the feedrate variable from 37.5 down to 33.5 to get it perfect.

    Rapidspeeds are affected by this update rate, however these values are controlled directly by encoder counts, so by reducing your Camsoft Rapidspeeds by the .375 factor, they will be equivalent to what they were before you changed the speed of the card.

    Also, some care is required to control the feedrate variable in your InputIO.fil, if you have manual feedrate override buttons. Here is the relevant example from my file:

    IF#17=1THEN\273={\273+.1} 'feedrate increase pushbutton located on right side of feedhold button
    IF#19=1THEN\273={\273-.1} 'feedrate decrease pushbutton located on left side of feedhold button
    IF\273<0THEN\273=0 'minimum feedrate override is zero, or equivalent to feedhold
    IF\273>2THEN\273=2 'maximum feedrate override is 200%
    \73={33.5*\273} : DISPLAY4 {\273*f} : DISPLAY2 {\273*100} 'when feedrate variable \73=33.5, actual commanded feedrate is at 100% by external clock.
    EXIT
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  4. #4
    Join Date
    Jul 2003
    Posts
    33
    Good idea Karl. I will try this later today and Billy Boy is right. I would rather read useful ideas like Karl's than read those negative comments from the same people.

    HuFlungDung this is a good idea too. This would be great if I could figure out what you just said. I will try this over the week end and post my notes.

    Bob

  5. #5
    Join Date
    Apr 2003
    Posts
    332
    Both of you gentleman are very clever. We want to compliment you with your knowledge and both of these very good suggestions.

    Bobs and Billys observation is worth mentioning also because we have been noting the same patterns here. Ideas such as Karls and Huflungdung are what we believe CNC Zone readers want too.

    We thought we should add the fact that when you employ Karls idea that if you do make any edits that you must exit the controller and re-start it so that the changes to the logic can be compiled and take affect.

    Tech Support
    CamSoft Corp.
    (951) 674-8100
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  6. #6
    Join Date
    Mar 2004
    Posts
    36

    Editing the .FIL files

    If you edit the .FIL files directly with NOTEPAD make sure to turn word wrap OFF. If word wrap is on by accident then you can alter longer lines of code and not know it until you run the machine and get an error.

    Example:
    ' This is one long line of code and they can be much longer.
    ' This needs to be on one continuous line not two lines to run.
    IF#16=1THENIF#17=1THENIF#19=1THENIF\401=1THENRAPID SPEED 1;5000

    Example:
    ' This is the same example but with word wrap turned on and the notepad
    ' window shortened becasue of screen space or whatever reason, maybe
    ' the guy likes short windows. But you can see the line is now on two lines
    ' of code and caused an invalid statement.
    IF#16=1THENIF#17=1THENIF#19=1THENIF\401=1THENR
    APIDSPEED 1;5000

    ' THENR at the end of the first line is not a valid statement and will produce an error
    ' APIDSPEED 1;5000 is not a valid command on a line by itself and will produce and error

    I would suggest for begginers that they use the CamSoft editor because there is no option for word wrap so they will never run into this problem.

  7. #7
    Join Date
    Nov 2004
    Posts
    446
    Sorry Intrusion, I have to disagree with you....

    I have been using notepad.exe to directly edit the .fil files from almost the first day I bought the camsoft software. My entire application is finished and seems to work good, and to this day, I still have no clue how to use the camsoft visual interface to program what I want.

    I just found it much MUCH easier to use notepad than the visual stuff... Maybe its just me and the way I learn because I have some history with VB programing in Microsoft Access. (I used to write entire applications)..

    I never thought I would love notepad so much!!!! LOL

    Murphy

  8. #8
    Join Date
    Mar 2003
    Posts
    332
    I don't use the visual editor either, too cute. Murphy have you tried the "Edit Other Motion Control Files" on the setup interface? All the files are there from a pulldown so I don't have to have multiple windows open when I update the different .fil files.

  9. #9
    Join Date
    Mar 2004
    Posts
    36

    Editing the .FIL files

    Murphy,

    Yes, you are correct about the Visual Process Editor, however what I am reffering too is as Keith said there is a System File Editor (text based) just like notepad that you can use when you click on the "Edit Other Motion Control Files" button in the SETUP program. This is what beginners should use so they do not accidently do I as described earlier.

    I myself use a programmers editor, but this is not for beginners either or people who are not that comfortable with computers and programming. The System File Editor provided by CamSoft is the easiest error proof way to program in CamSoft.

  10. #10
    Join Date
    Nov 2004
    Posts
    446
    Ok. Im not sitting infront of my camsoft computer, and its been a good 7 months since I have needed to mess with it so my memory may be a bit skewed..

    I remember clicking on the "Edit Other Motion Control Files" and I did not like what I got. I barely even remember what it was but I do remember I went straight back to the notepad.exe.

    To this day, I still like notepad better. Having a dozen windows open is not unusuall for me anyhow. My quick launch bar at the bottom of my computer is usually 2 or 3 rows anyhow Over the years, I have become very proficient at having 10 to 20 windows open at the same time. I guess we each have our quirks..

    My post was not in any way meant to degrade the camsoft software.. I live and swear by it.. I'm just not crazy about the built-in programming interface they came up with. (and from what I am reading, you guys like notepad better also?)

    One thing I do like VERY VERY much is the way we can label each IO and Variable number with a "tag" and a short note. Oh god that saves so much time and effort.. without that ability, I would be screwed!!!! I have an aux IO board installed and I also use around 300 different Variables..

    Murphy

  11. #11
    Join Date
    Jul 2003
    Posts
    33
    On last weeks Notepad subject I have found it easier for me to look at the whole CBK file all at once in Notepad. This way I can search for variables and make changes through out the whole file quickly.

    Last week I said I would post after implementing HuFlungDung's suggestion on how to speed up the motion card. I have got the Camsoft system dialed in perfectly now so I decided to wait until a time when I wasn't so busy. This is a fantastic tip and I will try this later. Thanks for the great idea.

    Bob

  12. #12
    Join Date
    Jun 2005
    Posts
    4
    I use a program called notespad.exe. It offers more flexibility than notepad, and opens new files in tabs. It works great.

  13. #13
    Join Date
    Aug 2005
    Posts
    25

    Helical Hole

    Thanks for starting this thread Karl. Here is a routine I recently wrote. We have used it in two different scenarios since. 1. Round hole with flat bottom, 2. Thread milling a large diameter hole (Didn't have a tap that size.)

    Reason for creating routine:

    We needed to create a 3" pocket with a flat bottom. This routine starts in the center of the pocket moves over to position then helical interpolates down until it gets to Z depth then does one more rev at that depth to give the flat bottom. (there were some default G codes that are similar, but didn't do what I wanted.)

    Here is an example:

    G75 X-2 Y-6 Z-2.4 D1 H3 R.25 Q.06 F20


    Hole center: -2,-6
    Finish depth: -2.4
    Tool diameter: 1"
    Hole diameter: 3"
    Retract: .25
    Feedrate: 20 ipm
    Z cut per rev: .06

    This goes into GCODE.FIL:

    'Spiral mill - helical interpolation
    'example G75 X-2 Y-6 Z-2.4 D1 H3 R.25 Q.06 F20
    TIME CYCLE;\4
    DISPLAY7 \4
    [HELICAL HOLE]
    RUNTIME \4
    DISPLAY8 \4
    -----G75

    This goes into MACRO.FIL:

    [[HELICAL HOLE]]
    'G75
    'Spiral mill - helical interpolation
    LOADING \55
    IF \55=0 THEN EXIT
    \500=x'hole center X
    \501=y'hole center Y
    \502=h'hole diameter
    \504=z'hole depth
    \505={d/2}'tool radius
    \506=q'cut depth
    \507=-\506
    \508={\502/2+\501-\505}'starting point in Y
    \509={\502/2-\505}'arc center J
    \513=r'retract
    BLEND -30
    DECELSTOP
    RAPID \500;\501;\513
    GO \500;\508;0

    :CUT
    RUNTIME \4
    DISPLAY8 \4
    CW \500;\508;\507;;-\509
    READOUT3 \514
    'IF CURRENT Z IS HIGHER THAN HOLE DEPTH + CUT DEPTH THEN REPEAT
    IF \514>{\504+\506} THEN \507={\507-\506}:GOTO :CUT

    'LAST PASS
    FEEDRATE 5
    GO \500;\508;\504
    FEEDRATE 20
    CW \500;\508;\504;;-\509
    DECELSTOP
    RAPID x;y;\513
    z=\513
    BLEND -5


    As previously stated, I also used this to threadmill a 2.54-18 thread into a through hole. To use it as such, the Q value is important (1/# threads=1/18=.055) Worked beautifully.

    Hope all this makes sense.

    AL

    De Oppresso Liber - Is 61:1-4

  14. #14
    Join Date
    Feb 2006
    Posts
    4
    I agree with Karl T. and Chip Sweeper, and have been using notepad to quickly edit programs.
    I have one additional trick. I use a free program called WinDiff to compare two CBK files (in notepad). You load the two programs side by side, hit compare, and it will hi-light in red any differences. I works well if you have made a couple of changes and things are not working. Also, if cutomers have been messing with your CBK, you can easily spot the changes.

  15. #15
    Join Date
    Mar 2003
    Posts
    332

    Smile Spindle Speed Control on ethernet card

    I need to change a spindle rpm on the fly manually during a process so put this in my mcode.fil;
    I'm running a spindle from 2-50 rpm and can't do it with camsoft logic so using galil native commands in cnclite on an ethernet card.
    The spindle is the 7th axis so six commas. The shaft rpm is read using camsoft logic. M3 is clockwise or a replacement for SPINFORWARD. M4 similar to SPINREVERSE. Since the SPINDLERPM doesn't tell direction, I've added the \49 variable and setting a positive or negative value to multiply the rpm and keep the shaft turning in the same direction in accel/decel.

    I will add some more logic so I can change the direction without having to come back to the 1800 speed each time.

    !COMMAND JG ,,,,,,1800 '25 rpm using F2 key
    !COMMAND AC ,,,,,,10000
    !COMMAND DC ,,,,,,20000
    !COMMAND BG G
    !SPINDLERPM \50
    !\49=1
    -----M3
    !COMMAND JG ,,,,,,-1800 '25 rpm CCW using F3 key
    !COMMAND AC ,,,,,,10000
    !COMMAND DC ,,,,,,10000
    !COMMAND BG G
    !SPINDLERPM \50
    !\49=-1 'negative value to keep CCW going in speed change
    -----M4
    !COMMAND ST 'spindle stop on F4 key
    -----M5
    'spindle accel using F5
    !COMMAND JG ,,,,,,{\49*\50*80}
    !SPINDLERPM \50 'had a "sleep" value of .1 before this line, but slowed down the speed I could tap the keyboard.
    -----M10
    'spindle decel using F6
    !COMMAND JG ,,,,,,{\49*\50*60}
    !SPINDLERPM \50
    -----M11

    The m codes are linked to four F keys via the setup file. Speed or directional change via the keyboard is instant and smooth, :wee: and this is with an ethernet control card. TRUERPM couldn't keep things as steady. You would need to figure your own speeds for your encoder rate and spindle speed.

  16. #16
    Join Date
    Mar 2004
    Posts
    1543
    Keith,
    It's certainly handy to be able to use direct Galil commands. Some things just seem to work better that way. Don't know why, but I never thought of using Camsoft variables and math functions in sending direct galil commands. Neat.

    Karl

  17. #17
    Join Date
    Mar 2003
    Posts
    332

    say \xx

    I was using an onscreen display to show the spindle rpm, but I'm never looking at the screen when I'm working.
    In the mcode, after I send the speed value, I use :
    !SLEEP 1.0
    !SPINDLERPM \xx
    !SAY \xx
    and the computer voice tells me the rpm.

  18. #18
    Join Date
    Jun 2004
    Posts
    16
    hi guys,

    I have been doing what keithorr said for years now. This is cool stuff. When I first started I used big speakers to blast out the number of parts, air pressure too low, door is opened, load next part and a bunch of other handy stuff that you wouldn't notice. It's like having a buddy tap you on the shoulder and saying hey notice this.

    One machine I had done I misspelled the word to speak spanish out of the speakers. I don't know of this is a trick or not but you can put in periods to pause, explanation marks and question marks to accent the voice.

    johnny

Posting Permissions

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