Hello Guest it is April 24, 2024, 04:52:27 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 - Cbyrdtopper

321
Mach4 General Discussion / Re: A Aixs Brake
« on: January 28, 2019, 12:32:01 PM »
I haven't tested this any further, maybe Brett or Steve can chime in on this one.
I found out how to get Fusion to post an M Command to engage and disengage the A Axis Brake for 3+1 or simultaneous 4th axis machining, so I don't need the mc.mcAxisIsStill right now.

I read the thread you just started,
It was suggested in this thread that you may be able to get an output from the drive to use.  I was able to get an output off the drives I was using; but then I ran into the delay time needed to release the brake completely, so I was unable to use it effectively.

322
Mach4 General Discussion / Re: Motor Tuning in Mach 4, Very Stuck
« on: January 26, 2019, 11:32:40 AM »
Homebuilt,
How what are you having trouble with?  The Steps Per Unit or the Velocity and Accel?
 
For Steps Per Unit, I found a couple of resources that are worth looking at. 
The first is Artsoft's YouTube Channel:  Steps Per Unit Calculator Wizard.
https://www.youtube.com/watch?v=d-xCWDR0Uvg
The next resource I found gives you a formula for finding the correct SPU.  (You can stop reading once you get to the formula)
https://planet-cnc.com/how-to-setup-cnc/

For Velocity and Accel; I'm sure someone else will have a better explanation than what I do, but this is how we do it....  I like the old trial and error approach.  First, calibrate your axis, otherwise this will be pointless because it will change with calibration.  Once I know that all my axis are calibrated correctly, I decide what the Max Rapid Rate for my machine should be or where I want it; this will depend on how strong your motors are for your table, I retrofit lathes and VMCs mostly so I use good size servos so I can get good speed out of my machine.  Your Velocity is the max units per minute the machine can move; for example, the mill I'm working on is currently set to 450 units (inches) per minute.  If you are unsure how fast to set the velocity, start high and keep adjusting your velocity down until the motors don't stall while jogging, then go 3/4 of that speed and you should be good to go.

As for the acceleration, I usually go with 10% of my velocity and 95% of the time it works great.  With servos and hybrid steppers it could be a little less because they have the feedback from the encoder; but again, this is trial and error, if you machine table is a heavy, has small motors, or is a gantry type machine, it will likely have to have a higher acceleration to not stall your motors.

Like I said, someone may have a more scientific or mathematical approach than what I do; but this has always worked for us.  Maybe someone else will share their experience, I'd love to hear it as well.

323
Mach4 General Discussion / Re: Can't set machine position in script
« on: January 24, 2019, 12:59:19 PM »
Like Craig said,
Having home switches in place will be the best option.  That way you can start your machine in the morning, home it, and your Work Offsets will already be stored into the Machine.
Also, when you home the machine, you are able to use soft limits.

324
Mach4 General Discussion / Re: Jog buttons are not activated
« on: January 24, 2019, 08:21:24 AM »
It sounds like something that happened to me a while back.  You press one of the jog buttons and it locks up some other buttons?
Mine was because I didn't have a motion device selected; kind of weird because the SIM should allow jogging on screen jogging, but, that's what it was. 
Another time it was because somehow my motors were turned off and it locked stuff up; this has been over a year now, but that's what happened to me before. 

325
Mach4 General Discussion / Re: Can't set machine position in script
« on: January 24, 2019, 08:12:19 AM »
I use these scripts for setting work offsets.
I find the center of almost everything I machine, so I made these buttons to make it go faster; I touch off one side (x,y) and call it zero, then I touch off the other side (respectively) and press these buttons that take the current coordinate position, divide it by two, and update the axis position.

BUTTON SCRIPTS

--X = "X / 2"
local inst = mc.mcGetInstance()
local val = mc.mcAxisGetPos(inst, mc.X_AXIS)
local XPos = (val /2)
local rc = mc.mcAxisSetPos(inst, mc.X_AXIS,  XPos)

