Hello Guest it is March 28, 2024, 06:28:06 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 - smurph

121
Mach4 General Discussion / Re: Mach4 not running on Windos 7 32bit
« on: August 15, 2021, 06:19:04 PM »
Yeah, no LUA version changes between 3481 and 4735.  So that makes not having to mess with the profile a real possibility. 

The VS x64 version will not load, I'm running 32 bit Windows7 Embedded Standard on my machine PC, so it should probably come as no
surprise that a x64 version won't load.

Yes, that would pose a problem.  No matter how hard I try, I just cannot get that to install either.  :)

Steve

122
To be fair though, it makes no sense that the "spindle RPM" box on the main screen lets you type a number in, but it does nothing. It had been long enough of a time gap that I had forgotten about all the quirk in Mach4 and how truly bad ArtSoft is at making intuitive and clean UIs. Sorry guys, it's true. You need to hire someone to help you make your UIs :).

To be REALLY fair though, have you ran a Fanuc, Fidia, or Siemens?  Or Linux CNC?  Good luck with anything being intuitive with those.  All things are relative.  :)

What is it supposed to do when you put a speed in the spindle RPM box?  Start the spindle?  If so, which direction?  Forward or backward?  Would that be what everyone likes?  There is NO WAY we can make a screen set/UI that everyone likes.  And there is NO WAY we can make everything intuitive either.  But we DO give you the ability of making it exactly the way you want it.  :)  We gave you a really good starting point though.  Just modify it to your liking.

Steve

123
Mach4 Plugins / Re: Mach4 Plugin-Development
« on: August 15, 2021, 05:54:43 PM »
I'm glad you are up and running!  I still have to implement a feature or two, but the the plugin seems to work nicely. 

Oh, you don't have to update to the latest Mach build to use the plugin.  Just install the latest build into a different directory (not installing any profiles) and just copy the mxXhcMpg files out of the plugins directory from the new build to your old build.  The plugin will be backward compatible with the older builds unless you are using a 10 year old build of Mach 4.  :) 

Steve

124
Mach4 General Discussion / Re: analog output
« on: August 15, 2021, 05:29:43 PM »
Also, you don't have to implement the PID in the PLC script if you want to implement it only in say an M code script.  That would take the relatively slow PLC script rate out of the equation.  Just hard loop the PID in the script (while loop).  Read the feedback, process the PID, write the analog value.  Repeat until you have hit your position. 

Steve

125
Mach4 General Discussion / Re: analog output
« on: August 15, 2021, 05:21:11 PM »
You might investigate how Mach does its Torch Height Control (THC). THC is generally considered a realtime feedback process however Mach has done it
using software alone and achieving bandwidths of about 10Hz. It seems to use PMC which is a much faster method of communication/output control.
Would 10Hz bandwidth be enough for your axis?

Craig

As usual, Craig has a nose for what is needed.  :)

First you need an device that has analog outputs and has a Mach 4 plugin.  Most will implement the analog output as a register which means that you can used the API functions having to do with registers to control the output value. 

local hReg, rc
hReg, rc = mcRegGetHandle(inst, "device/reg/path")
rc = mcRegSetValue(hReg, 4095) -- full scale + on a unipolar 12 bit DAC.

Or you can do some more configuring in the analog tab of the configuration dialog and use the analog API functions.  All these functions do is a transformation so that you can operate on analog outputs in terms of voltages instead of raw values.  You accomplish this by mapping a analog register to an analog object.  On the Analog Output tab of the config dialog, set the device, the analog register, the numerator, denominator and the offset.  To set these values, you will have to know a bit about the DAC you are using, like how many bits of resolution and its voltage range.

For instance, say the DAC you are dealing with is -10v to +10v with 12 bit resolution.  Set

numerator = 20 (total voltage swing)
denominator = 4095 (12 bit max value)
offset = 2047 (basically, the zero volt value)

Now you can set the analog output in terms of voltage.  Say 5 volts.  The calculation is (volts / (numerator / denominator)) + offset.

(5 / (20 / 4096)) + 2047 = 3070.75  or the integer value of 3071.

so

rc = mc.mcAnalogOutputWrite(inst, 0, 5) -- Set analog object 0 to +5v

writes 3071 to the actual analog register.

The next thing required would be some position reference like an encoder register

Then you would read the encoder feedback and and implement a PID loop in the PLC script to control the analog voltage driving the servo.  The PID loop with PID values that you tune will make it work even though it is not real time and will compensate for the horrible time resolution.  It will not be fastest and it will not be real time coordinated with some other axis or event (impossible), but it will hit the numbers.  This is exactly how we do torch height control.  The only difference is we are using an arc voltage as a target instead of a position. 

People will say "But torch height control needs to be realtime" and I will say "Show me a motor or any motion system that can react instantly to any voltage change magnitude."  It doesn't have to be real time to be close enough to do the THC job. 

Now, I don't have time to write all of this for you, unfortunately.  My post is simply to sate that this can be done. 

Steve

126
Mach4 General Discussion / Re: Get screen propety on macro
« on: August 15, 2021, 04:16:49 PM »
Just calling

scr = require("screenipc")
scr.scIpcInit("127.0.0.1")

makes the macro stop? 

Check your syntax. your original require didn't have a " and the scIpcInit() had a ' at the beginning of 127.0.0.1 and a " at the end. 

Next, you really don't want to "require" every time you run the M code macro.  Make a file in the macros directory called "screenipc.mcs" and put:

scr = require("screenipc")
scr.scIpcInit("127.0.0.1")

in it.  This will cause a file named screenipc.mcc to be built the next time you hit cycle start.  The "scr" library prefix will then be available to all M code script in the macro directory.  Meaning all you would have to do in your m200 macro is call scr.rtGetProperty('myPropety','Value').  Please do check the return codes of the function for errors, as all mysteries will cease to be and it is just good programming practice to do so. 

127
Mach4 General Discussion / Re: Mach4 not running on Windos 7 32bit
« on: August 15, 2021, 04:04:00 PM »
Craig,

Try running the VS redistributable as Administrator. 

You need the VS2017 redistributable package.  I was going to give an updated link and M$ has changed all of that now.  So I copied the ones from my compiler to our FTP server.

http://www.machsupport.com/ftp/Mach4/DevlopmentVersions/VS2017/

Install both the x86 and x64.  x64 just because some other programs may need it in the future. 

Steve

128
Mach4 Plugins / Re: Mach4 Plugin-Development
« on: August 15, 2021, 12:05:16 AM »
Mach builds after 4688 have the plugin.

Steve

129
Mach4 General Discussion / Re: pmc -parallel line how to do?
« on: June 18, 2021, 02:52:52 AM »
You can place your cursor to the left, right, or underneath most object to insert other objects.  So to do a parallel op, place the cursor under the existing coil and insert another coil. 

Steve

130
Mach4 Plugins / Re: XHC WB04 plugin
« on: June 12, 2021, 06:11:56 PM »
Ah...  Ok, I wasn't really sure what all the Mach3 plugin did.  You are talking a velocity jog, right?  As in not a step per detent thing?  If so, do you jog by moving the hand wheel dial?  Where as long as you are turning the dial one way, the machine will jog in that direction.  Try to be as specific as you can explaining what it does and I will see what I can do. 

Steve