Hello Guest it is April 25, 2024, 11:48:16 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 - SimonRafferty

Pages: « 1 2 3 4 5 »
21
From the conversations I've had with people who have built their own screensets, they seem to fall into two, maybe three categories.

Either they feel that it's too specific to their machine such that the code would require modifying extensively - and they don't want to provide support for that.

Or, because there is code embedded in the screens, they are worried about the potential liability if something goes wrong and damages your machine (or you!).

A partial third seems to be that if you are capable of modifying code to run with your hardware, you are capable of building your own screen.

The net result is there are practically no third party screen sets for Mach4.

It seems a shame as the number of people who are a machinist, competent programmer, have spare time - and a graphic designer is pretty small!

22
Finished Screens / Re: New Simple Lathe Screen Set
« on: December 18, 2020, 02:17:00 PM »
Have you by any chance built a Mach4 Version of this?

Si

23
Mach4 General Discussion / Mach4 Lathe - which motion controller?
« on: December 15, 2020, 02:31:15 PM »
I have a mill, running with Mach4 and a CSMIO/IP-M and I have few complaints about it.

This year, I decided to convert my Denford Cyclone with Fanuc OTB and servos to run Mach3 / 4 - and figured I'd buy another IP-M controller, but I'm starting to regret that decision!
The plugin for Mach3 was flaky as hell.  It worked OK with Mach3 Mill but refused to cooperate with Mach3 Turn.  OK, neither the plugin nor Mach3 are supported so I decided to go for Mach4 instead.
Unfortunately, their V3 Mach4 plugin also has problems.  Mainly with connectivity but when it does connect, the pulse-stream it generates is lumpy / jerky. They suggested a faster PC.  Made no difference.
 
Cut a long story short - I'm now at the point of abandoning CSMIO and buying something else!  I want to continue with Mach4 as I like it!

Ideally, I'd like:
  • 24v differential inputs & outputs
  • Threading with single pulse or Encoder
  • Proven ability to play nicely with Ultra3000 Servo Drives
  • 2 x Analog inputs
  • 1 x Analog 0-10V output
  • Ethernet connectivity (that works)
  • Mach4 Plugin that actually works!!!


Today I've looked at:
  • Pokeys57cnc - Although people have made it work - there are also a lot of people expressing problems.
  • Vital Systems HiCon Integra - Looks good but quite expensive.  Once I've bought the analog upgrade & threading it comes to $1120 + shipping, duty & VAT = over £1,000
  • UC300 - doesn't support Lathes
  • CNCDrive AXBB-E - Looks OK but very little info on line. No obvious Mach4 driver nor threading
  • PMDX-424 - Looks OK.  Shame it's USB but it ticks most other boxes
  • ESS - Has threading now, but people still finding problems with it.  I had an ESS, probably 10 years ago and had a lot of problems with the Mach3 driver loosing contact and hanging half way through a job.  Hopefully it's better now?

Is there anything decent I've missed?  Do any of you have a Lathe with Treading & Mach4 with Servos?

Feeling that I've wasted £500 (£1500 if you include buying a new PC unnecesarily) - I would value any advice you have on not wasting any more!

Si


24
Mach4 Toolbox / Re: Mach4 Serial Pendant
« on: August 29, 2020, 01:53:06 PM »
I would first have a look at the Arduino Serial Console (in the Arduino IDE).

You are clearly receiving Serial data from Mach to update the DRO's but either it's not being sent to Mach, or it's not responding to it.

Let me know whether the Arduino is sending data to Mach & we'll go from there.

Si

25
Mach4 Toolbox / Mach4 Serial Pendant
« on: May 25, 2020, 05:50:20 PM »
I had wondered how to make a more functional Pendant controller than the ones that you can buy off the shelf.  By more functional, I mean including DROs that are updated from Mach4 and confirmation lights on buttons, again controlled by Mach4 - so you know it has received and understood the instruction.

In place of Buttons, I've used a Capacitive Touch LCD (which works with wet fingers, unlike Resistive screens).

It uses an Arduino Nano as a USB Serial Device.  When a button is pressed, it sends a (short) Serial Message to Mach4.  When Mach4 receives it, it enacts it and sends back the state of the thing it changed (Coolant for example) which in turn causes the button to Illuminate.

