# LinuxCNC Observations and Questions



## devils4ever (Feb 21, 2020)

Perhaps, I should ask this on the another forum, but I know you guys are very helpful and friendly. As I work on my power supply issues, I've been playing with the *LinuxCNC GUI*. Note that my motors are wired, but are sitting on my bench pending the ball screw, nut, bearings, mounts, etc installation.

First, I have a *Emergency Stop* button wired to the *BoB *and configured in *stepconf*. When playing with the manual controls, I notice that the emergency stop function doesn't get recognized immediately. For instance, if I'm doing a continuous X-axis movement and hit the switch, nothing happens until I reverse direction. I would have thought that the stop button would have instant affect and shutdown all movement. It doesn't as far as I can tell. I'm hoping when running a G-code program, it would have an immediate affect, but I don't have any code yet to try.

Second, I plan on using the mill in manual mode a lot for simple things. The *Axis GUI* in the *Manual Control* tab and *DRO *tab allow for setting the *Home *positions. This is great since it will not allow the position to get out of bounds and damage anything. After setting the *Home *positions, I would like to be able to move the *X, Y, *and *Z *positions using another reference and zero that out. For instance, I could set the edge of the part after setting home. Or, I could set the beginning of the cut as another zero. Is there a way to do this?

Third, I'm thinking what to use as my *home* position. I'm thinking the centered position for my *X-axis* so that the range is about -10" to + 10". For *Y-axis*, I'm thinking of using the front of the cross slide vertically aligned with the base so that the range from there would be about -2.5" to 4.5". For *Z-axis*, use the middle position giving a range of -5" to +5". Does this make sense?

Fourth, I'm assuming *Touch Off* is used to reference a position on the part for the *G-code*. For example, I'm thinking I would use *Fusion 360* or *FreeCAD *to reference the back left corner of the part as the G-code origin. Then, I would use and *edge finder* to find the left and back edges of the part and use *Touch Off*. I think that's what the offset GUI that pops up is for? The edge finder has a 0.100" radius, so I would enter that in the GUI? Plus or minus? For the *Z-axis*, I would lower the tool until it just touches the part and then press *Touch Off* without an offset?

Thanks!!!


----------



## RJSakowski (Feb 21, 2020)

On my machines, the E stop button cuts the mains power to the machine.  

My Tormach 770 is running PathPilot which is running on a LinuxCNC engine.  I don't know which of the features are PathPilot specific and which are part of LinuxCNC.
PathPilot also has a soft E stop which is activated by hitting a limit switch or a similar fault which is different.  It will shut down the controller requiring a software reset to continue.  All movement, including spindle rotation, stops immediately and If exceeding a soft limit was the cause of the E stop, it will also require rereferencing that axis to continue.

Setting the home positions for the axes should just reference the machine.  In Pathpilot, the far end limits are also set in software so the controller senses the approaching far limit and adjusts movement accordingly.  This is great because even with a rapid movement, it isn't possible to overshoot and hit a hard stop.  In PathPilot, movement beyond the home positions isn't allowed so my home/limit positions are just short of the hard stops. To set your work zeros, you would use G54, G55, etc.  G53 will return you to the machine's absolute coordinates.

I haven't used the Touch Off feature for setting x and y zeros.  I will use an edge finder to find the edge, then either type in the offset or move by the radius of the edge finder to center the edge finder on the edge and zero the axis.  There are many instances where I set my axes zeros on the center of a circular feature, in which case, I find one side and zero the DRO, then find the opposite side and add"/2" to the DRO reading which divides the reading by two and sets the zero halfway between the two sides.

My process for setting the z axis zero uses a digital dial indicator. I use Tormach's TTS system and my indicator is permanently mounted in one of their TTS holders.  To set my zero, I lower the indicator to the desired surface until it reads zero and set my z axis DRO to zero.   I use a digital height gage to set all my tool offsets.  The height gage is set  to zero with the dial indicator reading zero and all tool offsets are referenced to the setting.  I then enter the offsets into my tool table or  press the button on the height gage to transfer the reading to the tool table.  This process allows me to add new tools at any time, setting their offset separate from the machine.  Useful if you have to replace one of your tools.

I use my machine in a manual mode more than I run programs.  I use Tormach's jog/shuttle for my movement.  I have used the conversational mode less frequently.  This is because I am a lousy typist and my eyesight isn't what it used to be and a typing error can have disastrous results.


