PDA

View Full Version : Setting up EMC2


servant74
Sun 16 November 2008, 18:35
The "official" install instructions are at:
http://www.linuxcnc.org/content/view/21/4/lang,en/ (http://www.linuxcnc.org/content/view/21/4/lang,en/)

What follows below are our layman's interpretation - copied from another thread:

If you use EMC2, DO NOT UPGRADE Linux past 8.04. I also suggest getting their downloadable live CD, and booting it. It works well, then will install. Unlike much software, EMC / linuxcnc project has decided to ONLY support the Long Term Support versions of Ubuntu. Version 6.06 and 8.04 are the current versions.

If you do a 'fresh install' of 8.04, and do not have emc2, their instructions on running the 'emc2-install.sh' script works. It basically updates apt, and adds the emc2 repository to your sources file, then issues 'apt-get install emc2'.

EMC2 is NOT in the standard distribution sources from Ubuntu, so it needs to be added to be able to get updates.

EMC2 configuration can be a little more challenging than Mach3. I would suggest staying with Mach if that is where you are now. If you are into learning or doing a DIY (or have really strange things you want to do ;) then EMC2 can be your toy.

bradm
Mon 17 November 2008, 06:35
If anyone wants help with EMC2, just give me a shout. I'm running it on my MechMate, on my benchtop mill, and I've been working with Linux systems since 1992 or so.

servant74
Tue 18 November 2008, 08:07
Want to try or run EMC2?

For anyone that is interested, EMC2 is available on a 'LiveCD' so you can 'try before you buy' (or install in this case ;) )

www.linuxcnc.org is the site

In the left hand column, there is a 'Live-CD' link. It will download a file that is a .iso file. Use Nero or similar to write a bootable disk image to a CD.

Boot the CD and it is running. If you decide to install it on your computer (It will wipe out windows if that is already there), there is an icon on the desk top to do it for you. An internet connection is useful to put on updates.

If you want, email me privately and I will mail you a tested bootable CD for $1US (in the US) to cover postage (I am out of work now, so even little things help! - I will mail to others but again I need to cover costs). PayPal is preferred. -- this is just a service.

If you have a machine you want to install it on your machine in full to start with, you can download and install Ubuntu 8.04LTS (8.10 is the current and not supported by EMC2. EMC2 is currently only supported on the LTS or Long Term Support versions of Ubuntu). Then download the emc2-install.sh shell script and run it. It will download and install EMC2 on top of your 'fresh' Ubuntu 8.04LTS install. An internet connection is required for this install method.

I hope that helps someone.

sprayhead
Sat 22 November 2008, 21:31
These boys at www.guiacnc.com.br are very much experts on EMC2:

Fabio Guilli
Sir Jorge
Yuri

I believe it will be a great solution for the MM.

A bit of mimics:D and screen captures should help with the language barrier. They do speak English.

They'll be able to say: E-N-G-L-I-S-H and also T-H-E B-O-O-K I-S O-N T-H-E T-A-B-L-E.:D

Just kidding, they might be of great help actually.

I'm excited to hear about the results
Francis