The MPG Wheel Sends "I" for Increment & "D" for Decrement.  If the DRO value for an axis changes, it's sent back to the Pendant for display.  With the short messages and fast serial (115200bps) the lag is minimal making the pendant very responsive.

While this is not just a 'script', the scripts it contains may well be useful, particularly for anybody wanting to communicate externally using Serial.  Most of the heavy lifting with the serial was done by Mike https://www.machsupport.com/forum/index.php?topic=42084.msg274487#msg274487

I used a variant of his code to talk to my Servo Drive - then adapted it for this. 
DanTheGaz's posts & particularly videos were invaluable discovering what's under the covers of Mach4

I'm sure I've done some of it the 'wrong' way - but life is for learning!

I've uploaded all the code, including Arduino to GitHub:
https://github.com/SimonRafferty/Mach4-Serial-Pendant

26
I don't know about PDMX - but I'm running Mach4 on an intel Compute Stick.  It doesn't get much more 'mini' than that!  It's just a little bigger than a typical USB Thumb drive.

I really didn't expect it to work - but it runs beautifully!

While it only has USB (one USB2 & one USB3), I have it connected to a USB Ethernet controller to talk to a CSMIO/IP-M motion controller.


27
Thanks Craig.  The Vista Pendants seem to be the only off the shelf option for Mach4 at the moment.

I could just buy one - but I enjoy building my own solutions.  It may not end up being as good - but it's mine!

That said, the ones I've made in the past have been pretty good - so, if I can make a nice one and publish the design + scripts then it opens up another possibility for people who want to build their own.  At the very least, it gives me a useful project during the Lockdown!

28
Mach4 General Discussion / Recommend me a high quality MPG Wheel?
« on: May 07, 2020, 05:17:43 AM »
I've bought a couple of MPG Wheels & encoders over the years, but none of them had the same, nice, feel as Fanuc or Heidenhain wheels. 

What makes a good one?  Enough mass that when you spin it, it will keep going for a turn or so, with enough damping that it will stop.  Soft detents so you can feel each click, but they don't interfere with spinning.  Nice finish.  It probably doesn't need a scale on it - as it changes with the jog increment.

I don't need a complete pendant - i'm going to build that!

My plan for the pendant, inspired by this post on Instructables:
https://www.instructables.com/id/Mach4-Pendant/

I'm not keen on the touch screen - I'd like buttons I can feel & operate without looking at them!
My plan (which may or may not work!) is to use the Lua Serial plugin to talk through a wireless USB Extender, to an Arduino on board the pendant. 
I'll write a PLC script which will establish 2 way comms with the pendant - sending axis positions and reading the MPG & buttons.  If that doesn't work, an arduino at both ends with X-Bee comms and feed the MPG + Buttons into the BoB as if it were connected directly. 

I'm not keen on the keystroke injection method most seem to use - it's dirty!

First step though is a nice MPG Wheel!

Thanks in advance,

Si

29
Mach4 Toolbox / EMCO PCMill100 or VMC100 Toolchange Macro M6
« on: May 07, 2020, 04:21:06 AM »
The PCMill100, VMC and several other EMCO mills use the spindle to drive the toolchange turret.
After you Home Z, if you continue raizing Z, the tool disengages and after 90mm (on mine, check on yours!) the spindle engages with a bevel gear and then can turn the turret.

Originally, the machines use a hybrid Analog / Pulse+Direction drive for the spindle.  I couldn't get it to do either and suspect it needed the original PC to send it someting via RS485 to activate as well as setting the input pins.

With this example, you can drive it just using a simple VFD driving the original spindle motor.

There's a video of it operating here:
https://www.youtube.com/watch?v=WpjGpXOVs3M

The turret has an index sensor, detecting magents set into the rear.  There is one for each tool, the rising edge of the sensor pulse coresponds to the tool being correctly located.  There is an extra magnet between tool 10 & 1.  This is used to determine the position of tool 1, just using a timer.

