0:01
Hello and welcome to today’s webinar.
0:14
In this webinar we will look at Stepper Motor Control using Horner and Ethernet IP. Let’s now look at the agenda for today.
0:23
We will start with a quick review of Ethernet IP and the Horner Ethernet IP scanner compatibility.
0:29
Then, we will have a hands-on look at the Nanotech PD6 stepper motor, and finally we will look at adding the motor to our Ethernet IP network in Seascape.
0:41
There will be demonstrations throughout, and if you have any questions or concerns, there will be a Q &A session at the end.
0:48
Ethernet IP is one of the leading industrial protocols in the United States and is widely used in a range of industries.
0:55
While most often associated with the American automation control company Rockwell-Allen-Bradley, EtherNet-IP is an open protocol based on a much older protocol named ODVA.
1:08
There are two common device types with EtherNet-IP, the I.O.
1:12
scanner, which is the PLC that controls the network, and the I.O.
1:16
adapters, which include any automation devices controlled over the network.
1:20
Watt Horner controllers support Ethernet IP scanner functionality.
1:25
This functionality comes standard in the Canvas series controllers and the CPU 300.
1:31
It simply requires Cscape version 10.2 Service Pack 2 or later with an extension code required for Service Pack 2 specifically.
1:41
This extension code is available through tech support.
1:44
Your controllers also require firmware version 17.4 or later for this to work correctly.
1:51
In the XL Prime series this comes as a licensed feature.
1:55
For a one time upgrade fee you can add this functionality to any XL Prime controller.
2:02
You will also require Cscape 10 service pack 3 or later and any XL Prime controller you will require firmware version 17.5 or later.
2:15
Next, for today’s demonstration, we’ll be using the Nanotech integrated stepper motor.
2:20
This is an integrated I.O. adapter, available in four different sizes to suit many different machine setups.
2:27
It features position, speed, and torque controls, along with support for a wide range of connection methods, including CANOPEN, EtherCAT, and of course Ethernet IP.
2:38
the Nanotech integrated stepper motor, comes with a software called Plugin Drive Studio, which we will be using when setting up Ethernet IP. This is specific to this Nanotech motor.
2:51
However, for most applications, using an EDS file in Cscape is just as easy.
2:57
This Nanotech stepper motor has a very simple interface with Ethernet IP.
3:04
It features a 128 byte input and 128 byte output.
3:08
The plug-and-drive software also allows the EIP parameter map to be modified if needed, but for most applications the default map will be sufficient.
3:18
Here we have the data maps for both the input and output of this motor.
3:23
This may look a bit intimidating because all the addresses are listed in hex codes.
3:28
This is specific to nanotech motors and may look different depending on what motor you decide to use.
3:35
Despite the initial appearance, the key points on these data maps are the first three or four entries at the top.
3:42
First, we have three values that we need to write to the motor to get it to run, and then four values coming back to our controller to monitor what exactly our motor is doing.
3:52
With that covered, we are now going to show you how to set up Ethernet IP for your motor using Cscape 10.
4:00
Here we are in Cscape 10.
4:02
To add our motor to our network, we start by navigating to Hardware Configuration at the top.
4:08
In this menu, we will select LAN 1.
4:11
This could also be LAN 2 depending on how you have your network set up.
4:15
Then under Resigent Protocols, we can see that Ethernet IP Scanner functionality has been enabled.
4:22
But before we can add any devices to the network, we have to ensure that we have assigned a Disable and EIP Status variable.
4:30
These should be created and assigned during initial setup of your Ethernet IP network, as without them you will lose some key functionality from your network.
4:41
With those variables assigned and verified, we can then right-click on the Ethernet IP Scanner option from our list and click Add Adapter.
4:52
For the sake of this demonstration, we have already gone ahead and added our stepper motor, but we will walk you through everything you need to fill out when adding a device of your own.
5:01
Firstly, you must give the adapter a name.
5:04
In this case, we’ve chosen STP Motor.
5:08
Then we assign its IP address.
5:10
If you have an EDS file from the manufacturer, you can click this button and navigate to the file’s location on your computer.
5:18
This is very useful as it will automatically fill out most of the necessary information for your device.
5:24
However, if you don’t have an EDS file, you can instead set up your device manually.
5:30
Next, for connection timeout, we can type in either a raw value, for instance 100ms or 500ms, or you can assign a variable like we have done here.
5:42
This gives you more control over the device, but for most applications, a raw value should work just fine.
5:48
Finally, you need to assign a disable and status variable for this device.
5:53
The disable variable is used to disable this specific device on the network, and the status variable will return information about the device to the scanner.
6:04
Once this basic setup has been completed, we now need to assign and configure the input and output assemblies for our stepper motor.
6:13
Navigate to the input tab at the top, and here we have some fields that need to be filled out for your input assemblies.
6:20
If we had an EDS file, this would all be filled in automatically, but for this demonstration we are going to do this manually. For input instance, we will enter a value of 100.
6:33
This value is specific to each stepper motor and can normally be found in the documentation.
6:39
Next, our motor features a total of 128 bytes for the input assemblies.
6:45
We have chosen to use integers instead of bytes, as Horner controllers provide far more options when working with integers compared to bytes.
6:55
But depending on your motor, it might be easier to use bytes or a different data type entirely. This is perfectly fine as well.
7:04
Just select your preferred data type and the appropriate length from the drop-down menu and field provided.
7:10
Since we have chosen to go with integers, we will fill in a length of 64.
7:15
Next, we need to assign an RPI in milliseconds. This controls how often data gets sent from the motor.
7:23
We have chosen 50 milliseconds, which should be fairly standard.
7:27
Finally, we assign a local variable, in this case a variable array, where the 64 words of data will be stored on our controller.
7:36
With that complete, we can now start on the output assembly.
7:38
First, we have an output instance of 101, which, once again, is specific to our motor, but can usually be found in the documentation.
7:48
We have chosen to use integers as our data type, so our data length is 64, and we have also given our output assembly an RPI of 50 milliseconds.
7:58
Finally, we created and assigned an integer array variable that will store data going from our controller to the motor.
8:05
And that is all the configuration needed to set up and connect our stepper motor to our Ethernet IP network inside Cscape.
8:16
For the next portion of our webinar, we are going to look at how to set up your logic and control your motor in Cscape.
8:23
Here we have the EIP parameter map for our motor, and highlighted at the top of each list are the variables we are going to use to command our motor.
8:34
Whether it’s a velocity move, or position move, or anything else, we are going to utilize the four variables on the right.
8:42
To issue commands, we set the PDI command variable to certain values.
8:47
Then, after a command is selected, we use the other three variables to store specific information about the command we are issuing.
8:55
In the documentation for your motor, it should specify where the key values for each type of command should be stored.
9:03
Then, on the input side, there are three key values to be aware of.
9:07
There is the PDI status variable, which returns important information about the current status of our motor, the error code variable, which will flag any errors that might occur at execution or runtime, and the PDI return variable.
9:22
This is a 32-bit variable that changes its meaning depending on what you’re doing with your motor.
9:28
If you execute a velocity move, for instance, then it will return your current speed.
9:33
If you were to execute an absolute position move, then it would return your current position, and so on.
9:40
In the documentation for your motor, it will tell you what you can expect to be returned by this variable, depending on what operation you choose to perform.
9:49
Here we have an example of some PDI commands for our motor.
9:53
This will look different depending on what motor you are using.
9:55
You can see there’s a lot of possible commands to choose from.
9:59
To showcase an example workflow let’s say we wanted to perform a profile velocity command.
10:05
To do this we first need to tell the motor the target speed that we are trying to achieve.
10:10
So we will write our target speed in pdi set value 1 for the profile velocity command.
10:16
Then we set the pdi command variable to a value of 23 which as we can see from our table the value for a profile velocity command.
10:26
Once that’s set our command should be ready to issue without any trouble but we can monitor for this with our PDI status variable.
10:34
If everything is successful we should see the target speed returned to us in the PDI return variable.
10:40
If we wanted to repeat this we could utilize the toggle command a bit.
10:44
Now we are going to show you some of the variables and logic we have written in Cscape to control our motor.
10:53
Here we are in Cscape, with the Program Variables window open at the bottom.
10:58
We are going to show you some of the variables we are using for the control of our motor.
11:04
First at the top, we have two variables we created during the Ethernet IP setup.
11:10
These are the two integer arrays coming from and going to our motor.
11:15
You may notice that we have manually mapped these variables to internal memory space, which is unusual because we are programming in variable-based advanced ladder, so this process should be done in the background automatically by Cscape.
11:29
This is a good example of the niche cases in variable-based advanced ladder where manual register mapping is preferred.
11:37
In this case, both the input and output arrays are big banks of data, 64 words long each.
11:45
We could work with these arrays as is, but it would be easier if we could separate out each word within those arrays so we can reference what we need much more efficiently.
11:54
Down here we can see some examples.
11:57
The first word coming into our controller is PDI status, and we have mapped it to the first location where our big bank of data comes in, so it will automatically be populated with the correct information.
12:09
This happens to be an integer value with meaningful bits within it.
12:13
So, we have also created corresponding bit type variables that map to the appropriate bit within the data stream.
12:20
This gives us meaningful variables to deal with, like fault status, or operation status, or so on.
12:28
And we have done this for every word in the array.
12:31
So the next word is an error code, which is an integer variable, and then the third word is PDI return, which is a double integer, and so on and so forth.
12:40
Next, we are going to show you some of the ladder logic we created for controlling our motor using the same variables we just showed you.
12:48
This is just a small bit of logic that sets the correct parameters for different moves that we are going to make.
12:54
For example, the first one here is an absolute move and before we can execute an absolute move, we need to make sure that our actual position and target position aren’t already the same.
13:06
And then we need to make sure that the velocity for the move is greater than zero.
13:10
It’s simple logic, but it’s important nonetheless.
13:13
Let’s move to the bench and demonstrate this in action at runtime.
13:18
Here we are on the bench.
13:19
This is a basic screen we created for this demonstration to show you how to perform an absolute move.
13:25
Here, we can type in values into each of our three variables and then receive feedback on our move from all the lights down the bottom.
13:34
The command value for an absolute move, as per our motors documentation, is 20.
13:41
But before we can type that value in here, we first need to set some parameter values.
13:45
First, our target position, which goes into the Set Value 1 box.
13:50
For this demonstration, we are going to set a target position of 100 ,000 steps.
13:55
Then we need our target velocity, which we can type into the Set Value 2 box.
14:01
For this demonstration, we are going to go with 300 RPM.
14:05
So with these added, we can now change our PDI command to 20, which should start an absolute move and then our command should immediately execute.
14:15
After this occurs, we are going to watch these lights here for any errors that might occur, as well as the PDI status and return boxes for the returning data.
14:26
So, when we type in 20, we can see our motor starts spinning.
14:31
Very quickly, back on our screen, we can see our operation is enabled, and now we are finished our move.
14:38
As we can see, our PDI return variable returned to the current position, which is now 100 ,000 steps.
14:44
This is what we had hoped to see.
14:46
We have successfully set up and configured our motor in Cscape, and we have seen it working correctly at runtime.
14:53
That concludes our webinar for today.
14:55
Thank you so much for listening and the Q &A session will begin shortly.