Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: DMBGO on September 22, 2017, 12:35:51 AM

Title: Servos progressing well, but question about index
Post by: DMBGO on September 22, 2017, 12:35:51 AM
As mentioned in my last post, my problem with the Z axis was resolved and things have proceeded on the stepper to servo conversion of the lathe . I now have servos working well on the Z and X axis. The Spindle servo is also working (you'll notice I didn't say "well" there). According to my laser tachometer it is spinning at whatever rpm I command, and since it is a servo, I thought that M3 would take this on trust :) and display the commanded speed in the "Actual RPM" DRO. As I post this I am realising that M3 probably needs some type of spindle index sensor, since it would otherwise have no way of compensating for speed fluctuations when threading etc.
No point really in proceeding with my question.
Bye
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 12:43:05 AM
Hi,
how is the spindle servo driven? Does Mach3 send an analogue voltage or a step/dir signal?

Craig
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 02:59:24 AM
Hi,
what you want is a closed loop control....Mach3 is not suitable.

Closed loop control occurs when an encoder/index pulse /tacho measues the current speed of a motor, some electronic device or computer compares the current
speed with the programmed speed and increases or decreases the voltage/current/frequency to the motor to  get it closer. While Mach3 can read an encoder
it can only stop and do the comparison and consequent correction about ten times a second, the macro pump rate. The Nyquist sampling theorem tells us that the
best control bandwidth is half that ie 5Hz. A control engineer would say that you'll get no/poor 'discrimination' at 5Hz, in fact it will still be pretty ragged at 1Hz.
Your control bandwidth is 1Hz at best, any variation in speed of your spindle due to load or whatever that occurs faster than once per second cannot be corrected
by Mach3, its just too damn slow.

Mach3 is primarily a Gcode interpretor and trajectory planner and does pretty well, as a closed loop motion control device it sucks.

Mach4 is much faster with the PLC script running every 10ms easily and faster if you wish to program it so. It can achieve a Nyquist rate of 50Hz  and pretty good
discrimination at 5Hz. Useful but hardly great, for a spindle I'd like about 5-10 times better and for an axis servo 100-500 times better. Yes axis servo bandwidths
are at least hundreds of Hz, 500Hz is a common number but 1kHz and more is not unheard of even if expensive.

There are a few Mach ready motion control devices that can close a control loop nicely, Galill, HICON, KFLOP and maybe others. All are reasonably pricey. In truth
most are best considered motion control devices that can optionally close a loop but is not their primary claim to fame.

The best device to close a servo loop is a matching servo drive. If you choose a servo and drive from the same manufacturer you can be pretty sure that 1) it
will work and 2) achieve best or near best performance capable of that servo.

With a suitable drive Mach can feed it with an analogue voltage say and the drive/servo loop will maintain its speed to within a small fraction of 1% depending
on the drive/servo pretty much irrespective of the load AND you don't have to do any fancy programming with Mach. Theres a reason control engineers are weird
antisocial chain smoking alcaholics....it comes from trying to program PID control loops on poor gear for an uncaring public..%$#)(*&&&!!! If you value your
health don't be too inclined to program feedback loops.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 06:20:13 AM
I believe closed-loop control for a spindle may be coming soon for the ESS as well. That will be a firmware upgrade - no cost. You would need suitable hardware on your motor of course.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: ger21 on September 22, 2017, 07:34:10 AM
Quote
As I post this I am realizing that M3 probably needs some type of spindle index sensor,

