Hello Guest it is March 28, 2024, 11:36:57 AM

Author Topic: Trouble with lathe spindle speed in Mach3Turn  (Read 6690 times)

0 Members and 1 Guest are viewing this topic.

Trouble with lathe spindle speed in Mach3Turn
« on: March 19, 2011, 01:00:03 PM »
I need some help configuring Mach to correctly operate the spindle on a lathe. I have two issues to solve, which I suspect may be related:

1) the speed the spindle turns at doesnt match the speed specified in the command; if I enter for example M3 S10 on the MDI line I get a spindle speed of around 30 rpm. I have tried adjusting the 'steps per' figure in the motor tuning config screen but so far, have not been able to get the two to match. In fact, changing the steps per doesnt always behave logically - one would think that doubling steps per would halve (or double) the spindle speed but this does not seem to be the case.

2) the 'actual speed' reported by Mach is incorrect; in the case above (M3 S10 / ~30 rpm) I get the spindle speed reported as 87 rpm actual - which it patently isnt, just from looking at it. Also, if I enter say M3 S100 then I'm getting around 1500 rpm on the spindle, but the reported actual is 125rpm. My speed sensor is an opto-switch and slotted disk, and this is working just fine - if I put a multimeter across the input terminals that it connects to on the breakout board, I can see the needle 'tick' every time the slot goes past. This sensor is attached to input 1 on my (Uniport) breakout board, and that input maps to (port 1) pin 10, so I have configured Mach's 'index' to look at this port/pin.

It's driving me slightly nuts trying to figure out what is going on, so any pointers or help will be greatfully received!

Regards, and thanks in advance,

Rick
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #1 on: March 19, 2011, 02:01:19 PM »
have a nose in general config and set the index debounce to 1

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #2 on: March 19, 2011, 03:00:16 PM »
One factor that can make reported speed and commanded speed and steps per unit all screwed up is what you have the spindle pulleys set to as a max speed and also if you have a ratio there.
Hood
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #3 on: March 19, 2011, 05:36:17 PM »
Thanks for the suggestions - I tried both but no luck.

Index debounce made no difference at all.

Changing the steps per value allows me to plot a curve of 'steps per' vs measured rpm that looks sensible, and changing the pulley max speed moves this curve up and down as you'd expect, but it's still wrong - S10 gets me 48rpm, for example, at 4000 steps per and 2500 rpm pulley max.

If I set the pulley ratio to 1 (the speed encoder is on the spindle itself) the index speed is correct most of the time (it would, in the case above, say 48) but at lower actual speeds it goes haywire and gives nonsense values - at a (stopwatch measured) 17 rpm the index insisted that the speed was varying between 400 and 450 rpm. It's as if Mach loses track of where it is, somehow. A meter across the opto-encoder pulses happily once per revolution, so I know that the device is working ok.

So, I still have the same problems as before.

I did try to auto-calibrate the spindle but had to abort the procedure - Mach started drawing a 'calibration curve' that was in fact a near vertical line, and having a massive 12" power chuck spinning at several thousand rpm two feet away is a bit hair-raising, to say the least.

Rick

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #4 on: March 19, 2011, 05:49:20 PM »
What type of spindle motor? What hardware are you using to connect it to Mach?
Hood
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #5 on: March 20, 2011, 05:42:05 AM »
Motor is a 250v 3ph one controlled through a Combivert 52 inverter. Breakout board is a Uniport v2 and spindle control board a 'Spindle v2', both from diycnc.co.uk.

The spindle board sits on the a-axis and converts the step/dir signals to 0-10v to control the inverter. Mach is configured to use a step/dir spindle and the port/pin for the motor are set to those that the breakout board uses for the a-axis. I can turn the spindle on and off, control rotation direction, and increase/decrease the speed. So, I know that I can communicate with the spindle and that the commands being issued do predictable things. Also, I've used these boards for other projects, where they work fine, so I dont think that it's board related.

I am first going to see if I can figure out why Mach isnt picking up the index pulse correctly (because hopefully, if I can fix this, I can then auto-calibrate the spindle and get rid of the speed problem). My encoder is a slotted disk with an opto-switch. Putting a meter across the switch output gives a kick once per revolution so this is working. The switch output goes to input 1 on the breakout board and Mach has its 'spindle index' configured to look at the port/pin for this input. Clearly, Mach gets a signal as it displays an actual rpm - it's just that the number it displays is wrong, and has little relation to the true rotational speed.

So, I am planning to increase Vcc on the opto-switch from 5v to 12v to 'boost' the output signal to a higher voltage, and see if this helps - it's possible that pulses are getting 'lost' at the moment. However, whilst this would explain underspeed readings (saying say '40' when the real speed is 50) it does not explain why I am getting overspeed readings like the one I described in my previous append - 17rpm (true) being reported as 400-450 rpm. That would need additional pulses.

It's not RFI either - the cable is shielded with the shield connected to ground.

Rick

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #6 on: March 20, 2011, 07:37:14 AM »
Presume when you are saying about the A Axis it is just what your breakout board labels these connections at rather than you are actually trying to set things up as an A Axis.
 Index could be fine coming out of the opto but what is it actually like by the time it gets through the breakout? A scope would be the best way to make sure its fine but obviously not everyone has a scope.
 Just looked and I see a V3 spindle board but not a V2, is that what you have?
 What do you have your steps per unit set to for the spindle? And have you confirmed that you are getting 10v when commanding a full speed?
Hood
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #7 on: March 20, 2011, 01:37:37 PM »
Yep, the connections are labelled as the a-axis, but it's set up as a spindle (and not as a mill-style rotary axis).

The Spindle2 board is a slightly older version of the one you looked at - no real difference except for one less set of output connectors. I do have a Spindle3 card that I will try if I cant get it to work - it will eliminate the possibility of a dud card, if nothing else.

I may have fixed the counter issue. At least, I think so - I wont be entirely confident until I've had a chance to test it out some more.
Setting the index bounce to zero (as per the discussion in this thread: http://www.machsupport.com/forum/index.php?topic=6069.0) and increasing the device voltage to 12v (giving a signal voltage of ~5v on the output line) seem to have done the trick.

According to the now-hopefully-correct spindle index, my spindle maxes out at 1876 rpm, which makes sense - 2000 pulses/sec from the inverter at the full 10v, a 2-pole motor, divided by the pulley ratio which is just over 2.1

So, I set the pulley speeds to min 30 and max 2000, then ran a spindle auto-config and it completed successfully although giving me a curve that was a bit odd - it hit max rpm by around 50% of the control value, after which increasing the S value had no effect on the spindle speed. So I saved this curve, and now.... I still get the wrong rpm values - S50 commanded gets me 68 rpm actual, and the difference increases with speed - S1000 is actually running at 1579 rpm.

I am now trying to figure this out, so any suggestions welcomed as always.

Rick
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #8 on: March 20, 2011, 02:19:26 PM »
with 2000 in steps per, try 80 in velocity and 125 in acc.
Re: Trouble with lathe spindle speed in Mach3Turn
« Reply #9 on: March 20, 2011, 06:28:36 PM »
I tried velocity 80 and acceleration 125, and it's the closest that I've gotten yet - the calibration curve is near linear at the bottom but then swings up and away from the straight line, so that actual rpm is lower than the commanded one at higher revs - S1000 gets me 893 rpm actual, for example.

I have tried auto-calibrating the spindle but this does not get rid of the error.

I also put the Spindle3 card I have in place of the Spindle2 and get pretty well exactly the same results - a couple of rpm difference in actuals.

I'm beginning to wonder if there might be a problem of some kind with these controller cards.

Rick