Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: XLR84x4 on June 23, 2008, 01:09:20 AM

Title: Tangental control can it be better???
Post by: XLR84x4 on June 23, 2008, 01:09:20 AM
My Smooth Stepper is running my machine like it's on steroids.

The only problem is when I select tangental mode it switched to exact stop and with the feed rate I'm running turns itself into a butter making machine shaking it's feet off.

I would really like to have this tangental exact stop bug sorted out so I can run the machine it's been designed for.

If there are sme programers/moderators that can help out in this area I would ike to hear from you.

Here is a link to a average video I shot with my phone. The first part is with tangential off running 10000mm/min. See how smooth it is. The end part is with tangenial on. Same feed but due to code problems feed rate is reduce to 3000mm/min and it shakes it ass off.

I really want to run the A axis cutter in CV mode and get the A tangentai code that mach is sending out working.

Is it that the tangental A axis code that Mach generates is on a on new line ??

Here is a video
http://www.youtube.com/watch?v=qDdijboi_LEhttp://

Looking forward to getting this sorted

Jason
Title: Re: Tangental control can it be better???
Post by: jimpinder on June 23, 2008, 04:33:07 AM
The difference between CV mode and exact stop mode is that in CV Mode, the computer calculates the new "direction" of the two axies. When you think about it, this is just changes of speed, and direction. As it slows down the last line to bring the machine to a stop, it accelerates the next line - in aother words it "mixes " the two different sets of information "on the fly", so that the table never actually stops.

The trouble is that, in tangential mode, the computer needs absolute values of X and Y so that it can calculate the "tangent" to control (I presume) the A axis.

To combine tangential calculations with CV calculations would be difficult. There is a warning in the manual that for Arcs on G2 and G3 work, tangential comtrol has not been finalised, and G2 and G3 are another form of CV mode where the speeds of the two axis are constantly changing.

I have no doubt this could be done ( and will be done ) but it says that arcs should be made up of small straight lines (implying that it does not work in CV mode), so that the tangential calculations can be made.

We will have to see if the lads on the hill have any coment.
Title: Re: Tangental control can it be better???
Post by: XLR84x4 on June 23, 2008, 05:03:46 AM
Thanks for the swift reply

I hear what you are same regarding the calculation of the A and the effect on CV as such.  I understand that Mach has to do this during the process of reading and outputing X,Y code.
I honestly wouldn't have a clue how Mach does it.  It is probably something like

X0 Y0
x5 Y5....Calculate, calculate etc.
A45
X5 Y10.....Calculate, calculate etc.
A90

Do you think that if it did this it would allow CV to do it's things
X0 Y0
X5 Y5 (Calculate) A45
X5 Y10 (calculate) A90

Do you think that a post processor tangential calculation for the A axis would be a better way to go and then let the CV do it's job?? Or am I totally not understanding CV

I really want to get this sorted out. If some clever person has a solution I would be happy to hear from them.
Jason
Title: Re: Tangental control can it be better???
Post by: jimpinder on June 24, 2008, 12:32:19 PM
I was hoping you wouldn't ask me that, because I have to use my brain, and lay back in my chair, drink my second can of beer and think:

Calculation of tangent is easy, and requires one calculation per line - tan@= x/y or whatever - and you look up in tables, arrive at @ and can set the A axis at the right angle. A little bit more in it, depending on + or - but essentially a one off operation per line.

CV is much more complicated - since, depending on the setting when CV is to start, and depending on the acceleration settings for your axis, then (because this is in the slowing area of one line, and the acceleration of another) :-
1. You have to calculate where the XY poisiton of the old line would be, in line with the deceleration rates set.
2. You have to calculate where the XY of the new line would be in relation to the acceleration rates set and the times of the introduction of the CV.
3. Combine the two into a new XY position.
4. Save the where are we now position and then calculate the speeds necessary to move the axis to the new position.
5. Implement those speeds.
6. Do this again immediately because the situation is always changing.

What you are then asking is do another calculation of new x - old x, new y - old y, =  x(t) and  y(t). Then do the tan@ -= x(t)/y(t) again and then ook up a new tangent angle for the A axis.

I suppose it can be done - but whether it will be inside the parameters of our bog standard P.C. to do it in the near future, or whether you will have to add Smmooth Steppers amd an add on maths cards in the computer, I wouldn't like to say. 
Title: Re: Tangental control can it be better???
Post by: XLR84x4 on June 25, 2008, 07:51:20 AM
Gotcha!

If I have the regular small line segment code generated by cam for the X, Y and Z do you think I could do a excell spread sheet and cut and past from note pad the code into excel which identifies the X and Y, does the calc and set a A axis code on the same line??

Sorry I no programmer, this is all I could come up with.
Title: Re: Tangental control can it be better???
Post by: Danny A on June 25, 2008, 08:14:06 AM
Gotcha!

If I have the regular small line segment code generated by cam for the X, Y and Z do you think I could do a excell spread sheet and cut and past from note pad the code into excel which identifies the X and Y, does the calc and set a A axis code on the same line??

Sorry I no programmer, this is all I could come up with.

This is worth a try...in my experience, alot can be done with simple modifications to the code.  There are always several ways to do something so i would see what sort of results you get by doing hard calculations.

This is some basic stuff that i found helpful going back and forth between notepad and excell:
1) In notepad, the replace command is very good at removing text so you can deal with just the numbers.
    g01 x2 y2 ..... replace the x with nothing....now you can copy right into excell using spaces as delimiters and work with the numbers (this one saved me some time as i had a good 40-50 lines of code to deal with)
2) Try toggling your accelleration vs velocity settings in the motor tuning page...through trial and error, most harmonic vibrations can be eliminated...(it's just a time consuming process)

I know its basic but I hope somethin helps,
Good Luck!

-Danny A
Title: Re: Tangental control can it be better???
Post by: jimpinder on June 25, 2008, 11:16:46 AM
If your code is all little straight lines, then - yes - I think if you then precalculated the tangent of the line and put that in as an A command on the line, then you can do away with tangential control and just use the CV.

Now its not going to be completely accurate, so you might be able to even use two adjacent lines and calculate an A angle to suit the mid point between the two, but, what the hell, we are only talking about the small bit of time when the machine is moving from one line to another, and the cutter (if thats what it is) is going to be on the right line for the new line anyway, so it might take up a slightly wrong angle in the first place, but this is only going to get better.