Machsupport Forum

Mach Discussion => Mach Screens => CVI MachStdMill (MSM) => Topic started by: handsmfg on August 04, 2010, 06:21:40 PM

Title: Homing and Limit Switch Probblems.
Post by: handsmfg on August 04, 2010, 06:21:40 PM
I just installed Beta 3. I was able to probe and home now I can't do either. I have all other axis disabled and am only using Z until I can get this figured out. Every thing worked pretty good in Beta 2. One thing that I found curious is Z will move in plus direction when the ref button is pressed but it gets stuck on the limit and won't back off. I had to disable the Z++ in the config pins box. The Z axis shows 0.0000 in the DRO. When the Z++ is enabled the axis stays stuck on the switch. The signal screen show that Z home and Z++ both light when the limit switch is activated. Another curious thing is when i shut everything off for lunch and went back and turned everything back on I had no power to my BOB. I did some investigating and my PP cable was grounding out the 5 vdc input voltage to the BOB. I disconnected the earth ground wire and everything started working again except limits and probing. It's been really hot and dry here in Missouri and very humid. Can heat and humidity play havoc with grounding? A long time ago when i started my mill conversion i read somewhere that there should be another earth ground besides house ground and both grounds had to be connected together to bring them to the same ground potential so there would be no resistance between them. All AC grounds went to machine base and all shielded grounds went to the other earth ground. Worked pretty well until today. I think i might have done some damage to some of the IC chips on my BOB. Z axis and Z limit still function though. I'm going to uninstall Mach and MSM and delete everything associated with it and uninstall the PP driver and do a fresh install of Mach .010 and MSM Beta 2 and see if that helps. If everything works like it should I'll go to Beta 3. Sorry for the long ramble but what I've seen of MSM I really like. The screens are fresh and clean and make sense how they are laid out. Probing is really cool. I haven't ever really use it before. It will be great for part setup. Again sorry for rambling on. Thanks in advance.

Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 04, 2010, 08:29:57 PM
From what you said, the problem is 99.99% likely to be a hardware issue that you are experiencing.
The is not much that screen set software can do to compensate for cables that ground +5 power supplies. You should check your system carefully - shorting of power supplys has been know to damage the associated electronics (like the break out board).
Dave
Title: Re: Homing and Limit Switch Probblems.
Post by: handsmfg on August 05, 2010, 03:44:24 PM
 Dave just to rule out hardware issues or software issues I uninstalled everything associated with Mach 3 and MSM and uninstalled the PP driver. I installed an older lockdown version of Mach 3 Version 3.042.029. The Z homed and then came off the limit and Zeroed out the Z DRO. I uninstalled .029 and installed 043.010 and started with MSM Beta 2. Z homed and stayed on the limit and forced an Estop. Unistalled MSM Beta and installed MSM Beta 3. Homed Z and stayed on the Z limit. I ran Mach3mill in Ver. 3.043.010 Z homed and came off the limit. I don't know what is different in MSM and I wouldn't know where to look but it seems it is MSM related. Again Mach3mill will home and come off the limit. MSM won't. I still like MSM and will continue to test it. Thanks

 Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 05, 2010, 04:30:00 PM
Hum,

It gets stuck on the first switch (Z) in the sequence - correct?

To make sure I am following you correctly: You are starting the sequence by clicking the "ref all home" button - both when using  1024 and in MSM?

Could you please tell me a bit about how your home switches are wired up?

Are there separate switches for each axis each to a separate mach input?

Or are the all the home switches in serial and going to a single mach input?


Dave
Title: Re: Homing and Limit Switch Probblems.
Post by: handsmfg on August 06, 2010, 05:46:42 AM
Z axis is wired to its own pin. I start homing by pressing the ref z button. Even when i push Ref All button the same thing occurs. Each axis is wired to its oun pin. Each limit take Z for example is wired to use the one limit switch for Z++ and home. X uses one limit for X-- and home the other switch for X++ wired to it own pin. Y is wired the same way. All axis use a seprate pin for limits the two switches that are on X use the same pin. Same for Y. Even when I disable the Z++ limit and still have Z home enabled. Z will home and zero DRO but Z won't come off the limit like it does on 1024 set. Hope this helps. it got me confused.

Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 06, 2010, 11:10:20 AM
Hi,
MSM and 1024 quite literally do the exact same calls to mach for referencing operations.
...and mach does the motion control for reference operations (not MSM or 1024).

