Results 1 to 8 of 8

Thread: Need Brain to fire from M5 signal

  1. #1
    Registered
    Join Date
    Jan 2010
    Location
    USA
    Posts
    47
    Downloads
    0
    Uploads
    0

    Need Brain to fire from M5 signal

    I need a Brain to fire my dynamic spindle brake for a second or two when an M5 is issued through mach. Can anyone help me with the code?

    Thanks


  2. #2
    Registered
    Join Date
    Aug 2007
    Location
    England
    Posts
    215
    Downloads
    0
    Uploads
    0
    Can't help you with a brian - never had need of one - how about a simple mod to the m5 macro? don't know your system but assuming your brake is applied simply by a mach output pin then something along the lines of:

    Code:
    'M5 macro
    doSpinStop() 'stop spindle
    activateSignal(OUTPUT?) 'apply brake on output number ? (you choose)
    while isMoving()
      sleep 10
    wend
    sleep 2000 'apply brake for 2 seconds
    deactiveSignal(OUTPUT?) 'release brake


  3. #3
    Registered
    Join Date
    Jan 2010
    Location
    USA
    Posts
    47
    Downloads
    0
    Uploads
    0
    Stirling,

    That's a good idea. I might have tried that if my VB skills were better. I will use it.

    Thanks


  4. #4
    Registered
    Join Date
    Jan 2010
    Location
    USA
    Posts
    47
    Downloads
    0
    Uploads
    0
    I had to change the signal wording for my output, but it works. The only problem is that it fires when mach estops. So it's kind of going off a lot when I'm messing around. Maybe there is a specific signal that can be used instead of the m5?


  • #5
    Registered
    Join Date
    Aug 2007
    Location
    England
    Posts
    215
    Downloads
    0
    Uploads
    0
    can you post your modified code?


  • #6
    Registered
    Join Date
    Jan 2010
    Location
    USA
    Posts
    47
    Downloads
    0
    Uploads
    0
    The code you had was ok. I had to replace the activate/ deactivate signal with....

    SetMasterOutput(12, 1)
    SetMasterOutput(12, 0)


  • #7
    Registered
    Join Date
    Aug 2007
    Location
    England
    Posts
    215
    Downloads
    0
    Uploads
    0
    If I undertsnad you correctly the problem is that the brake is being applied even when the spindle wasn't actually on at certain times. The code below (untested) might give you an idea. It only fires the brake if the spindle was actually on. There may be better ways of doing this.

    Code:
    'M5 macro
    Const SpindleOnLED = 11 '(CW Or CCW)
    Dim spindleOn As Boolean
    
    spindleOn = getOEMLED(SpindleOnLED)
    
    doSpinStop() 'stop spindle
    
    'if spindle on then apply brake
    If spindleOn Then
      SetMasterOutput(12, 1) 'brake on
      While isMoving()
        sleep 10
      Wend
      sleep 2000 'apply brake for 2 seconds
      SetMasterOutput(12, 0) 'brake off
    End If
    (It should go without saying that E-stop should not rely on this or any other software. i.e. as well as everything else, the spindle brake should be applied by hardware following an e-stop too.)
    Last edited by stirling; 02-01-2011 at 04:39 AM.


  • #8
    Registered
    Join Date
    Jan 2010
    Location
    USA
    Posts
    47
    Downloads
    0
    Uploads
    0
    Looks great. I will give it a try. Thank you.


  • Similar Threads

    1. Brain dead
      By Gpl625 in forum General CNC (Mill and Lathe) Control Software (NC)
      Replies: 0
      Last Post: 10-03-2010, 03:12 PM
    2. fire clay/fire rock
      By banctecbobn in forum Casting Metals
      Replies: 10
      Last Post: 12-12-2009, 05:14 PM
    3. Newbie- 1.6V-3.0V random signal voltage parallel signal from output – Any advice?
      By cjchands in forum Mach Software (ArtSoft software)
      Replies: 0
      Last Post: 11-12-2009, 05:36 AM
    4. Smoke and fire...yes FIRE!
      By fatal-exception in forum Gecko Drives
      Replies: 13
      Last Post: 01-25-2008, 02:58 PM
    5. Brain Tease
      By DSL PWR in forum CNCzone Club House
      Replies: 7
      Last Post: 08-15-2007, 08:38 PM

    Posting Permissions



    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.