Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Davek0974 on September 04, 2016, 07:36:19 AM

Title: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 07:36:19 AM
Ok, so have my CNC conversion at the stage where i wanted to make a part, several tool changes, two setups, both sides of part worked :)

First side went ok, changed the setup, set my offsets again.

First pass went ok, tool-change was requested and made (manual), path was cut correctly.

next tool change comes up - goes ok, machine faults out on run due to my tool being shorter and not realising it - the controller throws a limit error.

Ok, move bed up, re-cam the part so no first run, this time the tool change is ignored - machine just sits there idle waiting for me to push start as if the tool change had been made.

It did not move to tool change position so i took the tool out and pressed start, it carried on as if.

pressed stop, rewind, try again - same behaviour, no M6 macro

closed mach, restarted, re-homed, re-run - same, no M6 macro

I manually changed the tool to 1 from 6, re-run and it carried on merrily trying to run with the wrong tool loaded (it thought, spindle was empty)

I am getting really disheartened with the odd crap thats been going on here, i cant trust it all, its a crap-shoot if it will work or you will spend all day like today restarting and rehoming the damn thing.

Can anyone shed light on what can stop the macros running?

I had issues yesterday with the tool-setter macro not behaving, but i have not messed with that today and the macro pump is back to where it was before.

Arrrgh!
Title: Re: Just about to throw in throw in the towel now :(
Post by: stirling on September 04, 2016, 07:49:32 AM
You're doing what's known in the business as "thrashing".

You're moving from one thing to the other without REALLY understanding what you're doing and getting more and more frustrated. The final resort of all "thrashers" is to blame the system.

I'm really surprised and a little pissed to be honest that I'm spending time trying to narrow down what's amiss in your other thread and instead of working with me your off pissing about with a system that you KNOW has problems.

Take a break - have a coffee or a smoke or whatever and then concentrate on ONE thing at a time. Move logically from one step to the next and you'll get there. Carry on thrashing and you'll continue your journey up your own rear end.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 07:58:34 AM
Apologies if thats how it seems but the other issue is only related to the tool height setter, I am not using that now, I have a working set of heights so i pushed that subject to a back-burner in order to get some chip-time on the machine at last.

All the macros were either returned to previous states or not called so they should have no effect on this problem.

I could not see the point of carrying on with the setter at this time as i need to make stuff as well - the setter is a luxury after all.

I have not touched the M6 macro or any other macro today, it was a fresh start up so i presumed all would play nicely but it seems not.

If preferred i will go back and finish the setter if that helps but if something really IS messing up macro's then whats the point - the setter uses macros.

AFIK it should all be working but its not, hence the hair pulling.

Apologies again and thanks for the help so far, i have had coffee but still no idea which way to turn. The part is safe as i have noted the offsets so no loss there, it will stay bolted down until i am satisfied it is safe to try again.

BTW, although i asked about modifying the M6Start in another thread, I can assure ALL that it was just a question - i have done nothing about that thought yet.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 08:02:31 AM
I have used my code with the buttons and DROs for over 6 years without a hitch, might be worth trying it,  unchanged, it has been proven to work?
Then if it doesn't for you then investigate why not.
As said my coding skills are crap but it works for me and never fails, it also works for my pal in Glasgow who used it on his Boss retro and now uses it one his Avon retro.

Regarding you keeping the Index low, maybe that is fine, maybe it is not. I don't do that so I can not say whether it is good or not.
 Now one thing I can tell you is when I had the Index hooked up to the scales index the DRO would not start until the first index was seen and at that time it would start counting from zero. The glass scale had several Index marks along its length and each time the Index pulse was seen the DRO would be zeroed.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 08:06:57 AM
One more thing, height offsets are improtant, if you have a tool call and then have an axis move before you have called the height offset then you may run into problems. Whether that is the case with your code I have no idea.

Also if you use the Stop Spindle and wait for Start option in Mach then I think the M6End.m1s macro comes into play, so may be worth looking at it as well. I have it blank.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 08:11:09 AM
Thanks Hood, seems i have dropped myself in a can of worms.

I am going back to finish off the setter as Stirling mentioned above.

Yes, the index must be seen before things start working.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 08:19:27 AM
Yes but can you be sure that holding it low does not cause issues?
I can't say one way or the other but maybe it would be best to try it the way that is known to work. Once everything is working as intended  then that is the time to adapt things and try out new approaches, if that is what you want.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 08:24:41 AM
Yes, i have it on a push button at present, holding it low was just a test but does seem ok.

Its on a momentary button now
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 08:30:06 AM
Wojtek or Andrew, can't recall which, advised me that actually using a line driver for the Index pulse would be a be the correct way but as I had it done with the pulse and it worked I have never changed it. It could be that having the line driver pulse it then the Index will reset every time the button is pressed rather than just once after reset, not sure......

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 08:36:25 AM
That would make sense as it will then get the differential signal not just a half signal.

I can do that.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 08:54:57 AM
Ok, ENC module now getting differential index pulse but still works the same way - pressing index does not reset it, merely enables it.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 08:58:24 AM
but if you press whilst the slide is moving?
Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:05:24 AM
does nothing
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:11:32 AM
Ok well maybe they have changed things since the initial tests I did 3 or 4 years ago. Granted there wasn't even a DRO number for it in these days, just a modbus register if I recall, but as I moved the glass scale it would zero and start counting every 25mm or so because the glass scale had an index every 25mm or so.
 As I said previously (in a different thread) they were going to look at giving an option to zero, presumably from a modbus output, but I had already done my workaround I never followed up on it so not even sure if they have it done or not.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:13:31 AM
Yes it seems the index/reset works only once each time the CSMIO is booted up.

Have to make sure setter is at zero before boot
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:19:09 AM
My setter is very free and thus is always at the lowest position unless a tool is in.
But just  have to make sure it is at its lowest (home) position before you press the "Index" button rather than boot Mach? Or were you talking about when you had it set to operate the Index automatically which I presume was tied to Mach starting?

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:27:05 AM
So far have not had auto reset - its just been a button on a wire :)