So the difference is some where else - I got to thinking about where it could be and then it occurred to me:
You have two different profiles (XML files) - one that you use to run 1024 and on that you use to run MSM - correct?

The amount that Mach backs off a home switch is stored in the profile.
I'm guessing that in the profile for 1024, the back off amount is set to what you like. While in the profile for MSM, the back off amounts are set to 0.

Let's check for that. Please fire up Mach with MSM and go to config - Homing/limits and look at the values in the "Home Off." column - are they zero?

If they are zero, set them to the back off amounts you want to usem close the dialog box to save the values. Then close Mach (mach only writes changes to the Profile file when it exits). Restart Mach, is will now load the updated profile with the new back off values. Now try the referencing operation again.
Does it now do the same actions as when running the profile for 1024?

Please let me know if this is the cause of the "not backing off".

Dave
Title: Re: Homing and Limit Switch Probblems.
Post by: handsmfg on August 06, 2010, 03:33:41 PM
Hi Dave. I tried what you suggested. Z still stays stuck on the limit I used .1 and -.1 and still stays stuck no back off. All the home off did was offset the Z axis DRO .1 or -.1.

Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 06, 2010, 04:16:39 PM
OK, that means that I misremembered the purpose of that setting. "home Off." = "axis Offset amount after homing" rather than "amount to back off the switches".
My understanding of what mach does is home until the switch closes, then reverse until mach sees the switch open again.
That sequence is started by a ref axis call to mach. We know mach is seeing the call and starting motion toward the switch; we know it sees the switch close (the motion stops) - what you don't see is enough movement away from the switch so that the switch is open after movement stops.
I suppose it could be contact bounce of the switch making a very short pulse that makes mach think it is off the switch. so Mach would stop before perceptible motion would be evident - and it could then stop with with the switch staying in the static "on state"....

That would beg the question of why is 1024 acting different from MSM....
Here's another idea:
Do you have a a debounce interval set in the profile for 1204 that is not set in the profile for MSM?

(I'm quickly running out of ideas ....  :(  )

Dave


 

Title: Re: Homing and Limit Switch Probblems.
Post by: Calum on August 06, 2010, 04:56:23 PM
Hi Eric,

Have a look at Config > Ports & Pins >Mill Operations, there is a Home true when on home switch setting that might be causing this to happen.

Calum
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 06, 2010, 09:23:52 PM
Hi,
If Calum's idea is not the solution, keep reading.

Let’s determine if the problem really follows the screen set in use or the profile (XML) file in use.
The following is very similar to the "Divide and conquer" debug technique we used in another thread - so if you've been reading the other posts this will sound familiar.

You currently have two profiles, one for 1024 and one for MSM.
Let's give them some names just to make it easier to talk about them in this post.

Profile1024 is your "original" profile and the one where homing works with 1024.
I’d guess it's the profile that you have used before MSM can along to run the machine. We know it has the correct ports & Pin information and that homing works correctly for the combination of this profile and the 1024 screen set.

ProfileMSM is "Newer"" - I think you created it by using mach loader to make a copy of Profile1024 and then added the MSM option settings to the copy. For some reason the combination of this profile and MSM does not home correctly for you.

Here are some steps which hopefully, will let us determine if the problem lies with a screen set or a profile (XML file).

If at any point in the process, something goes badly awry, please stop; and let me know what happened.
Read thru the steps before starting to see if they make sense to you - I wrote them off the top of my head and I could have said something wrong n the course of writing them...

*** Note: In all of the "copy profile" steps below, DO NOT check "default Profile Values" in the Create profile dialog box. ***

First we try the 1024 profile with MSM to see what that tells us:
1)   Use mach loader to make a copy of Profile1024 – we‘ll call it Profile1024Base-w-MSM.
2)   Start mach using Profile1024Base-w-MSM.
3)   Use menus to view – load screen set and load up C:\Mach3\MachStdMill.set
4)   Close mach to get this change written into the profile
5)   Restart mach, again using Profile1024Base-w-MSM; mach should start and load up MSM.
6)   Click either the REfZ or Ref All Home button -

