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

Jawno

  • Posts: 26
    • View Profile
newb question Lua error, machine not moving
« on: March 06, 2020, 05:49:02 PM »
I'm a newb at this. I finally got the computer to recognize my SmartBob-424 card. It seems I've fixed the invalid or unknown device error. I have the STMelectronics port showing in Device Manager with no exclamation points. I tried to get the machine to do something today. My computer is a Win 7, 8 GB ram, 64 bit system. I tried putting in some code in MDI. A simple program, just G1Y1. The movement was made in Mach4 on my screen but no movement on the machine. When I started Mach4 I got a message in the History window that said Lua:Error occurred while opening file. I went into Diagnostics for the 424 card. When I make a move in Mach 4 the output lights turn green and yellow for the axis that I'm moving but nothing moves. At the bottom of the Diagnostics window under encoder position it says **Disabled** in the first window and Rawln 0x000007ff in the other window. Also I have a new light on the 424 board. I think its an "enable light". Its near a barrel shape capacitor, lower center of the board. I haven't done anything with the emergency stop switch. Could that be holding things up? My board still has the red connector on the E stop that came with the board. I would like to get this working. I feel like its close but no cookies yet. Thanks in advance for any help you could offer me. Not sure what other info to supply. Mach4 build #4162, screen set name wx4, set, PMDX SmartBob-USB Device: PMDX-424(RevD PCB)on COM3, Serial #: SN38024(D1), plugin version: 0.53.263, bootloader version: 1.15.76, firmware version: 0.60.208

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #1 on: March 07, 2020, 10:55:59 PM »
When you tried the motion, did the DROs on the Mach4 screen change (i.e. for "G1Y1" did the Y axis readout go to 1.000 from where ever it was)?

How do you have the PMDX-424 wired to your motor drivers?  What motor drivers are you using?  And what settings do you have on the PMDX plug-in config in the "Motor Config" tab?

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #2 on: March 08, 2020, 05:50:17 PM »
Yes the DRO changed on the mach4 screen. Not sure what the configuration settings are for the SmartBob. I'll have to check that next time I goto the shop (tomorrow). I am using geckodrives. G203 or 204, I forget which. I have three wires to each drive from the SmartBob, step and dir and ?.
I was wondering if I need to tell Mach4 something about my motors. Like step size, baud rate or something like that. If this is in the configuration settings then I'll look tomorrow. I know I left all the settings alone on the screens that say don't change these unless PMDX tells you to.
The Lua error never said what file so it may have nothing to do with the problem. I haven't wired up the limit switches or E-stop yet. figured I should try to get some movement first.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #3 on: March 09, 2020, 02:46:52 PM »
Okay, I looked at the machine today. Under control configuration it has counts/unit. The box is blank. Under velocity in  units/min the box is blank. under acceleration in units (sec 2) the box is blank. also the boxes for G force, backlash, Reverse and Enable Delay (ms) the boxes are all blank.
Also under axis mapping slave 1 is blank. I am using the dual motor feature on my x axis. These are assigned as motor 3a and 3b. Should I have something in the slave 1 box? Also under toolpath the boxes for Disable VBO tool path, use a frame to draw the tool path and use lazy Tool Path Update, the boxes are all blank.
I'm thinking I should have some info in some of these boxes,in particular, the counts/unit and velocity in units/minute. Wouldn't you agree? Not sure what to put there though. Any help is appreciated. 

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #4 on: March 10, 2020, 02:30:06 PM »
Okay I finally got the info you requested. Under motor configuration, the step/dir pinout configuration is Normal. Step/dir common configuration says step/dir common is ground.
for motors 0 to 3: Step pulse width is 5us, step polarity is active high and Dir polarity is Normal.
I tried to input numbers into the boxes on the control configuration screen (the one with the graph) but couldn't get it to accept any keyboard inputs for counts/unit or velocity in units/min.

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #5 on: March 11, 2020, 11:17:42 PM »
For Gecko G203V, PMDX plug-in motor config "step/dir common" should be ground and the step/dir polarity should be "normal".  5us step pulse if fine also.  So you are all set there.

In the standard Mach4 Configure->Control, "Motors" tab, you need to click on a motor along the right edge to display the current settings for that motor.  THEN you can edit them and save them  Then click on the next motor, etc.

If you are using the PMDX-424's built-in "clone" feature for running 2 motors for a single axis, configure Mach3 as if there is only one motor on that axis (PMDX "motor 3").  So leave the "Slave1", etc. boxes empty.