Yes, you need a sensor, to send an index signal to Mach3, so it knows how fast the spindle is spinning.
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 22, 2017, 08:06:55 AM
Thanks for your in depth replies Craig. The spindle servo that I am using atm is a GSK AC servo, and DA98B servo controller from GSK as well. I know that the loop is closed in the servo controller, but I was hoping that M3 would also take this as a given since no index pulse was configured, and consequently display the commanded speed in the "Actual RPM" DRO. I haven't tried to thread with this config, since I think it will probably fail or the pitch of the thread will be wrong. This is just supposition, mind you.
Tomorrow I will reinstate my hall effect encoder for the spindle that I built about 10 years ago, when I first converted the lathe to CNC using steppers. I am using step and direction to drive the servo btw, or as our Asian brothers across the way seem to call it pulse and sign (I like the idea of a signpost to point out directions). I do have a 0 to 10v converter from Peter H, but I am not aware of any benefit in using it.
I look forward to seeing a closed loop spindle control for the ESS Roger, thanks for mentioning this.
I can't see though any shortcut that I can take atm , it looks like I will bite the bullet, and ensure compatibility etc.
I agree with GER21 unless anyone has another idea?
Oh and I have had a M4 license for some time, but I haven't been able to bring myself to undertake the required learning curve.
Thanks again
Dave
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 09:48:39 AM
Hi,
you don't need it, as you say the loop is closed by the drive. You may have noted that there is an alarm that triggers if the servo deviates by
some small programmable amount, say 20 encoder counts. If you have a 10000 count per rev encoder that means your servo will alarm if it
lags by 3/4 of a degree from where its supposed to be....that's right 3/4 degree from where it supposed to be at say 1000 rpm! This thing is so
damn accurate it was intended as an axis servo not just a mere spindle motor.

The actual and programmed speed should be within a few parts per million.....you are wasting time and money if you try improve on that.
No doubt if I read the manual closely there will be an encoder output. This could be used by Mach to measure the rpm and display it if
you want to be totally anal retentive about it.

There is talk of the ESS having an API but given it has yet to get backlash compensation and THC support and I've been waiting for months I wouldn't
hold my breath....anoxia is a bad way to go! I don't intend this as a complaint about Warp9 either, I use an ESS and luv it, I just don't need a lot of
bull********* stuff.

I don't know whether you have done any control systems programming but PID programs are not for the faint hearted...you have to worry about loop
parameters, integrator wind up, how to generate a low numerical noise speed signal, usually done by a high gain integrator loop, and if you have to ask
you do not want to try it!

If you've already got full speed range control with step/direction signalling then using analogue voltage for speed control is going backwards...you already have
position control, and not just any position control but the full blown modern sense of position control...that is a final position accuracy of (programmable)
four encoder counts say, 8.6 min of arc, just a bit over a tenth of a degree!

The bottom line is you stumped up with I'm guessing $1000 for a servo and drive, ie you paid good and what you've got is good, in fact very good! If your
going to worry about stuff you might try worrying about who's going to win the next Melbourne Cup!

Craig
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 09:56:47 AM
Hi,
crazy thing about Aussies, you have to hit them with a stick to make them realise when something is good! You've paid for and got Mach4 but stick with
Mach3.

I'll send you an email...I've got some bottom land to sell you...bottom of what you ask....don't worry I'm Kiwi...would I put you crook? LOL

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 04:43:06 PM
Hi Joe

Yes, I have a PhD from a Uni Dept which specialised in control systems. I also have an original copy of Jacob Tals' book on digital PID control - I think he was working for Galil.

I want PID control via a full encoder on the spindle so I can do lathe threading properly. Control via just the Index pulse is not good enough!

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 22, 2017, 05:04:06 PM
With 2500 available counts per rev, 1 count does just not cut the mustard (or the thread). It needs to be fed back to the system, so that one can see (on an eye candy display) any deviations that may be occurring within an individual revolution, causing unsightly, and inconvenient deviations.
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 22, 2017, 05:14:42 PM
Craig, you said
"The actual and programmed speed should be within a few parts per million.....you are wasting time and money if you try improve on that.
No doubt if I read the manual closely there will be an encoder output. This could be used by Mach to measure the rpm and display it if
you want to be totally anal retentive about it."

Is this a common output on servo drives? Do they have a single output that has all of the encoder pulses? Is this too fast for Mach, since we are talking about 2.5 mhz at 1000 Rpm? So many questions, so little time......

