Part 5 of 8, In Part 5 of this video series on Motion Control, I will show the steps for programming the CTRIO High Speed Counter Interface Module. This will include setting all of the parameters, creating motion pulse profiles, updating the firmware, monitoring the inputs and outputs, and testing the profiles. There's a lot of ground to cover, so let's get started.
Take-away PDF and three application software projects can be found below.
Storyboard Handout take-away:
DirectSOFT5 Project File take-away:
CTRIO Project file take-away:
C-more Micro-Graphic Project File take-away:
SureStep User Manual: https://bit.ly/r5dgUO
Starting with Steppers, Part 1: https://bit.ly/J5U0tN
Starting with Steppers, Part 2: https://bit.ly/IQSjUb
In Part 5 of this video series on Motion Control, I will show the steps for programming the CTRIO High Speed Counter Interface Module. This will include setting all of the parameters, creating motion pulse profiles, updating the firmware, monitoring the inputs and outputs, and testing the profiles. There's a lot of ground to cover, so let's get started. There are several tasks that we can perform when using the CTRIO Workbench utility. I will touch upon all of the features, which will make this part of the video series a little long, so I will try and cover it quickly. If you miss anything, use the Power Point PDF file handout I spoke of earlier, and either use it to follow along with the video, or use it later if there are areas you need to brush up on. I start the DirectSOFT5 DSLaunch application. From here I open the Workbench support version titled 'CTRIO WB 2 -- DirectLOGIC PLC', under the 'Utilities' menu. Please note that there are additional support versions of the CTRIO Workbench that can be used with WinPLCs running the Think & Do software, or an Ethernet Base Controller, abbreviated EBC, an interface device that can be used for remote I/O. I can also use the Offline support version that allows me to create a complete CTRIO configuration file, extension type CWB, that can be read into a CTRIO module at a later time. Once I have the CTRIO Workbench dialog window opened, the 'Select Link' box will prompt me to establish a link to any found CTRIO modules. Other devices that are supported by the Workbench application will also appear. In my case I will select the 'DL05: Motion Control with Micro PLC' for my link. I had created this link for the DL05 at an earlier time. It may take a few seconds after the link is established before the known parameters and information is displayed in the CTRIO Workbench dialog window. As shown next, the 'Comm Status' should indicate 'OK', and the 'Config Status' most likely will display 'Same as Module', that is, if this is the 'first time use' of the CTRIO module. If there are other CTRIO modules installed in the PLC, they will be displayed in the 'Installed Modules' window. For my application, I'll make sure the CTRIO module I am using is the one highlighted. Please note that most likely the CTRIO Workbench dialog window will indicate the 'Module Mode' is in 'Program' mode, which is where I want to start. It is good practice to take a look at the 'Module Status' so that you are familiar with the 'Scan Time'. Also check which OS Version is running for your module. In my example, I have OS Version 2.1.22 being used. I will cover updating the firmware version of the CTRIO module a little later in this video. It is a good idea to provide a name and description of the CTRIO module that can be used later to identify the module. This becomes important if there are multiple modules in an application. Under the heading 'Current Module', I select the 'Edit' button to allow me to type in the 'Name' and 'Description' of my module. In my case, I named the module 'Motion Demo' and gave a description of 'Single axis linear lead screw slide with DL05, CTRIO and C-more Micro'. I click OK to accept the edits. Next I determine how I will use the CTRIO module in my application so that I can configure the module's inputs and outputs. Of course I will be using the module to output step pulses and a directional signal to my stepper motor drive. I next click the 'Configure IO' button at the middle left of the CTRIO Workbench dialog window as shown here. The 'Configure IO' window shows the various functions that can be selected for the H0-CTRIO module's four inputs and two outputs. Let me point out that the various functions within each input and output function box can change, based on the selections made in some of the other function boxes. For my application, I select the 'Pulse (Step/Dir)' function listed in the 'Output 0' function box. 'Output function box 1' will now show 'Slaved to 0' as shown here. 'Output 0', designated as 'Y0' on the CTRIO module, and not the same as 'Y0' on the DL05 PLC, will provide the step pulses, while 'Output 1', designated as 'Y1', also not the same as 'Y1' on the DL05 PLC, will provide the stepper drive's direction signal. I will be using the 'Homing' profile in my demo, so I will set 'Input C' as the 'Limit Out 0' function, which will allow me to use it to indicate when the linear slide is at the home proximity sensor. I'll cover more on this when I create the pulse profiles. Configuring the I/O at this point allows me to see how the Input and Output addresses are assigned when I 'Map the I/O' in the next step. Next I'll setup the PLC's memory addresses that are used to communicate with the CTRIO module. I click the 'I/O Map' button at the bottom of the CTRIO Workbench dialog window as shown here. In the 'I/O Map' dialog window I have two choices under the 'Map Display Mode' for how the addressing can be used within the PLC. The addresses can be broken down into either 2 ranges or 4 ranges. Using 2 ranges allows addressing the I/O in 'word' and 'bit-of-word' formats. 4 ranges allow addressing in 'word' and 'Control Relay' formats. In my example I have chosen to use the 2 ranges for my 'Input Map' and 'Output Map' display modes. In the IO Map dialog window I check the 'Enable Write to PLC' box and enter memory register V2400 for the 'Starting V address for inputs'. This produces a range of memory registers from V2400 to V2425. Next I check the 'Enable Read from PLC' box and enter memory register V2430 for the 'Starting V address for outputs', which gives me a range of memory registers from V2430 to V2461. The available Input, Output and System functions will now be shown under the respective tabs as we see here. A 'Report' that shows all of the mapped I/O addresses and their functions can now be printed from this dialog window and used as a reference for developing the ladder logic. As shown here under the 'Input Functions' tab, there are no Input assignments for the CTRIO to Controller data, or Outputs for the Controller to CTRIO data. Earlier in the 'Configure IO' dialog window I did assign physical 'Input C' as 'Limit Out 0' to use for my Homing profile that I will create in a moment, but it is an internal function, and is not communicated between the CTRIO module and the DL05 Programmable Logic Controller. The 'Output Functions' that have been assigned as part of the selections I made are shown here. Most important are the 'Output 0 -- Pulse' which provides the Steps to my stepper drive by way of connection terminal 'Y0', and 'Output 1 -- Pulse' which provides the Directional signal to my stepper drive by way of connection terminal 'Y1'. Under 'Input Data' are the various 'Bit' signals that the CTRIO communicates to the Controller, in my case, the DL05 PLC. Here are the 'Output Functions' continued with the 'Bit' and 'Word' signals that the DL05 PLC will communicate to the CTRIO module. The 'System Functions' that have been assigned as a result of the selections I made can be seen here. I have used the 'Bit' signals in my ladder logic to indicate when Channel 1, input terminal C, designated as V2425.2, is true for my Homing signal, and I also use the Output zero Active 'Bit', designated as V2425.8, to indicate when a move is no longer active. As a time saver, I can export the assigned functions as a Comma Separated Values file, file type 'CSV', from the 'IO Map' dialog window as I demonstrate here. Later I can import this file into my DL05 PLC ladder logic program as a part of my 'Element Documentation', and the assigned function names can be used as 'Nicknames'. I can now create the various 'Pulse Profiles' I will use for my demonstration slide. I click on the 'Pulse Profiles' button at the bottom of the CTRIO Workbench dialog window to open the 'Pulse Profile Tables'. I next click 'Add' to bring up the 'Edit Pulse Profile' window. I will need four different 'Profiles' for my demonstration. I'll start with the 'Home Search' profile. This 'Profile', when executed, will bring my axis to a known position based on the actuation of a fixed proximity sensor from a metal target that is located on the slide. I name my profile 'Home', and select 'Home Search' from the 'Profile Type' list. The 'File Number' will default to '1', being the first profile added. I use the 'Home Search Procedure' that will 'Run to Limit 1 at Frequency 1, then reverse by a Count amount at Frequency 2'. I use 7,500 Hertz for the first Frequency and 1,000 Hertz for the second Frequency. I make the Count equal to 2,000 steps, which will back the axis off of the proximity sensor by one revolution of the stepper motor, which is equivalent to 0.125 inches of travel. I assign 'Limit 1' to Channel 1C, terminal 'C' being where the proximity's sensor is connected, and I select the 'Event' to take place when the proximity sensor actuation changes to a 'High Level'. I then select 'OK' to add the 'Profile' to my profile table. Next I'll create my 'Dynamic Velocity' profile that I will use for jogging my axis. I name it 'Dynamic Vel'. The 'File Number' defaults to '2'. Later I will show how the numbers are used within the DirectSOFT5's ladder logic IBox instructions to load the profile into the PLC's CPU memory prior to executing the move profiles. The 'Dynamic Velocity' profile will be used for jogging the slide axis both to the left and to the right. The profile will be executed for as long as either the jog left or jog right push button on the C-more Micro-Graphic panel is pressed. I use 10,000 pulses per second per second for the 'Accel' and 'Decel' rates in both the 'Clockwise' and 'Counter-Clockwise' directions. I can adjust these values later to produce a slower or faster response during jogging if I desire. I click 'OK' to add this profile to my table. I now will create two different pre-determined move profiles. The first is a Trapezoid profile and will be identified as 'File Number' 3. I can control how fast the stepper motor will accelerate up to a target speed and then decelerate back to a stop position. I'll use a set time of 1,000 milliseconds to accelerate to my maximum target rate, and also use 1,000 milliseconds to decelerate to a stop. The Target 'Pos Frequency' is set for 20,000 Hertz. I'll use a 'Start' and 'End' frequency of 40 Hertz. 20 Hertz is the minimum that can be used. I use 160,000 steps for the 'Total Pulses'. With each step producing a distance of 0.0000625 inches, the final position will equal 10.00 inches of total linear travel. I have set the Trapezoid profile to be slightly aggressive in accelerating to the target speed, and decelerating to a stop so I can compare the response to the S-Curve profile which I do next. I click 'OK' and the Trapezoid profile is added to my table. The second pre-determined move profile is the S-Curve profile. It will be identified as 'File Number' 4. Like the Trapezoid profile, the 'Total Pulses' is set to equal 160,000 steps, again representing 10 inches of total travel. I use a set time of 10,000 milliseconds to accelerate and decelerate, and a maximum target 'Pos Frequency' of 25,000 Hertz. The 'Start' and 'End' frequency is set to 20 Hertz. I have left the default of 3% for the 'Min Freq Change' and 10 ms for the 'Min Entry Time'. Notice in the calculated results to the left of the plotted curve, the 'Peak Frequency' does not reach the target of 25,000 Hertz. The 'Accel' and 'Decel' times could be reduced to achieve reaching the target. The S-Curve profile is ideal in applications where we do not want the load subjected to vibrations or jarring motions. Again, I click 'OK' to add the new profile to my table. It is always a good idea to have the latest firmware loaded in the CTRIO module to take advantage of the latest enhancements and/or possible bug fixes when you begin a project. While connected to the module with the CTRIO Workbench utility, look at the module's 'OS Version' under 'Module Status'. My example is currently showing OS Version 2.1.13. To check the latest available firmware 'OS version', visit AutomationDirect's 'Firmware Upgrade' Web site page and click on the 'H0-CTRIO' part number shown in the list. You will be taken to the Host Engineering's Web site, or you can also go directly to Host's Web site. The links are listed here for your convenience. Click on 'Firmware' under Host's Support category. If there is a later OS version, download it to your PC. Once this is done, click on the 'Update Firmware' button located in the lower right corner of the 'CTRIO Workbench' dialog window. Select the firmware 'ceb' file type that was downloaded, and click the 'Open' button. My example shows updating from version 2.1.13 to version 2.1.22. In the 'Confirm Firmware Update' popup box check to make sure the 'New OS Version' is the latest, and click 'OK'. The update will take a few minutes. The CTRIO Workbench utility has the ability to backup the setting, parameter, and profile configurations that have been created. To save my configuration, I can 'Write' the configuration to a 'CWB' file format. Likewise, if I have a previous configuration saved 'CWB' file, I can 'Read' the file into the CTRIO Workbench utility, and then 'Write' it to the CTRIO module as explained next. The 'CWB' configuration file for the demonstration unit covered in this video series is available on the LEARN site. It is titled 'motion control demo -- ctrio workbench project.cwb' and includes all of the settings, parameters, and motion profiles covered in this video tutorial. After my CTRIO Workbench configuration is complete and saved, I can then 'download' the information into the CTRIO module by using the 'Write Module' button under the 'Config Operations' area located in the upper right corner of the CTRIO Workbench utility. The module does need to be in the 'Program' mode. The download starts as soon as the button is clicked, and takes a few seconds to complete. If I have a previous configuration saved in my CTRIO module, I can 'upload' the CWB file from the module by clicking on the 'Read Module' button, which is also located in the upper right corner of the CTRIO Workbench utility. And then I can do a 'Write File' to save the CWB configuration file for future use. I now have my CTRIO module fully configured and I am ready to test my settings, parameters, and move profiles. I click on the 'Goto Run!' button under the 'Utility Functions' area on the right center of the CTRIO Workbench utility. The 'Module Mode' indicator will now display 'Run' if the module has a valid configuration as seen here. Also note that the 'Monitor I/O' button located on the middle right side of the CTRIO Workbench utility will now be available, and I am ready to test my configuration! From the CTRIO Workbench utility I have the ability to monitor the module's I/O. I also can test the move profiles I created earlier. Before I start testing, let me point out that I for sure want to test my application under safe conditions! To prevent damage to my equipment, or cause possible injury to myself or someone in the vicinity, I uncouple my stepper motor from the load, keeping in mind that un-expectant results could occur. I do this before putting the CTRIO Workbench utility into the 'Monitor I/O' mode. With the CTRIO module in 'Run' mode, I click on the 'Monitor I/O' button located under the 'Utility Functions' area of the CTRIO Workbench utility. A popup warning will give me the choice to suspend reading output data from my DL05 PLC controller, preventing interference with the Monitor I/O's ability to control the CTRIO, so I select 'Yes'. I can monitor the CTRIO's inputs and outputs at this point by looking at the 'I/O Status & Input Functions' tab as seen here. I am using 'Channel 1', so 'Out 0' shows as 'Pulse Inactive', while 'Out 1' shows a 'Discrete On' condition at this time. 'Out 0' is my 'Y0' physical connection on the H0-CTRIO module that produces the step pulses, and 'Out 1' is my 'Y1' physical connection on the module that determines the stepper motor's direction. Again, please do not confuse 'Y0' and 'Y1' here with the DL05 PLC's output designations of the same name. I am using the 'C' channel as my 'Output Limit 0', so I can test it by toggling the 'Home' proximity sensor on and off by placing a piece of metal in front of the sensor's target area as seen here. From the 'Output Functions' tab shown here, I can test the various move 'Profiles' that I have created in the CTRIO Workbench utility. For example, I can execute the 'Trapezoid' pulse profile, which is file #3, by first selecting '0x10 -- Load Table' under the 'Command' pull down menu. I next enter '3' into the 'File Number' field. I click on the 'Process Command' button which turns on the 'Command Complete' bit. And then turn it off. The 'Direction' button is left as shown. I execute the move profile by clicking on the 'Enable Output' button. The 'Output Enabled' and 'Output Active' indicators are now shown as 'ON'. When the 'Trapezoid' profile is complete, the 'Output Active' indicator will turn 'OFF'. For future reference, if you look under the 'Systems Functions' tab as shown here, you'll see the ability to 'Read' from or 'Write' to the current input count, and the current output pulse count. Be aware that the current input count can be read or written only if the input is configured for Counter or Quad Counter operation. Timer values are not accessible. Also, the current output pulse count can be read or written only if the pulse output is running a 'Dynamic Velocity' or 'Dynamic Positioning' profile. The reading and writing to the CTRIO internal registers is accomplished using the DirectLOGIC 'Read from Intelligent Module' (RD) and 'Write to Intelligent module' (WT) instructions, respectively. OK, that wraps it up, for the CTRIO Workbench monitoring and testing of my configuration. I can now click the 'Done' button. A pop up message will remind me that the CTRIO module is no longer reading the PLC's output and asks me if it is OK to re-enable this function. I click 'Yes' and return to the CTRIO Workbench's dialog window. My configuration is stored in the module, so I can now 'Quit' the CTRIO Workbench utility. Join me in Part 6 as I continue with the programming by creating my ladder logic within the DirectLOGIC5 software, and make use of IBox instructions. Motion Control -- VID: L-PC-DL-STP-001-5 Part 5 of 8 -- Workbench Utility -- Configure CTRIO Module & Create Motion Profiles 0 3