Author Topic: newb question Lua error, machine not moving  (Read 448 times)

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #15 on: March 19, 2020, 01:43:47 PM »
Progress! I have movement! A couple issues though. I tried redoing the screw terminals. Un screwing the screws pulling out the wires, re-inserting them and screwing the terminals back down. I then fired up everything. I couldn't locate the jog screen so I tried inputting commands in MDI again. I got movement on both the Y and Z axis's (when commanded) . However when I command a y move the Z axis responds and visa versa when I make a z command the y axis responds. I'm assuming this is an easy fix. Okay so then I tried an X move, again in MDI, and got nothing. That's when I noticed a message in the History window that said "axis 0 commanded while disabled". I don't know if it was there before inputting the x axis command or not but I'm guessing it was after. Anyway about this time I found the jogging button and tried jogging in y (the Z motor moved) and Z (the y motor moved) but the x axis buttons were ghosted. I haven't tried the multimeter test yet. I will be going back to the shop this afternoon to see if I can figure out how to correct everything. Any suggestions would be much appreciated and thank you 12 strings for all the help so far. I can't believe it was such a simple fix as redoing the connections. Now if I can just get the x axis working as well. I'm about ready to try wiring up the limit (homing) switches and the E-stop and can't wait to start burning parts although that's still a ways away.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #16 on: March 19, 2020, 06:43:53 PM »
Okay, I went back to the shop this afternoon and started the machine. Same situation as before. Z on y axis, Y on Z axis, no x axis movement. X was ghosted in jog. so I tried to get back to the screen where I setup the machine a week or two ago. Where there was the tab for axis mapping. I couldn't get there because it was all ghosted. So I went in and created a new profile and restarted Mach4 and got into the axis mapping configuration screen there was a red x on motor zero which matched the error I got in the History window (axis 0 commanded while disabled). Then I have green checkmarks on y axis with motor one in the box and z axis with motor two in the box. Then I noticed that the next box is A axis and it has a motor 3 in the box. So, out of curiosity I went back into Mach 4, MDI and put in G1A1. and hit the cycle start button and, voila, the x axis moved. Way too much though, I shut if off by hitting the stop button and then put in G1A0, hit cycle start and the machine returned to x zero. The problem was the z axis (designated as Y) moves way too little (about a quarter inch maybe) and the X axis (designated as A) moves way too much, about nine inches for a 1 inch command. So I tried to get back to the screen where I set up the motor parameters but it seems everything is ghosted again. I know this is getting to be a mach4 problem which I'm still learning and not a PMDX issue but you have been so helpful in the past I would appreciate it if you might be able to give me guidance regarding these new issues. I will see what I can figure out elsewhere in the meantime. Thank you for your help so far.
 

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #17 on: March 19, 2020, 10:48:15 PM »
All righty then!

Based on the pictures you posted earlier,  you have Z axis on motor1, Y axis on motor2 and X axis on motor3 (PMDX-424 calls them "3a" and "3b" but Mach4 knows them as a single motor "3").

First, the axis configuration.  Go to the "Configure" menu and select "Control".  In the dialog window click n the "Axis Mapping" tab.  Change things so it looks like the first picture.  Then click on the "Motors" tab.  See the notes on the 2nd image below.  Click on "Motor1" in the upper right to display the motor tuning info below the graph (for the Z axis).  Change anything you need then click "apply".  Repeat for "Motor2" ("Y" axis) and Motor3 ("X" axis motors).

Finally, make sure the PMDX-424 has the slave motors enabled (probably does, but make sure).  Go to the "Configure" menu and select "Plugins" then the PMDX plug-in.  Click on the "Feature Config" tab and make the slave motors are enabled (see 3rd image below).

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #18 on: March 20, 2020, 06:09:56 PM »
Arrrg!! Just when I thought we'd gotten over all the rough patches... I went in this morning and made all the changes you'd suggested (The screen 3 change had already been made). Then I went into MDI and input G1X1. and clicked on the enable button then the cycle start button. Nothing. then I noticed the enable light was off on the 424 board. I forget what I did next, I think I looked at the History screen and there was some text in there that was like .03 inches tall, way too small to read. I think this is where I decided to just restart the system, not sure and its not in my notes. When I did, I got that old "USB device not recognized" error. When I click on that box I get a message that says: Error: One of the USB devices attached to this computer has malfunctioned and Windows does not recognize it. For assistance in solving this problem, click this message.
When I clicked on the message, it brought up a tree like the one under Device Manager. It said:
USB root hub (2 ports)
  Generic USB Hub (6 ports)
  unused port
  unused port
  unused port
  USB mass storage device
  Unknown device
  unused port.

Okay so the unknown device had the yellow triangle with the exclamation point in it. I double clicked on that and got the following message: USB serial bus controller in control panel windows has stopped this device because it has reported problems (code 43).
So I went into device manager and it had the same list under USB serial bus. I looked in Ports next and it only showed COM1 not COM3 as before. So I tried repairing the VCP file, no luck. Then I tried removing the VCP file completely, then restarting and re-installing it. The computer says it successfully installed the VCP files but there is still nothing in Ports under device Manager except port (COM1).
About this time I realized I could read the History window by double clicking on the button. The first time I did it, it had some messages about not finding the SmartBob board but the last time (after another restart) it said: Lua error occurred while opening filecannot open C:\Mach4Hobby\Profiles\PMDX-424-Sample\Macros\mcLua.mcc No such file or directory.
Seems like two steps forward, one step back. And just when I thought I had everything solved. I am wondering if it could be a computer problem. I have had hard drive problems with this computer before. Not looking forward to moving everything over to a new system though, plus I don't have one handy. Thoughts?

 

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #19 on: March 20, 2020, 11:11:56 PM »
For the Lua error, look in C:\Mach4Hobby\Profiles\PMDX-424-Sample\Macros and see what is there.  This image shows what is on my PC.  If you don't see those files then do this:
- Close Mach4 and unplug the PMDX-424 from the USB port
- Rename the Mach4Hobby\Profiles\PMDX-424-Sample directory to some other name (maybe "MyMachine" or something).
- Re-install the PMDX plugin, checking the boxes to install the sample profiles.
- Copy the contents of the macros directory from the newly created PMDX-424-Sample into MyMachine\Macros
- Plug the PMDX-424 into the USB port
- Start Mach4 and see if you still get that Lua error

