Hello Guest it is March 28, 2024, 06:25:11 PM

Author Topic: VB or Brains Question  (Read 18522 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB or Brains Question
« Reply #40 on: August 18, 2010, 11:57:06 PM »
Ok here it is, I put the default Z ht. for 0.25" 

so when the UserLED 1500 is ON, and the Z is lower than 0.25" that activates the clamp, and it stays on, until you go above 0.25" (or what ever you set it for). once above 0.25 it will unclamp.....

is that what you wanted?? or did you want it that when it is below the Z trigger hieght, but only clamp on the down direction and unclamp on the up directions??

at any rate, here is the revised version.....

scott
fun times
Re: VB or Brains Question
« Reply #41 on: August 19, 2010, 01:05:39 AM »
It sounds like it will work pretty good.
Are you able to make it so that the clamp will activate as soon as the X and Y distance to go reach 0, and then they deactivate when the Z has retracted to a set value? And possibly a time delay between the turn off and the start of the next XY movement?

I know I am asking alot, but would I be able to get the source to the plug in? I want to learn how to start making them as well.  :)

Thanks.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB or Brains Question
« Reply #42 on: August 19, 2010, 09:19:27 AM »
Ok here are my questions/answers......

It sounds like it will work pretty good.
Are you able to make it so that the clamp will activate as soon as the X and Y distance to go reach 0, and then they deactivate when the Z has retracted to a set value? And possibly a time delay between the turn off and the start of the next XY movement?

***  Ok, are you wanting the above INSTEAD of what you have now, or in addition to what you have, if you want them both do you want to be able to choose between the two type of clampong functions?

So if I understand you correctly, you now want where the OUTPUT1 will not activate until the X and Y ToGo DROs become 0.  But the only thing that will DeActive OUTPUT1 is the Z axis going over a specific hiegth?
Further once it goes above that Z hiegth, you would like a "Time Delay" before the OUTPUT1 would Deactivate, correct?
IF I have above what you are wanting, then yes it can be done....  If I dont understand explain what you want better, I will also need to know, would this take the place of how the Z clamp is currently working??
ALSO:  The Time Delay would need to be in 100ms units, since that is the loop rate of the plugin. If you would like to "Set" a variable delay vs. a hard coded delay, I can add a place on the config screen where you can enter the amount, in 1 ms intervals.

I know I am asking alot, but would I be able to get the source to the plug in? I want to learn how to start making them as well. 

If you want to learn plugins I HIGHLY, HIGHLY recommend you read Jemels "Plugin Tutorial" in the memeber docs, he takes you from Ground 0, to writing a usuable plugin.  I will send the source to you off list for a example as well.
Also the "Plugin Wizard" that Ed Bryson did (complete with trianing videos), is a MUCH easier way to do plugins!! If your going to learn them I would recommend you use his Wizard!!!!!!!!

Email me at: poppabear"AT"hughes.net

scott
fun times

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: VB or Brains Question
« Reply #43 on: August 19, 2010, 11:36:18 AM »
HIYA Scott, If you have not figured it out yet we are CLAMPING the gantry to the bed from  INSIDE of a canned drill cycle(;-) so obviously it cannot clamp while XY are moving.

 From my perspective it would need to clamp as soon as the Z started to move down to secure the gantry before the bit gets to 0.000. or else the gantry can jitter if the bit gets to the material before the gantry gets clamped tight

On the Z up stroke it needs to wait until after 0.00 is reached before it unclamps to insure the bit does not wobble in the hole AND give the unclamp cycle time to unclamp before the z reaches the Rlevel and the xy starts to move to the next hole. If the clamp does not unclamp fast enough OR you do not allow enough time based on teh retract level the xy drives may fault or steppers loose steps.

My thoughts are instead of a preset height "trigger" the clamping would begin on the start of the downstroke and end after it clears 0.00 on the way up. That way the operator/programmer can adjust the clearance height needed to allow cycle time for the clamp to work via the retract level of the Drill cycle and could be set from the Cam post.

Also remember some drill cycles are not like the G81 where you have a straight move to the bottom and a straight move to the top again. The g83 is a peck cycle and there are dwell drill cycles as well so if that can be worked in it would be great

This could be a very handy MACH  Mcode utility.

Just a thought
« Last Edit: August 19, 2010, 11:52:26 AM by BR549 »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB or Brains Question
« Reply #44 on: August 19, 2010, 11:55:07 AM »
what you have now does that.......

   Currently the trigger hight is set to 0.25 +.  as the Z goes down below that value, and still above the 0.00 vlaue the OUTPUT1 is told to clamp, in your Drill cycle put your retract level to above  +0.25", as it retracts above that it will unclamp
depending on your retract feed rate and how far up past 0.25 your are retracting there is some time involved there to give the clamp, time to unclamp. If that is not enough time, add a G4 P1 or what ever following your Drill cycle, prior to the next XY moves..... make all your XY moves above the 0.25" trigger point.

If I am still not following, educate........

scott
fun times

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: VB or Brains Question
« Reply #45 on: August 19, 2010, 02:22:30 PM »
CLOSE enough(;-)



 It is probably best to just leave it at a custom thing and not a general Mcode function unless Brian can add it to all the drill cycles

(;-) TP
« Last Edit: August 19, 2010, 02:24:45 PM by BR549 »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB or Brains Question
« Reply #46 on: August 19, 2010, 05:03:17 PM »
ok, run it on your machine to see if it works for you like you think it should.

scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: VB or Brains Question
« Reply #47 on: August 19, 2010, 09:23:11 PM »
Hey Dave,

    Here is the Code that operates the plugin, this code is just dropped into the UpDate() loop part of the plugin, all else of the plugin is Boiler plate of the "Universal Blank" plugin templete I posted up on the Plugins section.

After looking this over though, you could have done the exact same thing with VB in the Macro pump coupled with Brains to use the Serial Plugin Modbus to set your modbus IO......

void   myUpdate () // 10Hz update loop
{//====================START my update================================   

   if (GetLED(m_TriggerLEDNum)) //UserLEDnumber var (int) from dialog
   {   
      if ( GetDRO(802) < m_Zhiegth ) //Z height trigger var (double) from dialog
      {
         if ( GetDRO(802) < OldZhiegth ) //internal var as double
         {
            if (m_UsePPoutput) //bool check box from dialog
            { Engine->OutSigs[m_OutputNumber + 6].Activated = 1; }
                                                                 //the Mach internal var sturct/var for outputs 1-6
            if (m_UseMBSerialoutput) //bool check box from dialog
            { MainPlanner->ModBusData.cgf[m_CfgNum].Data[m_SerialMBlocalvar] = 1; }
                                                                 //if using the Serial plugin modbus, gets the Config#, and Local Var# from
                                                                 //the dialog box
         }
      }
      OldZhiegth = GetDRO(802);

      if ( m_Zhiegth < GetDRO(802)){      
         if (m_UsePPoutput)
         { Engine->OutSigs[m_OutputNumber + 6].Activated = 0; }
         if (m_UseMBSerialoutput)
         { MainPlanner->ModBusData.cgf[m_CfgNum].Data[m_SerialMBlocalvar] = 0; }
      }
   }
}

//   have fun........  Scott
fun times
Re: VB or Brains Question
« Reply #48 on: August 19, 2010, 09:27:07 PM »
Thanks.

I am trying to get a temp wiring bypass from the old controller to the new one with mach so I can test this out soon, so I will let you know how it works out either way.