Cheers
Dave
Title: Re: Servos progressing well, but question about index
Post by: RICH on September 22, 2017, 05:57:36 PM
Mach3 threading is based on a spindle index being used since it is required to read the TRUE rpm and also provide triggering to start the threading path. The true rpm is  to 3 to 5 decimal places if memory serves me,but, you do not see that in the RPM dro. You can also use a different pitch for the thread to refine it if you wish ie; say for a 20 tpi 1/20=0.050 on could use say .0499123456 and it will use that pitch.

There is no value in using an index with more than one slot. An encoder is not supported only a single disc slot type is as an index. If you measure your spindle rpm make sure the you are using a tool that gives you good resolution on the measuerment, else, trust me that Mach is more accurate than a crappy tach.
Things are the way they are!

Frankly if your can set your spindle  manualy and it will maintain the rpm for whatever pitch thread and depth of cut your taking then half the battle is won.In Mach you can't have two devices trying to control the feedrate as they would be fighting each other. Additionaly Mach will adjust the next path based on spindle slow ( range in the say 25% and i even tested it out to about 75% for punny lathes )With experience one can find what their lathe will and will not do and apply knowledge to accomplish a threading task.

Now how accurate is the threading? Well that depends on the "complete lathe system" and the criteria base is defined in the Threading on The Lathe manual I wrote. A quick test would be to do  multiple start threads and see how the tigger and start of the thread matches ( when you get to 3 start you will know what i am talking about and for the average guy how many two or three start threads are you going to do?). Lucky most folks will ever accomplish a class 3A thread. If you want more accurate threading them go to formed inserts and don't do single point threading. BTW, I asume you will using accurate thread cages to test the finished thread, high end comparator or micoscope. What more can one say..............

RICH
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 06:24:42 PM
Hi Dave,
most servo drives have programmable outputs, usually encoder outputs. They can and often are manipulated versions of the encoder fitted to the servo.
I haven't read the manual for your servo but would guess quadrature A and B channels and an Index channel. If some or all of that info is programmed
as an output of the servo drive than Mach can read it. The servo speed will be that close to its programmed speed it doesn't serve any useful purpose except
perhaps peace of mind. The Index however would be very valuable as Mach uses that for speed, which we've seen has little value, but very importantly the
index can synchronise the start of the thread.

As Rich has pointed out that half the battle with threading is to achieve a constant spindle speed in face of a varying load. Your servo and drive should
manage that with aplomb. Now all you need is an indexing pulse. You could add some extra external hardware or you may be able to use the index pulse
built into the servo encoder. Whether the duration of the included index pulse is suitable for Mach is a matter of investigation. The pulse may have to
be manipulated electronically for it to be useful for Mach. Either way is very achievable and you will end up with a very capable spindle that handles threading
with ease...be happy!

Craig
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 22, 2017, 06:41:37 PM
Thanks Craig, Rich et al. I'm going to put my old hall element back as a spindle encoder and connect it to the index input. The rest, while academically interesting, doesn't sound like it makes much difference. Thanks again. I'll let you know how it goes.
Cheers
Dave
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 07:00:11 PM
Quote
if your can set your spindle  manualy and it will maintain the rpm for whatever pitch thread and depth of cut your taking ...
.. . half the battle with threading is to achieve a constant spindle speed in face of a varying load. Your servo and drive should
manage that with aplomb.
Aye, and there's the rub.

So many smaller machines can NOT hold the spindle speed exactly constant under varying loads. They are not being managed by a servo system, just an open loop motor. The spindle will vary in both speed and in phase as the load changes. And during threading, the load does change quite a bit.

To be sure, the index pulse is also essential to trigger the Z axis movement: it sets the phase. Ypu will still need that.

No matter how good the PID control, it can NOT control the spindle to adequate stability within a single revolution. The controller simply does not have the necessary feedback information.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 07:00:48 PM
Hi Dave,
RTFM, you don't need it
Quote
PZOUT+ Encoder Z phase differential positive output
PZOUT- Encoder Z phase differential negative output

The built in index pulse form the encoder is already available as an output, pins 42 and 43 of CN1. You are just making work for yourself, the manufacturer is
way ahead of you.
Secondly note that the A and B channels of the encoder are 2500 pulses per rev, when they are combined as a quadrature signal they give four times that as
encoder count or resolution. 10,000 count encoders like this are pretty much the norm for incremental encoders on current production models.
10,000 count encoder will give you potentially 2.16 arc minute resolution, surely that enuf even for an Aussie.
Last thing is that Mach ASSUMES constant spindle speed when threading. Your spindle could conceivably provide variance information in between each
revolution buy Mach can't do anything with anyway.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 07:04:47 PM
Quote
Mach ASSUMES constant spindle speed when threading. Your spindle could conceivably provide variance information in between each
revolution buy Mach can't do anything with anyway.
Correct. That is why the spindle servo really needs to be moved into the external pulse engine. This is possible.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 07:05:44 PM
Hi Roger,
I disagree, the refresh rate on my Allen Bradley servo also used as a spindle motor is 8kHz. The manufacturer claims a control bandwidth of over 500Hz.
At max speed my spindle is rotating at 58 rev/second, easily slow enuf that the control loop is trying to close the error within a revolution.

Craig
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 07:16:52 PM
Hi Roger,
just as a matter of interest I'm making a servo drive for a large servo I plan to use as a lathe spindle motor. The servo looks new but is in fact
from the mid nineties and has a four pole resolver and the only applicable drives I can find are beyond my budget, hence I'm making one.

Its refresh rate is 20kHz for Nyquist rate of 10kHz and pretty fair discrimination at 1kHz. Has been a lot of fun working out how it all works, its
been many years since I've had to get serious about control....isn't Matlab just the bees knees!

Craig
Title: Re: Servos progressing well, but question about index
Post by: RICH on September 22, 2017, 08:04:13 PM
Quote
is that Mach ASSUMES constant spindle speed when threading

Not quite right........

Later,
RICH
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 08:11:31 PM
Quote
the refresh rate on my Allen Bradley servo also used as a spindle motor is 8kHz. The manufacturer claims a control bandwidth of over 500Hz.
At max speed my spindle is rotating at 58 rev/second,
Allen Bradley is a good brand: I know it well.
But exactly what is the servo controller basing its refresh rate of 8 kHz on, if you are only getting one index pulse every rev and you are doing 300 rpm for threading? That's one index pulse every 200 mS. The maths just does not work.

I suspect your Allen Bradley servo system is using a lot more than just the Index pulse - maybe there is an encoder hidden inside the system? A lot of the older and more expensive servo mfrs built them that way.

Now, translate that to the hobbyist who has a small 500 W DC motor on the spindle and some sort of simple power supply to drive it. Can he make a nice clean M45x0.5 mm thread on that? (Close to a camera filter thread I think.)

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 08:17:46 PM
Hi Rich

Well, Mach starts by letting the spindle spin a few times to get a nice average spindle speed - that is true. So having established that the spindle is running at 300 rpm, it starts the Z axis travelling in sync. Some mm later the tool hits the metal - and the spindle drops to 360 rpm. Mach will not know anything about that until the next index pulse arrives. So it HAS to assume that the the spindle speed has stayed constant, until it gets evidence that it has not.

To be sure, if you have a 3 kW synchronous AC motor driving the spindle through belt reduction, and the thread is M6x1, the motor will not be affected by the load. But if you have a hobbyist machine with a 500 W (DC or AC) motor, as so many do, things are different. And so we get repeated complaints that 'threading is not working'.

Cheers
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 08:26:52 PM
Hi Roger,
yes the Allen Bradley servo has an incremental encoder of 2000ppr for a resolution of 8000 counts. The servo reads the position 8000 times a second and
does the control calculation and correction. If the command is to maintain a constant speed the servo/driver loop can close the loop with a far greater
bandwidth than an index pulse alone. The index pulse is only useful to the servo when it is referencing at start up. That Mach uses a single index
pulse to snychronise thread starts is a useful coincidence. The servo loop is trying to maintain constant speed and it capacity to do so is very good,  its
trying to reduce the error 8000 times a second when the servo is rotating at threading speeds, say 300 rpm or only 5 revs per second.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 22, 2017, 08:50:38 PM
Hi Craig

