Hello Guest it is April 26, 2024, 12:54:26 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 - DanieGouws

Pages: « 1 2 3 »
11
Hi,

Thank you for your feedback. I will make the code change.
 I also found an error in X gain and the Z vel was set too low for the required pitch.

Regards
Danie


12
Hi,

I'm trying to cut metric thread on my Denford Starturn lathe using Mach4 and a Pokeys57 card. I only use a index pulse which seems to be stable and accurate. I believe the Pokeys configurations is set-up correctly.

I've used the Mach4 Turn Cycles conversational programming to generate the code, using the 2-line G76 command.
In this attached file I tried to achieve a pitch of 2mm but I have tried various larger pitch sizes, thread depth is set at 0.25 mm. The actual RPM was around 480.

The process seems to be correct but the depth of cut is wrong and the cut pitch is always around 0.6 mm, irrespective of my pitch setting.

What am I doing wrong? Thank you very much

Danie
 

13
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: July 21, 2019, 02:28:23 PM »
Dear Trent,

I am so glad it is working!! I struggled for months with this problem.

Kind regards
Danie

14
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: July 17, 2019, 02:30:58 AM »
Dear Trent

Please see my steps, generated with great help from the Forum members. I run a lathe with Mach4 and the name of my card is Pokeys_Lathe:

Go into the Screen Editor: Click on the X DRO on the screen, then look at the left and you will see droCurrentX highlighted slightly. Click on droCurrentX to highlight it.
Now look at the window (Properties)  below this window and click on the second little box which is the Events Tab. Now click on the first line below that called "On Update Script", then click on the box with the three dots to the right,  that will open a blank Lua Page.

Now copy the LUA code below for the X DRO below and paste it on that blank LUA page.  Please update the serial number of your Pokeys device.

local val = select(1,...)
Xcoords = val
val = tonumber(val)
local inst = mc.mcGetInstance()
mc.mcCntlSetLastError(inst, "On update ran")
local Xcoords = string.format("X:% 10.4f", Xcoords)
local hreg = mc.mcRegGetHandle(inst, string.format("PoKeys_Lathe/LCD Line 1"))
mc.mcRegSetValueString(hreg, Xcoords.."        ")
return val

Follow the same procedure for updating the Z axis DRO. Remember to update the serial number of your Pokeys device again.

local val = select(1,...)
Zcoords = val
val = tonumber(val)
local inst = mc.mcGetInstance()
mc.mcCntlSetLastError(inst, "On update ran")
local Zcoords = string.format("Z:% 10.4f", Zcoords)
local hreg = mc.mcRegGetHandle(inst, string.format("PoKeys_Lathe/LCD Line 2"))
mc.mcRegSetValueString(hreg, Zcoords.."        ")
return val

Now exit Mach4 and then start it up again.  Now the LCD should update each time you have the DROs updated in Mach4. I still struggle to understand what each line of code is doing.

Please let me know how its going.

Kind regards

Danie

15
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: July 15, 2019, 02:02:38 AM »
Hi
My LCD is working well, will post the code in a day or two,

Regards
Danie

16
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: March 28, 2019, 03:48:09 PM »
Dear Wolfgang

Tonight I can report, with joy in my heart, that your code is displaying the X and Z coordinates on my lathe. Understanding all the Lua code with still take some time but I am working on that. I'm using Build 3804.

Thank you so much for all your help,

Danie

17
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: March 24, 2019, 04:26:11 AM »
Dear All,

Thank you for all your help thus far.

As indicated above, starting and ending the Update Script (droCurrentX) in the correct way seems to be very important. I replaced my initial code with the following:

local val = select(1,...)
val = tonumber(val)
local inst = mc.mcGetInstance()
local Xcoords = val
local hreg = mc.mcRegGetHandle(inst,string.format("Pokeys_Lathe/LCD Line 1"))
mc.mcRegGetValueString(hreg,tostring(Xcoords))
return val

Now when I move the axis of the lathe, the droCurrentX continuously update on my Mac4 screen but my LCD still only indicates "Pokeys for Mach4" - thus the register does not seem to be updating? But when I go to Diagnostic -> RegFile -> Pokeys_Lathe - LCD Line 1, I am able to enter a value and the value is displayed on the 1st line of my LCD.

Any suggestions will be highly appreciated,

Kind regards Danie



18
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: March 14, 2019, 02:46:35 PM »
Hi,

I went to the Screen Editor, clicked on the X DRO value – the variable droCurrentX highlighted on the LHS. Then I clicked on Properties -> Events, went to RHS (….) of On Update Script, then a new Lua file opened.
I typed the following code in this new LUA file:
local inst = mc.mcGetInstance()
local Xcoords = scr.GetProperty("droCurrentX","Value")
local hreg = mc.mcRegGetHandle(inst, string.format("PoKeys_Lathe"))
mc.mcRegSetValueString(hreg, tostring(Xcoords))
where PoKeys_Lathe is the name of my Pokeys57 card.

I then saved and exited the screen editor. After enabling Mach4 I moved the X-axis – the axis moved as before but the DRO X stayed constant on the value displayed previously. Fur debugging purposes I removed lines 2 to 4 (leaving only local inst = mc.mcGetInstance()) but the problem persisted.

At this point I'm stuck, any help will be very much appreciated,

Kind regards

Danie

19
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: January 14, 2019, 09:19:00 AM »
Hi Russ,

I still have my set of problems to get the LCD going correctly.
If I place the simpler code as a Lua script attached to the “droCurrentZ” the following happens:

local inst = mc.mcGetInstance()

local Xcoords = scr.GetProperty("droCurrentX","Value")
local Zcoords = scr.GetProperty("droCurrentZ","Value")

local hreg = mc.mcRegGetHandle(inst, string.format("PoKeys_Lathe/LCD Line 1"))
mc.mcRegSetValueString(hreg, tostring(Xcoords))

local hreg = mc.mcRegGetHandle(inst, string.format("PoKeys_Lathe/LCD Line 3"))
mc.mcRegSetValueString(hreg, tostring(Zcoords))

The droCurrentX is displayed and updated on the LCD every time the Z axis is moved (this behaviour does make sense to me);
The droCurrentZ is displaying a zero value, even if the Z axis are moved around(?)

Then I removed all the code except for:

local inst = mc.mcGetInstance()

This line seems to be causing the droCurrentZ to be kept at zero. This is difficult for me to understand.

If I use the same lines of code above  in the droCurrentX script the effect of X and Z is reversed.

Thanks Danie

20
Mach4 Plugins / Re: Pokeys Mach4 plugin LUA reference for LCD
« on: January 07, 2019, 09:08:03 AM »
Hi Russ,

I'm still very new to Lua programming - your help is very much appreciated.

Thanks Danie

Pages: « 1 2 3 »