Sign in to follow this  
Followers 0
Bobbias

Servo Control

26 posts in this topic

Alright, I've already asked this question on plctalk.net, but it hasn't received much attention. (Thread can be found here: http://www.plctalk.net/qanda/showthread.php?t=54437) I'm a complete Omron newbie. I've been spending my free time for the last week or so trying to learn how to control an Omron servo using an CJ1M CPU23 with a CJ1W-MCH71 unit attached. The drive and servo are R88D-WN01L-ML2 and R88M-W10030H-S1. I've managed to figure out how to write a program in CX-Motion-MCH and run it in monitor mode. However there are some issues I'm having. When I started using it, I tried making it search for the origin. Unfortunately, the origin appeared to be somewhere outside the motion range. It's a ball screw setup, and the origin appears to have been set somewhere beyond the motion range moving towards the servo unit itself. To remedy that, I moved it (slowly) to the absolute limit of motion, and set the origin there, so at the very least it wouldn't try to move outside it's range of motion. Unfortunately, that hasn't seemed to do much goof. If I attempt to use a SPEED command, it has a tendancy to speed up, and move towards the origin really quickly. Of course, I've got my suspician that I'm not using the MOVE command correctly. I'm really not sure what I need to do to be able to say, give it a command to move to a location, and tell it to move at a half decent speed, instead of the dead crawl it defaults to, without encountering that nasty high-speed movement towards the origin, which ends up making the servo emit a loud noise because it can't move any more, and usually error out of the program... I've been scouring what manuals I can find, but Omron seems to have a nasty habit of hiding or outright leaving out some really helpful information in their manuals. And in case anyone asks, the computer I'm on doesn't have a copy of any of the files. I might be able to list out the servo parameters I've changed, but most of them are irrelevat (such as changing the output pins for certain outputs, for when I've got the PLC set up to control it, rather than just a program). The other part of my question is, what do I have to do to actually control the drive from the PLC. I have no idea how to control the MCH71 unit from the PLC, and haven't seen any detail in any manuals so far.

Share this post


Link to post
Share on other sites
Bobbias, I imagine that the reason that you have not had any takers on plctalk.net as of yet is that this is like opening a can of worms. This is not a simple process of asking the question on a forum and getting an answer. I would recommend that you try to contact an Omron representative in Canada and see if they can give you some help. This just so happens to be one of the most complicated modules that Omron makes. All of that being said, I can answer a few of your questions: 1) You have an incremental encoder on this motor. Therefore it is necessary to do an origin search (aka Home Search) before attempting any movement. You mention that you tried to do this, but something that you said just does not sit right with me (when you said the origin must be somewhere outside the range of the ball screw). The process of performing an origin search generally involves moving in a direction and looking for the origin switch. This is usually a proximity switch that allows the servo to locate a known position. The servo will travel to the switch and then usually move off of the switch and stop at the next z-phase pulse (a pulse signal in the encoder that has only 1 pulse per rev) to find the exact origin. If the origin search starts in the direction that moves it away from the switch, then usually there is an overtravel switch (on each end) that will stop the servo so that you do not grind the gears. The origin search can be set to turn around if it hits the overtravel and look for the origin in the other direction. From your question, it sounds like you do not have any of these switches in place. 2) To control the motion from the PLC, it is necessary to write your MCH program in such a way that it is waiting for changes in the MCH internal memory to trigger other programs to be started. Then, you can map memory area exchanges between the MCH71 and the PLC CPU. I would first worry about getting your origin search issue resolved, then move on to the other more involved programming issues. Good luck!

Share this post


Link to post
Share on other sites
Thanks for the quick reply. I admit, I know very little about servo control, as I am a co-op student. I've been pouring over every manual I can find related to this (that my acrobat reader will open :/) and it just seems like a lot of important info is missing/assumed you already know it. The servo is mounted on something that came off a machine we disassembled (It became known as the "De-thumber" thanks to an incident, and was deemed unsafe) before I started my co-op positon. There are 2 proxies mounted to watch as the stuff mounted to the top of te ball screw (not sure what exactly to call everything, lol) passes, presumably used for overtravel and origin. I could see using one proxie as the origin when the first of the 2 bolts passes in front of it, and as overtravel if the second one passed it (the stuff mounted to the ball screw has 2 bolts that pass by the proxies). No actual overtravel switches other than the proxies though. I wasn't sure exactly how the origin search actually worked in the case of an incremental encoder. I've done computer programming before this, and have had a bit of practice on AB PLCs, so I'm not entirely new to PLCs at least, but this is definitely a much more involved project than anything I've touched before, lol. But I always welcome a chalange. As for the stuff about changing the drive's memory, and watching it, which manuals should I be reading up on, and could you maybe give me a run down on how the addressing works in the drive? I'm still sorta grappling with the addressing on the PLC, since this is the first time I've touched an Omron one. I've transferred the advanced settings for the MCH unit from the drive, and noticed that it's got a couple ports mapped to different memory locations (some in CIO, some in DM, and some somewhere else). Is there anywhere that really explains how these ports work? I'm fine with reading manuals and learning from those, I just need someone to help point me in the right direction, and maybe give me a pointer or clarification when I feel like something is ambiguous or not mentioned in the manuals.

