586,106 active members*
2,916 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2010
    Posts
    49

    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
    Join Date
    Aug 2007
    Posts
    215
    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
    Join Date
    Jan 2010
    Posts
    49
    Stirling,

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

    Thanks

  4. #4
    Join Date
    Jan 2010
    Posts
    49
    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. #5
    Join Date
    Aug 2007
    Posts
    215
    can you post your modified code?

  6. #6
    Join Date
    Jan 2010
    Posts
    49
    The code you had was ok. I had to replace the activate/ deactivate signal with....

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

  7. #7
    Join Date
    Aug 2007
    Posts
    215
    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.)

  8. #8
    Join Date
    Jan 2010
    Posts
    49
    Looks great. I will give it a try. Thank you.

Similar Threads

  1. Brain dead
    By Gpl625 in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 10-03-2010, 08:12 PM
  2. fire clay/fire rock
    By banctecbobn in forum Casting Metals
    Replies: 10
    Last Post: 12-12-2009, 11:14 PM
  3. 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, 11:36 AM
  4. Smoke and fire...yes FIRE!
    By fatal-exception in forum Gecko Drives
    Replies: 13
    Last Post: 01-25-2008, 08:58 PM
  5. Brain Tease
    By DSL PWR in forum Community Club House
    Replies: 7
    Last Post: 08-16-2007, 01:38 AM

Posting Permissions

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