586,094 active members*
4,137 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2010
    Posts
    79

    Motion Clamp Question

    I just purchased a Kflop with Kanalog to retro fit on to a large gantry drill.
    This machine has old NSK motors in torque mode and linear scales on the X, W(dual drive) and Y axis and a standard ball screw on the Z.

    I had some questions about dual loop before and I think they have been answered, but let me know if there might be anything else to watch out for or where to start.

    Now the question I have is that this machine has hydraulic motion clamps.
    It is used with G81 drilling cycle 90% of the time and our code issues a M15 once in the beginning of the code that activates the motion clamps.

    The way they work is the machine positions the X and Y to the hole to be drilled, a output is activated that clamps the machine, the Z begins drilling, they drill retracts then the clamps are turned off and the machine moves to the next hole.

    What would be the best way to implement this with the Kflop? I am planning on writing my own GUI for this machine and if it works well we have 2 more of the same machine that could use this upgrade.


    Thanks
    Dave

  2. #2
    Join Date
    May 2006
    Posts
    4045
    Hi Dave,

    One problem with clamping the xy axes may be that after clamped there is likely to be a small error introduced that the servos may try to correct but be unable to do so because the axes can't move. Especially with some Integrator Gain the applied servo force will ramp up to a huge value possibly generating an amplifier fault or a big jerk when the clamp is finally released.

    I'm not sure the best way to handle this. The M15 code that enables the clamp may also want to disable the servo or maybe change the servo gains to zero or near zero values. And then another Mcode to unclamp the axes may restore the gains or re-enable the axes. You will probably need to experiment to find the best approach.

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Oct 2010
    Posts
    79
    Thanks Tom,
    Currently it is using a galil card and does not disable the amps when the clamps are on. Plus the servos can still move the machine with the clamps since they are not that strong.

    The M15 is only called once at the beginning of the code, not before each cycle.
    I am guessing that I will have to modify the interpreter code so that it looks for a clamp flag (set by the m code) at the beginning of the canned drill cycle and activate / deactivate accordingly.

    Does this sound like the right way to do it?

    Also one feature that we use all the time with the old software is the single block feature. basically during the canned drill cycle the operator presses the single block key, the machine finished the current hole and retracts and waits for cycle start to be pressed.
    If it is pressed with out deactivating single block it will drill the next hole and wait again.
    if it is deactivated then cycle start will continue as usual.

    I noticed in Kmotion that you have a step button to run a single line, but I did not see a single block to activate the pause after the current line.
    Is this built in somewhere that I am missing it?


    One more question.
    I plan to use a PLC so I can have more I/O. It uses ASCII modbus and I think I get how to read/write the registers but what is the best way to pass this data from a C program to the .net HMI?



    Thanks
    Dave

  4. #4
    Join Date
    May 2006
    Posts
    4045
    Hi Dave,

    If you don't currently disable the servos while clamped, then you shouldn't have to with our control either.

    It still isn't clear how the current system works. How does it know when to clamp and unclamp?

    The M15 turns on the automatic clamp/unclamp mode or something?

    It seems like the simplest thing would be to put a clamp MCode before the G81 and an unclamp MCode after. Why not do that? More lines of GCode?

    You could write a C Program that runs watching Z and as soon as it starts to move down enable the clamp, and then after it retracts back up to the original Z position unclamp. Would that work?

    None of this seems to require modifying the Interpreter.

    I noticed in Kmotion that you have a step button to run a single line, but I did not see a single block to activate the pause after the current line.
    Is this built in somewhere that I am missing it?
    Not sure what you mean? Do you want to run one block (line) of GCode at a time? If so just push the Single Step button.

    I plan to use a PLC so I can have more I/O. It uses ASCII modbus and I think I get how to read/write the registers but what is the best way to pass this data from a C program to the .net HMI?
    One way would be to put the PLC IO into Virtual IO bits. The PC app can just read/set those just like other IO on KFLOP

    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Dec 2003
    Posts
    24221
    Quote Originally Posted by Dave3891 View Post
    Thanks Tom,
    Currently it is using a galil card and does not disable the amps when the clamps are on. Plus the servos can still move the machine with the clamps since they are not that strong.
    Dave
    IMO it is not a good idea to clamp servo's when they are still active?
    With Galil it is usual to use the motor command off (MO) when braked or clamped, in the event of any motor movement, the control still keeps track of position via the encoders and when the motors are re-enabled the control updates the actual position to the current position.
    This should be done regardless of what control you are using.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  6. #6
    Join Date
    Oct 2010
    Posts
    79
    It still isn't clear how the current system works. How does it know when to clamp and unclamp?

    The M15 turns on the automatic clamp/unclamp mode or something?
    I have the origional QBasic code for this machine and the way they do it is by using M15 to set a flag for clamping.
    Then the code has a function called SUB DrillCycle (ZVal!, RVal!, FeedRate!)
    In this it looks for the flag and if set it calls
    IF UseClamps% THEN
    CALL Clamps(True)
    END IF
    in the beginning and then turns them off when retracted.

    You could write a C Program that runs watching Z and as soon as it starts to move down enable the clamp, and then after it retracts back up to the original Z position unclamp. Would that work?
    This could work, is there a flag or something that can be checked to see if it is in a canned cycle?


    Here is a basic Gcode example
    N9 G00 G90 X-19.3883 Y-5.6088
    N10 S855 M03
    N11 M08 M11
    N12 Z1.
    N13 M15 << Enable the clamps
    N14 G81 Z-.15 R1. F4.24
    N15 X-19.3883 Y-4.6245
    N16 X-19.3883 Y-3.6403
    N17 X-19.3883 Y-2.656
    N18 X-19.3883 Y-1.6718
    N19 X-19.3883 Y-.6875
    N20 M16 << Disable the clamps
    N21 M05

    Not sure what you mean? Do you want to run one block (line) of GCode at a time? If so just push the Single Step button.
    But how can you go in to this mode half way through a program?
    Is there a way to stop the interpreter after it finishes its current line?
    One way would be to put the PLC IO into Virtual IO bits. The PC app can just read/set those just like other IO on KFLOP
    Are there any examples of this?
    Can these virtual IO bits be read from a C program as well?



    IMO it is not a good idea to clamp servo's when they are still active?
    With Galil it is usual to use the motor command off (MO) when braked or clamped, in the event of any motor movement, the control still keeps track of position via the encoders and when the motors are re-enabled the control updates the actual position to the current position.
    This should be done regardless of what control you are using.
    Al.
    The clamps really are not that strong so I would be more worried about the machine moving during a drill cycle with the servos off.

  7. #7
    Join Date
    May 2006
    Posts
    4045
    I have the origional QBasic code for this machine and the way they do it is by using M15 to set a flag for clamping.
    Then the code has a function called SUB DrillCycle (ZVal!, RVal!, FeedRate!)
    In this it looks for the flag and if set it calls
    IF UseClamps% THEN
    CALL Clamps(True)
    END IF
    I suppose you could modify the Interpreter code for G81 to do the same thing, especially since you plan on doing your own GUI.

    This could work, is there a flag or something that can be checked to see if it is in a canned cycle?
    Not really, but I think you could basically use the M15 to set a flag to enable the mode.

    But how can you go in to this mode half way through a program?
    Is there a way to stop the interpreter after it finishes its current line?
    Good point. We don't have that. We have "Halt" that would stop immediately within the current block. Then Single Step could be used to repeat the current block.

    Are there any examples of this?
    Can these virtual IO bits be read from a C program as well?
    The ModBus Master Example does this with a Click PLC for 8 inputs and 8 outputs to Virtual IO bits.

    Yes from a C program use SetBit(), ClearBit(), ReadBit() functions for all IO bits including Virtual IO bits.

    Regards
    TK
    http://dynomotion.com

  8. #8
    Join Date
    Oct 2010
    Posts
    79
    Good point. We don't have that. We have "Halt" that would stop immediately within the current block. Then Single Step could be used to repeat the current block.
    Does the interpreter have the ability to do a "finish this line" type of thing or woudl something have to be modified?
    I haven't really looked in to the file run part of your code too much yet, but how is it send to the interpreter?
    Would this cause issues with the planner look ahead?

    The ModBus Master Example does this with a Click PLC for 8 inputs and 8 outputs to Virtual IO bits.

    Yes from a C program use SetBit(), ClearBit(), ReadBit() functions for all IO bits including Virtual IO bits.
    Is this in the newest beta version? I have Kmotion429 and I don't see it.
    It should work great since it is a click PLC that I am going to use.


    Thanks
    Dave

  9. #9
    Join Date
    May 2006
    Posts
    4045
    Dave,

    Does the interpreter have the ability to do a "finish this line" type of thing or woudl something have to be modified?
    I haven't really looked in to the file run part of your code too much yet, but how is it send to the interpreter?
    Would this cause issues with the planner look ahead?
    Not currently. But it is structured to read a block, then execute a block. So it wouldn't be too hard to make a test each line on whether to stop or not. See function calls:

    rs274ngc_read() and rs274ngc_execute();

    However as you note in some cases the Interpreter might be working hundreds of GCode blocks ahead along the path from where the machine tool actually is. In this case it may be physically impossible to stop on the next block from where the machine tool is. Instead it would stop on the next lookahead block and the Tool would proceed up to that point. This shouldn't be an issue with Drill Cycles as there wouldn't normally be any lookahead involved.

    Is this in the newest beta version? I have Kmotion429 and I don't see it.
    It should work great since it is a click PLC that I am going to use.
    Yes the ModBus Examples are not in Version 4.29. Please use the Test Version 4.30m

    Regards
    TK
    http://dynomotion.com

  10. #10
    Join Date
    Oct 2010
    Posts
    79
    I have started playing with the Kflop and I have it working well with the Click PLC so now I am back to the motion clamp issue.

    I have looked at the gcode interpreter and I am a bit confused at the flow from Gcode -> Kflop
    I get that is starts with the rs274ngc but I don't know what file the commands get driven to. I think normally it would be the cannon and driver files but this doesn't look like it.
    Any information of the flow through the files would be appreciated.


    I have a question on the M codes.
    I want to try the motion clamps with just a C program and I am not sure how to get a M code (eg M15) to set a bit. Is there a config file somewhere that I set all the m codes in ?
    I think that if I set a bit with the m code then check for Z commands and check for 0 X and Y commands and if all is true I activate the clamp.
    What command would I use for monitoring the current axis command?



    Thanks
    Dave

  11. #11
    Join Date
    May 2006
    Posts
    4045
    Hi Dave,

    There is a GCodeInterpreter object that encapsulates the rs274ngc code, thread creation, Coordinated motion, trajectory planning, buffer management to KFLOP, callback for status and back plotting, etc... After setting parameters you should be able to just call "Interpret" to execute a Gcode File. See the Dynomotion VB.NET, KMotion dotNET Console, and SimpleGCode examples.

    The interpreter has an "Invoke Action" concept for M Codes. There are a number of "Action Types". Setting a Bit, Setting two bits, running a C Program in KFLOP, Running a Windows Program, etc... Look at the GCodeInterpreter.h file for information. Basically there is an Array of MCODE_ACTION s that correspond to the M Codes. Fill in the parameters and the MCodes should then work.

    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Building Vacuum Clamp and Mechanical Clamp Sub-Table
    By automizer in forum DIY CNC Router Table Machines
    Replies: 11
    Last Post: 04-27-2012, 06:46 PM
  2. Motion King nema's question
    By 111wildbill999 in forum Stepper Motors / Drives
    Replies: 1
    Last Post: 04-03-2010, 07:50 AM
  3. Building Vacuum Clamp and Mechanical Clamp Sub-Table
    By automizer in forum Work Fixtures / Hold-Down Solutions
    Replies: 0
    Last Post: 04-08-2008, 03:05 AM
  4. question about precision motion controlls
    By D DAY in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 10-24-2007, 12:14 AM
  5. Galil motion controller question
    By REVCAM_Bob in forum CNC Machine Related Electronics
    Replies: 6
    Last Post: 07-22-2007, 10:24 PM

Posting Permissions

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