And just to ask the obvious question - are you sure you have the "step" signal from the PMDX-424 wired to the G203V "step" terminal?  And "dir" to "dir"?  And PMDX-424 "com" to G203V "Common"?

When you issue move commands, do you see the PMDX-424 "steps" LED flicker?  You should if you see the Mach4 DROs change, but just making sure.

With the system powered on and Mach4 "enabled", do the motors have holding torque (i.e. can you spin the shaft by hand)?  You may need to unmount the motor to test this.

For the Lua issue, go on the Mach4 support forums and ask how to troubleshoot that.  There is a link to that forum from the main PMDX forums page.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #6 on: March 12, 2020, 01:02:44 PM »
Okay I will check the wiring between the SmartBob and the gecko's. I did notice the led's on the SmartBob flickering once, usually I've been concentrating on the monitor.
The motors do have holding torque, at least I'm sure the x axis does as I was trying to count the number of teeth on the motor gear (rack and pinion) and had to shut down so i could move the axis.
Again, thanks for the help. The more I work on this, the more it feels like a driver issue. Mach4 and the 424 board seem to be doing what they are supposed to be doing. I am not sure I have the power supply wired correctly. Its wired to the drivers and they send power to the motors. Is that correct?

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #7 on: March 12, 2020, 06:11:16 PM »
Yes the led flickers upon execution of a movement command. Yes the common, step and dir connections from the 424 board are connected to terminals 8, 9 and ten on the Gecko (203v) which are marked as common, step and dir. I have the motors wired to terminals 3, 4, 5, 6, winding A is blk(3), winding -A is green (4), winding B is red (5)and winding -B is white (6). I have the red power wire from the supply connected to terminal 1, the power terminal on the gecko  and the black wire from the supply connected to terminal 2, the ground wire on the gecko. One thing I should mention is that I have the power supply wired for 110 volts. It said it would supply either so I figured 110 would be easiest to wire and if I needed more power I could rewire it later. I'm running 640 oz-in steppers. I think they are rated at 3.5 amps. I meant to grab that info when I was at the shop but forgot. The power supply is rated at 15 amps I believe.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #8 on: March 13, 2020, 04:32:30 PM »
Okay, one thing I was wondering about. My power supply output has two positive terminals, two negative terminals and a common terminal. I don't have anything hooked up to the common terminal. Wondering if I should have it connected to something and if so, what. I tried to get a pic but its a pdf file.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #9 on: March 14, 2020, 10:09:53 PM »
I have a bit of an update. No luck yet with getting the machine to move but I did run across a post that said that the choice between a one ten volt power supply and a two twenty volt supply depends upon the inductance of the motors being used. I'm using fairly large motors. 640 oz-in, 45 volt at 4 amps. So maybe 110 is not enough volts to turn them. I need to calculate the inductance and see if I can figure out what size supply I need to use. I just set mine up for 110 because it was "easier". I'm going to try to find the formula for calculating this again. Does anyone here happen to know what the formula is?

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #10 on: March 14, 2020, 11:05:19 PM »
110 or 220V????????  I sure do hope that this is the INPUT to your motor power supply and what you are putting into the G203Vs.  'Cause putting 110V into a G203V will probably kill the "un-killable" 203V :)

The motor is rated for 45V?  I don't have a lot of experience with a lot of different motors, but I am used to seeing motors with a voltage rating in the 4-10V kind of range.  And with a rule of thumb that as best I can recall went something like this: with a switching motor driver (like the 203V and most drivers) you can power the driver with 8x to 10x the motor's rated voltage, depending on the motor inductance and how hot you wanted the motor to run.

Can you post (upload) the PDF for your power supply?  You probably can just wire the + and - terminals to the gecko drivers.

Grasping at straws  and a really basic question - are you sure you have the motor wiring correct?  If you have a multimeter you can measure the resistance through the windings.  You should see a low resistance between the two wires on the same phase (i.e. A and -A), and infinite resistance between wires of different phases.  This means a low resistance between the black and green wires, and between the red and white.  You should see infinite resistance between the black and either red or white, and between the green and either red or white.