Initially the turret is turned and the max time between index pulses measured.  If a pulse comes along, with less than 75% of the max time - that must be the extra magnet - so the next pulse indicates tool 1.

Then it just counts up the number of pulses  / tools until the right one is reached.

There's not much on line about converting these machines.  Ping me a message if you need more info on my approach.  I'm using CSMIO/IP-M with Mach 4.

Code: [Select]
local inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)


package.path = path .. "\\Modules\\?.lua;" .. path .. "\\Profiles\\" ..  profile .. "\\Modules\\?.lua;"

function m6()
------ Toolchange Macro for EMCO PCMill 100 ------
--                                              --
-- Simon Rafferty May 2020                      --
--                                              --
-- This will allow you to control the spindle   --
-- with a simple VFD, rather than the hybrid    --
-- servo spindle (which I failed to reverse     --
-- Engineer).                                   --
-- Don't run the turret too fast or Mach4's     --
-- Macro pump will miss the indexing pulses     --
-- That said, it will execute a toolchange      --
-- reasonably quickly                           --
--                                              --
-- Run from a program or MDI using "T?? M06"    --
--------------------------------------------------

local SelectedTool = 0
local CurrentTool = 0
local CurrentTime = 0
local MaxTime = 0
local TurretHome = false
local ToolCounter = 0
local TimeInterval = 0
local rc = 0 --Return Code

-- mc.ISIG_INPUT0  used to read turret index sensor - Change this to the input you've used



SelectedTool,rc = mc.mcToolGetSelected(inst)
CurrentTool,rc = mc.mcToolGetCurrent(inst)


if(SelectedTool ==   CurrentTool) then
rc = mc.mcCntlSetLastError(inst, "Next tool = Current tool")

else   



if((SelectedTool<11) and (SelectedTool>0)) then
------ Tool number valid ------
rc = mc.mcCntlSetLastError(inst, "Changing Tool")

-- Move Z to Home
--rc = mc.mcAxisHome(inst, 2)
rc = mc.mcCntlGcodeExecuteWait(inst, "G00 G90 G53 Z0.0\n")

-- Start the spindle turning slowly to aid the gears meshing nicely
--rc = mc.mcCntlGcodeExecuteWait(inst, "M03 S20\n")
-- Move Z +93 - the position above Z home switch where the gears are fully meshed
rc = mc.mcCntlGcodeExecuteWait(inst, "G01 G90 G53 Z90 F400\n")

--Increase the speed of the spindle a bit, to speed up the process.  Don't go too fast or Mach will miss the index pulse
rc = mc.mcCntlGcodeExecuteWait(inst, "M03 S50\n")

--We need to measure the time interval between each index pulse
--The turret has an extra magnet between tool 10 and 1
--First rotate the turret and determine the longest interval between pulses.
--If the time interval is less than the max, it must be the extra magnet passing - so we are just beyond tool 10


rc = mc.mcCntlSetLastError(inst, "Homing Tool Turret")

while( TurretHome==false )
do
--Measure the time between each pulse of Input 0

CurrentTime = mc.mcCntlGetPoundVar(inst, 3001)
--rc = mc.mcSignalWait(inst,hTurretIndex,mc.WAIT_MODE_HIGH,10.0) --Wait for the index to go high
rc = mc.mcSignalWait(inst,mc.ISIG_INPUT0,mc.WAIT_MODE_HIGH,50.0) --Wait for the index to go high
if(rc==0) then
rc = mc.mcSignalWait(inst,mc.ISIG_INPUT0,mc.WAIT_MODE_LOW,50.0) --Wait for the index to go low
if(rc~=0) then
print("ERRROR2 RC=", mcErrorCheck[rc])
end

TimeInterval = mc.mcCntlGetPoundVar(inst, 3001)-CurrentTime --How long did we wait

--Update the longest interval between index marks
if(TimeInterval>MaxTime) then
MaxTime = TimeInterval
end

--If the interval is less than 75% of the max, this is probably the home index
if(TimeInterval<(MaxTime*0.75)) then
--This indicates the home pulse
TurretHome = true  --This will terminate the loop
rc = mc.mcCntlGcodeExecuteWait(inst, "M05\n") --Stop Turret
end