If the homing/reference issue is now gone, we now are pretty confident that whatever the problem is, it is in the ProfileMSM XML file.
(If the Homing problem still exists, I guess I want you to tell me that too….  :(     )

To double check this, let’s also do the opposite test:
7)   Use mach loader to make a copy of ProfileMSM – we ‘ll call it ProfileMSMBase-w-1024.
8]    Start mach using Profile1024Base-w-1024.
(the above line is 8] because 8-right-paren is 8)  ) -  :'(
9)   Use menus to view – load screen set and load up C:\Mach3\1024.set
10)   Close mach to get this change written into the profile
11)   Restart mach, again using ProfileMSMBase-w-1024 mach should start and load up 1024.
12)   Click either RefZ or Ref All Home button and let me know what it does.

If the homing/reference issue now happens with 1024, we have doubly confirmed that whatever the problem is, it is hiding inside the ProfileMSM XML file.

13)   Close mach
14)   Delete ProfileMSMBase-w-1024 – we know it is bad and so there is no reason to keep it around to cause trouble later.

If the above tracks with results so far, you have a working MSM profile (rather than spending lots of time looking for the mach setting that is different between the profiles).

(Don't fret about the fact that the new prpfile does not have the exact options ettings from teh MSM readme. I'm going to revise the readme to make it much simpler for the next release. Truth be told, MSM will operate with any combo of mach options settings.)

Time to clean up:
20)   Delete ProfileMSM – it’s known bad.
21)   Rename Profile1024Base-w-MSM to ProfileMSM

We’re done:
     Profile1024 is your profile for running 1024.
     ProfileMSM is your profile for running MSM.

Dave

Title: More Homing and Limit Switch Problems.
Post by: lvanduyn on August 06, 2010, 10:14:04 PM
  I also have something strange going on with the limit switches.  I have a home switch at one end  and a limit at the other end of each axis.  Each switch is wired normally open and the two are in parallel.  X axis is connected to input 11, Y to 12, Z to 13, and A to 15.   The parallel port monitor page shows pin 11 to be low and the other 3 to be high as they should be.  In fact all are high and go low with switch activation  as is verified by looking at the LEDs on the breakout board.  Toggling the home or limit on the X axis makes the bit go high on the PP monitor screen.  Exactly backwards.  The other 3 display as they should.  All inputs are marked as neg active on the setup page and the homing/ref all works as it should.  
  So the question remains - why is input 11 shown backwards from the rest???
  Larry
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 06, 2010, 11:21:44 PM
This is a bug. Thanks for spotting it.

The reason X acted backwards is that it was on pin 11. Pins 1, 11, 14 & 17 have hardware inversion on the lines.
The logic that drives the led display for the PP page was forgetting to invert the LED state to compensate for the hardware inversion in the PP. Thus the Leds for pins 1, 11, 14 and 17 were displaying "reversed".

You other switch signals were ok as they were on pins 12,13,14 which do not have PP hardware inversion.

I've fixed this for the next MSM release.

Dave

  I also have something strange going on with the limit switches.  I have a home switch at one end  and a limit at the other end of each axis.  Each switch is wired normally open and the two are in parallel.  X axis is connected to input 11, Y to 12, Z to 13, and A to 15.   The parallel port monitor page shows pin 11 to be low and the other 3 to be high as they should be.  In fact all are high and go low with switch activation  as is verified by looking at the LEDs on the breakout board.  Toggling the home or limit on the X axis makes the bit go high on the PP monitor screen.  Exactly backwards.  The other 3 display as they should.  All inputs are marked as neg active on the setup page and the homing/ref all works as it should. 
  So the question remains - why is input 11 shown backwards from the rest???
  Larry
