Hello Guest it is April 27, 2024, 07:07:19 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 - bob_at_pmdx

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 »
11
Mach4 General Discussion / Re: input as a dro display (not closed loop),
« on: September 21, 2016, 09:45:10 PM »
What plug-in and motion device are you using?

Whether you can alter the encoder value by editing a DRO depends on how the plug-in implements the encoder functionality.  For example, the PMDX-SmartBOB plug-in presents a register specifically for displaying in a DRO.  And if that encoder does not have an index, you can change the value by editing the DRO.  If the encoder DOES have an index, the plug-in will not allow you to change the DRO value as it is determined by the index pulse and amount of rotation.

Bob

12
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 16, 2016, 04:26:03 PM »
Yep, most likely related.  Short moves of any kind were fixed in the release after the one you were using.  Hopefully you have (or will soon) upgrade to the latest 0.46.221 plug-in release.  I also highly recommend subscribing to the "Announcements" section on the PMDX support forums (http://www.pmdx.com/PMDXForums).  That way you will receive an email notice when there is a new plug-in release ready.

Bob

13
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 16, 2016, 11:20:01 AM »
First:
Quote
If you do get the "motion underrun" error, you *should* be able to click on the Mach4 "Enable" button and continue running the machine (like, say, jogging the Z axis away from the touch plate).  Does that not work for you?  If you click on the "History" button in the lower left of the Mach4 screen, do you see any other messages?
When you get the underrun, have you tried the above and can you restore operation?  Do you see any other messages in the History window?

Quote
I am curious if you would get an underrun if you initiate a move to say 0,0,0 while at 0,0,0?
If the Z axis *really* is at 0 (in machine coordinates, aka the "G53" in your command), then sending a "G90 G53 G0 Z0.0" command to Mach4 will not generate any motion from the motion planner.  And I have tried having Mach4 generate *very* moves, including moves of only 1 step, and I cannot cause an underrun.  At least on my PC.

Quote
after each probe instance, the Z goes all the way back up to the top zero location.  I believe the underrun only occurs when this line is initiated and I am already in this location.  If it has to jog to get here the underrun does not occur.  At least that is what I believe. 
Do you *always* get the underrun error on the 2nd M6 if you run two M6 commands back to back?  Or does it only happen sometimes?

If you can replicate underrun error, please enable our plug-in's debug log as described here:

        http://faq.pmdx.com/content/3/3/en/how-to-capture-a-debug-log-file-and-send-to-pmdx.html

After you enable the log, exit Mach4 and re-start it.  Then run the consecutive M6 cycles, or whatever you have to do to cause the underrun  Then disable to debug log as described in the FAQ, create a profile package and send that to me.  You can post the profile here on this forum, or you can email it directly to me at bob at (fill in my company name here).com.

When you post or email the profile package please also include:
- any GCode file or MDI commands that you are using to make the M6 calls
- What version of Windows you are running (XP, 7, 8, 8.1, 10) and whether it is 32-bits or 64-bits.
- Are you running any other programs on your PC at the same time Mach4 is running?

Bob

14
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 15, 2016, 10:22:42 PM »
Quote
1) Initial M6 works because the machine has to move, if I do another m6 without first jogging the machine, I get an PMDX underrun error and have to restart the software.  If I jog the machine away so it has to move between M6 commands it does what it is supposed to, to the extent I have tested it.
This sounds like the there may be an issue in the SmartBOB with *very* short moves during probing.  I'll have to try that here.  When you run the M6 the 2nd time, is the tool still in contact with the touch plate?  Or has it backed off a little bit?  A lot?

If you do get the "motion underrun" error, you *should* be able to click on the Mach4 "Enable" button and continue running the machine (like, say, jogging the Z axis away from the touch plate).  Does that not work for you?  If you click on the "History" button in the lower left of the Mach4 screen, do you see any other messages?


Your fixture offset may be getting clobbered because of this call:

            mc.mcAxisSetPos(inst, 2, toolz)

The variable "toolz" is not declared anywhere, nor is it ever assigned a value.  I'm not that familiar with Lua so I don't know what it does with undeclared variables and variables to which nothing has yet been assigned.  It may initialize them to zero, or they may have some random value.  And mcAxisSetPos() sets the position by changing the fixture offset, as I mentioned in an earlier post.  However, that function only gets called when "toollen" is zero, and I don't know if that part of your code is every run.

Bob