Share this post


Link to post
Share on other sites
I have posted a manual for you in the downloads section: http://forums.mrplc.com/index.php?autocom=...mp;showfile=923 You should be able to find your answers here (although there is alot of info here and it can be confusing).

Share this post


Link to post
Share on other sites
Ok, weird issue. I've got an IORD instruction reading 3100, sending it (supposedly) to W5... I'm only reading 2 words, and somehow my number is appearing at W32. I'm not using W32 anywhere. And that number has nothing to do with the current coordinate feedback location, which is what it's supposed to be. According to the manual, the hex location 3100 corrosponds with the variable WL0200, shown as SL0200 in my program. As far as I can tell, there's no differnce between WL0200 and SL0200. But when my servo isn't moving, I get a number like 12506, no matter what the location is, and when it moves, it is anything between 28k and 46k. It drops back down when the servo stops. I'm moving the servo from -25 to 2000, then sending it a SPEED [J01]100T0; DWELL T500; SPEEDR [J01] T0;, and them moving back to -25. And I'm triggering the IORD with a DIFU generated by the 1 second clock pulse.

Share this post


Link to post
Share on other sites
I am assuming that you meant to say SL0200 and SW0200. These are in fact the same memory address. The difference is the format. The L in SL means that you are looking at address 200 as a double integer with a range of -2147483648 to 2147483647 and the W in SW means that you are looking at the same address as a single integer with a range of -32768 to 32767. This information is covered in section 4-3-1 of the manual that I posted in the link in this thread. With this particular address, it is necessary to use the SL0200 variable as the present position is a double integer. Post your program (both for the MCH and the ladder). It is difficult to see what you are talking about.

Share this post


Link to post
Share on other sites
Somehow I completely missed that section. The manual says that 3100h corrosponds to SW0200 and SW0201, which is directly equivalent to SL0200. IIRC when in monitor mode in CX-Motion it displays the variable SL0200 in the variable display box at the bottom left of the screen (along with displaying it in the control panel with jog and such). So if my understanding is correct, reading 3100h should read out SL0200 to a 2 word wide location in memory starting where I tell it to. I shouldn't be using odd spaced memory locations to read double sized variables, but that shouldn't stop it form reading the variable at least. And I haven't moved the servo to a location whose coordinates are larger than a single word can hold anyway. I just noticed that I should check and make sure P1AA02 and P1AA05 aren't specifying a different location... I'll post my code in a while when I can get it transferred onto the computer with the internet, but till then I'll explain what I've done so far trying to read the position data. I've used: IORD #0200 #00028000 W5 And IORD #3100 #00028000 W5 And both of them have given me those bogus results. I hope I'm interpreting how to use the IORD command correctly.... As far as I understand it, the first number is the location your reading from, the second number is the length of the read, and the unit you wish to read from (8000 to 800F) and the third operand is the location to write it to in the PLC, correct? So, I've completely changed my IORD command to see if it would do anything different. Now I've got it as: IORD #0200 #00088000 W5 (well, I've got it pointed to an actual symbol called Current_Location, that is a DWORD pointing to W5) In the memory watcher, it still continues to to update W32. As far as I can tell, -2000 somehow corrosponds with 30DAh. Even if you switch it to DA30h that is not -2000 (which is F021 if my conversion abilities serve me correctly). But seriously, why am I only getting 1 result in the wrong location when I should be getting 4 DWORDS starting at W5 (which I know is a bad location, but I just want it to transfer for now)? Edited by Bobbias

Share this post


Link to post
Share on other sites
Ok, new post because I've made some progress. I changed my IORD to #3100 #00088000 D0, and it works. Sort of. I get the right numbers, but it doesn't seem to update. I tried triggering it with the 1 second clock bit, still nothing. Now I'm trying to use a counter with the .1 second clock bit to be able to change how quickly (roughly) I want the IORD bit to update. However, I have no damned idea how to use the CNT function. I just want the counter to count down, trigger the IORD, and reset itself. Is there a "done bit" or something that I can use as the trigger for the reset? (This is my first time working on any Omron software, so in some cases I really have no idea what I'm doing.)

