Hello Guest it is April 28, 2024, 09:24:08 PM

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 - mcardoso

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
21
Mach4 General Discussion / Re: T## Oddities
« on: April 28, 2020, 01:28:56 PM »
I can certainly give that a try. Can you elaborate on what is in the parameters INI file? I have a copy of my Mach 4 directory from a few months back. If it is only the control settings then I shouldn't have any changes.

22
Mach4 General Discussion / Re: Reading Signals / ENUMS
« on: April 28, 2020, 09:11:15 AM »
Craig,

Thanks for looking into this!

Bob,

I didn't get a chance to dig into this last night. Why don't you open the screen editor and try to understand the display element and backing code that makes the cycle timer work on the normal screen set? I had to dig into it in the part. I think the code is in the PLC script. You should be able to copy their code or at least see how it works.

Mike

23
Mach4 General Discussion / T## Oddities
« on: April 28, 2020, 08:54:29 AM »
OK I have a weird one.

I keep a complete system image of my computer in case anything gets screwed up with Mach 4. This week we had a power outage right after I finished a program and had Mach 4 open. When I rebooted, Mach 4 was scrambled, had defaulted all the settings, and was running the wx4 screenset.

So I got out my trusty restore image and in 20 minutes everything was right back to where it was before the power outage. This is a BIOS level image so it gets Windows and everything. Big file, but it isn't quite a finicky as a Windows backup.

Mach 4 is running great with one exception (and it is possible this is entirely unrelated to doing that restore). When I execute an M06 Txx G43 Hxx from the MDI, the first thing it says is "Current tool in the spindle - nothing to do". If I run it again, then it works correctly, prompting me to change the tool and hit cycle start.

I found in the settings that the radio button is marked for "T# on line is next tool to use" or something like that. I think that it is designed for pre-load tool changers. I can choose the other option, but the APPLY button never becomes available. If I hit OK and reopen the control settings, the radio button is back to where it was before. It seems like I can change all the other settings in Mach except for this one.

Any idea what I can do to fix this?

Also, if NFS reads through here... Why is Mach 4 so unstable when it comes to shutting down incorrectly. I can't think of any other piece of software that I use that has such an adverse reaction. Heck, even if Mach 4 is closed and the computer is unplugged, it was mess stuff up. Can't this be protected against using save states in the software or some other method to automatically load a known good configuration?

24
Mach4 General Discussion / Re: Dro counter
« on: April 28, 2020, 08:43:16 AM »
Nice! There are some great guides to registers on here. I figured I'd let you do the research, but please ask questions if you get stuck.

Most high end VFDs like you have will have a million configuration parameters. It can be a chore to learn the manual and set them up, but if you know a guy who works with them, then you're way ahead of the game. I would look to see if you can add a "fast stop" to the drive as a digital input. When the signal goes low, the drive does a max ramp to a stop. Just an idea for safety, otherwise let Mach 4 handle the normal accel/decel.

25
Mach4 General Discussion / Re: tool table
« on: April 27, 2020, 01:00:28 PM »
I bet in LinuxCNC you were also managing tool offsets (even if you didn't know you were). In a simple machine you might clamp a tool in a collet and touch off the part, zero your Z axis - perhaps with a slip of paper, then run your part. You never opened up a tool table to do this. Mach 4 can be used the same way, and for many years that is what I did in Mach 3.

The beauty of the tool table comes when you start mounting your tools in interchangeable tool holders. Now you can switch tools and repeatably have each tool end up at the same position in the spindle. Not all of these tools are going to be the exact same length, so you need a way to tell Mach 4 what that length is. You enter the length of each tool in the tool table so when you ask Mach 4 to take you to Z0.0, the tip of every tool ends up in the same position, regardless of how long it is.

The tool table also tracks the tool diameter and wear offsets. If you program with cutter compensation, the value here determines how the compensation is calculated. If you find you tool path cut a bit shallow, rather than adjusting your entire program, you would adjust the length wear offset.

This doesn't really have a lot to do with Mach 4 specifically, rather it is the way in which the entire CNC industry interprets G-code commands.

26
Mach4 General Discussion / Re: Dro counter
« on: April 27, 2020, 10:49:49 AM »
This sounds like a custom script. You'll want a script that responds to the button press, reads a register value, increments and saves the register value, and a DRO that just displays the data in the register. The DRO is a dumb object on the screen - just a display. Adding the homing would be easy

The signals script is probably the best place to write this code. I tend to add to the signals enumeration inside the screen load script, although it can be done elsewhere. PMC is also an option, but this is such a simple script, I'd encourage you to try out LUA. Do some research on the signals script and how to read and write registers. Feel free to ask questions here if you get stuck.

If this is a mechanical switch, your hardware better have some filtering or you'll get input bounce where it will count many times for a single switch hit. This can be handled in software too, but easier if your motion controller filters inputs (I know the ESS does).

I don't know how the machine would have worked originally, but I would personally want 2 cases. An M05 should ramp the spindle to a stop gently, however (if your VFD can handle it with a braking resistor) an ESTOP should stop the spindle in a minimum amount of time. No need to do this for every stop as it will stress the electrical components in your VFD and wear it out faster.

Mike

27
Mach4 General Discussion / Re: Reading Signals / ENUMS
« on: April 27, 2020, 09:26:53 AM »
Bob,

When I have a bit of time, I'll come back and do some research, but at first glance, I question if mc.VAL_CYCLE_TIME is correct. I don't remember needing to include the "mc." in front of my signal names.

I think you program is failing to get the correct path to the data. Thus, "val" always has a value of 0.

Mike

28
Typically, I handle errors and optional user cancel operations by checking them first and returning from the function early. Pseudo code would look like this

Code: [Select]
function doThis()

errorCode = myFunction()

if errorCode then
    return  -Exit the program early
else
    *do the rest of the program*
    return  --Program would normally exit here
end
end

Ideally I would also include an error code in the return so I could figure out if it returned normally, or with errors. Something like this:

Code: [Select]
function doThis()

myError = 0
errorCode = myFunction()

if errorCode then
    myError = 1
    return  myError -Exit the program early (error code is 1)
else
    *do the rest of the program*
    return myError --Program would normally exit here (error code is 0)
end
end

29
Well you have (2) copies of the message box (and the second one doesn't do anything or collect a return code).

I think you want to delete or comment out the line that says exactly:
Code: [Select]
wx.wxMessageBox ("Load the correct tool & lower the bit within 50mm before probing. Attach the MAGNET!!!",16)
I think the line you intended to use is right above it:)

Try to add some spaces between the lines of your code and add lots of comments - even line by line if needed. This will force you to really understand what you are doing with each line of code rather than it looking like a giant block of "magic".

30
No worries Adam.

I had a brutal learning curve with LUA (I am not a programmer by trade) but there was one day where it all clicked and I was able to just write what I was thinking. Probably happened after a month or two of really struggling through the code. We are happy to help you along.

-Mike

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »