Hello Guest it is April 25, 2024, 07:43:43 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Oldraven

Pages: « 1 2 3
21
VB and the development of wizards / M6Start for Toolchanger again.
« on: June 07, 2011, 07:43:22 AM »
Hi ,

I used a M6Start macro that someone had written for a 6 tool Boxford ATC.
That worked, sort of, for my Emco5 ATC converted with a stepper motor and one optical slot for homing.

The problem was that the macro could not see if the ATC was homed in the Manual screen, Home All.
It would turn at random, tool positions were not absolute.

I inserted this piece of VB code in the beginning of the macro;

'----------------------------------------
' First check if ATC is homed.

If IsActive(INPUT1) Then
  Message " Input 1 is Active"
  SensorState = "Active"
Else  
  Message " Input 1 is NOT Active, Home first."
  
  Code "M30"   'End the execution of the G-Code.
End
End If
If SensorState = "Active" Then
Current_Tool = 1      'Set ATC Home as Current Tool.
End If         

'-----------------------------------------

That set the Current_Tool as tool # one.
But, when a second tool change was asked for in the G-code things went wrong.
The macro insists to be homed again.

I need some code or place to store the information that the part homing command is to be skipped.
Say that I insert a variable like Homing_Done just before the   end If;

If SensorState = "Active" Then
Current_Tool = 1      'Set ATC Home as Current Tool.
Homing_Done = 1
End If

I want to store this Homing_Done somewhere. Can that be done outside the macro and have the macro look for it each time the M6Start
is called in the current G-code?

This is the total macro;

' Boxford 160TCL Toolchanger Macro.
'
' Works by turning CW to just past the tool position
' and then CCW into a stop.
' Axis setup as rotary e.g. move 360 = 1 full turn.

' Adapted for the EMCO5cnc Automatic Tool Changer.
' Checks if ATC is Homed first and sets Current_Tool as #1.
' If not Homed it ends the program.

If IsLoading() Then
' Do Nothing, program loading
Else


' Dim Variables

Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer

Dim moves As Integer
Dim total_move As Integer

'----------------------------------------
' First check if ATC is homed.

If IsActive(INPUT1) Then
  Message " Input 1 is Active"
  SensorState = "Active"
Else  
  Message " Input 1 is NOT Active, Home first."
  
  Code "M30"   'End the execution of the G-Code.
End
End If
If SensorState = "Active" Then
Current_Tool = 1      'Set ATC Home as Current Tool.
End If         

'-----------------------------------------
' set up some vars

Num_Tools = 6
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
'  Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 700      
CCW_Feed = 700
Current_Feed = GetOEMDRO(818)



' start tool change

Message ("Requested Tool No=" & Requested_Tool)

If Requested_Tool > Num_Tools Then
Message "Requested Tool No. too high, program stopped."
Code "M30"
End
End If

If Requested_Tool < 1 Then
Message "Requested Tool No. too low, program stopped."
Code "M30"
End
End If

If Requested_Tool = Current_Tool Then
' do nothing
Else
' lets do some changing
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool

total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)

'Code "G01 x-10 F700"
'Code "z-10"
Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
While IsMoving()
Wend

SetCurrentTool Requested_Tool
SetUserDRO HoldingDRO, Requested_Tool
Code "G90" ' back to absolute movement
Code "F" & Current_Feed
End If
End If

' end of tool change          

Thanks for looking,

Jos
Holland

22
General Mach Discussion / Re: G74 for turning not recognized in Mach3.
« on: April 28, 2011, 02:28:42 AM »

Thank you Rich,

This is something I can use.
A peck drill on the lathe would be nice.

Regards,

Jos

23
General Mach Discussion / G74 for turning not recognized in Mach3.
« on: April 27, 2011, 05:07:35 AM »
Hello,

I am struggling with my postprocessor to do some turning with Mach3.
I have generated a g-code with Solidcam and there is the G74 code. Mach3 does not accept this.

I do not understand the G81 code and I think that this is intended for drilling on the mill, not for drilling while turning.
This is the part in my .gpp file for turning;

@turn_drill
        local string for for1 for2  for3
        for1 = '2/2.0(P)'
        for2 = '2/2.0(P*10)'
        for3 = '5.0(P*1000)'

    local numeric save_feed xc_new
    gcode = 74
    if drill_type eq drilling then
        r = 0
        q = abs(drill_lower_z + r)
    endif
    if drill_type eq peck then
        r = r
        q = (down_step)
    endif
    if drill_type <> tapping
        {nb 'G'gcode, ' R'r }
        {nb 'G'gcode, ' Z'drill_lower_z ' Q'q:for3}
        if drill_type eq peck then
               {' R0.'}
        endif
        if feed_unit eq css
            {' F'feed }
        else
            {' F'feed:'5.0(p)' }
        endif
    else
        gcode = 32
        save_feed =feed
        xc_new = 100-p_feed
        feed = feed*xc_new/100
        { nb 'G'gcode ' Z'drill_lower_z}
        if feed_unit eq css
            {' F'feed }
        else
            {' F'feed:'5.0(p)' }
        endif
        ;tbd.. check for a maximum of 10 mm mistake (BIG MISTAKE)
        ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        feed = save_feed
        {nb 'M5'}
        {nb 'G'gcode ' Z'drill_upper_z ' S'(spin*1.3):integer_def_f  ' M4'}
        if feed_unit eq css
            {' F'feed }
        else
            {' F'feed:'5.0(p)' }
        endif
    endif
endp

Someone has been working at this, see the comment.

Can G81 be used for turning?
Any ideas how to solve this?? Please??