else
print("ERRROR1 RC=", mcErrorCheck[rc])
end
end

--rc = mc.mcCntlSetLastError(inst, "Turret Homed")
--At this point the turret is homed and the next tool is #1

rc = mc.mcCntlGcodeExecuteWait(inst, "M03 S50\n")  --Slow down turret a bit
ToolCounter = 0  --Set to zero as next index pulse will indicate tool 1

while (SelectedTool~=ToolCounter) --keep the turret turning until we reach the required tool
do
--Just wait while the turret rotates & Count the number of tools passing
if(ToolCounter==(SelectedTool-1)) then
rc = mc.mcCntlGcodeExecuteWait(inst, "M03 S20\n")  --Slow down turret
end


rc = mc.mcSignalWait(inst,mc.ISIG_INPUT0,mc.WAIT_MODE_HIGH,50.0) --Wait for the index to go high



if(rc==0) then
--At this point, the index input has gone HIGH so increment the tool count
ToolCounter = ToolCounter + 1
print(string.format("Found Tool No: %.0f", ToolCounter))
if(ToolCounter==SelectedTool) then
rc = mc.mcCntlGcodeExecuteWait(inst, "M05\n")  --Stop turret
else

--Wait until turret index goeS low before continuing

rc = mc.mcSignalWait(inst,mc.ISIG_INPUT0,mc.WAIT_MODE_LOW,50.0) --Wait for the index to go low
if(rc~=0) then
print("ERRROR4 RC=", mcErrorCheck[rc])
end
end
else
print("ERRROR3 RC=", mcErrorCheck[rc])
end
end

--When we get to here, the required tool has been found and the turret is in position.
--The turret location does not have to be that precise as the drive disconnects before the
--tool is in the socket.  It will self align if not too far off.
--Return Z to the home position
--rc = mc.mcAxisHome(inst, 2)
rc = mc.mcCntlGcodeExecuteWait(inst, "G00 G90 G53 Z0.0\n")

--Lastly change the active tool number in Mach4
rc = mc.mcToolSetCurrent(inst, SelectedTool)
rc = mc.mcCntlSetLastError(inst,string.format("Selected Tool: %.0f", SelectedTool))
rc = mc.mcAxisHome(inst, 2)
else
rc = mc.mcCntlEStop(inst)   
rc = mc.mcCntlSetLastError(inst, "ERROR: Tool number out of range!")
do return end
end
end
end

if (mc.mcInEditor() == 1) then
--If you get a 'not found' error here, change the path below to where load_modules.mcs lives
--If, like me, you don't have a copy, you can download it here:
--https://www.machsupport.com/forum/index.php?action=dlattach;topic=34318.0;attach=45828

dofile (path .. "\\Profiles\\" .. profile .. "\\Macros\\load_modules.mcs")
m6()
end

30
Mach4 General Discussion / Re: Axis as a Spindle using Jog? (or Serial??)
« on: November 23, 2019, 04:59:03 AM »
Dear Mike,
Thanks very much!  You're a star!

The main problem I encounteres was lack of documentation - and what there was, didn't entirely work with Mach4.  I'll give yours a go.

I was using the same library - but the bit I'd missed was to close then flush the buffer and using two instances for Tx & Rx.  Well done for figuring that out.

Without the flush, mine would send intermittently.  I'm guessing that when you create the instance, the buffer pointer has some random value - then depending on the string you send it, the buffer overruns?

This is only my second outing with Lua (first was an ESP8266) though I've coded in C++ & C# for a long time - so it's just getting my head round the different syntax & environment. 

I'm also intending to use Ultra3000 drives on a Denford Cyclone F using Fanuc Red Cap motors.  I've had one spinning with pulse & direction though the motor needs a bit of tuning.  I'd not yet tried talking to the drives using Serial.

I have been trying to figure out how to control the original Fanuc A068-6059 spindle drive - but much of that still remains a mystery!  If that fails, an Ultra3000 30A ought to be sufficient to drive it.  Then talking to the drive to implement the spindle as an Axis would be useful.  My intention is to add live tooling - for which this is rather important!

Thanks again,

Si

Pages: « 1 2 3 4 5 »