View Full Version : Driving Industrial Servos
g_jilek
12-09-02, 04:20 AM
I just discovered the IsoPod the other day. I read the article in ”Poptronics” and was hooked. I’ve spent the last few days reading all of the manuals on the IsoPod and IsoMax, I’ve even shimmed through processor manual. My focus is industrial process and motion control and I see the IsoPod as an excellent candidate for a number of the systems I am working on.
One of the things that I was not readily seeing was how to configure the PWM outputs to provide a Step & Direction or Clockwise / Counterclockwise to drive a standard industrial servo amp. I assume that it one would probably do something like setting the duty cycle to 50% and then drive the period with software, producing the desired pulse train. I would appreciate a little sample code to get me pointed in the right direction.
I also have need for analog outputs. I had hit on the idea that the PWM outputs could be used for this purpose. I was looking around for a suitable circuit topology finding nothing that I liked. I then found Daniel Schmidt’s little RC circuit and at least I knew I wasn’t way out in left field. The idea that I had was to use the above concept to provide a pulse train and feed that into a Frequency to Voltage Converter. The question is, is this a reasonable approach; or would one be better of using the SPI and driving a 12 or 16-bit serial input DAC. If the DAC is the way to go I would appreciate seeing how that might be coded.
blueeyedpop
12-09-02, 08:49 AM
Rushing off to work here, so my reply is short.
I wouldn't try to generate classical Step/Direction signals with the pod, at least not if I wanted reasonable speeds. It's more of the domain of the PGA than this sort of processor. It will accept S/D easily enough, many channels of it.
If all you wanted was velocity you could generate a negitive pulsetrain, and perhaps there is a clevery way to do it with the timers I am not aware of.
I recently did D/A, and I know an opamp configured as an integrator would do the trick, but I just bought a weedtech serial D/A board, and ripped out their PIC, and hotwired it via SPI. Pretty trivial.
Glad the article "hooked you", I'm hooked too.
Mike Keesling
RMDumse
12-09-02, 09:21 AM
Using PWM for a D/A output is a good idea. With the very high frequency PWM the Pod can generate, you can have smooth signals into the higher audio ranges.
There's a nice app not on filtering PWM outputs from Microchip. http://www.microchip.com/download/appnote/devspec/17cxx/misc/00538c.pdf
Step and direction control seems not to be a good match for the PWM outputs, which are designed for fixed frequency PWM with the period varying. I think you could more easily generate a variable frequency rate with a fixed pulse, with the timers. Do you have some specs on what the amplifiers expect the signal to be like?
blueeyedpop
12-09-02, 10:09 AM
What I have seen, as far as this method of control is concerned, is a 1uS to 3 uS negitive pulse on the direction line, and transitions on direction just before the pulse. I have see frequencies beyond 200khz
Mike Keesling
g_jilek
12-09-02, 03:33 PM
Thanks for the Input.
I am looking at the Sanyo Denki PB Series of hybred steppers.
http://www.motiononline.com/home.htm?welcome.htm&2
A frequency of 25k-50k hz will drive these motors to full speed at low resolution. The motor itself is driven by a PWM signal so the possibility is there to drive directly through an interface. I will know more after I’ve had some time to play with the units.
The DAC looks like I could try the PWM fed into an audio “brick-wall” type filter, possibly the Maxim MAX280.
http://www.maxim-ic.com/quick_view2.cfm?qv_pk=1560
Odd order filters tend to be better behaved in the audio range. The Bessel is probably the best choice here also.
unterhausen
12-13-02, 06:59 PM
Originally posted by g_jilek
Thanks for the Input.
I am looking at the Sanyo Denki PB Series of hybred steppers.
http://www.motiononline.com/home.htm?welcome.htm&2
A frequency of 25k-50k hz will drive these motors to full speed at low resolution. The motor itself is driven by a PWM signal so the possibility is there to drive directly through an interface. I will know more after I’ve had some time to play with the units.
Is this for work or for fun? Have you looked at geckodrive?
These DSPs are so cheap, there are a lot of motor drive applications for them. I have even thought of using them as an encoder interface.
It seems a more natural way of driving a step/direction drive is simply to use a digital i/o port. This chip is overkill in that application, but, again, they are cheap.
I suggest another approach. Instead of trying to drive someone else's industrial drive, hang two h-bridges off of the isopod pwm outputs and drive the steppers directly. If you go look at motorola's web-site, that was their intent with these chips.
If you look at http://www.irf.com/product-info/intero/ you will find a design for such a computer using the TI 240x DSP, which have very similar features to the moto chips. I have been eying the TI chips for a few years now, and you can get some good app notes from them on motor control. Similarly, Analog Devices has some motor control oriented DSPs and they have appnotes of interest.
The emphasis is on three phase brushless or induction motors. Steppers are very similar, but easier.
RMDumse
12-14-02, 09:28 AM
I tried to follow your link to the Sanyo Denki PB Series but had trouble navigating the site to find the particulars on the signals needed to drive this amp.
Well, as fate would have it, a couple of my professor friends at Automation Robotics Research Institute (UTA) are putting on a new motion control seminar this coming Tuesday, and wanted to demo some of the motor drives they had on hand, but had no controller to drive.
They had a brushless servo amplifier which ran "step and direction". (actually, it ran one direction with a step pulse train in one input, and the other direction with the step pulse in the other input.) The motor was connected to a shuttle on a long linear drive. They wanted to let a student move the shuttle with a potentiometer, so they could experience the system work. (I also did the same thing with a brushed motor system with our NMIH-0050 H-bridge driving it. They had a student set up the same with a stepper motor and control system they already had on hand.)
I was able to drive the brushless dc motor through the amp beautifully, with the code listed below. To have the dynamic range to run from almost stopped to top speed of this amp, I cascaded two timers together. I used the first like a settable prescaler, and the second to run the count. I read the A/D channel to get an analog value from a pot. I converted that analog value to "above or below" a middle set point. I used a statemachine to sense if the direction had changed, then reconfigured and reinitialize the timers to go with one (or the other) output. The rate would be calcuated each time the statemachine ran, but the timers were only reconfigured once per change in direction.
I hope this helps. If you can help me find the exact details of your amp, I can tell you if this code would work for you or would need to be modified.
SCRUB
HEX
VARIABLE DIR EEWORD
VARIABLE SPEED EEWORD
VARIABLE DIV EEWORD
: INIT
2003 E80 ! ( SET UP A/D
0000 E81 !
3210 E83 !
7654 E84 !
; EEWORD
: GO<
TRUE DIR !
3021 D46 ! ( CTRL TMRC1
0005 D47 ! ( STATUS
E823 D4E ! ( CTRL TMRC0 EXTENDED 32 BITS
0001 D4F ! ( STATUS
200 D40 ! ( CMP1 FOR OVERFLOW
0000 D45 ! ( COUNTER
DIV @ D48 ! ( CMP1 FOR OVERFLOW
0000 D4D ! ( COUNTER
; EEWORD
: GO>
FALSE DIR !
EA23 D46 ! ( CTRL TMRC0 EXTENDED 32 BITS
0001 D47 ! ( STATUS
3021 D4E ! ( CTRL TMRC1
0005 D4F ! ( STATUS
DIV @ D40 ! ( CMP1 FOR OVERFLOW
0000 D45 ! ( COUNTER
200 D48 ! ( CMP1 FOR OVERFLOW
0000 D4D ! ( COUNTER
; EEWORD
: SETRATE
E89 @ 4000 - DUP 0< DIR ! ABS SPEED !
7FFF SPEED @ / DIV !
DIR @
IF
DIV @ D48 ! D48 @ D4D @ U< IF 0 D4D ! THEN
ELSE
DIV @ D40 ! D40 @ D45 @ U< IF 0 D45 ! THEN
THEN
; EEWORD
MACHINE <> EEWORD
ON-MACHINE <>
APPEND-STATE MOV< EEWORD
APPEND-STATE MOV> EEWORD
IN-STATE
MOV<
CONDITION
SETRATE
DIR @ NOT
CAUSES
GRNLED OFF
REDLED ON
GO>
THEN-STATE
MOV>
TO-HAPPEN IN-EE
IN-STATE
MOV>
CONDITION
SETRATE
DIR @
CAUSES
GRNLED ON
REDLED OFF
GO<
THEN-STATE
MOV<
TO-HAPPEN IN-EE
: STARTUP
MOV> SET-STATE
INIT EVERY C350 CYCLES SCHEDULE-RUNS <>
; EEWORD
( 7C00 AUTOSTART STARTUP
( SAVE-RAM
g_jilek
12-14-02, 03:17 PM
To: unterhausen
Is this for work or for fun?
Yes.
Have you looked at geckodrive?
Thank you for the tip. They look like they would work nicely for a couple of my applicatons.
It seems a more natural way of driving a step/direction drive is simply to use a digital i/o port. This chip is overkill in that application, but, again, they are cheap.
It might be a bit of overkill but the Pod does provide a good basis for a distributed controller network; cheap!
I suggest another approach. Instead of trying to drive someone else's industrial drive, hang two h-bridges off of the isopod pwm outputs and drive the steppers directly. If you go look at motorola's web-site, that was their intent with these chips.
This is an intreging solution, but the Sanyo Denki is getting 9.29 lb-in out of a 3.6" NEMA 23 motor that will spin up to 4500 rpm. That is tough to beat. The magic is in their controller algorithms.
Gerard Jilek
[/B][/QUOTE]
g_jilek
12-14-02, 04:05 PM
To: RMDumse
I tried to follow your link to the Sanyo Denki PB Series but had trouble navigating the site to find the particulars on the signals needed to drive this amp.
Yes it is a bit hard to get at their data, but what I have been able to gleen is that the inputs will accept a 5-24 volt signal. The motor's max frequency is 100k hz. The CW/CCW pulse train you discribed is one of the inputs that this amp will accept.
I have been waiting "patiently" for my first Pod to arrive. At that point I will give the code a go and see if I can get myself into a Bit of touble. At least I've had time to put together a PWM DAC interface for testing when the Pod arrives. More on that later.
Thank you,
Gerard Jilek
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.