Jos Raven
Holland

24
Post Processors / Re: Solidcam 2006 Rev10 to mach2-mach3 post pro
« on: April 08, 2011, 03:49:33 AM »
Hi Tony,

I use for Solidcam turning MACH30T.gpp and MACH30T.mac.
They are not made by me , but they work with Mach3  and my Emco5 cnc.

They work for me. I found these on the Internet somewhere.

Regards,
Jos


Give it a try,
Jos

25
VB and the development of wizards / Re: Need help with Macro A-axis.
« on: March 07, 2011, 10:40:10 AM »
Thanks Scott,

I will give it a try.

What I wanted to do is first of all Home the A-axis (ATC optical pulse)
 then on call from the G-code , M6 T0404 for instance, select the tool called for.

I run into different problems;

A-axis is Angular > set
Rot 360 rollover > set
A Home input 13 low active.

After homing I want to turn the A-axis 60 degrees ( 6 tool positions)

The ATC turns alright but sometimes CW and sometimes CCW.
Sometimes 60 degrees but mostly turns a few times around.

Even the VB script editor plays up, stepping through a macro if OK, running it gives some errors even to the point that the system hangs up.

It is hard to get control,

thanks,

Jos

26
VB and the development of wizards / Need help with Macro A-axis.
« on: March 04, 2011, 08:38:27 AM »
I am wrestling with the VB language to make a macro for turning a stepper on the A-axis.
Complete newbie to Visual Basic.

There is an optical sensor on the tool changer axis, one pulse per revolution.
I want first to home the tools to this optical pulse.

This is what I have;

'M6start.own 
'Input is an optical sensor for homing the ATC. 
'Get OEMLED ATC-Home. Check if ATC opto is lit.
'One pulse as a home reference generated by Emco5cnc ATC.   

While GetOEMLED(821) = False    
Call Rotate_1
Wend 

Private Sub Rotate_1()
Code "G91"
Code "G00 A259" 
GetOEMLED(821) 
Code "G00 A-10"
Code "G90" 

End Sub 

any ideas please.

Jos

27
G-Code, CAD, and CAM discussions / Re: Need Help A-axis.
« on: February 26, 2011, 09:37:05 AM »

Yes Graham,
I was aware of that one, tried it but I only get syntax errors in VB Sript.

Thank you,

Jos
Hi Jos,

do a search on here for 'tool change macro' or something similar, you will find many versions but there is one on here for the emco.

I may be this one:-  http://www.machsupport.com/forum/index.php/topic,16685.0.html

Graham


28
VB and the development of wizards / Re: Emco Turn tool changer macro
« on: February 24, 2011, 11:19:04 AM »
Hello,

I am also wrestling with a macro for my Emco5cnc tool turret.

I have some questions about the INPUT and OUTPUT statements.
What are they looking at?
I have an signal from an optical sensor on A-HOME , it lights yellow.
However it does not do anything under Mach3.

What stands for INPUT1, INPUT2, OUTPUT3 in the snip below???

thanks,
Jos
Holland


If (OldTool = 0) Then
    While Not IsActive(INPUT2)
        ActivateSignal(OUTPUT3) ' rotate tool changer forward
    Wend
    ' Input 2 must Now be active so the microswitch has been triggered
    DeActivateSignal(OUTPUT3)
    CurrPos = 1
End If

If (CurrPos <> NewTool) Then
    While CurrPos <>  NewTool
        ActivateSignal(OUTPUT3) 'start rotating forward
        If Not IsActive(INPUT1) And Not IsActive(INPUT2) Then
            CurrPos = CurrPos +1
            If CurrPos = 7 Then
                CurrPos = 1
            End If
            If IsActive(INPUT2) Then
                CurrPos = 1
            End If
            If CurrPos = NewTool Then
                DeActivateSignal(OUTPUT3) 'stop rotating forward, rotate backward now
                CurrentTool = NewTool 'sets up the current tool variable as the start point for a future tool change
                Sleep(200) 'Allow a time interval for the toolchanger to settle back against the ratchet pawl
            Else

29
G-Code, CAD, and CAM discussions / Need Help A-axis.
« on: February 24, 2011, 09:10:24 AM »
Hello all,

I am new to this forum and need some help in setting up the A-axis for driving a tool turret on my Emco5cnc lathe.
The turret has a new stepper motor and an optical 1 slot detector.
The turret will turn if I give out the G-code ; g00 a60 .
It should go 60 degrees, sometimes it does this and most times not it will turn forever.

The zero slot lights up in A-home in the diag screen.
What does Mach3 do with the A-home light?
I want to use a code or macro so that the turret turns around to the zero pulse output by the optical slot.
Then turn as many degrees as needed by the tool # input. I.E. 3 = 180 degrees.

The turret is a 6 position, the stepper needs to go forward to the position indicated and reverse back a little to the stop pawl.

Any advice is very welcome.

Regards,

Jos Raven
Holland

30
Hello All,

I ran into the same fault codes yesterday.

I managed to generate a G-code with Solidcam after many, many tries.
First I had to find a solution for two fault messages from Solidcam itself. Thanks to CNCzone.com.

As a first solution I deleted the offending lines and Mach3 produced my simple design on my Emco Compact5 CNC lathe.

That worked.
I also encountered the long distance that the tools is set . G0 x150 z200.
Why Sc does this I do not know.
Also the Feed is set at F0.3 , way too slow and I changed that to F100. Exactly fine for my little lathe.

So, there is some more fiddling to be done with Solidcam.

Thanks for all the info.

Jos
Holland
mraven.com

Pages: « 1 2 3