Pictures of your wiring might be helpful.  Or not.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #11 on: March 15, 2020, 08:50:06 PM »
I've come up with some stats on the motor and power supply. I have three Nema 34 motors rated at 4.05 volts, 4.5 amps current, .9 ohms resistence, 6.8 mH inductance and 640 oz-in of torque. I also have a fourth motor on the Z axis which is a Nema 23 rated at 3 amps current, 1.2 ohms resistence, 4.7 mH inductance and 2 Nm torque. My power supply is rated at 1200 watts, 60 volts dc and 20 amps. The input is 110 volts, the drivers are connected to the output side which should be 60 volts, correct?
I will check the motor connections. Can I do this at the drivers? all the cables are heat shrinked and not easy to get at the wires. Everything is in drag chains and all cable is shielded.
I've attached the pdf's for the power supply and the X and Y axis motors. I'm still not sure where to run the common wire for the output. I have the two plus outputs attached to the driver power (2 into 4)and the two minus outputs attached to driver power ground (again 2 into 4). In other words there are two terminals each for plus and minus on the power supply and I have these split into four wires going to each of the four  geckodrives.
 I'll have to try to take a picture of the wiring next time I'm at the shop. Should be tomorrow.

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #12 on: March 15, 2020, 10:34:41 PM »
Your wiring matches the motor data sheet, so that should be OK.  Other than verifying you really do have the motor's black & green wires to the Gecko phase A terminals (pins 3  & 4) and red & white wires to Gecko phase B (pins 5 & 6).

On your power supply, leave the "C" terminal unconnected.  Yes, you should see 60VDC going to your G203Vs.  And it shouldn't make any difference to the Gecko drivers or your motors whether you wire the power supply for 110 or 220VAC input.

I just realized I didn't double-check how you said you had the step/dir/common connected from the PMDX-424 to the G203V.  You said pins 8, 9 and 10 were common, step dir.  It should be pin 8 is dir, 9 is step and 10 is +5V Common (exactly reversed from what you said).  So double check that to make sure it wasn't just a typo.  And verify the connections at the 424 end (i.e. the 424's "COM" to the G203V "COMMON", etc.).

Do you have anything connected to the G203V pin 7 (labeled "Disable")?  You should not.

Jawno

  • Posts: 26
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #13 on: March 17, 2020, 03:44:05 PM »
I got to the shop today and took photo's of the electronics. I do have dir on 8 of the gecko, step on 9 and com on 10. I have nothing hooked up on the disable connector. I was guessing its for emergency stop which I haven't wired up yet, Or maybe not, but its open right now. I do have black and green to phase A and red and white to phase B. I did a resistance check at the drive by probing the screws that hold the wires down. I got zero resistance on both phase A connections and phase B connections.
However I tried to do a voltage check on the power supply wires. I stuck one probe (the black one) on the power ground terminal (1) and then as soon as I touched the power terminal (2) I got a nasty spark so I backed off from doing anymore testing. I did see that the power led in the geckodrive was still lit afterward so hopefully no damage to the drive.
Anyway, attached are some pictures of the electronics.

12strings

  • Posts: 236
    • View Profile
Re: newb question Lua error, machine not moving
« Reply #14 on: March 18, 2020, 11:53:57 PM »
Sounds like you still had the meter in "resistance" or "continuity" mode (instead of DC volts) when you tried to measure the motor power supply :)  I hope your meter survived.

A picture is worth a thousand words!  It looks like the screw heads on the PMDX-424 step/dir connectors are sticking up near the top of the plastic.  They should be down/recessed, like the screw heads in the G203V connectors.  The PMDX-424 screw terminals are "rising clamp" type, which means you turn the screw clockwise (when looking down from above) to clamp the wire, and counter-clockwise to release the wire.  It looks like you have put the wire in, then turned the screws counter-clockwise to clamp the wires.  This does not form a reliable connection.

Here is how to verify that this is the issue:

Start with everything powered on and Mach4 "enabled".  Using the jog buttons on the "Jogging" tab, jog the Y axis in the positive direction (i.e. "Y+").  Doesn't matter how much, just enough that you see the Y axis DRO increment some.  Take you meter on DC Volts and measure on the voltage from the "com" terminal (black meter probe) to the "dir" terminal (red meter probe) on the PMDX-424 connector that you have labeled "Y".  It should be either near zero volts or near 5 volts (I don't recall which).  Also measure the voltage at the G203V for the Y axis with black meter probe on "common" and red meter probe on "dir".  You should see very close to the same reading.  Then press the "y-" button just long enough to see the Y axis DRO decrement.  Repeat the measurements at the PMDX and G203V connectors.  You should always have seen approximately the same voltages at the PMDX and G203V connectors.  And if the first readings were near zero, the second readings should have been near 5V.  If the first readings were near 5V then the second should have been near 0V.

If you don't ever see a reading near 5V **AT THE G203V** that most likely means the the wires are not making good contact in the PMDX screw terminal connectors.  Remove the wires, turn the screws fully COUNTER-clockwise, re-insert the wires and turn the screws CLOCKWISE to tighten.  You hopefully should now get motor movement.