----------



## shooter123456 (Feb 21, 2020)

devils4ever said:


> First, I have a *Emergency Stop* button wired to the *BoB *and configured in *stepconf*. When playing with the manual controls, I notice that the emergency stop function doesn't get recognized immediately. For instance, if I'm doing a continuous X-axis movement and hit the switch, nothing happens until I reverse direction. I would have thought that the stop button would have instant affect and shutdown all movement. It doesn't as far as I can tell. I'm hoping when running a G-code program, it would have an immediate affect, but I don't have any code yet to try.


When I E stop, it stops immediately.  Spindle stops, coolant stops, and motion stops.  I don't recall what control computer you are using, but it is possible that it isn't processing an e-stop as an interrupt, but a command that it waits to execute.  It would be worthwhile to run a dummy program and see what it does.  



devils4ever said:


> Second, I plan on using the mill in manual mode a lot for simple things. The *Axis GUI* in the *Manual Control* tab and *DRO *tab allow for setting the *Home *positions. This is great since it will not allow the position to get out of bounds and damage anything. After setting the *Home *positions, I would like to be able to move the *X, Y, *and *Z *positions using another reference and zero that out. For instance, I could set the edge of the part after setting home. Or, I could set the beginning of the cut as another zero. Is there a way to do this?


You will have a few different things you can use here.  Hard limits and soft limits for one.  The hard limits will be your limit switches, which should override any software and tell everything to stop.  The soft limits are where you tell the control computer how far it can go, and it will stop you if you ask it to go farther and give you a message along the lines of "Command over runs limits in Y".  It will also run through a program you open and tell you if something exceeds set limits.  Then you have positioning and offsets within your work envelope.  You will set these using the "Touch Off" button.  That will let you use a wiggler to pick up reference edges and set a relative position for them.  That will not affect your hard and soft limits. 



devils4ever said:


> Third, I'm thinking what to use as my *home* position. I'm thinking the centered position for my *X-axis* so that the range is about -10" to + 10". For *Y-axis*, I'm thinking of using the front of the cross slide vertically aligned with the base so that the range from there would be about -2.5" to 4.5". For *Z-axis*, use the middle position giving a range of -5" to +5". Does this make sense?


I use the X in the center of travel, the Y as close to me as it will go, and Z at the very top of its travel. This makes all of the Z travel negative, but thats fine.  It gets it up and out of the way and makes the most sense to me.  For the Y, having it all the way forward gives me the most access to the table for loading and unloading parts.



devils4ever said:


> Fourth, I'm assuming *Touch Off* is used to reference a position on the part for the *G-code*. For example, I'm thinking I would use *Fusion 360* or *FreeCAD *to reference the back left corner of the part as the G-code origin. Then, I would use and *edge finder* to find the left and back edges of the part and use *Touch Off*. I think that's what the offset GUI that pops up is for? The edge finder has a 0.100" radius, so I would enter that in the GUI? Plus or minus? For the *Z-axis*, I would lower the tool until it just touches the part and then press *Touch Off* without an offset?


That is correct.  Note that you can touch off without running a program.  That will work if you want to use it in semi manual mode and DRO.  You are correct about referencing.  If you are using the back left corner of the part to zero, when you approach left to right on the X, your offset will be -.1" and if you approach rear to front for the Y, your offset will be .1".  For Z, I lower the head down and wiggle a piece of paper until the tool grabs the paper and I can't wiggle it anymore.  Then you will touch off as 0" if the top of the part is your zero.  What I will often do is reference the bottom left rear corner of the part, then touch off the parallels or top of the jaws (when using talon clamps) and touch off on the actual jaw for the Y.  This way, your zero doesn't change for Y and Z and you only need to touch off the X between parts.  I would suggest some kind of tooling system that will save your Z axis offsets.  I think using TTS and a pneumatic drawbar was probably the largest productivity boosting modification I have ever done.  Going for 3 - 5 minutes per tool change to 5 seconds was massive.  When you can't save the Z axis height and need to mess with draw bars and such, a part with 5 tools can have 2 minutes of machining and 20 minutes of tool changes.


----------



## JimDawson (Feb 21, 2020)

The E stop should cut power to the drives and outputs, in other words drop out the control power and kill everything.  This is done with a relay(s).  You should have it wired to pull out the E stop and then have to press a button that enables the control power.  The computer should monitor the E stop, but not control the shutdown, computers are not that reliable.

