Hello Guest it is March 19, 2024, 12:56:56 AM

Author Topic: Yet another Retrofit. Hardinge HXL-S  (Read 111460 times)

0 Members and 1 Guest are viewing this topic.

Re: Yet another Retrofit. Hardinge HXL-S
« Reply #50 on: April 21, 2007, 09:37:40 PM »
I got me a cubloc also with the same proto board, thing is sweet! 

Wayne, will you want to share some of the code that you used for the LCD?

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #51 on: April 22, 2007, 10:18:16 AM »
The LCD is simple to write to.

It's just PRINT statements after a LOCATE x,y to put the text where you want it.

My application will take a fair amount of time to write completely, as I will be using a combination of Ladder, Basic and using Modbus for comms.  As well as a custom macropump for mach.

I'll let you all know how it goes.

Did you get yourself a Cubloc PLC as well or are you just starting out with the studyboard ?   I got both as I will develop the code with the studyboard before committing it to the CUSB PLC.

Really with these things you should be able to do just about anything.   The I2C will allow you to add io for just about anything over what the cubloc already gives you.   The BASIC allows you to do more complex stuff that would be very difficult in Ladder.


Wayne....

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #52 on: April 24, 2007, 02:50:33 PM »
Dennis here's a bit of Cubloc basic I have knocked up to give me some idea of status on the Cubloc LCD while I an playing with it and Mach.

It will get more complicated but at the moment I can turn spindleand coolant on & off and alter Overrides no problem

EXCEPT I can't find the bleeding DRO code for the spindle override!!   Have these been documeted anywhere?


Wayne

Const Device = CB280

Set Display 2,0,1,50
Cls
Wait 200

Dim coolant As Byte

Dim spincw As Integer
Dim sro As Integer
Dim fro As Integer

Opencom 1,115200,3,80,80
Set Modbus 1,1,20
Usepin 1,Out    'Coolanr
Usepin 2,Out   'Spindle CW   
Usepin 3,Out

Input 24
Input 25

Set Ladder On

Do
  coolant = _P(1)
  spincw = _p(2)
 
 
  _D(10) = Adin(0) 'Read ADC0 Feedrate overide
  fro =_D(10)/10.21
 
  _D(11) = Adin(1)
  sro =_D(11)/10.21
 
Locate 0,0
Print "Coolant ",status(coolant)
Locate 0,1
Print "Spindle ",status(spincw)
Locate 0,2
Print "FRO Pot ",Dp(fro,3),"% fsd"
Locate 0,3
Print "SRO Pot ",Dp(sro,3),"% fsd"

Csroff
 
 
Loop





Function status(raw As Byte)As String

   If raw = 1 Then
      status = "ON "
   Else
      status = "OFF"
   Endif

End Function


 
« Last Edit: April 24, 2007, 03:51:00 PM by fdos »
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #53 on: April 24, 2007, 05:17:58 PM »
Thanks for the code!!!  I'll mess around with it.  What about this DRO: ( Overriden spindle speed DRO-------202)
Found it on the Wiki: http://www.artsoftcontrols.com/MachCustomizeWiki/index.php?title=OEM_DROs

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #54 on: April 24, 2007, 05:30:13 PM »
Dennis

The code is just test code as I get familiar with the Cubloc.   I will use some of it, as I will be using the LCD on the machine to verify that the PLC matches Mach etc.  I may create a button on the Cubloc to toggle through pages of info on the LCD.

Nope OemDRO202 is Overridden spindle speed not the Override as a percentage like on FRO.

It's got to be there somewhere, but where!

Wayne....

UPDATE:  Just found it from screen designer.     The Spindle overide % is OEMcode 74, so I tried OEmdro 74 and it now works as expected.
« Last Edit: April 24, 2007, 05:36:00 PM by fdos »

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #55 on: April 24, 2007, 06:42:17 PM »
Just in case anyone finds it useful here's the initial Macropump for the two overrides.

Spindle Speed CAPPING Courtesy of Aaron ;)

I only said I needed to write something to cap the overridden rpm if it exceeded my max safe rpm, and he wrote it for me!   What a kind Yorkshireman.

Wayne....


maxrpm = 6200

feedpot = Getinput(64) / 1023
spinpot = (getinput(65) / 1023)

spinover = (spinpot * 125) + 25

curSValue = getoemdro(817)
overRideRpm = (curSValue * spinover) / 100

If (overRideRpm > maxrpm) Then
  Spinover = (maxrpm / curSValue) * 100
End If


Call setoemdro(74,spinover)

feedover = (feedpot * 240) + 10

Call setdro(21,feedover)
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #56 on: April 30, 2007, 01:41:19 PM »
you have helped me out enough in the past Wayne - least i can do is help out with a few lines of code !!! ;D

Aaron
« Last Edit: April 30, 2007, 01:52:12 PM by aaron_b »

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #57 on: May 18, 2007, 05:11:52 PM »
This week got most of the upper enclosure grit blasted.    Just got to finish DAing the external surfaces and then off for powder coating.

Wayne....
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #58 on: May 18, 2007, 05:45:14 PM »
you mean you aint get em powddered yet Wayne - its only 10:45 and you have given up  :P

Offline fdos

*
  •  326 326
    • View Profile
Re: Yet another Retrofit. Hardinge HXL-S
« Reply #59 on: May 24, 2007, 06:54:28 PM »
Well at last I got those damn expensive 5 port valves fitted in, plumbed and wired!

Been a long haul that job!

Hopefully can get the turret and encoder refitted on the w/e, then I can apply air and check it alll works still.

Wayne....