Welcome, Guest. Please login or register.
Did you miss your activation email?
February 08, 2012, 11:23:43 AM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Industrial Robot Help and Discussion Center
| |-+  KUKA Robot Forum (Moderators: Werner Hampel, Martin H, SkyeFire)
| | |-+  stepper control from KRC2
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: stepper control from KRC2  (Read 1981 times)
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« on: February 19, 2010, 11:16:58 PM »

I am trying to control an external positioner from my KRC. Just simple positioning moves, not interpolated motion.

I noticed WAGO makes a stepper drive that fits the 750 system I already use for I/O
It is model 750-672. Is this something that would work with the KRC? I am trying to avoid using serial or krl/xml to communicate with the stepper; also this unit is a bit cheaper than an external drive/controller. Perhaps I still need those protocols, because I am not sure how exactly I would be communicating with this.

If so, great, my next question will be how to configure it on the devicenet. I have a little experience with it, having set up the I/Os, but this seems a bit more involved.
Logged
TygerDawg
Full Member
***
Offline Offline

Posts: 205


« Reply #1 on: February 20, 2010, 04:48:38 PM »

I've recently implemented a stepper motor from Intelligent Motion Systems http://imshome.com/
Very nice package, integrated motor+control, I was very pleasantly impressed with their products.  Different models allows you to do anything from simple speed control via analog input all the way to sophisticated indexer programming.  Instead of getting all jammed up with DeviceNet silliness you could use one of these units and just give it simple I/O signals.
Logged

TygerDawg
Blue Technik
Virtuoso Robotics Engineering
www.bluetechnik.com
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #2 on: February 20, 2010, 05:47:31 PM »