IMHO unless you have a tool changer, there is no reason to have a home position on a mill.  Just set zero off of the part.  I do use a ''parking'' position on my mill that is set after I set part 0,0,0.  Just moves the axes to a convenient location for measuring, tool changes, or part removal.


----------



## devils4ever (Feb 21, 2020)

I don't have limit switches currently, but I might add them in the future. The way I understand it, you use the *home *function to limit movement so you don't need limit switches. Once homed, *LinuxCNC *will prevent motion past what is set in *stepconf*.

I'm using a *ASRock Mini ITX DDR3 1066 Q1900B-ITX* motherboard since it had a parallel port and is very small. I'm using pin 10 on the *ST-V2 BoB* as *Estop In*. Like i mentioned, it doesn't seem to react instantly which is useless. I think I may rewire things so the *Emergency Stop* switch kills power to everything!

I'm also thinking of changing the functionality from *Estop In *to* Limit Switch*. I'm hoping this will cause instant stopping.

I have a simple *G code* program I'll try and see if it causes instant reaction.

I don't have any plans to control the spindle. I'll manually set it before starting the program.

That makes sense keeping *X *at the center,* Y* at the front and *Z* at the top. Thanks, shooter. For Touch Off using back left corner, *X=-0.1"*,* Y=0.1"*,* Z=0* offsets. Got it!

Since I plan on doing a lot of manual machining, I might want to add a *MPG pendant*. Can anyone recommend one and how hard is it to setup?

I'm not doing production, so I'll have to live with manual tool changes for now. This may change in the future.


----------



## devils4ever (Feb 22, 2020)

ARGH!

Ok, now I have a new issue.

I can't get the *Z-axis* motor to reliably go in the negative direction. It's really strange. In *stepconf*, I can spin the *Z-axis* motor in both directions 100% of the time. But, in the *LinuxCNC GUI*, it doesn't always spin in the negative direction. I've been playing with the timing parameters, but if the motor works in *stepconf*, why wouldn't it work in *LinuxCNC*?

This is getting very frustrating!!!


----------



## devils4ever (Feb 22, 2020)

Never mind. I figured it out. Operator error.


----------



## devils4ever (Feb 24, 2020)

I'm still working on generating sample *g-code* to test the *Estop *function. I'm still learning how to use *FreeCAD*. 

Shooter: Could you share your timing settings in *stepconf*? I think we have the identical setup with the same stepper motors and motor controllers.


----------



## shooter123456 (Feb 24, 2020)

devils4ever said:


> I'm still working on generating sample *g-code* to test the *Estop *function. I'm still learning how to use *FreeCAD*.
> 
> Shooter: Could you share your timing settings in *stepconf*? I think we have the identical setup with the same stepper motors and motor controllers.


I have mine set for 2000 ns step time, 2000 ns step space, 20000 ns direction hold and 20000 ns directions setup.  The base period is set for 20000 ns.  I think those are the default settings and I have not had any issues.


----------



## devils4ever (Feb 24, 2020)

shooter123456 said:


> I have mine set for 2000 ns step time, 2000 ns step space, 20000 ns direction hold and 20000 ns directions setup.  The base period is set for 20000 ns.  I think those are the default settings and I have not had any issues.



Yeah, that works for me as well.

I was able to load some *G-code* and found that the *Estop-In* function is useless. It seems to have no affect. I may have to rethink this and use this switch to power off the motor power supply.


----------



## shooter123456 (Feb 24, 2020)

devils4ever said:


> Yeah, that works for me as well.
> 
> I was able to load some *G-code* and found that the *Estop-In* function is useless. It seems to have no affect. I may have to rethink this and use this switch to power off the motor power supply.


Try E-stopping using the escape button on the keyboard.  That may tell us if it is an issue with the switch, the computer, or something else.


----------



## devils4ever (Feb 24, 2020)

I think this is a software issue.

The keyboard *F1 *button stops everything.

If I start the LinuxCNC app with the *E-Stop* button pressed, it recognizes it and won't do anything until I release it. 

If I put an axis in continuous mode and press the "+" button to move the motor, it runs. Hitting the *E-Stop* button does nothing until I try to reverse the direction, then the software recognizes the button was pressed and stops everything.


----------

