Hello Guest it is April 28, 2024, 06:24:08 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 - rufan

Pages: « 1 2 3 4
31
VB and the development of wizards / Re: ismoving() error message
« on: July 24, 2013, 09:32:47 AM »
Attachment the M6Start version with the ismoving error on Ln-124

32
Brains Development / Something is Ignoring the commands
« on: July 24, 2013, 08:08:06 AM »
I have setup a Brain to see when an Axis Fails, then Estop must be triggered.
But for some reason only the last line is working (OEMTR#4)
Tested signals > brain is detecting the signal and Estop turn GREEN but Mach3 do not Estop for OEMTR#2 and OEMTR#3

Brains code:
OEMTRIGGER#2 > No-Operation > Estop
OEMTRIGGER#3 > No-Operation > Estop
OEMTRIGGER#4 > No-Operation > Estop

Only OEMTRIGGER#4 is working perfect

What I am doing wrong?

33
VB and the development of wizards / Re: ismoving() error message
« on: July 24, 2013, 07:59:07 AM »
I was also thinking about that but just didn't try that.
Now I change the code, for code"M4" I put:
  '----M4--------            'Start spindle CCW to brake
  DoSpinCCW()                'Enable CCW Relay
  ActivateSignal(OUTPUT6)         'Spindle enable

This didn't solve the problem with getting the error message line 134 error (while ismoving)

I keep playing around with vb, and found out vb is jumping so fast from 1 sub to another and I think this is causing the issue.
I put sleep 200 before (End Sub), and until now the problem seems to be solved.

34
VB and the development of wizards / ismoving() error message
« on: July 20, 2013, 02:06:21 PM »
During the toolchange the Z-axis needs to move to Z130 position but I got a ismoving() error message. See Sub MoveZ
This only happens when the routine: '-----If spindle RPM =0 and not Aligned ----- '  and   '----- If spindle RPM > 10 and not Aligned ----'  are executed
If routine '----- If spindle RPM =0 and Aligned ----' is used every thing works perfect.

Already tried this but does not help
While ismoving            While ismoving()
Wend                        Wend     

While ismoving            While ismoving
sleep 10                     Sleep 10
Wend                        Wend

I have no idea what is causing the problem, any suggestion.

This is a part of the code:
Sub AlignSpindle

'-------------------- If spindle RPM =0 and Aligned -------------------------
If GetOemDro(39) <10 Then             
  If isactive(INDEX) And isactive(OEMTRIG1) Then    
    ActivateSignal(OUTPUT9)         'Activate Locking Pin
    Exit Sub
  End If
End If

'-------------------- If spindle RPM =0 and not Aligned ---------------------
If GetOemDro(39) <10 Then                        
  Code"M4S10"
  ActivateSignal(OUTPUT9)         'Activate Locking Pin
  While Not isactive(INDEX) And Not isactive(OEMTRIG1)
    sleep 10
   Wend
   code"M5"
End If

'-------------------- If spindle RPM > 10 and not Aligned -------------------
'--------------------------- Dynamic spindle braking ------------------------
If GetOemDro(39) > 10 Then         'Get True spindle
  code"M4S1000"               'Start spindle CCW to brake
    While getOEMdro(39) > 100         'Check if spindle speed above 100rpm
    sleep 1
      If getOEMdro(39) > 100 Then
       activateSignal(OUTPUT6)         'Activate Spindle ENABLE
       sleep 50
       deactivateSignal(OUTPUT6)              'deActivate Spindle ENABLE
      End If
    Wend
   ActivateSignal(OUTPUT9)                 'Activate Locking Pin
   code"M4S10"
   While Not isactive(INDEX) And Not isactive(OEMTRIG1)
    sleep 10
   Wend
   code"M5"
End If

'---------------------- Double Check Spindle Index Alignment -----------------------
If Not isactive(INDEX) And Not isactive(OEMTRIG1) Then MsgBox("Tool Alignment Fail") 

End Sub
'----------------------------------------------------------------------------


'----------------------------------------------------------------------------
Sub MoveZ
code "G1 G53 Z130 F3000"      'Move Z-Axis to tool change position
While ismoving()
Wend
End Sub

35
VB and the development of wizards / Dynamic Braking Macro
« on: July 16, 2013, 04:10:03 AM »
I have written a macro to Dynamic Brake my Mill spindle to perform tool change.
The macro is working, but in my opinion it is not the most nice solution.
Spindle motor = 4kw DC motor with Lenze 480 controller.
Rotation Direction is performed by 2 relays.

Please check the macro, if there is a better approach please let me know.
You will wonder why I used the code instead of dospinCW(), this is because macro M3, M4 & M5 are also edited.

Sample M3 macro:
DoSpinCW()
ActivateSignal(OUTPUT6)      'Activate the motor controller.


-----------------------Dynamic Braking Macro---------------------------------------------
code "M5"                   'Stop spindle
sleep 100
code "M4S10"              'Turn spindle CCW
sleep 2000                  'Time to brake from 6000rpm
code "M3S10"          'Turn spindel CW to brake if the overshoot
sleep 100
code "M4S10"          'Turn spindel CCW to brake if the overshoot          
sleep 200

While Not isactive(INDEX)
sleep 1
ActivateSignal(OUTPUT9)      'Activate the locking pin
If isactive(INDEX) Then code"M5"
Wend

While GetOEMDro(39) >0      'Get actual spindle speed
sleep 1
Wend

While Not isactive(INDEX) And Not isactive(OEMTRIG1)   'To make sure spindle is aligned
sleep 10
Wend
'Continue Tool Change Macro

Thanks in advance.



36
VB and the development of wizards / Re: Macro Syntax Error
« on: June 08, 2013, 07:17:09 AM »
Let me explain

I have a Dual  Slotted Opto Switch with a space of +/- 5mm from each other.
A disk with a 6mm gap is installed on the spindle axis.
1 output connected to Spindle Index
2 output connected to OEM Trig #1

The spindle will turn at slow speed(100) when the gap in the disk line up with the opto switches the spindle must stop turning.
A friction brake is already triggered, so when spindle stops turning it will stop immediately.
Then I can move onto the next process of changing tools.

SetSpinSpeed(100)
ActivateSignal(OUTPUT9)      'Active Friction Brake
DoSpinCW()            'Turn spindle at 100rpm

While (isActive(OEMTRIG1) And isActive(OEMLED826))
  sleep 10
Wend
DoSpinStop()            'Stop spindle
deActivateSignal(OUTPUT9)           'Deactivate Friction Brake

I will try this later

Thank for helping.

37
VB and the development of wizards / Re: Macro Syntax Error
« on: June 07, 2013, 01:47:44 PM »
I am not a programmer, I learn by trail and error and of course from you guys
I have copied this command from the Macro Programmers Reference Manual and modify it.

Page 79:
While IsActive(OEMTRIG10) = False Then
Sleep 10
Wend

What I want to achieve is:
I need to get the spindle aligned.
A spindle friction brake is active, then the spindle turns very slow until OEMTRIG1 and Index Pulse is active then the spindle needs to stop.
It's a DC motor running for this procedure at 100RPM

Thank you.


38
VB and the development of wizards / Macro Syntax Error
« on: June 07, 2013, 11:45:38 AM »
I have add the following command to my macro, but then get a Syntax Error on the "Then"
For me everything looks normal, don't understand why.
Do someone have any idea.

While IsActive(OEMTRIG1) = False Then
   DoSpinStop()
Wend

Pages: « 1 2 3 4