MechMate CNC Router Forum

MechMate CNC Router Forum (http://www.mechmate.com/forums/index.php)
-   CNC motion control software (http://www.mechmate.com/forums/forumdisplay.php?f=21)
-   -   Setting up EMC2 (http://www.mechmate.com/forums/showthread.php?t=1167)

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

Pdf
 
1 Attachment(s)
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-Ty...ovJXhfDcX50Otd

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.


All times are GMT -6. The time now is 15:31.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.