EXACTLY.
What many of us want is for low-speed PID control using an encoder to be added to the ESS. We don't need encoder feedback at 4000 rpm - that is fast turning speed and 3900 rpm would (usually) do just as well. So if the FPGA in the ESS can only do the PID up to 600 rpm - no worries.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 22, 2017, 09:14:13 PM
Hi Roger,
yes certainly that would be useful for many people. OP in this case has a servo and drive not wildly dissimiiar to mine and it can maintain constant
speed under almost any circumstances and signal an alarm because  of deviation from programmed profile at need.

I suspect that it may be some time before the ESS has the ability, Andy has little time left over for development after support duties.

Even then it will be a very distinct challenge for many to program PID loops with what promises to be a fairly low level instruction set. I for
instance had to spend sometime simulating a high gain integrator loop as a means for generating a low numerical noise speed signal from
my resolver-to-encoder module. That such a technique is useful or required will not be easily understood by a majority of Mach users, it is likely
that decrepit control engineers such as ourselves, or me at least, are going to have to lead the challenge for others to get any useful gains.

I have done a little reading about the closed loop option available for the HICON unit and it sounds like the manufacturer has arranged it so the loop
could be easily closed around their Masxsine servos. While other devices could be closed up the same way the software convenience is gone... its
plain hard work from there.

I don't have access to any Galill products but would luv to see how control loops are constructed using their motion code.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 12:27:31 AM
Hi Craig

Actually, after some prompting from a couple of us, Andy is now looking at the possibility of putting some spindle servo control into the ESS for Mach3 as the next priority. I have emphasised to him what i have been saying here: that the big need is for pid control of the spindle using an encoder for the lower end of the speed range.

We know it CAN be done: a Gecko servo drive can rotate a DC brush motor at 1 rev/minute very easily on a normal axis. The big Q is whether there is enough real estate left in the FPGA for this to be shoe-horned in.

Actually programming it - there must be hordes of tutorials on the web these days with code already there. It's not that hard, especially if you start with someone elses existing implementation.

My thought is that it would be a huge boost to Mach and the ESS to have this. A small hobby lathe turning 45 mm filter threads perfectly, and so on. Sure, you might need to do it 0.05 mm at a pass - so?

Cheers
Roger

Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 12:50:22 AM
Hi Roger,
you are right of course, it would be a boon to many whom are not in a position to buy a capable modern servo and drive. Indeed Machs origin is
just exactly a response to the need for an affordable option for hobbyists, if we forget that we break faith with all those who've devoted so much
time and energy to get Mach to where it is.

Programming a loop is as you say not too bad, its when you start summing and differencing over previous iterations of the loop to achieve I and D
components that the difficulty and confusion arises. Also some of the limits and precautions to get numeric stability, integrator wind up for instance,
are very much necessary to a successful solution but don't have any simple explanation or implementation that may mean many who wish to take advantage
of a closed loop control of a spindle hopelessly overmastered by the programming required. To get useful uptake would require some sort of template
where a user substitutes various parameters and the actual programming be already done by the manufacturer. That would represent a challenging
task for any manufacturer but especially so those in the hobby market whom are chronically under resourced ie just about all the Mach capable suppliers.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 12:55:47 AM
Hi Craig

All of the above.
Big Q: can it be fitted into the FPGA? Dunno.

Yes, the set-up menu would need to allow the user to tweak the coefficients. Fair enough. More sophisticated stuff, like anti-dither bands, might or might not follow.
If offered the chance, I will beta test. Dunno when though.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 01:14:46 AM
Hi Roger,
if you want to roll up your sleeves and get stuck in I too would be a starter, I don't consider myself brilliant at programming but have had a few
wins along the way, including assembler.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 02:28:36 AM
Hi Craig

Oh, I think Andy would have to do the programming of the FPGA in the ESS. Special tools and compliers are needed. All the customer would be 'allowed' to do would be to adjust the PID coefficients - within limits.