needs pressing when mach is loaded or when machine is booted but does nothing at any other time.

I have passed the question to CS-LABS see what they say.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:27:24 AM
One other thing, why did you have your screen button call a macro rather than just have the script in the button?
Unlikely it would make a difference but was just curious.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:29:05 AM
Ok well I do not need to do it  immediately, I can press that button at any point after I take Mach out of reset, often the machine has been switched on for 4 or 5 hours before I pulse the Index.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:34:43 AM
I have it call a macro because on the 2010 screen set all the buttons are macro calls, makes it easy to mess without upsetting the screen itself.

I have just had a reply from Ger21 and he has made me a custom screen with a userdro 1200 where the A axis used to be - no chance of that upsetting anything now :)

It all seems to have settled down again but too late to run code now, however all macros seem to be functional.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:35:21 AM
Ok well I do not need to do it  immediately, I can press that button at any point after I take Mach out of reset, often the machine has been switched on for 4 or 5 hours before I pulse the Index.

Hood

Yes this is the same, just needs doing once to get things going, don't matter when
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:39:24 AM
Well hopefully the A axis  DRO was the issue, I do not like using axis DROs for things they were not intended to do as you have several factors playing out at the same time. Firstly an axis DRO contains not only the machine coords but also the offset coords, so there is a possibility of issues there. Secondly you usually need an axis enabled to use its DRO, but add to that there is an external controller with a plugin in the loop then all sorts of things could happen.

Fingers crossed it is now resolved by using the user DRO.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:46:53 AM
Well, there was a slight hitch, fun to discover but no damage - it seems DRO1200 is really the ToolChange X-axis park position so as i was testing the macro motion I called a go-to-tool-change position macro and off it shoots to the same value as i had the tool setter set at :)

This is only relevant to the 2010 screen set though, i have passed it back to Ger for a fix :)
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 09:49:30 AM
Does it not have DRO100 on that screenset? If not then ask him to use it, it is an encoder input DRO so should not be affected by anything else. If you do press the button which zeroes it (the Enc 4 Zero button , not your Index one) then it shouldn't matter as the macropump will flip it right back to where it should be.
Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 04, 2016, 09:57:18 AM
I did ask to use DRO100 but he said it was the encoder one so would not go for it.

Dro's above 1200 were then suggested as user ones but it seems some have been used by the system, maybe Ger forgot ;)

I have asked for a re-edit to another number.

I did try it on 100 as you suggested and it did seem to work but with no display.

I could not see DRO 100 on the 1024 set either?
Might have not looked hard enough though.
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 04, 2016, 10:02:27 AM
Ok maybe it  is not on the screen, just presumed it would be as it is predominatly a 4 axis screenset.