But, that's not going to help; I just realized you want to change the Machine Coordinate.  mcAxisSetMachinePos... I've never tested it.
I'm curious, why do you want to set the machine position?  Generally you don't want to mess with the machine coordinates, it will alter any and all work offsets you have set; if you have home switches, using the Axis Position (Work Offset Positions) should work just fine; but like I said, I don't know what your intentions are.

326
Mach4 General Discussion / Re: Mach4 LED's
« on: January 22, 2019, 05:14:11 PM »
What you want can be accomplished because LUA is quite powerful.
I would name each Text Box something easy to remember because the name will be used in the code.
You will also have to edit the code to get the handle of the Coolant, Spindle, and whatever else you want to have a notification of.
I put this code straight into the PLC script that way if the state changes, IE coolant turns on or off, the Text Box will update.

--Code Placed in the PLC Script.
--Coolant State Text Box
local hSig = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON)
local State = mc.mcSignalGetState(hSig)
if State == 1 then
    scr.SetProperty("txtCoolantState", "Value", "Coolant On") --The text box name is "txtCoolantState"   Whatever you want it to say, replace where it says "Coolant On"
else
     scr.SetProperty("txtCoolantState", "Value", "Coolant Off")
end   

Kind of harsh wanting to ditch Mach4 because of some LEDs IMHO; but hey, that's one great thing about Mach4, you can change it and make it whatever you like.

Mach4 is very powerful and very flexible, and this forum is a great place to learn and share your experiences.  There are some very knowledgeable people that get on the forum to help everyone out as well.

Welcome to the forum!!   

327
We use the HiCON Integra from Vital Systems.  A little pricey; but it is has threading and is well supported by Vital Systems. 
You do need to have encoder feedback from the spindle to the Integra.
I know there are others but I can't tell you which ones, we only use the Integra now.

328
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 21, 2019, 11:16:41 PM »
So, I don't have any idea about wx stuff.  Looking through Daz's example makes a little bit of sense to me, but when I generate code from wxFormbuilder I don't really know what I'm looking at.
I have attached a screenshot of a simple test I made in wxFormbuilder (FB) and the code that was generated from that.
How do I get the ZeroBrane editor to run this file correctly and open up my APP. 

I haven't found any examples for FB and LUA on YouTube, just Python.

From what I understand I have to add the functionality behind the scenes outside of FB (since I can't edit anything in FB), so I will do that in ZeroBrane once I know and understand what allows it to run properly.

329
TTalma,
The code you supplied was almost there; make the following changes and it should work fine.

You have to assign your "Blow Off" output to an Output# in the Mach4 Configuration.
Once you assign that to an output you can then use the following code in a macro to get the handle of the output to change it's state.

function m6()
 ------ Turn on Blow off ------
    local BlowOff = mc.mcSignalGetHandle (inst, mc.mcOSIG_OUTPUT#) --Use the Output # you assigned the Blow Off in Mach4 configuration.
    mc.mcSignalSetState(BlowOff , 1)

    ------ Move to current tool change position ------
    local GCode = ""
    GCode = GCode .. "G00 G91 G53 Z-1.0\n"
    mc.mcCntlGcodeExecuteWait(inst, GCode)

    ------ Turn off Blow off ------
    mc.mcSignalSetState(BlowOff , 0)
end
if (mc.mcInEditor() == 1) then
    m6()
end


To answer your question about "inst".  Here is a post that Craig made this past week that sums it up nicely.

"It is possible and may become fact one day, that multiple instances of Mach can run at once. This was allowed for
in the original 'design' of Mach. As a consequence there are many instructions in Mach which need to be applied
to a particular instance of Mach. As it turns out Mach as currently deployed allows only one instance, usually instance
'0' and thus if you used the variable 'inst' in any part of Mach it will probably work. The safe way is to ensure that
the proper and current instance is used....ergo mc.mcGetInstance() is used within each scope."

330
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 20, 2019, 08:10:37 PM »
Easy enough.   I'll open it up and try it again. 
I wonder who should show uo to a meet up if one was put together.