How to use the Do-more PLC and Do-more Designer Software in a DirectLOGIC PLC System
Live demo showing you how to use CTRIO2 and Do-more processor to implement a Trapezoid profile.
The Trapezoid command simply ramps up to speed, runs for a while, and then ramps back down to the position specified. Make sure the Module is configured correctly – so hit the configure button, module configuration, our module, Configure the IO. These are my inputs – I’m not using any. And I have assigned two outputs to be pulse step and direction. Step 2: Set up the profile. We’re going to use the same one we had in a previous video – the JOG video – but just as a reminder, this is our CTRIO module, we’re going to start at 100 pulses per second and we’re going to ramp up to 200,000 pulses per second. Since this stepper motor is a 20,000 pulses per revolution and that is 10 times that, that would be 10 shaft revolutions per second. And we are going to get there in half a second because we are going to ramp at 400,000 pulses per second. And it’s going to decelerate at the same rate. We are not using an encoder. We are also going to initialize our starting position at zero. So we initialized the hardware, we setup a profile. All that is left to do now is to setup our trapezoid function. The CTRIO2 has a CT AXis Trapezoid function. This one is easy – we select the module we are going to use, what kind of move it is going to be. Are we going to move to an absolute position or are we going to move relative to where we are? Let’s start with an absolute move. Our target position will be placed in register D0. You can put any register you want there or you can even put a constant if you want to. That’s all there is to setting up the Trapezoid function. Let’s put some controls in here. We’ll use our X0 switch to enable the Trapezoid, and let’s use X1 to suspend it. We need one more thing here – we need a Dataview so we can put some values in that D0 register that specifies our position. Let’s turn on EDIT and let’s make our first position we want to go to 100,000 pulses. Which would be 5 shaft revolutions. Let’s accept that, save it, write it to the PLC, and we are ready to go. If we go back and look at our configuration, and I reset the PLC, sure enough the configuration zeroed out our position and now if we enable the trapezoid function by flipping on switch X0, and we watch our position right here, we can see our carriage ramp up and ramp back down very quickly and stop at the 100,000 we specified. If I turn off this switch, and turn it back on, the carriage doesn’t move. Remember, this is an Absolute move. Since we told it to go to 100,000, and we are there already, the carriage didn’t move. I’m going to turn off X0. Let’s go out to 200,000. D0 is now 200,000 – we can see that here. If I turn on X0 – sure enough the carriage moves out to 200,000 and ramps back down and stops. If I want to go back home, well, I just put a zero here – write that to D0. D0 is now a zero so if I re-enable X0, the carriage moves all the way back to zero and stops. Now let’s see how the Relative command works. We simply go into the Trapezoid function, flip it over to relative, say ok, accept it, save it, write it out to the PLC. D0 is at 100,000. And I am currently at position 0. If I enable X0 with this relative command, sure enough, the carriage moves out 100,000 pulses. Remember, with the Absolute positioning, if I flipped X0 again, nothing happened because we were already at the 100,000 we specified. But because this is a relative move - if I flip X0 – the carriage moves another 100,000 pulses. And yet a third 100,000 pulses. So now we are out at 300,000 using the relative move. With the absolute move, to get home, I would put a zero in D0. With relative, I want to go minus 300,000 pulses. Enable X0 and the carriage goes all the way home. PLEASE make sure your CTRIO2 firmware is up to date. Use the live update under Help – Check for Updates. Of course mine is up to date so there is nothing showing here. But if you did, you would download the files using this button here. Once you have those files, go to PLC, Monitor CTRIO Module and look right here. If this has an asterisk next to it, it means it is out of date and you hit the Update OS Button. It will then take that file you just downloaded and burn it into the CTRIO module. That’s all there is to implementing motion using the Trapezoid instruction with the Do-more and the CTRIO2. Be sure to check out the other videos in this series for more on using motion. And as always, please send us any comments you may have, we appreciate the feedback. Spend Less. Do-more. From AutomationDirect.