Programming - I started around 1970, and yes, in Assembly. Since then I have done most things you can do with a computer, barring massive web site jobs. One has one's pride, after all.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: RICH on September 23, 2017, 08:24:44 AM
Roger,

Quote
Now, translate that to the hobbyist who has a small 500 W DC motor on the spindle and some sort of simple power supply to drive it. Can he make a nice clean M45x0.5 mm thread on that? (Close to a camera filter thread I think.)

YES, and can probably do a 0-80 thread which is even finer, ( on my wimpy punny Sherline for example)
BUT  
1. How accurate is the lathe system?
2. Is setup appropriate for what will be done?
3. Is practical knowledge and epxerience being applied to the task?

So the controller can do it's function but the user in many cases ( plug and play comes to mind)
just lacks 1,2,3 above and you get "repeated complaints that threading is not working". BTW,
people don't read any more ( we live in a visual world), it takes too long, require instant gratification, want for free, etc ,etc.  Most folks are just happy that the nut goes on. Other folks or folks in industry  that specify threads and do analysis in design of things have a different understanding of threading appication.

A walk down memory lane is appropriate:
Threading was "broke / didn't work some 10 years ago" and it got fixed. A lot of effort went into
fixing the single point threading it has not changed since then. So it is what it is and not going to get updated to provide for electronic gearing, encoder use  as the internal code must be changed and
developement procedures will be required. The lathe has taken a back seat and will probably continue
as such.

As the PP continues to go away you have the changes in hardware and external motion controllers addressing the issue. If it's so easy to implement how come it's taken 10 years? Just note that
we need to keep it all in perspective ie; high end controllers etc. compared to low end stuff.
Mach4 is surely going to provide for a higher control end and the burdon falls on the external motion
developers to implement the appropriate functionality. Only time will tell what happens in development
and suggest one dosen't hold their breath.

The above said, if  there are users that can help make a step change that would be great.
The pay is great just don't spend it all in one place!

Enough rambling ........ keep up the effort guys, ;)

RICH
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 02:16:51 PM
Hi RICH,
Quote
people don't read any more
ain't that the truth!

Craig
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 02:40:18 PM
Hi Roger,
RICH raises an excellent point about people wanting instant gratification without any work.

Just think about the number of posts on this forum alone where someone has bought some gear, spent
half an hour assigning pins etc on a 'by guess or by God' basis and then straight onto the forum asking
questions...grumpily. To suggest that they read and then reread the installation manual is ignored 90%
of the time.

Any manufacturer of technical software, Artsoft and Warp9 being the two in focus in this thread, are
really 'sticking their neck in a noose' because so many customers will complain/whinge/demand satisfaction
when it doesn't work straight out of the box and forget reading the manual, the manual is just a source
of paper for wrapping rubbish!

Craig
Title: Re: Servos progressing well, but question about index
Post by: RICH on September 23, 2017, 02:42:13 PM
Hey Graig,
I don't read anymore ..... just write or type what the boss tells me.  :D
I leave the hard part to my better half.  ::)  ;D


RICH
Title: Re: Servos progressing well, but question about index
Post by: RICH on September 23, 2017, 02:59:08 PM
We have all been newbies and have an understanding about what a broad spectrum CNC covers.
Fortunately the members in here need to be applauded for assisting users.

A friend hates to ask me questions, he always starts by saying  I know, I know....RTFM.  :D

I believe he can read but can't write.  :o Me come from Mars....him Jupiter!  ::)

RICH

Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 05:22:03 PM
How true about manuals, sigh. Except that they can't be used for wrapping paper these days: they are just electrons.

Back in the days of a certain mainframe, the reply to RTFM was WFM: Which Fine Manual? The shelf of grey 3-ring binders was over a metre long!

Actually, my thread example was a very poor one. An M45x0.5 thread is not that hard to do, because the tip engagement is never large. Try instead an M30x1.5 thread, where the tip engagement can suddenly go from 0.2 mm length to 1.0 mm length. In case you are wondering, yes, recent experiences! The results were horrible.

