View previous topic :: View next topic |
Author |
Message |
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
NCO useage for stepper motor control/acceleration |
Posted: Fri Jan 30, 2015 6:46 am |
|
|
Hi Folks,
I'm developing a product at the moment where I need to precisely set the speed of a stepper motor up to quite high frequencies.
Using a signal generator, I've managed to get the motor spinning up to frequencies of about 20,000RPM which is perfect for my application as I only need between 2000 and 10,000rpm.
I now need to control it via a processor, and obviously need to accelerate the motor up to the speeds I want.
I thought I'd hit the jackpot using a AD9833 precision clock generator. I've got the device working fine - but for this application it's rubbish, as when you change the frequency it disables the clock for a period. At low speeds you can get away with it, but as you get faster this delay causes the motor to stall during the frequency changes.
I'm now toying with the idea of using the NCO feature as it looks like it may do what I want.
However I've never used one before.
Can anyone please answer the following:
1) Can you set an "accurate" frequency for the output? I need to be accurate to a couple of RPM. Assuming I'm running at 400 steps per rev on the motor, and wanted to dial in 7900 RPM could I do it?
2) Does the NCO disable the clock during an output change?
3) Looking at the introductory data on microchip. There is an "increment input" that looks like it will add/subtract to the existing nco clock output. Is this an instantaneous change, or will it look relatively smooth if the frequency change is small enough?
Thanks in advance
James |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Jan 30, 2015 7:11 am |
|
|
re your questions:
1- what precise NCO frequency range do you need?
(Fmax and Fmin)
BUT about the math implied -
are you saying 1hz = 1 step?
if so then your top frequency for the nco
is (400*7900)/60 =52667 hz Fmax and easily achievable with a 4.194304 mhz crystal at better than 2 hz resolution .
but to get low jitter -you need to use an external oscillator. BTDTGTTS
2- NO it does not - changes are clean and on the next cycle after the accumulator-compare load
3-it is smooth if the Fdelta change is small enough,
BUT you need to delay making the change proportional to the
period of the frequency you are generating.
There will be "period distortion" on the first cycle of the new frequency. |
|
|
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
|
Posted: Fri Jan 30, 2015 7:33 am |
|
|
Thanks for the reply.
I need to run between 2000rpm (which is 2000/60 = 33.3rps * 400steps/rev = 13320Hz) and 10000rpm (which is 10000/60 = 166.67rps * 400steps/rev = 66,666.6 Hz)
Cheers
James |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Fri Jan 30, 2015 8:44 am |
|
|
Quote: |
There will be "period distortion" on the first cycle of the new frequency. |
this is ONLY true of you are generating a square wave. (FDC mode)
HOWEVER if you are generating narrow pulses ( PF pulse frequency )
mode instead - so long as the accumulator-compare register update interval is longer than the output pulse width -
there will be no distortion or glitch at all. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Fri Jan 30, 2015 1:32 pm |
|
|
Seriously, unless you have very non standard steppers, the torque will be almost zero at speeds like this.
Have you actually put a load on the motor at the full speed?.
Have a look at the links from:
<http://techref.massmind.org/techref/io/steppers.htm#Estimating>
Which allow a very good start for the torque relationship of motors.
For most motors the maximum useable revs will be perhaps in the order of 1200RPM. Going over this will waste an enormous amount of power unless the motor is specially designed for high revs.
Post the part number of your motor.
BLDC motors can give you synchronous operation at higher speeds (they are very like steppers but require different waveforms, and are designed for faster operation). |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Sat Jan 31, 2015 6:54 am |
|
|
also...
you'll need some form of feedback to report the actual speed !
Just because the 'math' says it's going at xxxx RPM doesn't meant it is! If the load on the motor's not constant, neither will the speed.
I prefer digital encoders. Simple, cheap, reliable, easy to interface.
Jay |
|
|
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
|
Posted: Mon Feb 02, 2015 8:05 am |
|
|
I'll dig out the part number for the motor shortly.
Technically there is almost zero load on the motor - as it's spinning a small disc attached to the shaft in a fluid.
Cheers for the help |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Mon Feb 02, 2015 2:27 pm |
|
|
At 10000RPM, the drag on a rotating disk in even quite thin fluids may well surprise you. It's actually one of the standard physics demonstrations, and the actual power rises as the cube of the rotational speed if I remember correctly...... |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Feb 03, 2015 3:59 pm |
|
|
no need to believe what you are being told by people with wide and deep experience. why not see for yourself?
a typical stepper has only 15% of the torque when comparing 200 rpm to 2000 rpm. at 10000 rpm ( if he stepper will actually do it -instead of cog) only 2 to 3% torque can be had
when running with your signal generator at various "high speeds" use a
dual trace o-scope to LOOK at the waveforms on the motor driver output pins ( stepper motor coil) while triggering on the S.G. speed pulse waveform.
let your eyes be the judge of what you are seeing in the time domain.
perhaps that will make a believer out of you. |
|
|
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
|
Posted: Wed Feb 04, 2015 3:58 am |
|
|
Thanks for all the help, I've got my customer coming to visit in the next couple of days bringing the motor arrangement and some fluid.
I will run it on the sig gen, and see what happens. If I have insufficient torque, I will head back to the drawing board.
Watch this space
Cheers
James |
|
|
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
|
Posted: Mon Feb 09, 2015 5:32 am |
|
|
Just had a meeting with my client, they have now dropped the max speed to 5000rpm - and the disk it turns out is only going to be 15mm diameter.
Hopefully this should be achievable with the NCO. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Feb 09, 2015 5:30 pm |
|
|
IMHO -you will still be lucky to achieve 5% of the torque you get at 50 rpm-
and the risk of cogging is always present.
I urge you to do a careful ramp up in frequency if you want to ever operate
at the top speed you desire -because once the stepper fails on ONE high speed step - it can easily fall into stuttering-erratic operation aka "cogging"
Don't worry though - if it starts to happen - you will hear it if there is not a lot of ambient noise in the vicinity.
BTDT & have a nice shirt to show for it. ;-))
if i had your design challenge - i would use a DC motor -10 bit PWM buck drive - and a tachometer for closed loop control. I would not use a stepper anywhere near the speeds you are proposing.... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Tue Feb 10, 2015 9:04 am |
|
|
Have to agree wholeheartedly.
Simplest is a normal PWM controlled DC motor, with a encoder fitted (Temtronic pointed out the need for this earlier in the thread), and just regulate the PWM to give the required speed. Have this working in a few minutes on the test bench. Next way similar encoder, but with a BLDC motor instead of the simpler DC motor. Advantage no brushes to fail etc., but more code. This is how things like hard drive motors are done.
I'd not trust a stepper without feedback, and it's the least capable motor to work at these speeds.
Wrong tool for job... |
|
|
JamesW
Joined: 23 Apr 2007 Posts: 91 Location: Rochester, England
|
|
Posted: Wed Feb 11, 2015 12:09 pm |
|
|
I promised I'd post the stepper model on here, it's an enhanced torque low inductance motor.
http://motion.schneider-electric.com/products/nema17.html
Initial tests are looking pretty positive, but the real test will be next week when a motor with disc arrives. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Wed Feb 11, 2015 1:33 pm |
|
|
Note the maximum revs they show ratings for, is only 2100rpm, and how fast the torque is dropping. From 18oz-in at 1100RPM (using 48v supply), to just 10oz-in at 2100 RPM. The drop is close to linear, so as we have said many times, torque at the sort of revs you want to use (even 5000RPM) is going to be almost zero.
To get 5000RPM, you are going to be stepping phases at 16666per second, work out the reactance of the inductor at this sort of rate. You are going to get tiny power, unless you are using an extremely high drive voltage. |
|
|
|