Hello Guest it is October 26, 2020, 06:03:59 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 - jschoenly

Pages: 1
1
PoKeys / Re: Pokeys 56U PWM Output with LUA
« on: May 18, 2017, 08:34:04 AM »
So, I'm really green with the LUA.  I wasn't getting the string correct for the PWM register.  I fixed that up. 

function WriteRegister(device, outPin, newValue)
    local inst = mc.mcGetInstance()
    local hreg = mc.mcRegGetHandle(inst, string.format("%s/PWM %s duty", device, outPin))
    return mc.mcRegSetValueString(hreg, newValue)
end

Working now!!

2
PoKeys / Pokeys 56U PWM Output with LUA
« on: May 17, 2017, 05:35:48 PM »
Hello all.  I tried out the Pokeys today.  I used the FRO example in the manual today to test out an analog input and just my sanity.  After switching to the correct " after a copy and paste, I have this working great for the FRO slider on the screen.  I then wanted to try out using the same analog input to set the one PWM output.  So I tried out:

--Function to read value from analog register
function ReadRegister(device, analogPin)
    local inst = mc.mcGetInstance()
    local hreg = mc.mcRegGetHandle(inst, string.format("%s/Analog input %s", device, analogPin))
    return mc.mcRegGetValueString(hreg)
end

--Function to Write value from analog register
function WriteRegister(device, outPin, newValue)
    local inst = mc.mcGetInstance()
    local hreg = mc.mcRegGetHandle(inst, string.format("%s/Analog output %s", device, analogPin))
    return mc.mcRegSetValueString(hreg, newValue)
end

--Function to set FRO value
function SetFRO(analog)
    local percent = analog/1*250 --calculate percentage from 0% to 250%
    local inst = mc.mcGetInstance()
    mc.mcCntlSetFRO(inst, percent)
end

--Main
local device = "PoKeys_30290" --Change this to the name of your PoKeys device
local analogPin = "41" --Analog input pin number
local outPin = "18" --Analog output pin number

analogVal = ReadRegister(device, analogPin) --Save analog register value in variable
outVal = analogVal
WriteRegister(device, outPin, outVal)  -- Set Output Value
SetFRO(analogVal) -- Set FRO value in %

In my quick and dirty additions, I thought I'd just maybe get this having an output duty cycle matching the analog signal, but alas it does not. 

Can someone help me with how you use similar code to above to set the duty cycle on the PWM Output?  I'll eventually be using some of the z positions for a custom solution to control the duty cycle but for now I just wanted to understand how to get the signals working.  I'm starting to understand the usage but I'm a little slow sometimes. 

Also - This in on MACH 4, I have the plugin installed and otherwise working well NOT using it as the pulse gen/motion control.  I just want to use this for some external accessories.  Thanks!

Jared

3
I have a few more tweaks to do yet on the machine but I'm basically there! This video shows some g32 threading but I'll be testing out the g76 threading soon too. Too much fun!

https://youtu.be/Klo8Qay8IRM

4
Hey All.  I haven't posted much here, but I sure use a lot of support from the forum.  I previously converted a BOSS 5 mill with Mach 3 and now have gotten 2 new (to me) machines running Mach4. 

This lathe was previously converted to Mach 3 and was essentially running when I got it.  It did however have a 4 slot spindle index signal and I bought it with the intention to Upgrade to Mach4 for the better Turn features, codes, etc etc.  I planned threading so I wanted a better encoder signal.

I thought about it a while and decided to go with the HiCON board and I'm very happy with it.  I was able to remove a lot of the old interface wiring in this conversion and it's pretty streamlined now.  Some of the original hardware on the HNC that is still used has signals/level ranging from 110v ac, 12v dc, and 5v dc.  A small triple output power supply was installed with 5v, 12v, and 24v.  Limits (NPN) were interfaced using a 4.7k pull up to 24v on the inputs (PNP).  The turret encoder (more below) uses 12v and so far the 12v signals have proven to be a functional level for the HiCON to read.  Gecko G320's are receiving single ended (-) signals from the HiCON with 5v+ to the common.  The VFD is controlled with a FWD and REV solenoid and the 0/10v+ HiCON spindle control.  I added a ADC 1000 ppr encoder to the spindle's original resolver bracket with relative ease.

A few relays interface with the solenoids actuating the collet closer and the turret functions.  The encoder for the turret is a 4 bit binary set of outputs for the decimal number of the turret position.  I have read these into the HiCON and wrote my own M6 macro to run the tool changer.  The turret is in need of a few o-rings and some oil (and use), but it's functioning well all things considered.  The occasional missed tool change on the turret is caught in the M6 and given another try.  It hasn't made it to a second "retry" after a good number of test tool changes (test code runs 15 various changes) so it's time to cut some metal!

I'm using AutoCAD Fusion 360 for simple CAD and CAM to the machine and hopefully some testing tonight will prove it's time for light production.