15
Mach4 General Discussion / Re: PLC Script troubleshooting
« on: September 13, 2016, 04:06:55 PM »
Update: the patched version of the plug-in appears to have solved the problem.  This fix will be included in the next public SmartBOB plug-in release.

Bob

16
Mach4 General Discussion / Re: PLC Script troubleshooting
« on: September 13, 2016, 12:05:32 PM »
Thanks.  I've just sent you a personal message with instructions on where to get the new plug-in and how to test it.

Bob

17
Mach4 General Discussion / Re: Altering M6 but am confused
« on: September 13, 2016, 02:17:15 AM »
This code doesn't look like it should compile.  There are mis-matched if/end blocks and you have code after "return" lines that will never be executed.  I don't know if something got changed when you pasted the code here.

For example, you have (I've changed the indentation to better show the content of the "if" clause):

Code: [Select]
function M6()
    local inst = mc.mcGetInstance();
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local TouchPlateThickness = 0.0;                     --What is the offset for the touch plate to the table top.  I dont have this figured in yet.

    if selectedtool == currenttool then
        return
        mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
    else
      .... more code here
The mc.mcCntlSetLastError() will never execute because it is after the "return".  Any lines of code between a "return" and an "end" (end of code block) will not be executed.  So move the mc.mcCntLSetLastError() line between the "if" and the "return" so that it looks like this:
Code: [Select]
    if selectedtool == currenttool then
        mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
        return
    else
      .... more code here
There are other instances of this further down in the code, including one section of code that performs a probe inside the "if toollen == 0" block.  After moving that mc.mcCntlSetLastError() to before the "return", that prove code should probably be deleted (all the code after the "return" and before the "else").

If the indentation of your original source file is the same as what showed up in your forum post, I suggest changing the indentation so the contents of every "if/end" or "if/else/end" block is immediately visible.  My quick guess is that you need one more "end" just before the "if mc.mcInEditor" line.

Now to your questions:

(1) The line "currenttool = selectedtool" is not needed.  There is nothing below that line that uses "currenttool", it all uses "selectedtool".

(2) I don't see any calls to mc.mcAxisGetPos().

(3) The calls to mc.mcAxisSetPos() tell Mach4 that the where ever Z axis currently is should be called "0.0".  It does this by changing the fixture offset for the currently selected fixture.  And the Z axis *should* be at the point where the new tool touched the touch plate, presuming that the G31 probe command moved far enough for that to happen.

Bob

18
Mach4 General Discussion / Re: PLC Script troubleshooting
« on: September 12, 2016, 01:43:53 PM »
Thanks for that last clue.  There looks to be a bug in the firmware that only shows up when the encoder is moving in a "negative" direction, and only under certain circumstances.  Let me know which version of our plug-in you are running (go to the "Diagnostics" menu and select the "PMDX SmartBOB").  I will send you a TEMPORARY patched version to see if this is indeed your problem.

Bob

19
Mach4 General Discussion / Re: PLC Script troubleshooting
« on: September 11, 2016, 11:52:40 PM »
I suggest adding some debug output to your script.  The easiest way is to use mcCntlSetLastError(), which outputs to the status/error line at the bottom of the Mach4 screen (and the "history" button gets you all the messages).  In each of your "if" and "elseif" cases where you change one of the solenoid control outputs, log the current encoder position and what you are commanding the solenoids to do.

For example,
Code: [Select]
if  zEncoderVal >= zStrokeUp then
    mcCntlSetLastError(inst, string.format( "pos %.4f turn output0 on",zEncoderVal) )
    mc.mcSignalSetState(output_0, 1)
elseif zEncoderVal > zStrokeDown and zEncoderVal < zStrokeUp and output_0_state == 1 then
    etc...

Not tested and you may need to tweak the string.format() to get it to work.  Then see what the encoder values are when you make the decisions to change directions.

Even better would be to save the raw encoder value in a separate variable from the one you use to store the value in inches.  The output both values in the mcCntlSetLastError() calls, just on the off chance that there is something happening in the conversion to inches (I don't know WHAT might go wrong there, but I do know that when debugging something, collecting more data is almost always the right thing to do).

Bob

20
Mach4 General Discussion / Re: Axis setup
« on: September 11, 2016, 11:27:25 PM »
No ball screws then AFAIK mach4 is not to good yet on backlash

Will they be updating Mach4? 
One of the design decisions in Mach4 was to push backlash support into the plug-in.  The Mach4 core has no concept of backlash except to provide a place in the motor configuration screen to enter the value.  Check with your motion device manufacturer to see if they support backlash compensation.

Bob

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 »