https://www.automationdirect.com/productivity (VID-P2-0022)
Learn how to use the Productivity Controllers HOME command to move your system into it starting position. Discusses all four homing modes and how to use sensors with those modes.
Our FREE Practical Guide to Programmable Logic Controllers eBook: https://www.automationdirect.com/ebooks/plc-handbook
The HOME instruction gives you a convenient way to locate and set your home position. We’ll use the same linear slide configuration that we used in the Simple Move video so check that out to see how we set all of this up. The only difference is I added a third limit switch to one end so we can test all of the Homing modes. Let’s bring up a HOME instruction, select the channel we want to use and create a structure for the tags. We’ll modify those tags later during runtime in the data view. Could we just put numbers in here if we wanted to? Sure, but then we can’t control them programmatically. Let’s do Mode 1 first which says move to sensor 1, then slow down, move to sensor 2 and stop. The carriage will be operating out in the middle of the slide, so we’ll always want to go in the reverse direction to get back to our home position. You can use any of the 6 inputs on the HSO module as sensor inputs. We wired inputs 4 to be the first sensor and 6 to be the second sensor, which we are also using as a limit sensor on this slide. We want to know when the sensor goes active which is the rising edge. We do want to reset the position counter when this is done so we enable that here. And again, we’ll set all of these values later in the dataview. That’s it. Hit OK to define the tags. Change any tags from integer to float that you will want to use fractional amounts with and hit OK. Now that the Tags are defined, go back into the instruction and click on this button to automatically create a dataview. We have a momentary pushbutton button connected to input 1 on the HSO that we’ll use as our homing button. And let’s use the in progress bit to seal the contact and keep the instruction running even if we let go of this momentary switch. Transfer to the processor. Let’s bring up the data view and setup our homing. We want a fast speed to sensor 1, a slow speed to sensor 2 and some modest acceleration and deceleration speeds. When we get there we want to set the position to zero. Let’s add the channel 1 position and velocity to the dataview and plot the velocity so we can see what happens. Well, let’s try it. Put the processor in RUN mode and don’t forget to re-write rewrite all of your edits to memory – they get cleared when you go into Run mode. I’ll hit the HOME button and sure enough you can see on the graph that the slide moved quickly to sensor 1, decelerated, then crept to sensor 2 where it stopped and set the current channel position to zero. Perfect. Could we have used the same sensor for both positions? Sure – we could have looked for the rising edge as the first sensor and the falling edge as the second. That works rally well if you have a wide sensor detection range. Modes 2 and 3 are simple. Move to the first sensor and stop immediately or move to the first sensor and decelerate to a stop. I don’t think we need to demo those. Let’s take a look at mode 4 – that one is more interesting. This one detects a sensor, decelerates past it, then reverses direction and creeps back to the original sensor. Note that if it looks for the rising edge on the first hit, it then looks for the falling edge on the second pass so you end up right at the first edge. This is a great way to get rid of backlash when you are homing your system. Let’s try that … I’m going to bring up the High Speed Test Tool, and put the processor in stop mode so I can use this tool to manually move the carriage back out to the center of the slide. Shut that down. Move it out of the way. So we want to go fast to the first edge and slowly creep back. And I’m going to slow down the deceleration to make sure we go past the sensor. Let’s get back in RUN mode and re-write those edits that run mode just cleared. Hit the home button and sure enough we can see on the graph the carriage ramped up to a fast speed, found the leading edge of the sensor, decelerated, then moves backwards to find the trailing edge of the sensor and then set the current channel position to the zero just like we asked for. Notice that when using the HOME instruction you never use negative values for speed. You specify the initial direction here and then everything else is relative to that. For example, the instruction knows that when using mode 4 that the second velocity moves in the opposite direction. You don’t put a negative value here. And as always, if things don’t work as expected, take a look at the status word bits. If you see one bit set, just look it up in the help file and it will tell you exactly what the problem is. And one of my favorite features of the Productivity Software is you can test bits in a word directly. Just bring up the status word, tell it which bit to test and you’re done! You don’t have to do a bunch of math or masking or shifting or testing of bits – this built in “Bit of Word” feature does it for you. The beauty of all of this is the productivity suite software makes all of this so easy to setup and test independent of your actual application so when you do go to write your ladder code you already know the system works and have narrowed down the settings you will need – which makes your programming life go so much smoother. If you need any help with the Productivity Series of controllers, contact AutomationDirect’s free award winning support team during regular business hours. They will be happy to help. And don’t forget the forums. There are lots of folks there that love to share their years of experience. Just don’t post any questions directed at AutomationDirect’s support team there, they don’t monitor the forums on a regular basis.
Voted #1 mid-sized employer in Atlanta
Check out our
job openings