thanks, that looks like a good option. A triple stack 34 motor would do it, since I am running a 100:1 gearhead. My indexing point will vary(infinitely) though, so I am not going to rule out a direct communication(just to pass a position variable). Looks like IMS has a canopen option(though that would be back to the "sillyness" I assume....I don't even have a canbus installed).
Logged
SkyeFire
Global Moderator
*****
Offline Offline

Posts: 1625


« Reply #3 on: February 21, 2010, 07:18:46 PM »

Well, it would depend on what you need to send the WAGO module.  If the WAGO stepper-control module just takes raw coil-control inputs, then it's a fairly simple matter to create a rotating binary pattern that can drive the motor the way you want.  OTOH, if the WAGO module is smarter, it might be even easier -- just send it "direction" and "speed" binary codes, along with "single step/half step".  If you've already got a DeviceNet bus coupler slaved to the robot, and the WAGO stepper-driver module is just another "slice" to add to the backplane, this might well be the easiest way to go.

I probably don't need to mention that for steppers, getting the coils wired in the right order is REALLY REALLY important.   

One thing about steppers, though, is that you don't have positional/speed feedback from them normally -- I've seen steppers "slip" electrically when blocked or over-driven.  Do you have some external means of knowing where the stepper is at any given time?
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #4 on: February 22, 2010, 03:37:33 PM »

thanks Skyefire, that sounds promising. Yes I understand how steppers can lose steps. We are hoping that we will be well within our torque capability to avoid that. I was planning to use some limit switches, hopefully these will let us home it(and stop it if it runs away for some reason. If it does slip I think we will just be recognizing that visually; in my experience the slipping occurs from trying to accelerate the motor too fast, because I assume if you stall it at a low speed it should just stop, but not necessarily slip. This is really just a initial experiment, not building a production machine here.

Yes I already have a wago 750 output input module on my bus. I should probably make sure I have enough power though, I may need another PS on the bus for such a large draw(5 A) device as the stepper controller.
Logged
SkyeFire
Global Moderator
*****
Offline Offline

Posts: 1625


« Reply #5 on: February 24, 2010, 03:13:23 AM »

5A?  Whew, yeah.  I'd say a separate power supply dedicated to the motor is likely to be necessary. 
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #6 on: February 24, 2010, 10:53:28 PM »

Yeah turns out the wago is just the drive, requires a separate 70V motor PS. So now I am weighing my options. A wago pulse/direction unit with external drive; a wago drive with separate PS, or a fully external system. I am running an 1800 oz in stepper(nema42) through a 50:1 gearhead, so yeah this is a pretty high torque system. But I don't need to move fast at all, 6-10 rpm at the output shaft.

I am still stuck on how I will be communicating to the stepper drive or pulse/direction unit. I just can't find any example of what a krl program would look like that was passing data to this thing. Regular I/O is easy, OUT_C for example. Is this thing going to be declared as a new data struc? or a variable? Or do I have to open a channel, or worse use my krl/xml interface? Which I find confusing in the least. Trying to avoid using serial interface for sure.

The wago manuals are a little too generic. Worst case I will simply set an output and have an external(read: PC based) PLC controll/drive combo running a separate positioning program. But that seems so redundant.
Logged
SkyeFire
Global Moderator
*****
Offline Offline

Posts: 1625


« Reply #7 on: February 25, 2010, 09:54:10 PM »

Well, long, long ago (when dino-robots ruled the earth), I used to drive stepper motors by bit-banging them from the printer port of an old 386 PC using BASIC.  Bit-banging steppers really isn't hard.  As long as you can associate an $OUT[ ] signal on the robot with each of the motor wires on the stepper (with sufficient drive current, of course), this should be workable.  If, for example, you had WAGO output module with sufficient bits, you could have each WAGO output drive a high-amp Radio Shack relay wired between the stepper and the big power supply.  It wouldn't be able to go fast, given that relays are "sticky", but it would work for a bare-bones rig.  The real magic is in the pattern with which you fire those outputs.  And there's even a fairly easy formula for that; I don't recall the details offhand, but it looked like a FIFO buffer with the overflow output looped back to the input. 
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #8 on: February 26, 2010, 09:22:04 PM »

ha that definitely sounds old school. So I went for it and purchased a nema 34 2 stack and a planetary head, with a unilevel driver(built in PS). So now I just need pulse and direction. I think I am going to try the wago 750-670, but if it doesn't work, a PC source for pulse and direction shouldn't be very expensive(I hope).

I emailed the kuka hotline, but they never seem to reply. I get a response ticket, but then no response. oh well, I will call them if I get desperate.
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #9 on: March 11, 2010, 01:13:44 AM »

So I have most of my components, including a Wago 750-670, which is a pulse/direction stepper module. I have to admit I am a little stuck on how to get started. I have an idea of what I think it would look like, but no idea if it is correct.

Here is what the manual says:

The 750-670 I/O module provides the fieldbus coupler/controller 12 bytes
input and output process image via 1 logical channel. The data to be sent and
received are stored in up to 7 output bytes (D0 … D6) and 7 input bytes (D0
… D6), depending on the operating mode. Output byte D0 and input byte D0
are reserved and have no function assigned. 1 I/O module control and status
byte (C0, S0) and 3 application control and status bytes (C1 ... C3, S1 ... S3)
provide the control of the data flow.


But before we get to that, I know this thing needs to be set up in the IOSYS file.

Kuka devicenet manual only refers to digital I/O and analog I/O. This doesn't seem to fit that description....but I don't completely know.

My current IOSYS says something like

INB0=1,0
OUTB0=1,4,x3
ANOUT1=1,0,16,2,CAL 32768

After reading this again, I am thinking I need to assign 7 bytes of output data to this module.

So something like

OUTB5=1,0,x7

Even close?
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #10 on: March 11, 2010, 01:46:57 AM »

update: That appears to have done something, because I no longer get a fieldbus error on startup(first I tried plugging it in with no setting change, of course that gave an error)

so maybe beerchug

But I am still not sure what a "command" would look like. I have only used things like $OUT[1] = true.

So I think I am going to group these into one or more signals, and pass more complex integer/hex data that way?



Actually now I am thinking I may should have said

OUTB5=1,0,x12

not sure yet.
Logged
SkyeFire
Global Moderator
*****
Offline Offline

Posts: 1625


« Reply #11 on: March 12, 2010, 12:39:24 AM »

Yep, you're on the right track.  x7 or x12, I can't tell you offhand.

Now, if you're using OUTB5 as the "start byte" of the 7 (or 12), that means that the first $OUT[] that goes to the stepper controller will be (5*8)+1) = 41.  IOSYS allocations are by byte, and can't be broken up any smaller, but KRL $OUTs and $INs start at 1, not zero.  So OUTB1 is $OUTs 1-8, OUTB2 is $OUTs 9-16, etc.  In the robot I/O table, the first $OUT or $IN of a byte will always start with an odd bit number, and end with an even one.

Your last bit will be (41+(7*8) -1) = 96 if you're using x7, or (41+(12*8)-1)=136 if you're using x12.

Now, here's the thing:  you'll have to really dig through the docs for that WAGO module, and map out which $OUTs in your KRL program will match to which bits on the Wago.  You'll also need to figure out what the Wago's commands look like.

Now, if you need to send, say, an 8-bit word all together as a single variable, you'd do something in your program, not in your IOSYS like:
Code:
SIGNAL Mookie = $OUT[41] TO $OUT[48]

"Mookie" could be any valid KRL variable name.  And you can set the number of bits almost arbitrarily, from two up to 32.  Any integer value you set the variable to will be converted into binary and show up in the $OUTs that make up that SIGNAL variable:
Code:
Mookie = 170 ; will put pattern 10101010 onto $OUT[48] through $OUT[41]

The higer $OUT in the SIGNAL declaration will be the Most Signigicant Bit, and the lower $OUT in the SIGNAL declaration will be the Least SB.

One warning:  if you need to put a negative number onto the outputs, that'll take some extra math that I can explain if need be.  Unless your SIGNAL is declared as a 32-bit binary number, in which case +/- is handled automagically (the KRCs are 32-bit operating systems).

Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #12 on: March 12, 2010, 04:27:36 AM »

Thanks Skyefire,
   I am starting to get this I think. Everything you explained there makes sense, including the signal declaration. I have done the manual read about 20 times, and it is slowly sinking in. I think it was x12(to answer the width issue) For example, my signals are now:

SIGNAL CONTROL0 $OUT33 to $OUT40
SIGNAL STEPVEL $OUT41 to $OUT55 ; 16bit 1...25000(LSB,MSB) in hex
SIGNAL STEPACC $OUT56 to $OUT80 ; 16bit 1...31767(LSB,MSB) in hex
SIGNAL STEPPOS $OUT81 to $OUT104 ; 23bit+sign -8388608 ... +8388607(LSB,B,MSB) two's complement in hex
SIGNAL STEPCONTROL3 $OUT105 to $OUT112 ; in binary
SIGNAL STEPCONTROL2 $OUT113 to $OUT120 ; in binary
SIGNAL STEPCONTROL1 $OUT121 to $OUT128 ; in binary


This is just for one very basic mode of the WAGO, cyclical positioning. I believe the negative math you are referring to is the "two's complement" which I think I can avoid, as my positions should always be positive. Who would believe I have to do all this to turn a gearhead from 0 to 180., which will hopefully all be between POS 0 and POS + xxxx which is measured in pulses. It is pretty exciting to figure this data stuff out, because it really means you can do a lot with these controllers.

OK, but on to my real question (of the day). Several of the signals, lets talk about STEPPOS are in what I think is called little endian format and expects a 3 byte value, (LSB,B,MSB).

My plan was to pass a Decimal number to STEPPOS. I believe KRL requires STEPPOS to be declared in  order of increasing output...in my case $OUT81 to $OUT104.

So I need to reverse the byte order of the number. For example 65056 (hFE20) needs to be set as

STEPPOS = 'h20FE00'

unless by some chance there is a way to tell the control that this number needs to be read as little endian hex.

Does that sound logical? Is there an easy way to do that? Sounds like something a little array loop/parse thing could fix.

Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #13 on: March 13, 2010, 10:23:00 PM »

OK,
  Looks like it isn't so easy. Turns out my IOSYS is not set up right. I know we have been through this a thousand times, but I guess it still doesn't click.


I have 750-306 wago fieldbus, MACID 1

IN order I have

4 channel DI
4 channel DI
4 channel DO
4 channel DO
4 channel DO
4 channel DO
4 channel DO
4 channel DO
Stepper controller 750-670, which has a 12 byte in and 12 byte out process image
2 channel ANOUT


shouldn't this mean that

INB0=1,0,x1
INB1=1,1,x12
OUTB0=1,0,x3
OUTB3=1,3,x12
ANOUT=.......(this part works)

Obviously if that actually worked I wouldn't be posting this. One guess I have is that multipliers can't exceed x3, therefore for large assignments I need to use W or DW?
Logged
wes_mcgee
Jr. Member
**
Offline Offline

Posts: 81


« Reply #14 on: March 14, 2010, 01:31:58 AM »

OK after 7 hours I recognize why the above doesn't work, but still can't get it. The analog outs apparently occupy spaces in the right side byte offset.

So I took out the analog out and the stepper control.

INB0=1,0,x1
OUTB0=1,0,x3

and the IO works again.

Now I want to add my 12 byte in 12 byte out controller module, and I want to add a 2 channel, 16 bit per channel Analog out. The analog out must go last, because the housing doesn't allow the slots to pass of anything other than an "end module". APparently this is their way of telling you not to put it ahead of a digital module. I am also not convinced all of these modules are compatible, but I can't find anything in the manual that says that.
Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!