Hello Guest it is May 20, 2019, 01:05:50 AM

Author Topic: speed control of stepper used as spindle motor  (Read 7316 times)

0 Members and 1 Guest are viewing this topic.

speed control of stepper used as spindle motor
« on: April 22, 2010, 03:47:27 PM »
Hi, I've asked this before in a different (maybe over complicated) way and got no replies, so I'm rephrasing it to get to the point a bit more...

How exactly does Mach3 handle step/dir for a stepper motor used as a spindle?

Under say, an M03 command, does it produce a step signal and direction signal, and have some internal algorithm for changing the frequency of the steps to alter the spindle speed? I assume this would need to be sent through a driver as for any ordinary axis.

Is it just a matter of connecting up a stepper motor as if it were an ordinary axis, but specifying it as 'spindle' in the motor outputs panel? still not sure why I can't make this work

Richard B

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: speed control of stepper used as spindle motor
« Reply #1 on: April 22, 2010, 04:14:44 PM »
It is just like any other axis, you need to work out the steps per unit and set a velocity and an acceleration.
One unit is one revolution so for example with a normal stepper that would be 200 steps per rev multiplied by any microstepping that your drive has. For example Geckos have 10 microsteps to 200 x 10 = 2000 steps per unit.
Now velocity I am not too sure about as I use a SmoothStepper on all my machines, the motor tuning page seems to suggest that it is revs per second for the velocity so say for example you reckon you will get 1000rpm out of your stepper you would set the Vel to 1000/60 = 16.66666667 revs per second. The Accel is Revs/s/s so start low, maybe 5 and see how things go.

If you command a M3S100 the spindle should rotate at 100 rpm, if its too slow then it is likely that the Velocity should actually be Revs per min so set it to 1000 and try the M3S100 again.

If you still have problems attach your xml and I will have a look and see if I can find a problem in your setup.

Hood
Re: speed control of stepper used as spindle motor
« Reply #2 on: April 22, 2010, 05:45:15 PM »
Okay, thanks.

Just to note, the spindle DRO's yellow led flashes, but not a sound from the motor(S5000 on 1 line in the MDI, then M3 on the next). It's on an ncPod; their support don't know anything about spindle control, apparently. Xml attached, I think...

Richard

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: speed control of stepper used as spindle motor
« Reply #3 on: April 22, 2010, 05:52:24 PM »
Ah OK afraid I know nothing about the ncPod, it may well be that it does not support Step/Dir spindle.
Looked at your xml and all seems fine in it so it looks like its  a ncPod issue :(
Hood
Re: speed control of stepper used as spindle motor
« Reply #4 on: April 22, 2010, 06:08:02 PM »
That's what I suspected. An alternative approach to solving this problem might be this:

What I want to do is to operate a linear stepper to deposit paint in straight lines (ie movement on the x axis only; no depositing of paint during movements involving any other axes), so I could 'link' the number of steps made by the x axis to those taken by the axis driving the pump, and play around with the ratio between the 2 rates to get a rate of deposit as required.

Would I need to write some code to achieve this? Or is there some way of slaving the a axis (pump) to the x axis, but specifying different steps per, or speeds, to achieve the desired ratio(s)?

This is for anyone to chip in on...Thanks Hood

Richard B

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: speed control of stepper used as spindle motor
« Reply #5 on: April 23, 2010, 12:07:33 PM »
Fascinating, as Spock would say,

If I understand the issue correctly you have a stepper motor driven pump that pumps paint in sync with movement of the X axis, and you have a controller in the mix that won't allow step dir spindle.

You might investigate the potential to set up the pump stepper as your 'A" axis.  In this way you can have independent control of the paint application, for example to start the X movement before the paint to avoid a puddle  . .  I'm speculating only here.

Mach will coordinate the movements of both axis so you could for example program:

G1 X25A7200

This would move the X axis 25 units and simultaneously rotate the pump 20 revolutions (or however much you have it set up to do). Actually this may be more intuitive than mentally converting linear motion into pump volumes, but in any case, be aware that Mach seems to have some 'interesting' ideas about how to mix rotary and linear speeds.  I'm still working on that one myself.
Re: speed control of stepper used as spindle motor
« Reply #6 on: April 23, 2010, 01:29:53 PM »
You are correct, Simpson36, that is what I'm trying to achieve, and yes, the controller doesn't seem to want to know. The developers of the ncPod don't know if it handles step/dir for spindles, but assume it does. they don't know Mach3 well, apparently. I'm surprised they haven't tested this feature, but there.

I take heed of what you say about speed problems in combining/ interpolating rotary and linear axes together, in fact I'd considered using the z axis to drive the pump for that reason. Only trouble is, that might make generating the g code difficult,as I already have a physical z axis, so I'm hoping there's a way to configure the a axis as another linear axis.

Do you know if this is the case?

The problem remains in either case of 'fixing' the ratio between x axis movement and pump axis movement during 'painting' (Assuming the axes can work well enough simultaneously.) This is where I may need to write an app to edit my gcode that works like

 'read x axis value
 divide by the number needed to get correct ratio
 add this new value into the code and precede it with the designated axis letter'

This might be easier than trying to generate the pump axis code in, say, Cam Bam or whatever g code generator end up I using. This simple approach won't allow for non simultaneous starting of both axes, of course, but it's a start. Once I get the principles involved in getting to this stage, I should be able to have a go at more sophisticated stuff

I have no idea how to do this yet; it feels like it should be simple, but I bet it won't be!

Any suggestions?

Thanks,

Richard B

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: speed control of stepper used as spindle motor
« Reply #7 on: April 23, 2010, 03:09:04 PM »
I will tell you a workaround I have used to make mach run the axis at the speed I want, if that might help you.

The problem: Mach seems to have a very different idea about what 'speed' is to a rotary and linear axis. For example, using a G1 with the A axis and the X axis moving at the same time is like molasses in winter. It is the A axis that it is running at a snails pace. Maxing the speed in motor tuning has little effect. If I use a G0, if flies.

There may be something that I am unaware of that need to be set correctly, but I have not looked into that as it has not been a priority . . . . so far. It may have to do with using the stock radius to calculate the linear equivalent surface speed, or something similar, but so far I have not found it in Mach, at least not in a form that makes and sense to me. I've asked the question a couple times long ago but so far, no clear direction  :(

Anyway, what I do if I MUST have simultaneous movement and I cannot live with my normal G0 speed, then I have to set the X axis max speed down in the motor tuning to what I would want a G1 to be and then use G0. The tuning limits the speed, but G0 runs the A axis at full speed. limited then by the X axis and all is well.

That's pretty convoluted to follow, but I think I explained it correctly so just read it a few times and hopefully it will make sense.

Offline Hood

*
  •  25,811 25,811
  • Carnoustie, Scotland
    • View Profile
Re: speed control of stepper used as spindle motor
« Reply #8 on: April 23, 2010, 04:34:49 PM »
Simpson, I have never used a rotational  4th axis on any of my machines but have you set a rotational radius on the settings page, actually think it should be dia if I remember other peoples posts on the subject.
Maybe this has nothing to do with your problems but I thought I would just mention it in case.
Hood
Re: speed control of stepper used as spindle motor
« Reply #9 on: April 23, 2010, 04:47:18 PM »
Thanks, Simpson, this sounds like a good way around the problem, especially as I don't use the max speed as it stands. I'll get back to you in a couple of days and say how it went.

Richard B