As a side note - it is a good idea to clone the PMDX sample profiles before editing them.  The current PMDX plug-in installer will not overwrite profiles that already exist, but future versions may change this.  And if a new plug-in overwrites your highly modified version of the PMDX-424-Sample profile you will be very sad.

Now, for the VCP port issues.  Just to make sure, with the PMDX-424 unplugged from the USB, bring up device manager and see if there are any devices with a yellow triangle.  If not, plug the USB into the PMDX-424.  Does a device a ppear with the yellow triangle? And does the yellow triangle & unknown device go away when you unplug the PMDX-424 USB cable?

If so, try one more thing.  But first, what steps did you take to uninstall and re-install the VCP driver?  Did you use the steps here:
https://faq.pmdx.com/content/2/8/en/how-to-manually-install-the-virtual-com-port-driver-version-14.html

If you are running Windows10, try unplugging the PMDX-424 and then uninstalling the VCP driver.  The do NOT re-install the VCP driver.  Instead just plug the PMDX-424 into the USB. With Win10, the "in box" 9i.e. supplied with Windows) driver that is used by the PMDX devices is the preferred driver.  See if that works.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #20 on: March 23, 2020, 06:55:07 PM »
I had a fairly productive day today. I didn't find the image you mentioned of what should be seen in the Macros file. What I have in there is the following list:
  load_modules.mcc
  load_modules.mcs
  m6,mcc
  m6.mcs
  m162.mcc
  m162.mcs
  m163.mcc
  m163.mcs
And that's it. I'm wondering if I should be unplugging the SmartBob from the computer whenever I shut down? I was leaving it in but that seems to be when I've been getting the device not recognized window.
Anyway, I went through what you told me, I renamed the sample profile. I couldn't find another copy of the plugin. I may have just had it on a thumb drive or something. Anyway, I plugged the PMDX-424 into the USB port, started Mach4 and I still had the Lua error. However I didn't have a device not recognized error so I loaded Mach4 and went in to configure/controls/motors and adjusted some parameters and made some movements. I can't adjust these parameters after changing them once. I assume this is to keep you from accidentally changing them. So I would close Mach4 Hobby. whenever I would try to restart it I would receive the error that another instance of Mach is already running even though I just closed it out. So I would shut down and restart. Once I got the device not recognized window again but I just went in and reinstalled the VCP driver and that seemed to fix everything. Its not showing up in Device Manager/Ports like it was before but it says it was successfully installed and I'm not getting any errors and the 424 board is working like it should. Anyway I did this process several times today, shutting down restarting, plugging in the USB cord, adjusting parameters. At the end of the day all three axis were moving within an accuracy of about three thou per inch so I called that good enough for now.
I do have one other thing I'm not sure how to change. When I make a positive x move the gantry moves in the negative direction and the same with the z axis, a negative move moves the axis in the positive direction. Other than that I'm quite satisfied with how things seem to be working. Looking forward to actually loading a program and starting to burn metal. I've still got some work to do before then but appreciate all the help you've been giving me. I feel like I'm on my way there. So, two questions really, should I unplug the 424 board after shutdown and how to get my two axis's moving the right direction.

 no exclamation points in Device Manager

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #21 on: March 24, 2020, 12:30:53 AM »
Sorry - I forgot to post the picture.  The only file that I have that you don't is the "mcLua.mcc" file, which (I think) is a combination of the compiled versions of all the other macro files in that directory.  I don't know why Mach4 isn't generating that (it should regenerate it every time it runs).  That is a question for the Mach4 support forums.

That is total weirdness only being able to change settings once.

There are 2 ways to change the direction of an axis:

(1) Go to the Configure->Control dialog and click on the "Motors" tab.  Click on the motor in the upper right that drives the desired axis (i.e. Motor1 for "Z" and Motor3 for "X"), then click the "Reverse?" check-box to check it (or un-check it if it was checked).

Or (2) Go to the PMDX plug-in configruation dialog, click on the "Motor Config" tab. Change the "Dir Polarity" for Motor #1 and Motor #3.

NOTE: Making the change in one place will reflect that change in the other place.  You only need to change the setting in one or the other place, not both.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #22 on: March 25, 2020, 11:51:28 AM »
Okay, I will try making the mentioned change. I think I am good to go for a while now. I just need to research how to hook up the E-stop and the limit switches. I'm going to spend some time sorting out my CAD-CAM program as well. I know I've mentioned this before but I really appreciate all the help you have provided. I would have been lost without it. If I have additional problems I will try starting a new thread. Thank you.

« Last Edit: March 25, 2020, 11:53:02 AM by Jawno »

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #23 on: March 26, 2020, 10:10:57 PM »
If you haven't already done so, check out the "Mach4 CNC Controller config.pdf" document in the Mach4Hobby\Docs directory.  Limit switches and EStop are in the "Input Signals" section (and "Input Signals" tab in the config dialog).  Note that limit switches (and home switches) are assigned to motors, not axis (axes? axees????? :)