Title: Re: Homing and Limit Switch Probblems.
Post by: handsmfg on August 07, 2010, 08:04:26 AM
Hey guys thanks for all the help. Daves post  about the debounce setting in general config being set at 0 was the correct fix. i set it to 2000 and closed MSM down and then reopened and now i can home in MSM just like in 1024. Ok this raises my last and final question on this issue. What is an exceptable debounce level and how high is too high? Right now I have it set at 4000. I've had signal noise issues in the past and had it so high that none of my inputs worked at all. which I assumed Mach was looking for an input signal but since the debounce was set so high it was taking too long for the signal to keep up with the CPU clock. I think I read on the Mach3 form that 4000 to 8000 was good. Thanks.

Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 07, 2010, 11:12:03 AM
Good to know that we have identified what the problem was.

Here is some info re debouce:
4000 is a pretty high debounce setting.

Mach's debounce is really a software fix for a hardware problem.
The ideal solution is to remove the noise form the system and use a debounce of 0.
Many people either can't or don't want to expend the effort required to accomplish that.
The pragmatic approach is to lower the debug number until the problem reappears, then raise it back up a little.
That leaves the issue of "How do I tell if my required debounce setting is too high"?

"Debouce" is the amount of time a signal must be continually "on" before mach will consider it as just having turned on.
Each number in the DRO represents about 40usec of time (25kHz Mach: 1/25KHz = 40uSec)
A debounce of  40uSec* 4000 = 160mSec. That is a long time for a computer, it's even pretty noticeable to a human.

At 4000, the probe signal has to be on for a minimum of 160ms before mach will see it and stop the probe motion.

How fast are you probing?  Let's just pick a number for illustration:
Say you are probing at 50ipm; during the debounce interval the probe will have moved (50ipm * 160msec ) / 60 sec/min = 0.133 inches....
so the probe will travel 0.133 in past where the edge is before mach will think the probe is triggered - and then it has to decelerate and stop.....
One might want to consider - how much tip travel does the probe have? 0.133 inches over travel could be hard on the probe -  depends on the probe design.

Same scenario with 200 debounce: 50ipm * (200*40usec) / 60 sec/min = 0.0067 inch over travel

Personally, I prefer to see a debounce of no more than a few hundred. but the real answer is whatever combination works that makes the machine run reliably.

Play with the numbers and decide what you are comfortable with.

Dave
Title: Re: Homing and Limit Switch Probblems.
Post by: handsmfg on August 07, 2010, 11:29:32 AM
Since I can home now, I decided to jump into my probing issue that I mentioned in my first post. I have never probed before so I thought I would try and get it to work. Before I had all incoming power cords grounded to the mill frame. I was getting feed back voltage to my BOB and it was sending the 5vdc for my BOB to ground every time the probe light came on. I disconnected the grounds that ran to the frame and they are not attached to anything. My star ground for limits and metal controller box go to another earth ground separate from house ground. I set everything up and got my probe to light up Mach3 probe light using the MSM profile. I was getting false probe touches indicating signal noise i guess when i wasn't probing so I installed a 1uf capacitor across pin input and 5vdc out on board which I have going to mill frame. I use a 1uf cap. on all my encoder read heads for signal noise suppression. The probe light stopped twitching and finally was stable. I tried probing again and it worked. Today has been a day of surceases so thank you Dave and all others for inspiration. It took a long time to get to this point and lots of mistakes and lots of fried hardware. It was fun and rewarding but also very expensive. This thread can now be put to bed problem fixed. So again thanks to all.

Eric
Title: Re: Homing and Limit Switch Probblems.
Post by: DaveCVI on August 07, 2010, 11:36:32 AM
Eric,
It's good to know you have it working now - have fun!

Dave
Title: Re: Homing and Limit Switch Probblems.
Post by: Aetherins on August 16, 2016, 03:55:37 AM
Eric,
It's good to know you have it working now - have fun!

Dave


Yeah Dave. I agree with you.