YRD
Fri 28 November 2008, 18:26
Gerald I will try to show how to configure EMC2 (more details here (http://www.guiacnc.com.br/forum/index.php/topic,1763.0.html) - Portuguese forum, needs registration before reading)

Please correct my English, please.

Francis (Brazilian who lives in Australia) is right: my English is very poor :o. But he is wrong: I do not know almost nothing of Linux :D.

If I can set up EMC2, you can too :cool: :eek:.

First, use Linux 8.04 and record EMC2 on DVD - .ISO

On a computer with WinXP use the LiveCD and test of Latency in Terminal (portuguese Portugal - Consolas).

2789

The ideal is to be around 15.000. My PC is 1.000.000 (this occurs with some Intel, does not occur with AMD) and the PC (theoretically) does not serve. Not tested yet because my MM is not ready ;).

2790

Before installing the Linux and definitively whether your PC is appropriate. Linux is more selective that the WinXP. If everything is OK, he repartition your hard drive. Use for Linux 8 GB.

In picture 1 is the Setup screen.

2791

Here's the bottom line and enter the test result of latency (this is very important).

In picture 2 is where many errors occur. Leave for now the options on the right side disabled.

2792

In pictures 4, 5 and 6 are the screens of settings of the axes X, Y and Z.

2793
2794
2795

See that the pattern is different from standard MM:
X is Y
Y is X

2796
2797

Important: Use symbols for testing positive and negative the size of the table.

Image 11 is the screen where you "invoke" the previous settings, to use the program EMC2.

2798

Picture 12 is the program EMC2. Congratulations if you come up here. To start, press the red X.

2799

Picture 13: press the orange and enable the motors/driver.

2800


Picture 14: press the blue button and start the machining. Congratulations. The quality of the cut is better (curves) and faster

2801

Gerald D
Fri 28 November 2008, 20:00
Thank you very much Yuri!

Have made a thread for it, and moved your pictures in between the words.

This is going to be very helpful!

sprayhead
Fri 28 November 2008, 23:47
Awesome stuff Yuri. Thanks!

first questions now..


- To run EMC2 do you always put the Linux CD in the CD/DVD drive? or after you run the CD once it installs Linux on your HD and somehow you can choose between Linux and Windows when the computer Boots?

I really want to have a better look at the EMC2 program but I cannot get rid of windows. In the future I imagine that a dedicated PC to EMC2 is the best way to go.

PT(Voce roda o EMC2 sempre apartir do CD ou o Linux instala no HD junto com o Windows? Tem alguma tela de boot que voce escolhe se quer carregar Windows ou Linux? eu nao posso tirar windows do meu laptop, talvez no futuro um novo computador so com o Ubuntu e EMC seria o ideal.)


- So, at picture #13 there is a button that turns on the Drives/motors... does that mean that until you turn on the drives via EMC2 the Parallel port will not emit little voltages that can make your machine move unwanted?


PT( Na foto 13 tem um botao que liga os drives/motores... isso quer dizer que voce pode fazer o boot do linux/emc com a maquina ligada, sem perigo de que os motores se movam??)


- Can you tell us better what happens with Intel x AMD processors? I didn't quite understand, do you think Intel or AMD is more reliable??

PT(Intel ou AMD?)

Francis

bradm
Sat 29 November 2008, 07:41
The initial step is to boot the linux CD. There is then an option to install it to your hard drive. During that process, you can choose to set up your system as a dual boot setup, where you chose windows or linux each time you start.

There is some variation from system to system in the options you'll be presented during the process, as in some cases the linux installer has to change the way your disk is partitioned to create space. A normal windows install (or any other OS) allocates all the space on the disk to itself.

There are clear warnings and options to stop before taking actions that change your system, however it's always wise to have a backup of anything important before beginning such a process.

I suspect that given the relatively inexpensive cost of a PC compared to other items on the MechMate, that you'll eventually migrate towards a
dedicated machine. The type of setup that you do for a MechMate operating in a dusty shop environment doesn't necessarily lend itself to other types of computer work.

EMC features something called the "HAL" - Hardware Abstraction Layer, which allows you to map functions to pins on the parallel port. Incidentally, the HAL allows you to do lots of other interesting things in a ladder-logic type of fashion, such as mapping virtual motors and sensors for testing purposes. The two user interface functions of "Power On" and "Emergency stop" can be mapped to pins on the serial port.

For my MechMate, I have the 'power on' mapped to enable the Pin 16 watchdog charge pump for my G540, which means that until that button gets hit on the screen, the motor outputs are all disabled, and the machine cannot move.

I intend to eventually make my EStop circuit interface to an input pin so that pressing the physical EStop buttons on the machine will also cause an EStop in EMC, but at moment, my physical buttons are on a 120V loop that hold my main contactor in the on position. So the virtual EStop will cause EMC to halt all motion, and the physical EStop will power down everything, but the two are not linked. I'll likely add a relay at some point so that the physical EStops run on low voltage (12v since that's what I've got for my proxy sensors), link with the PC, and hold the relay which holds the contactor.

Either AMD or Intel are reliable, but other design factors of the motherboard of a given PC can affect the realtime latency that the machine is capable of. For example, some motherboard designs share RAM (memory) between the build in display card and the CPU (mostly Intel designs), and the slight contention for memory access can make these machines less responsive to real time events, even though the system itself has lots of CPU power. Other types of I/O devices, like soundcards, network ports, and the like can have a similar detrimental effect. This latency will control the maximum pulse rate the PC can reliably produce, and thus the ultimate maximum speed of the MechMate.

With that said, most modern PCs have way more than enough horsepower to drive a MechMate to reasonable cutting speeds. If you are obsessive about hitting very high *JOG* speeds, you make care more about locating a low latency PC.

I use EMC on my mini-mill for metal work, and that's on a 350Mhz ten year old Pentium III based system, which comfortably produces pulses for 60 IPM. On my MechMate I have about a 1Ghz system from about five years ago, and it will run my mechmate to 600+ IPM, which is useful really only for jogging. It's also pretty scary to see that sucker coming at you at a
foot a second in two dimensions with a spinning bit.

Gerald D
Sat 29 November 2008, 08:19
This talk of the "Linux CD" is unclear to me. It that a CD with the Linux Operating System? (I think not - ie. it is not the equivalent of a Win98 CD).

I guess that is the CD one makes from EMC2's site?

It is the Linux CD and Live-CD are one and the same?

Gerald D
Sat 29 November 2008, 08:33
The file that one has to download is 695MB :eek: My PC has downloaded 2.73MB so far and tells me that it has 7 hours to go! :eek::eek:

Gerald D
Sat 29 November 2008, 08:36
Stopped that download and went to the EU mirror instead. Now downloading from Romania at about 60% faster - only 4 hours to go!

bradm
Sat 29 November 2008, 09:48
As Gerald discovered, the EMC / Ubuntu CD can be found at:
http://www.linuxcnc.org/content/view/21/4/lang,en/

Most variants / derivatives of Ubuntu come in a live CD version that can be booted and run, or used to install.

The difference between the Linuxcnc version and the base version of Ubuntu is that it's been modified to have a realtime kernel to support emc, and it's preconfigured to point to the linuxcnc software repositories to download (and update) the EMC software.

You could also take any Ubuntu family release and manually add the linuxcnc repositories, get a new kernel, and install EMC, but using the preconfigured disk is easier for a dedicated PC. If you wanted a general purpose Linux PC, you might use this alternate approach.

servant74
Sat 29 November 2008, 09:52
This talk of the "Linux CD" is unclear to me. It that a CD with the Linux Operating System? (I think not - ie. it is not the equivalent of a Win98 CD).

I guess that is the CD one makes from EMC2's site?

It is the Linux CD and Live-CD are one and the same?

Gerald,

There are two different ways to do the EMC install. One is to get the 'LiveCD' from the EMC2 web site (http://www.linuxcnc.org). If you do this you will already have BOTH Linux and EMC2 available to install at one time.

The second way is to get the UBUNTU 8.04 LTS (Long Term Support) version install disk (http://www.ubuntu.com/getubuntu). Install it on your machine, with updates. But DO NOT UPGRADE to any newer version (8.10 is available currently). Then, go to

http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Installing_EMC2#On_Ubuntu_8_04_using_pr ecompiled_EMC2_packages

and follow the directions on installing EMC2. Basically download

http://linuxcnc.org/hardy/emc2-install.sh

to your desktop or somewhere you can find it.

Then run it from your command prompt in a command or terminal window (not as root).

This script will then install EMC2 for you. Then you still need to configure it using the information from a previous post.

I hope this helps a little! ... Jack

Gerald D
Sat 29 November 2008, 09:54
Okay, so we are talking of one CD that contains the Linux/Ubuntu/EMC2 . . . that's a bit simpler than I first thought.

Before I dedicate a machine solely to a new OS, I would like to experiment with both Windoze and Linux together on a machine. This is the area that has me the most nervous now.

YRD
Sat 29 November 2008, 10:00
I use WinXP and Linux in DualBoot.

As for the latency test:
Abuse of the machine, opening multiple files.
Get Tested for more than 10 minutes.
During the test does not run EMC2 (important)

YRD
Thu 18 December 2008, 15:33
Gerald,

Tested the EMC2?
What is your opinion about the system?
Advantages and disadvantages?

Gerald D
Thu 18 December 2008, 19:22
No, havn't played with EMC2 yet.

orotemo
Sat 26 December 2009, 22:44
Hello everybody, and merry Christmas.

I guess this question goes to Yuri, but if anyone knows....

Running a wide gantry is done here with two motors on the X (mach users use a as the slaved axis) as you all know. Trying to switch to EMC from mach, I ran into trouble finding the right way to achieve this.

I totally understand I can 'wire up' the X signals to the A axis pins, and this can work great on the EMC. one problem though, I must be able to home them separately, or my gantry won't be perfectly square.
Mach gracefully handles that, it moves both motors to the switched, circuit brakes, backtracks both, then only moves A, circuit break, and backtrack A. I would like to exactly mimic this behavior on EMC.

Can anyone help here?

bradm
Sun 27 December 2009, 06:16
Note: I use EMC2, with a single limit switch on one of the two gantry motors. In practice, the only time it gets out of square is if there is a crash, in which case I use the hard stops to realign.

I don't think that the structure of EMC2's code will allow you to exactly mimic the Mach3 algorithm unless you write a fair amount of extra code; it treats "joints" as separate entities at a low level. I do think you can get it to simultaneously and independently home the two motors. You might look at the sample configs for "Stepper-gantry" as a starting point.

YRD
Sun 27 December 2009, 07:09
Orotemo,

What driver are you using?

I use "Smile" :) (http://www.lolata.com.br/Smile/) and there are 04 boards to control each of the motors. In the X1 motor connection is correct but the engine X2 is the inversion of two wires allowing turning around.

As I did not understand correctly your question, I have helped. :o

I still do not use keys to limit, although I believe is important.

My MM is only with the E-Stop set - 03 in the machine and 01 on the board of control.

orotemo
Sun 27 December 2009, 10:48
Brad: Thank you for the tip, that is exactly where I am. I've made the motors move, not yet slaved them, using the stepper gantry as a starting point.

Yuri: Man, that is fine you didn't get my question, because I definitely didn't get the answer :):D. what I try to achieve, is have my two X motors act as one axis for all purposes, and have them home separately so I know the machine is a perfect square.

I use PMDX-122 break out board, Gecko G203V driver, oriental motor 296(I think A1A) SG7.2.

I read somewhere that U is a parallel axis to X, not really sure if that is my solution, hopefully tomorrow I'll find out. if I'll make it - it will definitely be posted.

Thanks for your efforts guys.

Sherman McCoy
Sun 27 December 2009, 13:34
Yuri -
Great thread, I'm glad you started it. I've got Ubuntu/EMC 8.04 installed in my box, and have enough prior experience with Linux to appreciate how challenging using it can be without guidance from an expert- user friendly it is not. I'll soon be using this thread to set up my machine.

I want to use open source software as a complete CAD/CAM solution. I found dxf2gcode as a rudimentary 2D CAD package, and hear Google Sketchup can be converted to gcode. I'm interested in knowing what you are using for design purposes?

orotemo
Tue 29 December 2009, 08:02
Brad, this one is for you:

I use the pmdx 122, how do I make the homing work when all I have is onee pin for all limit switches and home?

11 - start
12 - pause
13 - touchoff plate (auto Z zero)
15 - all limit switches chained

the only workable configuration until now is when you have one loop for homing and another for limit switches, won't take all home + limits no way.

Advice?

:confused:

bradm
Tue 29 December 2009, 11:23
Orotemo, you may have stumped me. You could try the #emc irc channel (on freenode.net).

However, if you have separate home and limits, you could consider placing all the homes together with pin #13 for the Z zero. (The limit switches are chained, the homing switches are in parallel).

orotemo
Thu 31 December 2009, 09:05
Thanks Brad, that was a brilliant idea. geniusity at its best :). really, it didn't occur to me I can do that, but it works great - hardware-wise, the NC connections of my relays function as the home switch, and the NO act as the limit switch chain.

One problem though, after checking the IRC #emc, they say that HOME_IGNORE_LIMITS works only for the axis you currently home, so if you have the limits chained - you simply can't do that.

I'll try and investigate the ladder - maybe my salvage is there.:o

If anyone has tips/ideas - welcome.

HAPPY NEW YEAR EVERYBODY!!! may your mechmate bring you happiness, work and wealth (although my grandfather always told me, that those who work, have not time to make money... :D). At any rate, I wish you all good health.

lonestaral
Mon 02 October 2017, 18:26
I am thinking about installing Linux.
As this is an old thread, is there any up to date advise,
recommendations or warnings ?

I have looked on the website and viewed You Tube.
Just a bit daunted by the task:eek:

bradm
Tue 03 October 2017, 12:59
Not much has changed. However, this is really a low risk operation, if you get the bootable image (http://linuxcnc.org/docs/2.7/html/getting-started/getting-linuxcnc.html) and fire it up. No commitment required, just a one time boot and play.

I've been spending more time looking at alternatives based on embedded computers lately; I've tried the BeagleBoneBlack ( do not recommend ), and I'm currently looking at solutions based on TinyG2 (https://github.com/synthetos/g2/wiki) I'll report back if I find something I like.

lonestaral
Tue 03 October 2017, 17:46
Thanks Brad.
Yes I made a bootable usb with the image
and had a look.
All a bit strange, so different to Mach 3.
Lets see what happens today.
Good luck with your investigations.

lonestaral
Sun 08 October 2017, 00:25
Computer set up as a dual boot.
Linux installed.
Found a pp with a .ngc extension.

I have a few no pressure days next week,
so I will try it out.

Can you run tool height offset and work coordinate setting
scripts with Linux and if so how do I go about setting them up ?

lonestaral
Mon 09 October 2017, 04:41
I got the motors and axis set up and moving.

I could not get it to reference.
Persistent positive and negative soft limit alarm.
Many threads on this so it is a common problem for some reason.
I will try again tomorrow.

If no joy, then I have to decide whether to go back to Mach 3 or use it without
homing switches.

Yes, you can use Linux and Mach 3 without homing but
power cuts are common here, so it is good to be able to reference and not have to find your datum from scratch.

bradm
Tue 10 October 2017, 06:49
Yeah, there's some not super helpful info around, like http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Homing_And_Limit_Switch but first you need to be comfortable with editing the config files.

I'm not near my MM at the moment to pull the files, but for me, the standard MM limit sensors are configured for homing, as is a Z zero plate.

My process after firing up the machine, using keyboard shortcuts is:

"X" - "Home" - "Y" - "Home" which starts the machine zeroing off the switches on both
axis. That's done once to set the machine zero. Then for each workpiece:

Jog to the 0,0 reference point on the work, and bring the tool about an inch above. Place the zeroing plate on top of the piece. "X" - "End" - "0" - "Enter" "Y" - "End" - "0" - "Enter" "Z" - "Home" - "End" "0" "." "2" "5" "Enter" - Since the zero plate is 1/4" thick.

If you're getting a persistent alarm, I would expect that either the machine zero is not set, or the machine limits are too small. Have you homed each axis before you start?

lonestaral
Tue 10 October 2017, 18:06
Thanks Brad.
I had to give up after 2 days.
Went back to Mach to get a couple of jobs done.
Will try again later today.

I cannot get it to reference, persistent 'exceed soft limits' alarm.
It also locked up, would not jog.

I knew it would not be an easy job to get it to work
but I didn't think it would be this hard.

I suppose a Degree in computer programming would help.
Pages of documentation but no idiots guide.

Oh well, on with the war.

lonestaral
Wed 11 October 2017, 01:07
It works:D
References.
Reversed Scale, Home velocity and Switch polarity.
G30.1 set.
A big relief.

Brad, can you please explain what I should type please.

"X" - "End" - "0" - "Enter"

"Y" - "End" - "0" - "Enter"

"Z" - "Home" - "End" "0" "." "2" "5" "Enter"

Is it exactly as you have typed on 3 separate lines?

lonestaral
Wed 11 October 2017, 01:19
Brad, another question.

I have a laser crosshair I use with Mach to set the G54.

If I jog the cross over the 0,0 position can I type in the X and Y offset values in the lines of code you supplied and would that set the work zero position ?

I hope this helps others in the future.

Thanks for your time.

bradm
Wed 11 October 2017, 19:05
Yes, "X" means the X key on the keyboard - same for all the others. And yes, if you have the cross hair over your 0,0 then "X" "End" <offset> "Enter" and "Y" "End" <offset> "Enter" sets up your work zero position.

Glad you are making progress

lonestaral
Thu 12 October 2017, 02:43
Thanks again Brad.
I ran a program today.
No problem until the end.
There was a ' Finished with no percent' error.
The % was there though, no big deal.

Now the big problem came when I tried to run op2.
I touched off in Z, save the offset.
'Exceed limit' error.
I could not do an MDI input as it was not referenced.
Z referenced ok but the x went the wrong direction.

Turned it off and back on, same result.

The only way out was to turn off, change the sign of home speed and turn back on again.

Then I had to do this.
3. So if you're lost, what should you do

Having trouble getting 0,0,0 where you want it for your gcode Start by getting rid of all the sources of offsets
Move to the machine origin. MDI G53 G0 X0Y0Z0 (A0B0C0)

Clear the G92 coordinate offset. MDI G92.1

Use the G54 coordinate system. MDI G54

Set the G54 coordinate system to be identical to the machine coordinate system. MDI G10 L2 P1 X0Y0Z0 (A0B0C0)

Turn off tool offsets. MDI G49

Turn on Relative coordinate display from the menu

now, you should be at machine origin (0,0,0), and the relative coordinate system should be the same as the machine coordinate system. You can now set your origin on the material.

I then could set another tool.

The same thing happened for op3.

A bit sick to say the least.
What am I missing ?:confused:

lonestaral
Thu 12 October 2017, 03:09
Start of program.
%
G21 G40 G49 G64 P0.03 M6 T1
G17
M7
G0Z25.000
G0X0.000Y0.000S8000M3

End.
G0Z5.000
G0Z25.000
G0X0.000Y0.000
M2
%

OK or is there something missing ?

bradm
Thu 12 October 2017, 06:51
Hmm. I haven't seen that. For the "no percent", try making sure there is a blank line at the end of the file, after the percent. If there is no line ending, it may not be seeing the percent there.

The start and end of program look just fine. I assume that you ended up back at the home position after the first job. A couple of things that might trip you up:

When you are setting up the offsets ( with the "END" key ), what you are entering is where the tool is currently with respect to where you want it to be in the coordinate system. So if you have two jobs next to each other, 400mm apart on the X axis, and you setup the one closest to machine origin, run it, return to 0,0 and then use "X" "END" to adjust for the second job, you will enter -400 since the tool is currently at that position in the new coordinate system you are setting up. If you enter 400, and you are within 400 of the machine limits, you would see an error. That's one possibility for confusion.

Also, from that same manual page:

5. Other reasons for nonzero coordinates at start

If you specified [TRAJ]POSITION_FILE, the contents of that file are read at startup and define initial axis positions.
To forget these values once, exit LinuxCNC and remove the file. To never store these values, remove the POSITION_FILE line from your inifile.


I suspect you do have this file configured, which is why power cycling doesn't solve your problem - it's saving and rereading the current settings.

lonestaral
Thu 12 October 2017, 19:41
I deleted the Traj file in the .ini file.
When I started the control it threw up an error and would not start.
I loaded the backup .ini then it started.
There is no 'Position' line in the Traj section to delete.

lonestaral
Thu 12 October 2017, 22:25
I must admit that I am totally lost, confused and sick with the toolsetting.

Same procedure as yesterday.
Op1 ok, looks as if putting in a blank line at the end worked.

Op 2 set the tool. Run, exceed limit error, run anyway.
Program runs then cuts out halfway through, exceed limit error

Clear all using the procedure from that manual page.

Reset g54, reset tool, run, exceed limit error.
Attached picture of the screen.
All looks ok and the machine is in the correct position.
Must be Friday the 13th part 365 again.

bradm
Fri 13 October 2017, 08:30
So, what are your machine limits? Which limit was exceeded? Z? I'm guessing that because of the red box at the lower limit of the Z axis on the display, and because you were apparently happy with how it was running until halfway through, and because you say the machine is in the correct position.

If it was Z, then we need to figure out why you aren't getting the right touchoff settings on your second piece. Is your gcode indexed to the top or bottom of your piece?

Here's how I would approach it. Let's assume a 50mm high workpiece, an overcut into the spoil board of 1mm, and jogging clearance of 10mm above the piece.

If it's indexed to the top of the piece, then the touchoff is at 0mm, top of piece at 0mm, jogs at 10mm, the bottom of the piece is at -50mm, overcut is at -51mm, and the Z limits need to be at least -51mm to +10mm.

If it's indexed to the bottom of the piece, then the touchoff on the spoilboard next to the piece is at 0mm, or the touchoff to the top of the piece is at +50mm. Top of piece at 50mm, Jogs at 60mm, bottom at 0mm, overcut at -1mm, Z limits must be at least -1mm to +60mm.

Of course, if it's not Z yelling at you, ignore all of that.

Sorry if I confused yesterday on the Traj file; I was just trying to explain why it did not reset on reboot.

lonestaral
Fri 13 October 2017, 18:51
Hello Brad.

Limits are X 1200mm, Y 700mm and Z 150mm.
All set as minus in the .ini file.

It was the X axis that alarmed.

I can run the first tool, the problem occurs when the second tool is set and run.

Ok, its 8a.m. I turn on the computer, load the control, power up the control box and press the orange button, motors engage.
Reference all home.
Jog the tool to job datum in X and Y. Press touch off X and Y(G54 now set)
Jog the tool in Z until it touches the job, press touch off Z.
Jog up in Z, load the Op1 program and run.
Program complete.

Change tool. Jog the tool in Z until it touches the job, press touch off Z.
Jog up in Z, load the Op2 program and run.

Alarm message, 'exceed limit in z , run anyway?'
I say yes and carry on.
Program runs for a while then alarms, 'next line will exceed limit'
Program stopped.

Jog up in Z. Press Ref all home.
Z moves up ok.
X moves in the wrong direction. Press e stop, press power on.
Try to do a MDI but alarm, 'Cannot Mdi when not referenced'

Change X jog speed sign in .ini.
Ref all home.

If I then go through the whole procedure again to run op2, ALARM.
'Exceed limit in X'

Are my steps to set the G54 and the tools correct?
If not feel free to call me an idiot and please explain the error of my ways.

bradm
Sat 14 October 2017, 08:43
Okay, that's all really weird. Can you post or PM me your .ini file so I can go through it?

lonestaral
Sat 14 October 2017, 17:55
.hal file.
Thanks for your time.

# Generated by stepconf 1.1 at Tue Oct 10 12:00:00 2017
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd-rpm <= motion.spindle-speed-out
net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cmd-rps <= motion.spindle-speed-out-rps
net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-at-speed => motion.spindle-at-speed
net spindle-on <= motion.spindle-on

net probe-in => motion.probe-input

net xdir => parport.0.pin-01-out
net spindle-on => parport.0.pin-02-out
net zstep => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1
net xenable => parport.0.pin-04-out
net xenable => parport.0.pin-05-out
net zdir => parport.0.pin-06-out
net ydir => parport.0.pin-07-out
net ystep => parport.0.pin-14-out
setp parport.0.pin-14-out-reset 1
net xstep => parport.0.pin-16-out
setp parport.0.pin-16-out-reset 1
net xenable => parport.0.pin-17-out
net home-x <= parport.0.pin-10-in-not
net home-y <= parport.0.pin-11-in-not
net home-z <= parport.0.pin-12-in-not
net estop-ext <= parport.0.pin-13-in-not
net probe-in <= parport.0.pin-15-in

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 50000
setp stepgen.0.dirsetup 50000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
net home-x => axis.0.home-sw-in

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 50000
setp stepgen.1.dirsetup 50000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
net home-y => axis.1.home-sw-in

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 50000
setp stepgen.2.dirsetup 50000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net home-z => axis.2.home-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

lonestaral
Sat 14 October 2017, 17:59
.ini file
# Generated by stepconf 1.1 at Mon Oct 9 12:38:21 2017
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = my-mill
DEBUG = 0

[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm
MAX_FEED_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 10.00
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 100.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/alan/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000

[HAL]
HALFILE = my-mill.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 10.00
MAX_VELOCITY = 100.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl

[AXIS_0]
TYPE = LINEAR
HOME = -0.25
MAX_VELOCITY = 100.0
MAX_ACCELERATION = 250.0
STEPGEN_MAXACCEL = 312.5
SCALE = 22.143
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -1200.
MAX_LIMIT = 0.0
HOME_OFFSET = -0.25
HOME_SEARCH_VEL = -10.
HOME_LATCH_VEL = 1.00000
HOME_SEQUENCE = 1

[AXIS_1]
TYPE = LINEAR
HOME = -0.25
MAX_VELOCITY = 100.0
MAX_ACCELERATION = 250.0
STEPGEN_MAXACCEL = 312.5
SCALE = -22.143
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -700.
MAX_LIMIT = 0.0
HOME_OFFSET = -0.25
HOME_SEARCH_VEL = -10.0
HOME_LATCH_VEL = 1.00000
HOME_SEQUENCE = 2

[AXIS_2]
TYPE = LINEAR
HOME = -0.25
MAX_VELOCITY = 41.666
MAX_ACCELERATION = 150.0
STEPGEN_MAXACCEL = 187.5
SCALE = -22.143
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -120.0
MAX_LIMIT = 0.00
HOME_OFFSET = -0.25
HOME_SEARCH_VEL = -10.0
HOME_LATCH_VEL = 1.0000
HOME_SEQUENCE = 0

bradm
Sun 15 October 2017, 10:55
Hmm. I'm fairly suspicious of those negative axis limits confusing things. I would have expected MIN_LIMIT = 0, MAXLIMIT = (1200, 700, 120), HOME_OFFSET = (1199.75, 699.75, 119.75)

lonestaral
Sun 15 October 2017, 18:20
I will change them and give it a try.
Wonder what that will do to the other settings.
Thanks.

lonestaral
Mon 16 October 2017, 00:18
Sorry Brad but that didn't work.
The axis overshot the switch and hit the hard stop.
Not to worry.

The good news is that I got it to work:D

I had a thought in the small hours.
Was it hanging on to an offset ?
So I put a G49 at the end of the program.

G0Z5.000
G0Z25.000
G49
G0X0.000Y0.000
M2

%
(Blank space after %)

Now it works.
I think the reason it was referencing in the wrong direction was the switch was sticking.
Must change it and see.

Thank you for your time and effort.

I might make a PDF about this and post it on here.
It might help someone in the future.;)

bradm
Tue 17 October 2017, 08:36
Hey, glad you got it sorted!

lonestaral
Wed 18 October 2017, 02:40
Well the final piece of this particular jigsaw
clicked into place today.
I got the touch plate to work.

So now I have the functions I had with Mach.
Its been a struggle though.

The reason why I changed?

Earlier on this year I thought the control board was faulty,
so I replaced it.

A few weeks ago I was having a similar problem, one axis was not moving.
Tried a new motherboard, same result.
The same thing happened on 3 different computers.
Also the driver would not load on 2 computers.

I proved it was not the control board by swapping motor wires.
Same with the parallel cable.
Must be something with the software.
I got round it for a while by using the A axis for the X.

I still have the driver board, maybe it was ok after all.

I had a look for alternative software.

Mach 4 does mot use the parallel port so a separate driver is required.
Also there has been a lot of discussion about how reliable it is.
There was another program but I did not like the look of it.

That left Linux.
New, supported and free.

Thats why.

lonestaral
Sat 21 October 2017, 02:45
Here is the PDF, warts and all.
Hope it helps you.

jhiggins7
Sat 21 October 2017, 05:30
Thanks, Al. You are and have always been an "exceptional friend" of the forum. Thanks again.

servant74
Sat 21 October 2017, 08:30
Thank you for taking this information to the next level.

lonestaral
Mon 23 October 2017, 01:49
Cheers John,
you've made my day.:)

lonestaral
Mon 23 October 2017, 05:59
Thank you as well Jack.
Wise words in your original post.

'EMC2 configuration can be a little more challenging than Mach3. I would suggest staying with Mach if that is where you are now. If you are into learning or doing a DIY (or have really strange things you want to do then EMC2 can be your toy.'

It was challenging and strange but I had to do it.
Its working well at the moment.

racedirector
Tue 24 October 2017, 05:07
Chiming in late on this one but your next step Al is getting Pathpilot to run your machine :)

lonestaral
Tue 24 October 2017, 06:06
Hi Bruce.
Where have you been ?
Whats a Pathpilot?
I just need a younger me:D

racedirector
Thu 26 October 2017, 05:31
Hey Al

Just been working too much and not doing enough with my machine :)

Pathpilot is Tormachs version of Linuxcnc, they use icon their machines. Think of LinuxCNC with a very pretty face. It runs my big red beast at the moment.

sphericos
Sat 28 October 2017, 14:47
I use LinuxCNC and I never installed my limit switches. I have never needed them. I home the table every time I reboot the computer and providing the tables limits are set there is no reason it should crash into an end stop unless you miss steps somewhere.

lonestaral
Sat 04 November 2017, 23:06
On the subject of Pathpilot,
I came across these videos.
Not watched them all yet
but they look pretty comprehensive.

https://www.youtube.com/watch?v=K-TyGT1krUM&list=PLAkBh7HnKkbtfjDSnKUovJXhfDcX50Otd

racedirector
Mon 06 November 2017, 05:13
Well found Al, they will definitely get you started. Still digging up my old configs for PP port, will send you as I find them :)

Well look at that, video 4 shows that file PP for path pilot, thats a copy of my files I used. They were from the linuxcnc forum :)

lonestaral
Mon 06 November 2017, 17:23
Thanks Bruce.
That's saved you some time.
I will do some more when I have some time.

IamDave
Wed 08 November 2017, 22:03
I learn a new resource, every time I read here.