Anyway I would personally go for the encoder DRO but any unused User DRO should also work. CS Labs tend to use 1500 and up I think so again you will have to watch out.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 05, 2016, 06:25:21 AM
I think Stirling has identified the issue and I will test it tonight, it appears either my ill-advised use of DRO803 is the issue and/or the fact that i am calling the macros from a macro and not running the code directly in a button.

The pudding will be proved tonight ;)
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 05, 2016, 07:02:12 AM
Wojtek or Andrew, can't recall which, advised me that actually using a line driver for the Index pulse would be a be the correct way but as I had it done with the pulse and it worked I have never changed it. It could be that having the line driver pulse it then the Index will reset every time the button is pressed rather than just once after reset, not sure......

Hood

As i now have the differential feed for the index/reset but it made no change, reading up on the signal to feed the line-driver with got me to this point..

I am currently pulsing the index input low with a button but the encoder provides a voltage output - see diagram in pic below.

The encoder instructions list the output as "Provides a voltage output" for this model.

Should i really be supplying a +5v pulse instead?
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 05, 2016, 09:17:42 AM
Hood (mainly), I just got a reply from Cs-Labs re the reset or index situation....

"
The counter value of the CSMIO-ENC module are reset with reset in Mach3 and that is the only way to zero the counters.
 
To solve that you can use your own UserDRO to which you will copy the counter state.
Whenever you want you can reset your UserDRO state.
The UserDRO reset isn't about entering 0 value to it.
It's about adding or subtracting the value to get the 0 in your UserDro.
"

So that answers it then - to reset the counter you have to reset Mach3, the index just enables the counter initially.

So, with some thought, a 'Zero" button should be do-able but i'll save that for another day i think, it works well as long as the reader is down at ref position when you get going, my one is a bit stiff (ooh-err) as the linear motion is pretty poor but was free :), your linear guide version won't suffer this issue.

Interesting.
 
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 05, 2016, 09:49:51 AM
Thinking about a reset button over my coffee ;)

Should be simple - just needs a vb button on screen that sets a #var to whatever value is in the encoder counter when pressed, lets call it #null-me-out

In the macropump code the sum would now be...

set user dro to (encoder-count - #null-me-out) / steps-mm

any reason that should not create a button that can zero out the DRO at any given reading?
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 05, 2016, 02:53:20 PM
Ok searched back through my emails from CS-Lab and found the ones referring to the setting up of the Enc module for my height setter. I was correct in that initially the access was via modbus and then they changed it later on  to user DRO 1501 to 1503 I think.
Also what I was seeing  regarding the index was the counter would start with the index but as I moved the scale to the next index then it would start counting negative, likely that has all changed now as that was over 3 years ago.

Regarding the reset button, I do recall they mentioned something like that to me but as I had the Index working by that time I didn't look into it.

The only reason I wouldn't have such a button is I don't need one as the Index  pulse does it fine for me.

Also found via my email searching that on the Chiron I am not using a relay but rather I am using a voltage divider to take the output down from 24v to 4.7v for the Enc modules Index input, so I am feeding it with a positive voltage.
I seem to  remember though that when we set the Index input up  on Forbes's Avon via a relay that it wasn't working and we had to take it to 0v for some reason.

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 05, 2016, 03:13:38 PM
Thanks Hood,

Yes its UserDRO 1501 to 1503 now.

I have fitted a reset button on screen now and yes it does work as i thought earlier, so all i need to do now is fit a pulse of some sort to trigger the counter each time Mach comes out of reset, that shouldn't be too demanding i think, just a matter of figuring the best way. I am using the 5v supply to the encoder for the pulse to the input of the line driver, still not sure if it should be 0v or 5v though, but it works on 0v.

Back to the main issue...

The new screen-set with user DRO and code moved to a VB button seems to have fixed all the troubles, been messing with it for a good couple of hours and cat get it to lock-up or otherwise stall or mess about. Tool height-setter can be called any time, works every time, macros still work before and after using it, all motion calls still work.

Thanks all
Title: Re: Just about to throw in throw in the towel now :(
Post by: Hood on September 05, 2016, 06:18:16 PM
Do you have the line driver output connected to I+ and I- ?


Good to hear the issues have gone :)

Hood
Title: Re: Just about to throw in throw in the towel now :(
Post by: Davek0974 on September 06, 2016, 02:12:31 AM
Yes, full differential on all inputs now.

It does seem to be working smoothly again now.