No, we cannot expect any changes inside Mach3, and I don't think Mach4 can do any better. The PID control has to go into the external engine. Many older-generation servo drives come with that embedded: you bought the motor AND the controller as a package, and there were two thick cables between them (power and encoder). But those were incompatible between companies and hence very expensive. We are now transitioning to much more modern and lower cost versions where the functions have been separated and there is price competition. The digital Step/Dir + PWM interface has become the 'Standard'.

My vision is that the code in the existing ESS could be upgraded to take encoder signals from the spindle motor and to PID control the motor to the accuracy of the encoder (via PWM). That would be a pure firmware upgrade in the ESS (you load the firmwarte every time Mach starts), plus the allocation of 2 pins on, say, port 2, for the encoder. This means you would have to fit some sort of encoder to the spindle motor, but that is not that hard to do. At the very least, you already have a primiitve encoder there to give the Index pulse. Just add slots!

Technically, this is possible. The Q is whether the FPGA in the ESS has enough spare gates to implement the high-speed code to do it. That is what Andy at Warp9 is working on.

Could the average novice handle this? I think so - because the ESS could come set up with some conservative default values for the PID control. He would need to enter ONE number into the ESS Config: the number of slots in the encoder.  If he can't do that ... he should try gardening.

Cheers
Roger


Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 23, 2017, 06:26:23 PM
I tried gardening Roger, which is why I changed to something easy like CNC instead. Thanks Craig for your input re the encoder pulses from the servo drive, but I am now down the path of making an improved version of my old spindle based encoder, so I'll keep going....
The thread has devolved into an interesting discussion on the possibilities based on a hardware encoder  on the spindle of the lathe, and I am enjoying it immensely. I bought the servos that I am using about 6 years ago and it was seeing a you-tube video showing someone cutting a hex onto a spinning shaft with their lathe, using parametric Gcode that made me extract my digit.
Cheers
Dave
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 07:28:54 PM
Hi David,
yes Roger, RICH and I have rather hijacked your thread but as you say it is interesting and  least loosely related to your post.

Cutting a hex into a spinning shaft is very impressive, would require untold acceleration in X axis.

Under that circumstance the spindle is no longer a spindle according to some definitions but becomes a C axis. Like any axis to be worthy of its name
it has to be capable of co-ordinated motion. Given that you already have step/dir control of your spindle you can claim 'axis' status for it and so you could
as it stands replicate what you have seen.

As I've said before you have made a substantial investment in your spindle drive and the capability it confers is impressive and exceeds a lot of pro gear
and 99.9% of hobby gear. Kick back and enjoy.

Craig
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 23, 2017, 08:26:50 PM
Hijack away. Here is my goal. "https://www.youtube.com/watch?v=DajrTlI8IWA" Imust admit I have no idea how I will acheive it, but you never know.
Cheers
Dave
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 08:45:03 PM
Hi DMBGO

Dead easy if you use a rotary table as your chuck. You could do it 'lathe' style, or you could just mill it. You could even do it on the mill table with the rod pointing up if it is not too long.
Been there, done that, several ways, already.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 23, 2017, 08:53:46 PM
There are always several ways to skin a feline Roger. You are right of course, but I am using this as the impetus for something that I should have done long ago.
Cheers
Dave
Title: Re: Servos progressing well, but question about index
Post by: joeaverage on September 23, 2017, 08:56:36 PM
Hi Dave,
whats stopping you from doing it now? As far as I can tell with an indexable spindle you can do it.

Craig
Title: Re: Servos progressing well, but question about index
Post by: rcaffin on September 23, 2017, 08:57:32 PM
Ah well, [strong]that[/strong] is a whole different kettle of fish! One cannot argue with that.

Cheers
Roger
Title: Re: Servos progressing well, but question about index
Post by: DMBGO on September 23, 2017, 09:09:56 PM
Craig, I have to finish the job at hand before starting to play. If I start enjoying the rewards of my labour prematurely, I will intermittently, in the future, say to myself, I must do such and such at some stage and never get around to it. At some time another impetus will drive me to complete the work, in maybe 5 or 6 years time.
Roger,  :)

Cheers
Dave