584,857 active members*
4,452 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Setting up Feed, Rapid and Spindle override with potentiometers...
Page 2 of 2 12
Results 21 to 37 of 37
  1. #21
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    I'm not sure why that would be. Were they working before the change?

    Can you provide all the details so we can try to duplicate. Your Screen Script? How M3,M4,M5 are configured? Any Spindle Programs?
    TK
    http://dynomotion.com

  2. #22
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Tom,
    Just checked with a INIT program before i added pots and the physical Spindle buttons do not work when a Gcode is running or in FeedHold, but when Gcode is not running the physical buttons work fine.Again, the keyboard hotkey buttons for spindle F9,F10,F11 do work when Gcode is running. So problem was before adding pots. Attached is my 3 screens and my c programs for M3,M4,M5 and the rigid tapping c code.
    Testing Gcode is simple....
    G20
    M3S500
    G01 X-.5 F10.
    G01Z-10.F10
    G01Z0F10
    G01X0.
    M30

    Let me know if there is something else you might need that i did not include.
    Thanks,
    Troy

  3. #23
    Join Date
    May 2012
    Posts
    537

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    I guess kmotioncnc is not allowing the M codes to be sent while a job is running. Instead of your init file sending an M code after pushing physical buttons, consider copying the M3/4/5 code directly into the init file. Should work that way.

    Glad you got the pots working the way you want. Isnt it awesome how we can get just about anything to work exactly how we want with just a few lines of code?

    Mark

  4. #24
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    Mark is correct. For safety reasons KMotionCNC rejects requests of MCodes or User Buttons while a Job is running. Maybe we should have an option to override this. Copying the code that eventually needs to execute should work and actually be faster and more reliable as it wouldn't depend on the PC. Shame to have duplicated code though. You could put the functions in an include file.

    We are working on new Screen Script functionality that might also solve this. Where Screen Script can push a screen button or a keyboard button. Also the ability for KFLOP to command KMotionCNC to execute Screen Script (without pushing a User Button to do so).
    TK
    http://dynomotion.com

  5. #25
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Quote Originally Posted by mmurray70 View Post
    Hi Troy,

    I guess kmotioncnc is not allowing the M codes to be sent while a job is running. Instead of your init file sending an M code after pushing physical buttons, consider copying the M3/4/5 code directly into the init file. Should work that way.

    Glad you got the pots working the way you want. Isnt it awesome how we can get just about anything to work exactly how we want with just a few lines of code?

    Mark
    Hi Mark,Tom
    Iam always amazed at what is being done with C code. Wish i could comprehend it more tho.

    Hi Troy,

    Mark is correct. For safety reasons KMotionCNC rejects requests of MCodes or User Buttons while a Job is running. Maybe we should have an option to override this. Copying the code that eventually needs to execute should work and actually be faster and more reliable as it wouldn't depend on the PC. Shame to have duplicated code though. You could put the functions in an include file.

    We are working on new Screen Script functionality that might also solve this. Where Screen Script can push a screen button or a keyboard button. Also the ability for KFLOP to command KMotionCNC to execute Screen Script (without pushing a User Button to do so).
    Will see if iam successful at adding button code to INIT and will let you know.

    Thanks again guys,
    Troy

  6. #26
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Tried adding code but main INIT does run past the point where i added code and when i run main INIT code, spindle trys to start and then turns off. If i let machine set for a minute or so, spindle will try to start again! So needless to say i reverted back to an older program. What would be safer and more reliable, having spindle buttons connected to Konnect board like i have them or using the keyboard hotkeys? As the hotkeys seem to work no matter what.

    Thanks,
    Troy

  7. #27
    Join Date
    May 2012
    Posts
    537

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    I would think you can still get it working reliably with external buttons, probably just some little bug somewhere in the code. Should be able to fix it. But honestly I find the hotkeys to work fine. Thats all im using. I had a start/stop button first but decided not to use them for some reason. At least doing it with the hot keys your code is only in one place, so if you make changes you dont have to remember to do it twice. And it will probably be easier to use delays for the spindle to ramp up this way too. Delays in the forever loop would obviously be a bad idea. I just mounted a keyboard directly to my controller and put some labels on the buttons for the spindle. See attached pic. Works fine for me.

    Mark
    Attached Thumbnails Attached Thumbnails Untitled.jpg  

  8. #28
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    You might have placed the code in the wrong place. Post the code and we can check it.
    TK
    http://dynomotion.com

  9. #29
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Thats similar to what i have now on my mill.Except its not nicely layed out as yours. I plan to make a control panel for it after this lathe project is done. Using what i have learned from lathe buttons setup.

  10. #30
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Tom,
    Atttached is INIT c code. The Spindle CW and CCW also has the pop up reminder asking if 3 phase converter is on.
    Troy
    Attached Files Attached Files

  11. #31
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    You forgot to put in curly brackets.

    When you have a conditional statement like:

    if (result == 1)

    That means either the following single statement will only be executed when the condition is true, or the following block of code marked with curly brackets will only be executed when the condition is true.

    When you have:

    Code:
    if (result == 1)
    A;
    B;
    C;
    Only the A will be skipped if the condition is not true. B and C will always be executed regardless. Which is the problem you are seeing.

    If that is actually what you want you should indent the code to show only A is impacted by the if statement this like:

    Code:
    if (result == 1)
        A;
    B;
    C;
    But if you want to skip a bunch of instructions when the condition isn't true put them in curly brackets like this and indent the instructions to show they are all in the same block like this:

    Code:
    if (result == 1)
    {
        A;
        B;
        C;
    }
    Think of the curly brackets like shorthand for Begin and End statements.

    Note that indenting the instructions properly doesn't change how it will execute but just makes it easier to read and see problems.

    Let me know if this makes sense. If not we can correct it for you.
    TK
    http://dynomotion.com

  12. #32
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Tom,
    I think i made some progress with the curly brackets The main INIT program appears to be running completely now and not stopping at the section that handles the Spindle buttons. But now i have a new issue. When i turn on spindle with my physical buttons the spindle starts and then about 1 second later it shuts off. This happens in both directions. Attached is updated INIT program.

    Thanks,
    Troy

  13. #33
    Join Date
    May 2012
    Posts
    537

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Quote Originally Posted by Need TECH Help! View Post
    Hi Tom,
    I think i made some progress with the curly brackets The main INIT program appears to be running completely now and not stopping at the section that handles the Spindle buttons. But now i have a new issue. When i turn on spindle with my physical buttons the spindle starts and then about 1 second later it shuts off. This happens in both directions. Attached is updated INIT program.

    Thanks,
    Troy
    Hi Troy,

    Looks like your making progress but still may have some issues with curly brackets. You have an If statement to check for spindle start button, and inside of that you have an if/else statement to check if phase converter is on. And I think its being read as, if button is pushed start spindle, else stop spindle. So any time button is not pushed the spindle will be told to stop. Its much easier to see whats going on if you indent the code something like this screenshot, see how it looks to be turning off spindle any time button is not pushed?

  14. #34
    Join Date
    May 2012
    Posts
    537

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Troy, see if this works. Im not 100% sure if its right or not. It is a little confusing with a few things going on there. Good luck with it.

    Mark
    Attached Files Attached Files

  15. #35
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    I think Mark is correct and fixed the CW button but the problem was with the CCW. Attached I tried to correct both. And formatted the entire file to make it more readable.
    TK
    http://dynomotion.com

  16. #36
    Join Date
    May 2006
    Posts
    4043

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    This is a new feature that we will be releasing soon which may help with coding

    https://youtu.be/CsIijoLMq8U
    TK
    http://dynomotion.com

  17. #37
    Join Date
    Dec 2007
    Posts
    578

    Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Code works moocho better now Thanks guys.
    Also checked out video earlier today, looks good and simple for me. Glad I could be a sort of test subject
    Will be waiting for the test release version.

    Thanks again,
    Troy

Page 2 of 2 12

Similar Threads

  1. Replies: 38
    Last Post: 03-09-2015, 05:19 PM
  2. Disable Feed and Speed override potentiometers - Heidenhain
    By doubravacek in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 1
    Last Post: 10-27-2011, 10:21 PM
  3. Override rapid feed rate in program?
    By donl517 in forum Fadal
    Replies: 5
    Last Post: 09-18-2009, 06:36 PM
  4. Please help with feed/rapid override parameter
    By Hermle UWF851 in forum Fanuc
    Replies: 2
    Last Post: 04-22-2009, 10:29 PM
  5. feed override and rapid speeds
    By rkremser in forum Mach Mill
    Replies: 1
    Last Post: 02-03-2009, 03:04 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
  •