Share this post


Link to post
Share on other sites
Here's the code I have so far. Don't worry about the random stuff in the ladder logic. The problem I've got right now is that for whatever reason, I'm getting an error saying that Rung 2 won't compile. No explanation, just an outright "this won't compile" error. Sa fr as I can tell, it should work, so I'm completely stumped on what might be wrong. Servo_Control_Project.zip

Share this post


Link to post
Share on other sites
You cannot put an instruction on the right side of a counter. Here it is fixed up:

Share this post


Link to post
Share on other sites
You have two main issues with this rung. Number 1: You have used channel 2 as your set point for the counter. I am guessing that you had intended to use the number 2 as the setpoint. If this is the case, then you need to use a constant indicator of #2 which means BCD constant of 2. This would not cause the compile error, but it might bite you later. Number 2: This issue is causing the compile error. You cannot stack two output functions back to back like that. If you had intended to trigger the move instruction and reset the counter when it hit 2 counts, then the ladder should look like the image below. The IORD function should read 8 words starting at address 3100 and put them in the PLC beginning at D0. So, to look at D0 as a DINT (double integer) and you should see the present position of the axis. It looks to me like the system variables are already mapped to Port C in the I/O table. Port C is set to grab 160 system variables starting at 512 (200 hex, ie SW0200) and put them in the CPU at CIO 1000. So, if you monitor channel 1000 as a Double Integer (DINT), you should see your present position for Axis 1 if I am reading it correctly. See below: The drawing above specifies that 160 words will be written in the CIO area from the MC Unit to the CPU at address 1000. This pic specifies that the data will be read beginning at System Variable 512 (decimal). The HEX value of 512 is 200, so it starts at SW0200.

Share this post


Link to post
Share on other sites
Ahh, the way it was giving me errors, it sounded like it wanted something on the right side. That's good, I grabbed those settings from the drive at one point, because I had no idea what they were for, lol. I was wondering what the Port stuff was for. But like usual, there was nothing in any of the manuals I've read so far mentioning that. It may be hidden away somewhere, but it's been hidden well enough that I've never seen it. Right now, I'm trying to get the thing to origin, but I can't seem to get it to. I've got a break out box on the end of my CN1 connector and that's what I'm wiring to (it seems it was a custom job, and I've already had to pull the cable apart and solder a new conductor in). I've got it set to use the DEC (Origin proximity) signal on pin 9 active high, and have that set so that it triggers a high signal when the proxie is tripped. I've got the servo set to Limit Reversal mode. The servo moves in the positive direction, but passes by the proxie and just keeps going. Do I have to manually route the Z/C axis signal somewhere for it to determine the origin? I've seen the manuals menton the "Origin Determine" signal, but as far as I know none of the I/O pins on CN1 are for that... Edited by Bobbias

Share this post


Link to post
Share on other sites
Just a small update on my progress: I can get it to home now. I think my pin numbering was wrong for the CN1, so I was giving it signals on pins that didn't mean anything to it. The only problem is that it seems to think it's getting the home proximity signal all the time, when it's programmed to only go off after it gets the home proximity signal, which isn isn't getting when it choses a home location. I'm gonna have to play around with the signals and settings a bit I guess. What has me confused is why the NOT and POT signals, which were the first signals I wired to it, aren't working even when they're on the right pin. I've got them on the default pins (7 and 8) and set to "Valid for high signals", which I would guess should lock it up if I'm giving a constant high signal to those pins. Unfortunately, it doesn't seem to be doing anything. Like I said, I guess I need to play around with the signals and settings a bit more. If anyone has some insight into what could be happening/not happening, let me know.

Share this post


Link to post
Share on other sites
Your POT and NOT signals should be wired so that they are bringing the (-) side of the 24VDC supply through the Normally closed contacts on the overtravel switch. This would require them to be valid for a low input (setting of 1 for Pn50A.3 and 2 for Pn50B.0). This would also imply that you are using the (+) side of the 24VDC supply as the common for your inputs and it should be wired to pin 6. The origin switch is supposed to be a normally open switch. It sounds like you might be using a Normally Closed switch. Slowly but surely....

Share this post


