Hello Guest it is July 12, 2020, 12:12:26 AM

Author Topic: Long programs crashing  (Read 2651 times)

0 Members and 1 Guest are viewing this topic.

Long programs crashing
« on: September 05, 2016, 02:24:27 AM »
I'm using mach3 to run a winding machine, where the A axis is a mandril which rotates continuously in one direction for hundreds, if not thousands of revolutions.  It seems to more or less work with shorter programs, but longer ones will crash part way through.  The E-stop is triggered, often without an error message.

I suspect the problem might be due to an internal counter for the A axis which maxes out.  I'm only using relative movements in my G code, and have 360 rollover turned on, but it still seems to be storing absolute degrees.

Can anyone help me find a solution to this problem?  Is there a way to reset the internal counter?  I'm using an Apollo 3 motor controller.

Thanks!

Offline Tweakie.CNC

*
  • *
  •  8,357 8,357
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Long programs crashing
« Reply #1 on: September 05, 2016, 02:33:48 AM »
My guess is that it is an electrical noise issue rather than an A axis counter - try increasing the Debounce Interval (Config / General Config.) to 2000 and see if that prevents the E-Stop being triggered.

Tweakie.
KEEP SAFE !
Re: Long programs crashing
« Reply #2 on: September 05, 2016, 08:17:03 AM »
Hi Rachie,
I recently wrote a script to wind coils and am interested in how you went about it.

In my case I wanted to wind 500 turns of 0.2mm wire in 5mmwide layers (25 turns)
and 20 layers. It works but needs more work to get it right.
I used an encoder (an old rotary potentiometer with the detent ball taken out) on the spindle.
The spindle is a 24Vdc brushed motor run at about 15V thru a 16Ohm resistor. In runs in
torque mode where I feed the wire by hand to regulate the speed that the spindle rotates.
Provided I don't let it spin to fast the encoder counts OK. I have Mach3 reading the encoder
and do a calculation to shift backwards and forwards to lay the turns down.
I enabled encoder4 in the config ports&pins. The raw count is OEMDRO(143) and I believe
the units count is OEMDRO(173). While I can read them (getOEMDRO(n)) I couldn't reset
either of them (setOEMDRO(n,0.0)). Don't really understand why.
I have since discovered another DRO that holds the corrected units value (OEMDRO(100)) and
this one I can reset. Additionally resetting DRO(100) 'forces' DRO(143) to reset also.

That's about the extent of what I've learnt about Mach3 encoder DRO's at present. Seems I have
more questions than answers at the moment.

I don't know for sure but I think DRO(143), the raw count, is stored as a long integer, ie 32bit
which means it can count up to billions. With my encoder at 96 count/rev it could count millions
of turns before it overflows.

My guess is if you are doing a similar thing that the error is not overflow but as Tweakie has suggested
noise on your Estop circuit.

Would luv to hear what your doing and how you're doing it.

Craig
My wife left with my best friend...
     and I miss him!

Offline Tweakie.CNC

*
  • *
  •  8,357 8,357
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Long programs crashing
« Reply #3 on: September 05, 2016, 10:55:22 AM »
Hi guys,

If it’s of any interest there is a coil winder screenset here;  http://www.machsupport.com/software/downloads-updates/screensets/
It was never completely finished but it has all the required elements to do the job.

Tweakie.

( Just to make you smile, I adapted that screen for a guitar string winder and there are some details here; http://www.machsupport.com/forum/index.php/topic,28721.0.html )


KEEP SAFE !
Re: Long programs crashing
« Reply #4 on: September 05, 2016, 01:25:22 PM »
It doesn't seem like electrical noise to me.  Once it gets to a certain point in the program, it E-stops.  If I use the reset button and try to continue the program, it will immediately E-stop again.  It refuses to progress past this point, but I can still manually jog without a problem.  I'll try playing with the debouncing when I get a chance though.

joeaverage, my application is probably very different from most.  I'm using only stepper motors instead of a continuous spindle, because I need accuracy rather than speed.  I'm winding fairly complex patterns, not simply a helix.  I don't have encoders, so I'm relying on dead reckoning of the steppers, which seems to work well enough.  I actually wrote my own Python script to generate G code.  I set G91 relative coordinates, so I could simply tell it how far to move for the next step.

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: Long programs crashing
« Reply #5 on: September 05, 2016, 02:56:17 PM »
I never have  an issue with the coil winder doing tens of thousands of revolutions but I am sure I have it set up so that 1 unit is one revolution rather than 1 degree, I also do not have Rot Rollover enabled as there is no need.


Hood
Re: Long programs crashing
« Reply #6 on: September 06, 2016, 01:51:58 AM »
How do you change the unit sizing?  The DRO on my setup currently displays thousandths of a degree, which is far more precise than I need.  One revolution per unit is too coarse for me, but one degree per unit would be just fine.

Does the Rot Rollover affect any internal counters, or is it just a modulo 360 on the DRO user interface side?

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: Long programs crashing
« Reply #7 on: September 06, 2016, 02:50:46 AM »
How do you change the unit sizing?  The DRO on my setup currently displays thousandths of a degree, which is far more precise than I need.

You need to open the screen in one of the editors and then change the format string of the DRO, for example it may be %4.3f and if you change to %4.1f you will only have one position after the decimal.


 
Quote
One revolution per unit is too coarse for me, but one degree per unit would be just fine.
You could command 0.0001 of a revolution  so it would just be as precise. You would have exactly the same steps for a full revolution no matter whether your revolution was 360 units or 1 unit. It may however be easier for you to have your units in degrees depending on what you are doing, for me the   amount of turns are what determines the required values of the coils so it makes sense for me to use 1 revolution as a unit.


Quote
Does the Rot Rollover affect any internal counters, or is it just a modulo 360 on the DRO user interface side?
Not a clue on that, think Art would likely be the only person able to answer that properly.

Hood
Re: Long programs crashing
« Reply #8 on: September 06, 2016, 03:14:02 AM »
Hi Rachie,
I did a bit of searching on the net when I was trying to get this to work and I came across
an article, one of those research paper types from a crew in Germany. Don't have a link
but might be able to find it again.

They were trying to develop machine/methods to wind unusal shapes without a lot of tooling
and so on.

What they did was have the bobbin fixed to the table and the winding head describe an appropriate
path around the periphery under CNC control with the wire exiting a little "L" shaped tube.
Great idea for motor winding and so on. They used a 'you beaut' industrial robot with three arms
varying under computer control. Such machines are capable of high (100's m/sec) and looked good.

I experimented with my 3 axis mill but even screwing everything to the max it would do a turn every
ten seconds or so. It was going to be very slow and as the coils I'm winding are so simple it didn't make
sense. I was impressed by the idea tho... and if I were winding something weird I would certainly go
back and revisit the idea.

Craig
My wife left with my best friend...
     and I miss him!
Re: Long programs crashing
« Reply #9 on: September 06, 2016, 02:40:32 PM »
%f is used in presentational string formatting, and has no effect on the underlying counter.  It's still nice to make a more readable DRO though.

joeaverage, that paper sounds very interesting, and could prove very useful for my application.  Do you think you could find it again?  Thanks!