All in all, it was an easy upgrade and good support from Vital Systems!  Thanks!

5
G-Code, CAD, and CAM discussions / Re: MasterCAM X and Tool Offsets
« on: March 15, 2010, 10:26:25 PM »
Seem to have things figured out now.  I have to input the tool offset at the parameters screen.  Can this be set up in MC to automatically put the tool's number in the offset in the parameters.  I won't be surprised if that answer is no, i just have to remember to do it all the time. 

Thanks for the help!

Jared

6
G-Code, CAD, and CAM discussions / Re: MasterCAM X and Tool Offsets
« on: March 12, 2010, 01:21:21 PM »
OK, talked with a guy here at work pretty well practiced in MC and he showed me a parameter screen i think I've been overlooking.  I also think i need to setup the Fanuc as the machine definition.  The definition wasn't adding the offset as the tool number and i think the fanuc should do this.  I have some things to look at tonight, but it looking like I'm on the right track to have it all working.  I'll check back in if i have more questions.  Thanks for the help!

Jared

7
G-Code, CAD, and CAM discussions / Re: MasterCAM X and Tool Offsets
« on: March 11, 2010, 09:30:45 PM »
Quick and last update for the night.  I used the generic fanuc post.  Seems to work OK, there is now G43 but all tools have H0, Not the tool number.  This will not give the proper tool offset, correct?  Thanks again!

Jared

8
G-Code, CAD, and CAM discussions / Re: MasterCAM X and Tool Offsets
« on: March 11, 2010, 09:21:11 PM »
That my problem, i've been trying all the modified posts that i could find and none seem to work.  I was thinking i did something somewhere in MC to mess up the G43 thing.  I'm going to try the generic and go from there.  I don't care what post it is, if it work ;)

On the carriage returns, i actually fixed that and forgot about that when i posted it.  The NWDTOOL comment lines string all together without returns and cause an error with MACH in that it's too long.  I'll see how i make out and report back.  Thanks so far. 

Jared

9
G-Code, CAD, and CAM discussions / Re: MasterCAM X and Tool Offsets
« on: March 10, 2010, 08:55:27 PM »
Here is the top of some code for reference.  Any help is GREATLY appreciated!

Jared

(MASTERCAM - V10.)
(MC9 FILE  -  C:\DOCUMENTS AND SETTINGS\JARED\DESKTOP\BROCKWAY FAN\ADAPTOR.MCX)
(POST      - )
(MATERIAL  -  ALUMINUM INCH - 2024)
(PROGRAM   - FLAT ADAPT _UPDATE_3.NC)
(DATE      - MAR-10.-10.)
(TIME      - 20.5311)
(POST DEV  - NovaLab)
(NWDTOOL N" 1/4 FLAT ENDMILL" T1 D0. F.5 L2.5 CD2. CL1. SD2. C0)
(NWDTOOL N" 1/4 CENTERDRILL" T2 D0. F2. L3. A90. CD2. CL1. SD2. C0)
(NWDTOOL N" NO. 28 DRILL" T3 D0. F2. L3. A118. CD2. CL1. SD2. C0)
(NWDSTOCK X3.25 Y2.25 Z.1875 OTC OX-.5 OY0. OZ-.1875)
(OVERALL MAX - Z.75)
(OVERALL MIN - Z-.2622)
G00 G17 G20 G40 G49 G80 G90
T1 M06 ( 1/4 FLAT ENDMILL)
(MAX - Z.5)
(MIN - Z-.2)
G00 Z.5
G00 X.0156 Y0. S2000 M03
Z.1
G01 Z-.0286 F10.
G03 X-.0781 R.0469
X.1406 R.1094
X-.2031 R.1719
X.2656 R.2344
X-.3281 R.2969

10
G-Code, CAD, and CAM discussions / MasterCAM X and Tool Offsets
« on: March 10, 2010, 08:43:03 PM »
Hello all.  I'm a little new to some of the CNC world.  I've been learning some of the basic G code language by brute force as i'm used to getting code via mastercam, camworks, etc.  Anyway, here is my situation:

I'm running Mach 3 on a retro fitted Boss.  I have Mastercam X and Mach 3 post.  I've been messing with things and trouble shooting a while and i have my offset issue narrowed down for the most part, as in whats not happening.  The code is not adding a G43 H#  (# = tool number).  As i understand it and after a bunch of digging around, this will setup the tool offset after a tool change.  I added the G43 H# line after each tool change and it appears to be working with that. 

The Question:  How can i get this to happen via mastercam and not have to add it to any program i post??

There is also an issue where the post doesn't seem to be putting a carriage return after some of note lines at the beginning of the code (details for tool and some of the extents).  Can this be updated to function as well? 

I think i have the other options pretty well figured out....  Thanks!

Pages: 1