Link to post
Share on other sites
My overtravel "switches" are actually 2 proxies set up with bolts that pass in front of them when nearing the edge of travel. And I'm running them through the PLC, so I can use them for more than just overtravel (specifically, I want to use one of them as the origin, and only overtravel when the second bolt passes the "origin" proxie.) I actually switched the parameters in the servo to active high, rather than active low, so by my understanding they should work with a +24v signal, shouldn't they? The odd thing is that in monitor mode, in the panel with jog and stuff, if I switch to the I/O status window, it shows me with various signals as on, and yet none of them are getting a signal form the PLC. I set my external latch 1 to be active high as well, and it still acts as though it's active low. It doesn't help that I'm not entirely sure of the pinout for the CN1 cable on the drive side. I don't know for sure how the numbering is on it, and the manual doesn't say anything specifically about the connector's pin numbers. Most of this is just guesswork, since it appears that I'm stuck with a custom cable running to the breakout box. But yes, slowly but surely, this thing is doing more and more. I do have to say that I'm happy nobody is waiting on me getting this thing working, lol. EDIT: I've got the POT and NOT signals working. I just said screw it and rewired for active low, or whatever you want to call it. Now I need to figure out how to give it an origin with just 2 proxeis at the absolute limits of movement. I decided to move the one proxie to a point where both bolts can't pass through it. So now I need to figure out how to accurately give it an origin using only the 2 limit proxies. Any hints on what I might do? Edited by Bobbias

Share this post


Link to post
Share on other sites
Check out P4AA04 - it lets you assign whether you are using the Origin Prox switch or one of the overtravel switches.

Share this post


Link to post
Share on other sites
Doesn't it still require a separate signal to designate the origin? I was thinking of doing somehing like checking it's location against whatever it was when it hit the limit, and then letting it move X number of units away from the limit and sending it the signal. Of course, I have no idea if that is really feasable or not. I think I could do that both in the PLC code and in the actual motion code if I wanted to, since it has the ORIGIN function, which I can use to manually specify an origin. So I could use that with some extra code instead of simply using the DATUM command... I might try that at some point today, if I have the time.

Share this post


Link to post
Share on other sites
I believe that if you set P4AA04 to use the overtravel switches, then you do not need an origin switch.

Share this post


Link to post
Share on other sites
Ahh, I haven't tested that out yet. I hadn't seen anything describing how it was supposed to work with the overtravel switches. I might still try to use the relative location idea, just because then you could customize your origin point by simply changing when it decides to use the origin command.

Share this post


Link to post
Share on other sites
Ok, so I've got it more or less working the way I want it. However, I'm now trying to use the communication ports to send data back and forth between the PLC and the MCH unit. Thing is, when I go into test run mode, there doesn't seem to be any communication while the program is executing. I've got a program in the PLC, which updates a memory location in the PLC, which corrosponds with a memory location in the MCH. I know it works, because when the servo isn't running, it updates fine. If I hange the data there, and have my program do something based on the data there, it works. But it seems that it only updates when the program isn't running... Is it supposed to work like that? What I'm trying to do is make my program interact with the user. I've got a WAIT command set to wait until the PLC sets a certain memory location to 1. And the PLC is set to change it to 1 when I press a button. I know it works, because if I leave it at 1 before the servo program is started, it works fine, but if I try to pres the button when the servo is running (and waiting for it) the servo doesn't get updated information. Is there a proper way to do this that I don't know?

Share this post


Link to post
Share on other sites
So along with another drive by some other company, I've got an Omrom R88D-WT02HL drive that I was wondering about adding to this setup. Thing is, it doesnt have a Mechatrolink connector. And I cant seem to find the manual for it, either. How does it communicate with a PLC, and would I be able to use it with my current setup?

Share this post


Link to post
Share on other sites
You have two options. Option 1: This drive will work with an analog or pulse traing signal. If you have a FL02 module with your trajexia controller, you could use it to send either an analog signal or a pulse train signal to the drive. Option 2: You can purchase a JUSP-NS115 adapter that plugs onto the side of that drive to make have Mechatrolink communications. It can then work with the other MLII drives in your network.

Share this post


Link to post
Share on other sites
Well, purchasing is out, because this is just a learning project really... We do have a JUSP-NS600, which came form the same thing we disassembled. Right now I've kinda dropped this project. I knew servo control was complex, but this is ridiculous. I mean, sure, I've got nothing but the manuals, and the (really useful) help of the few people who actually responded to me (basically just you, when it comes to the actual servo control end of things), but I'm getting tired of fighting though all this for now.

Share this post


Link to post
Share on other sites
I am sorry that you are having so much trouble. Be encouraged though, this is the most complicated card that Omron makes (in my opinion). You started with a very difficult module. A micro PLC sending pulses to a small servo would be a better place to start. If you could convince an Omron engineer to come by and give you some tips it certainly would help. Good luck.

Share this post


Link to post
Share on other sites
Hi Micheal I think JUSP-NS115 Mechatrolink card just act on new omron servo drive(I think by firmware newer than 2.0 version). But if you sure its not true please tell me and if true can you tell me how can i upgrade firmware of drives.Actually i have some R88D series and i want to use them with TJ1-ML. Regards

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0