Difference between revisions of "Single Axis Setup in EtherCAT/CANopen Network"

From SoftMC-Wiki
Jump to: navigation, search
((3) Create a folder for the ControlStudio machine application)
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Languages}}
+
<div id="BackToTop"  class="noprint" style="background-color:; position:fixed; bottom:32px; left:95%; z-index:9999; padding:0; margin:0;">
 +
<span style="color:blue; font-size:8pt; font-face:verdana,sans-serif; border:0.2em outset:#ceebf7; padding:0.1em; font-weight:bolder; -moz-border-radius:8px; ">
 +
[[Image:TOP2.png|50px|link=#top]] </span></div>
 +
{{Languages|Single_Axis_Setup_in_EtherCAT}}
 
= Introduction =
 
= Introduction =
 
'''Note''': Only essential background information is included in this training manual. For downloads and more information about the softMC hardware and software systems, use the resources available on the Servotronix website.  
 
'''Note''': Only essential background information is included in this training manual. For downloads and more information about the softMC hardware and software systems, use the resources available on the Servotronix website.  
Line 11: Line 14:
 
= Procedures =
 
= Procedures =
  
== (1) Install and activate ControlStudio ==
+
== Step 1: Install and activate ControlStudio ==
 
'''Windows'''
 
'''Windows'''
  
Line 20: Line 23:
 
<br/>
 
<br/>
  
== (2) Install device parameter (library) file on PC ==
+
== Step 2: Install device parameter (library) file on PC ==
 
'''ControlStudio Offline'''
 
'''ControlStudio Offline'''
  
Line 64: Line 67:
 
<br/>
 
<br/>
  
==(6) Create a Configurator project.==
+
==Step 6: Create a Configurator project.==
 
'''Configurator online'''
 
'''Configurator online'''
  
(6A) Open Configurator.
+
# Open Configurator. <br> Access through: '''Tools''' > '''softMC Configurator'''  <br> If using '''CANopen''' network, the Configurator online screen will look like this: <br/> [[File:configurator-172a.png|600px]] <br/> If using '''EtherCAT''' network, the Configurator online screen will look like this: <br/> [[File:configurator-172b.png|600px]] <br/> If using EtherCAT network, select the option:''' Use CODESYS''' <br/>
:Access through: '''Tools''' > '''softMC Configurator'''   
+
# '''Optional''': In the MC Name field, enter a name for the softMC; e.g., '''DEMO_EX''' <br/>
 
+
# Create a''' Configurator project  '''(called '''EX01''') by saving a file to the softMC folder created previously (Step 3). <br/> [[File:configurator-16.png|200px]] <br/> [[File:configurator-157.png|400px]] <br/>
:If using '''CANopen''' network, the Configurator online screen will look like this:
+
# In ControlStudio (online), go to the''' File Manager '''pane at the bottom of the screen. <br> Select folder EX01 in the left pane, and look at the middle pane. <br> If files do not appear, right-click in the middle pane > '''Refresh List''' <br> You will see a file named '''EX01.mcfg '''= Configurator project file <br/> [[File:configurator-158.png|400px]]
<br/>
 
::[[File:configurator-172a.png|600px]]
 
<br/>
 
 
 
 
 
 
 
:If using '''EtherCAT''' network, the Configurator online screen will look like this:
 
<br/>
 
::[[File:configurator-172b.png|600px]]
 
<br/>
 
 
 
 
 
 
 
:If using EtherCAT network, select the option:''' Use CODESYS'''
 
 
 
 
 
<br/>
 
(6B) '''Optional''': In the MC Name field, enter a name for the softMC; e.g., '''DEMO_EX'''
 
 
 
 
 
<br/>
 
(6C) Create a''' Configurator project  '''(called '''EX01''') by saving a file to the softMC folder created previously (Step 3).
 
<br/>
 
::[[File:configurator-16.png|200px]]
 
<br/>
 
::[[File:configurator-157.png|400px]]
 
 
 
<br/>
 
(6D) In ControlStudio (online), go to the''' File Manager '''pane at the bottom of the screen.
 
:Select folder EX01 in the left pane, and look at the middle pane.
 
:If files do not appear, right-click in the middle pane > '''Refresh List'''
 
:You will see a file named '''EX01.mcfg '''= Configurator project file
 
 
 
<br/>
 
::[[File:configurator-158.png|400px]]
 
 
<br/>
 
<br/>
 
<br/>
 
<br/>
  
==(7) Define axis A1 configuration settings ==
+
==Step 7: Define axis A1 configuration settings ==
 
'''Configurator online'''
 
'''Configurator online'''
  
(7A) Define Axis A1.
+
# Define Axis A1. <br> ''If using EtherCAT devices/drives, they will automatically be detected and displayed. Skip to Step 7.3. <br> [[File:configurator-159a.png|300px]] <br/> If using '''CANopen''' devices/drives, right-click on '''CANopen''' in the navigation pane. <br> Select '''New Device.''' <br> [[File:configurator-159b.png|300px]] <br/>
:''If using EtherCAT devices/drives, they will automatically be detected and displayed. Skip to Step 7C.
+
# If using CANopen devices/drives, select '''Servotronix''' > '''stepIM''' or '''CDHD'''. <br> Click '''OK'''. <br> [[File:configurator-130.png|300px]] <br/> <br/>
:::[[File:configurator-159a.png|300px]]
+
# Depending on the selected device, stepIM or CDHD now appears in the Buses section of the navigation pane. <br> Select a drive ('''stepIM''' or '''CDHD'''). Selected device is displayed in blue text. <br> Enter settings as shown below. <br> Initial Active OpMode = '''8-Cyclic synchronous position''' <br> Physical Address = '''1''' <br> Click '''Apply'''. <br> Link Drive to Axis''' = A1'''. <br> Click the '''Link''' arrow. <br> [[File:configurator-131.png|600px]] <br/> '''Note''': For proper operation, Initial Active OpMode must be set to '''8-Cyclic synchronous position''' <br/>
<br/>
+
# Configurator displays the''' Axis:A1 '''screen. <br> The screen has four tabs: General, Properties, Movement and Graph. <br> In the '''General '''tab, enter settings as shown below. <br> Axis Type = '''Rotary Gear''' <br> Length Units = '''Degrees''' (default) <br> Gear Ratio =''' 1.0''' <br> [[File:configurator-160a.png|600px]] <br/> '''Note''': A gear ratio value is usually in the range 10—160. <br> When using a Servotronix Demo Kit, Gear Ratio value = 1. <br/>
 
+
# '''Guidelines''' <br> Most robotic applications are programmed in units of '''degree/second''', that is, 360 deg = 1 revolution. Therefore: <br> 6 deg/sec = 1 rpm <br> 120 deg/sec = 20 rpm <br> 360 deg/sec = 60 rpm <br> The instructions in this document use the following calculations and values, which are typical for a brushless DC motor: <br> [[File:configurator-guidelines.png|500px]] <br/> Use the same value for both acceleration and deceleration. However, if the Load to Motor Inertia Ratio ratio is less than 10 (optimal LMJR value), a higher acceleration can be used. <br/>
:If using '''CANopen''' devices/drives, right-click on '''CANopen''' in the navigation pane.  
+
# In the '''Properties '''tab, click on the '''Limits''' bar to access Limit parameters. <br> Change the values of the following parameters: <br> Position Error Max = '''10'''  <br> Velocity Max = '''30000''' <br> Acceleration Max = '''900000''' <br> Deceleration Max = '''900000''' <br> Jerk Max = '''2700000''' <br> After typing in a value, be sure to press '''Enter'''. <br> [[File:configurator-161.png|500px]] <br/>
:Select '''New Device.'''
+
# '''Save '''Configurator project ''' '''('''EX01.mcfg''')
:::[[File:configurator-159b.png|300px]]
 
<br/>
 
 
 
 
 
(7B) If using CANopen devices/drives, select '''Servotronix''' > '''stepIM''' or '''CDHD'''.
 
:Click '''OK'''.
 
:::[[File:configurator-130.png|300px]]
 
<br/>
 
 
 
<br/>
 
(7C) Depending on the selected device, stepIM or CDHD now appears in the Buses section of the navigation pane.  
 
:Select a drive ('''stepIM''' or '''CDHD'''). Selected device is displayed in blue text.
 
:Enter settings as shown below.
 
:Initial Active OpMode = '''8-Cyclic synchronous position'''
 
:Physical Address = '''1'''
 
:Click '''Apply'''.
 
 
 
:Link Drive to Axis''' = A1'''.  
 
:Click the '''Link''' arrow.
 
  
:::[[File:configurator-131.png|600px]]
 
 
<br/>
 
<br/>
  
:'''Note''': For proper operation, Initial Active OpMode must be set to '''8-Cyclic synchronous position'''
+
==Step 8: Define axis A2 configuration settings==
 
 
<br/>
 
(7D) Configurator displays the''' Axis:A1 '''screen.
 
:The screen has four tabs: General, Properties, Movement and Graph.
 
 
 
:In the '''General '''tab, enter settings as shown below.
 
::Axis Type = '''Rotary Gear'''
 
::Length Units = '''Degrees''' (default)
 
::Gear Ratio =''' 1.0'''
 
 
 
:::[[File:configurator-160a.png|600px]]
 
<br/>
 
 
 
'''Note''': A gear ratio value is usually in the range 10—160.
 
When using a Servotronix Demo Kit, Gear Ratio value = 1.
 
 
 
<br/>
 
(7E) '''Guidelines'''
 
Most robotic applications are programmed in units of '''degree/second''', that is, 360 deg = 1 revolution. Therefore:
 
:6 deg/sec = 1 rpm
 
:120 deg/sec = 20 rpm
 
:360 deg/sec = 60 rpm
 
:The instructions in this document use the following calculations and values, which are typical for a brushless DC motor:
 
 
 
:::[[File:configurator-guidelines.png|500px]]
 
<br/>
 
 
 
:Use the same value for both acceleration and deceleration. However, if the Load to Motor Inertia Ratio ratio is less than 10 (optimal LMJR value), a higher acceleration can be used.
 
 
 
<br/>
 
(7F) In the '''Properties '''tab, click on the '''Limits''' bar to access Limit parameters.
 
:Change the values of the following parameters:
 
::Position Error Max = '''10''' 
 
::Velocity Max = '''30000'''
 
::Acceleration Max = '''900000'''
 
::Deceleration Max = '''900000'''
 
::Jerk Max = '''2700000'''
 
:After typing in a value, be sure to press '''Enter'''.
 
 
 
:::[[File:configurator-161.png|500px]]
 
<br/>
 
 
 
 
 
(7G) '''Save '''Configurator project ''' '''('''EX01.mcfg''')
 
 
 
<br/>
 
 
 
==(8) Define axis A2 configuration settings==
 
 
'''Configurator online'''
 
'''Configurator online'''
  
(8A) Define the parameters for '''Axis A2''' by repeating the steps in Step '''7'''.
+
# Define the parameters for '''Axis A2''' by repeating the steps in Step '''7'''. <br> [[File:configurator-136.png|600px]] <br/>
:::[[File:configurator-136.png|600px]]
+
# Save''' Configurator project  '''('''EX01.mcfg''')
<br/>
 
 
 
(8B) Save''' Configurator project  '''('''EX01.mcfg''')
 
  
 
<br/>
 
<br/>
  
==(9) Compile project files and send configuration to the softMC==
+
==Step 9: Compile project files and send configuration to the softMC==
 
'''Configurator online'''
 
'''Configurator online'''
  
(9A) In the Configurator menu bar, click the '''Build & Run''' button.
+
# In the Configurator menu bar, click the '''Build & Run''' button. <br> [[File:configurator-buildrun.png|100px]] <br/>
:[[File:configurator-buildrun.png|100px]]
+
# The Configurator generates files on the PC and sends them to the softMC. <br> When complete, click '''Close.''' <br> [[File:configurator-163.png|300px]] <br/>
<br/>
+
# Save''' Configurator project  '''('''EX01''') <br/>  <br/>
 +
# '''ControlStudio online''' <br> '''Note: '''Configurator generates a ControlStudio project file called''' EX01.APJ''' file. <br/>Configurator generates a folder called  '''''EXO1_''Files''' <br> In ControlStudio, go to the''' File Manager '''pane at the bottom of the screen. <br> Select folder '''EX01''' in the left pane, and look at the middle pane. <br> If files do not appear, right-click in the middle pane > '''Refresh List'''  <br> '''Note''': Files in the right pane reside in the softMC. ''Do not click on these files, or attempt to manipulate them.'' <br> If using an EtherCAT network and devices and '''Use CODESYS''' option was selected, the ''EX01_'''''Files''' folder will contain an additional file called '''softmc.devdesc.xml'''
  
(9B) The Configurator generates files on the PC and sends them to the softMC.
 
:When complete, click '''Close.'''
 
:[[File:configurator-163.png|300px]]
 
 
<br/>
 
<br/>
  
(9C) Save''' Configurator project  '''('''EX01''')
+
==Step 10Verify the configuration by moving the axes==
<br/>
 
<br/>
 
(9D) '''ControlStudio online'''
 
 
 
:'''Note: '''Configurator generates a ControlStudio project file called''' EX01.APJ''' file. <br/>Configurator generates a folder called  '''''EXO1_''Files'''
 
 
 
:In ControlStudio, go to the''' File Manager '''pane at the bottom of the screen.
 
:Select folder '''EX01''' in the left pane, and look at the middle pane.
 
:If files do not appear, right-click in the middle pane > '''Refresh List'''
 
 
 
:'''Note''': Files in the right pane reside in the softMC. ''Do not click on these files, or attempt to manipulate them.''
 
 
 
:If using an EtherCAT network and devices and '''Use CODESYS''' option was selected, the ''EX01_'''''Files''' folder will contain an additional file called '''softmc.devdesc.xml'''
 
 
 
<br/>
 
 
 
==(10) Verify the configuration by moving the axes==
 
 
'''Configurator online'''
 
'''Configurator online'''
  
(10A) Select Axis '''A1''', and open the '''Movement''' tab.<br/>
+
# Select Axis '''A1''', and open the '''Movement''' tab.<br/> [[File:configurator-141a.png|500px]] <br/>
 
+
# Refer to the units of motion table in''' Step 7'''.<br/> Change the values of the following parameters: <br> Set Target = '''360''' (1 revolution) <br> Set Velocity = '''120''' <br> Set Acceleration and Deceleration = '''720000''' <br> Set Jerk = '''2160000''' <br> Make sure '''Absolute''' option is not selected. <br> Move the switch to '''Enabled'''. <br> Click the '''Run''' button. <br> Watch motor 1 load disk – it will rotate once. <br/> :[[File:configurator-142.png|400px]] <br/> Enable the '''Absolute''' option. <br> Set Target to '''0'''. <br> Click '''Run'''. <br> When motor stops, note the '''Actual Position'''. It will show '''0.000''' <br/>  
:[[File:configurator-141a.png|500px]]
+
# Select Axis '''A2''', and in the '''Movement''' tab, and enter the same settings as above. <br> Click the '''Run''' button. <br> Watch motor 2 load disk – it will rotate once. <br>  Enable the '''Round Trip''' option. <br> Click '''Run'''. <br> Watch motor 2 load disk – it will rotate once in each direction. <br/>
<br/>
+
# Disable both axes. <br/>
 
+
# Save the Configurator project.
(10B) Refer to the units of motion table in''' Step 7'''.<br/>  
 
 
 
: Change the values of the following parameters:
 
::Set Target = '''360''' (1 revolution)
 
::Set Velocity = '''120'''  
 
::Set Acceleration and Deceleration = '''720000'''
 
::Set Jerk = '''2160000'''
 
::Make sure '''Absolute''' option is not selected.
 
:Move the switch to '''Enabled'''.
 
:Click the '''Run''' button.
 
:Watch motor 1 load disk – it will rotate once.<br/>
 
 
 
:[[File:configurator-142.png|400px]]
 
<br/>
 
 
 
 
 
:Enable the '''Absolute''' option.
 
:Set Target to '''0'''.
 
:Click '''Run'''.
 
:When motor stops, note the '''Actual Position'''. It will show '''0.000'''
 
 
 
<br/>
 
(10C) Select Axis '''A2''', and in the '''Movement''' tab, and enter the same settings as above.
 
:Click the '''Run''' button.
 
:Watch motor 2 load disk – it will rotate once.
 
: Enable the '''Round Trip''' option.
 
:Click '''Run'''.
 
:Watch motor 2 load disk – it will rotate once in each direction.
 
 
 
<br/>
 
(10D) Disable both axes.
 
 
 
<br/>
 
(10E) Save the Configurator project.
 
  
 
<br/>
 
<br/>
  
==(11) Record a motion==
+
==Step 11Record a motion==
 
'''Configurator online'''
 
'''Configurator online'''
  
(11A)
+
# Select Axis '''A1''', and open the '''Movement''' tab. <br/>
Select Axis '''A1''', and open the '''Movement''' tab.
+
# Change the values of the following parameters: <br> Target =  '''360''' (1 revolution) <br> Velocity = '''360''' (60 rpm) <br> Acc/Dec = '''720000''' deg/sec <br> Jerk = '''2160000''' deg/sec <br> Clear the '''Absolute''' option. <br> Clear the '''Round Trip''' option. <br> Enable the option '''Display Graph After Recording''' <br> Select Variables: ''' VCMD'''  and '''VFB'''. <br> Clear all other variables. <br> Make sure drive is '''Enabled'''. <br> Click '''Record &Move''' button <br/> [[File:configurator-144.png|400px]] <br/>
 +
# In a few moments, the recorded plot appears in the '''Graph''' tab. <br/> [[File:configurator-175.png|300px]] <br/> '''Note''': The recorded plot is saved in a A1.rec (A2.rec) file in a temp folder. The last recording always overwrites the previous recording. <br/> The Configurator recording function is only intended to provide initial confirmation of the axis configuration. For complete testing and adjustment, use the Recording function within ControlStudio. <br/>
 +
# In the Movement tab, disable the axes <br/>
 +
# Save the Configurator project. <br> Exit Configurator
  
 
<br/>
 
<br/>
(11B) Change the values of the following parameters:
 
::Target =  '''360''' (1 revolution)
 
::Velocity = '''360''' (60 rpm)
 
::Acc/Dec = '''720000''' deg/sec
 
::Jerk = '''2160000''' deg/sec
 
::Clear the '''Absolute''' option.
 
::Clear the '''Round Trip''' option.
 
  
::Enable the option '''Display Graph After Recording'''
+
==step 12: Work with softMC controller via Terminal==
::Select Variables: ''' VCMD'''  and '''VFB'''.
 
::Clear all other variables.
 
::Make sure drive is '''Enabled'''.
 
::Click '''Record &Move''' button<br/>
 
 
 
:[[File:configurator-144.png|400px]]
 
<br/>
 
 
 
 
 
(11C) In a few moments, the recorded plot appears in the '''Graph''' tab.<br/>
 
 
 
:[[File:configurator-175.png|300px]]
 
<br/>
 
 
 
:'''Note''': The recorded plot is saved in a A1.rec (A2.rec) file in a temp folder. The last recording always overwrites the previous recording. <br/>The Configurator recording function is only intended to provide initial confirmation of the axis configuration. For complete testing and adjustment, use the Recording function within ControlStudio.
 
 
 
<br/>
 
(11D) In the Movement tab, disable the axes
 
 
 
<br/>
 
(11E) Save the Configurator project.
 
:Exit Configurator
 
 
 
<br/>
 
 
 
==(12) Work with softMC controller via Terminal==
 
 
'''ControlStudio online'''
 
'''ControlStudio online'''
(12A) If softMC has been power cycled, this step is required. Otherwise, skip to Step12C.''
 
In the Terminal pane, enter the command '''reset all'''
 
 
: '''Note: '''The command '''reset all''' does the following:
 
::Removes all system variables and tasks from controller RAM.
 
::Removes all files from controller RAM .
 
::Runs the CONFIG.PRG task
 
 
<br/>
 
(12B) ''If softMC has been power cycled, this step is required. Otherwise, skip to Step12C.''
 
:In the Terminal pane, enter the command  '''load startprg.prg'''
 
 
:'''Note: '''The command '''load startprg.prg '''loads all configuration data from controller Flash (non-volatile) memory to RAM. Data remains in Flash memory.
 
 
:Look at the messages in the Message Log pane.
 
:The system is now ready to receive commands.
 
 
<br/>
 
(12C) In the Terminal pane, enable the axes.
 
::Enable axis 1: 
 
::-->'''a1.en=1'''
 
::Enable axis 2: 
 
::-->'''a2.en=1'''
 
 
:Gently grasp the motor load disk and try to move them. Strong resistance indicates the motor is enabled.
 
 
<br/>
 
(12D) '''Note''':  The '''Move''' executes a point-to-point move from the current position to the target position of a single axis or a group of axes.
 
:'''Note''': Use''' F3''' as a shorcut to repeat last command entered
 
 
:In the Terminal pane, execute '''Move''' commands, and observe the response of the motors.
 
:Move A1 and A2 to absolute position PFB 0:
 
::-->'''move a1 0 abs=1'''
 
::-->'''move a2 0 abs=1'''
 
:Move A1 and A2 to absolute position PFB 3600 (10 revolutions from 0):
 
::-->'''move a1 3600 abs=1'''
 
::-->'''move a2 3600 abs=1'''
 
:Move A1 one revolution counterclockwise:
 
::-->'''move a1 -360 abs=0'''
 
:Move A2 two revolution clockwise:
 
::-->'''move a2 720'''
 
:Move A1 and A2 to absolute position PFB 7200 at different speeds:
 
::-->'''move a1 7200 abs=1 vcruise=720'''
 
::-->'''move a2 7200 abs=1 vcruise=240'''
 
  
<br/>
+
# If softMC has been power cycled, this step is required. Otherwise, skip to Step 12.3.<br> In the Terminal pane, enter the command '''reset all''' <br> '''Note: '''The command '''reset all''' does the following:
(12E) '''Note''': '''Jog''' moves the axis at a constant velocity.  
+
## Removes all system variables and tasks from controller RAM.
:Use the '''Stop''' command to stop a Jog motion.
+
## Removes all files from controller RAM .
:In the Terminal pane, execute '''Jog''' commands, and observe the response of the motors:
+
## Runs the CONFIG.PRG task <br/>
::-->'''jog a1 720'''
+
# If softMC has been power cycled, this step is required. Otherwise, skip to Step 12.3. <br/> In the Terminal pane, enter the command  '''load startprg.prg''' <br/> '''Note: '''The command '''load startprg.prg '''loads all configuration data from controller Flash (non-volatile) memory to RAM. Data remains in Flash memory. <br/> Look at the messages in the Message Log pane. <br/> The system is now ready to receive commands. <br/>
::-->'''jog a2 240'''
+
# In the Terminal pane, enable the axes. <br/>
:Allow both motors to run simultaneously.
+
## Enable axis 1: '''a1.en=1''' <br/>
:Then stop the motion:
+
## Enable axis 2: '''a2.en=1''' <br>Gently grasp the motor load disk and try to move them. Strong resistance indicates the motor is enabled. <br/>
::-->'''stop a1'''
+
# '''Note''':  The '''Move''' executes a point-to-point move from the current position to the target position of a single axis or a group of axes. <br> '''Note''': Use''' F3''' as a shorcut to repeat last command entered <br> In the Terminal pane, execute '''Move''' commands, and observe the response of the motors. <br>•  Move A1 and A2 to absolute position PFB 0: <br> →'''move a1 0 abs=1''' <br> →'''move a2 0 abs=1''' <br>•  Move A1 and A2 to absolute position PFB 3600 (10 revolutions from 0): <br> →'''move a1 3600 abs=1''' <br> →'''move a2 3600 abs=1''' <br>•  Move A1 one revolution counterclockwise: <br> →'''move a1 -360 abs=0''' <br>•  Move A2 two revolution clockwise: <br> →'''move a2 720''' <br>•  Move A1 and A2 to absolute position PFB 7200 at different speeds: <br> →'''move a1 7200 abs=1 vcruise=720''' <br> →'''move a2 7200 abs=1 vcruise=240'''<br/>
::-->'''stop a2'''
+
# '''Note''': '''Jog''' moves the axis at a constant velocity. <br> Use the '''Stop''' command to stop a Jog motion. <br> In the Terminal pane, execute '''Jog''' commands, and observe the response of the motors: <br> '''jog a1 720''' <br> '''jog a2 240''' <br> Allow both motors to run simultaneously. <br> Then stop the motion: <br> '''stop a1''' <br> '''stop a2''' <br> Disable the axes.
:Disable the axes:
 
  
 
<br/>
 
<br/>
  
==(13) Write and run a program==
+
==step 13: Write and run a program==
 
'''ControlStudio online'''
 
'''ControlStudio online'''
  
(13A) To begin writing a program for your motion application:
+
# To begin writing a program for your motion application: <br> In ControlStudio, select: '''File''' '''New''' '''File'''<br/> [[File:configurator-176.png|200px]]<br/> <br/>
In ControlStudio, select: '''File''' > '''New''' > '''File'''<br/>
+
# In the '''New''' dialog box, do the following: <br> Select '''Motion Controller Program File'''. <br> Enter a name for your program (e.g., ''MYPROG1'''). <br> '''Note''': A program name cannot exceed 8 characters. <br> Browse to and select the path/folder containing your application files (e.g., '''EX01''') <br/> [[File:configurator-177.png|300px]] <br/>   <br/>
::[[File:configurator-176.png|200px]]<br/>
+
# The '''Program Editor''' pane opens in ControlStudio. <br> The pane has a tab for the new program, containing a blank program template.<br/> [[File:configurator-178.png|400px]] <br/>   <br/>
<br/>
+
# Insert the cursor in the line below '''program'''. <br> Enter the following program lines: <br> '''program''' <br> attach a1 <br> attach a2 <br> a1.En=1 <br> a2.En =1 <br> move a1 720 abs=1 vcruise= 360 <br> move a2 1440 abs=1 vcruise= 360 <br> delay a1 1000 <br> delay a2 1000 <br> move a1 0 abs=1 <br> cruise=360 <br> move a2 0 abs=1 vcruise= 360 <br> delay a1 10 <br> delay a2 10 <br> a1.En=0 <br> a2.En=0 <br> detach a1 <br> detach a2 <br> Print "End of MYPROG1" <br> '''end program''' <br/>
 
+
# Save the program: File > '''Save''' <br> Alternately, click the '''Save''' button on the toolbar. <br> Check the File Manager pane at the bottom of the screen. Refresh if necessary. <br> You now see the program in the application folder.<br/> [[File:configurator-180.png|500px]]<br/>   <br/>
(13B) In the '''New''' dialog box, do the following:
+
# Send program MYPROG1 to the controller. <br> Click the '''Save and Load''' button in the ControlStudio menu bar.<br/> [[File:configurator-181.png|300px]]<br/> <br/>
:Select '''Motion Controller Program File'''.
+
# Run the program. <br> Click the '''Continue Task''' button in the ControlStudio menu bar.<br/> [[File:configurator-182.png|200px]]<br/> <br/> Observe the motion of the two motors. <br> When motion stops, note the message in the '''Message Log''' pane:<br/> [[File:configurator-184.png|200px]]<br/> <br/>
:Enter a name for your program (e.g., '''MYPROG1''').  
+
# Run the program one line at a time. <br> Click the '''Step by Step''' button in the ControlStudio menu bar.<br/> [[File:configurator-183.png|150px]] <br/> Continue clicking and observing the motion of the two motors.
:'''Note''': A program name cannot exceed 8 characters.
 
:Browse to and select the path/folder containing your application files (e.g., '''EX01''')<br/>
 
::[[File:configurator-177.png|300px]]<br/>
 
<br/>
 
 
 
(13C) The '''Program Editor''' pane opens in ControlStudio.
 
:The pane has a tab for the new program, containing a blank program template.<br/>
 
::[[File:configurator-178.png|400px]]<br/>
 
<br/>
 
 
 
(13D) Insert the cursor in the line below '''program'''.
 
:Enter the following program lines:
 
::'''program'''
 
::attach a1
 
::attach a2
 
::a1.En=1  
 
::a2.En =1
 
::move a1 720 abs=1 vcruise= 360
 
::move a2 1440 abs=1 vcruise= 360
 
::delay a1 1000
 
::delay a2 1000
 
::move a1 0 abs=1 vcruise=360
 
::move a2 0 abs=1 vcruise= 360
 
::delay a1 10
 
::delay a2 10
 
::a1.En=0
 
::a2.En=0
 
::detach a1
 
::detach a2
 
::Print "End of MYPROG1"
 
::'''end program'''
 
<br/>
 
 
 
(13E) Save the program: File > '''Save'''
 
:Alternately, click the '''Save''' button on the toolbar.
 
:Check the File Manager pane at the bottom of the screen. Refresh if necessary.
 
:You now see the program in the application folder.<br/>
 
::[[File:configurator-180.png|500px]]<br/>
 
<br/>
 
 
 
(13F) Send program MYPROG1 to the controller.
 
:Click the '''Save and Load''' button in the ControlStudio menu bar.<br/>
 
::[[File:configurator-181.png|300px]]<br/>
 
<br/>
 
 
 
(13G) Run the program.
 
:Click the '''Continue Task''' button in the ControlStudio menu bar.<br/>
 
::[[File:configurator-182.png|200px]]<br/>
 
<br/>
 
 
 
:Observe the motion of the two motors.
 
:When motion stops, note the message in the '''Message Log''' pane:<br/>
 
::[[File:configurator-184.png|200px]]<br/>
 
<br/>
 
 
 
(13H) Run the program one line at a time.
 
:Click the '''Step by Step''' button in the ControlStudio menu bar.<br/>
 
::[[File:configurator-183.png|150px]]<br/>
 
 
 
:Continue clicking and observing the motion of the two motors.
 
  
 
<br/>
 
<br/>
Line 455: Line 164:
 
'''Windows'''
 
'''Windows'''
  
(A1) Uninstall all previously installed softMC programs.  
+
# Uninstall all previously installed softMC programs. <br> You can identify and uninstall the programs to be removed according to the publisher name: '''Servotronix'''. <br> '''Note''': Do not uninstall '''ServoStudio''' by Servotronix. <br/>
:You can identify and uninstall the programs to be removed according to the publisher name: '''Servotronix'''.
 
 
 
:'''Note''': Do not uninstall ServoStudio by Servotronix.
 
 
 
<br/>
 
  
 
== Appendix B: Update the softMC firmware ==
 
== Appendix B: Update the softMC firmware ==
 
'''ControlStudio online'''
 
'''ControlStudio online'''
  
(B1) To update the firmware:
+
# To update the firmware: <br> Tools > '''Firmware Update'''
:Tools > '''Firmware Update'''
+
# At the prompt, click '''Update'''.  
+
# Browse to the folder containing the firmware '''zip''' file. <br> Select the file and click '''Open'''.
(B2) At the prompt, click '''Update'''.
+
# Follow the prompts. <br> During the firmware update, the controller power cycles automatically. <br> The Communication status indication turns yellow. <br> Wait for the yellow LED on the front of the Demo Kit to turn off. <br> To reestablish communication, use the '''Reset Communication''' button in the Controller Monitor pane (or Ctrl+D).
+
# When finished, check the version again. <br> If it does not appear to be updated, turn the controller off and then on again. <br> Make sure Communication status indicates Connected.
(B3) Browse to the folder containing the firmware '''zip''' file.
 
:Select the file and click '''Open'''.
 
 
(B4) Follow the prompts.
 
:During the firmware update, the controller power cycles automatically.
 
:The Communication status indication turns yellow.
 
:Wait for the yellow LED on the front of the Demo Kit to turn off.
 
:To reestablish communication, use the '''Reset Communication''' button in the Controller Monitor pane (or Ctrl+D).
 
 
 
(B5) When finished, check the version again.
 
:If it does not appear to be updated, turn the controller off and then on again.
 
:Make sure Communication status indicates Connected.
 

Latest revision as of 03:34, 23 October 2017

TOP2.png
Language: English

Introduction

Note: Only essential background information is included in this training manual. For downloads and more information about the softMC hardware and software systems, use the resources available on the Servotronix website.

ControlStudio is a PC-based graphical user interface for developing and testing motion applications controlled and/or coordinated by the softMC. ControlStudio contains a programming editor, data recorder, debugger and monitoring tools. Once the application programs are completed, the PC can be removed and the softMC controller can operate standalone or within a network.

softMC Configurator is a wizard that is bundled with ControlStudio. The Configurator is used to define the axes and IOs to be controlled in the motion application; it then generates a set of programs and files for initializing the softMC.

MC-Basic (Motion Control BASIC) is the proprietary programming language developed by Servotronix for use with the softMC. It is based on standard BASIC programming language, with extensive enhancements for multi-tasking and motion control functionalities.

Procedures

Step 1: Install and activate ControlStudio

Windows

  1. If any previous versions of softMC are installed on the PC, uninstall them.
    For instructions, refer to Appendix A of this document and/or contact Technical Support.
  2. Run CSSetup.exe to install ControlStudio.
    Accept the default settings during the installation.
    Four programs are installed.
  3. If not already opened, activate ControlStudio (from the Start menu or desktop icon).


Step 2: Install device parameter (library) file on PC

ControlStudio Offline

  1. From the ControlStudio menu bar, activate the softMC Configurator.
    Select: Tools > softMC Configurator
    Note: Always activate Configurator from ControlStudio (and not from the desktop icon).
  2. When operating offline, the Configurator looks like this.
    configurator-2.png
    At the bottom of the Configurator screen, click Install Libraries.
    Note: Libraries is a file that contains the parameters of all devices (such as CDHD, stepIM, IOs) that can be controlled by the softMC.
    An updated Libraries file must be installed on the PC whenever new controller firmware is installed.
  3. Browse to the folder containing the file configurator_archive_0.4.x.x.bndl
    This is the Libraries file.
    Click Open.
    configurator-library.png
    Wait for the confirmation message: Libraries successfully imported.
    Click OK.
  4. Close Configurator.
    Note: Do not minimize. You must close Configurator.


Step 3: Create a folder for the ControlStudio machine application

ControlStudio offline

At the bottom of the ControlStudio screen, click to open the File Manager.

The File Manager has three panes.
In the left pane, select the location where you want to create a folder for your application files.
In the middle pane, right click, and select New Folder.
Give a name to the new folder: EX01


configurator-151.png



Note: The motion application (Solution) developed in ControlStudio will contain Project and Subproject folder/s that hold task (program) files, library files, and data files. The PC file system does not reflect the softMC controller file system.


Step 4: Make the cable connections

  1. Connect the system cables, if not already connected.
    Refer to diagrams below.
    For more instructions, refer to the softMC Installation Guide.
    stepIM-softMC-demo-cabling.png
    Note: If using ServoStudio for motor setup and/or drive tuning, a Kvaser adapter will be needed to enable serial communication with the PC. Refer to the stepIM Technical Training Manual or contact Technical Support.
    softMC 3 with stepIM - Training Setup - CANopen devices and network
    softMC-3-Networks-stepIM-Training-v4a.png


    softMC 7 with CDHD – Training Setup - EtherCAT devices and network
    softMC-7 Networks-CDHD-EtherCAT-Training-v4a.png
  2. Turn on the softMC training system.

Step 5: Establish communication between PC and softMC

ControlStudio online

  1. At the right side of the ControlStudio screen, hover over Controller Monitor.
    The Controller Monitor pane opens.
    Click the Refresh button.
    Wait a few moments until the softMC in your setup is recognized and displayed in the list. (e.g., “DEMO”)
    configurator-169.png
  2. Select the detected softMC, and click the Connect button.
    configurator-118.png
  3. The communication status at the bottom of the screen turns green, indicating that the softMC and ControlStudio are communicating.
    configurator-170.png
  4. In the middle of the ControlStudio screen, you will see the Terminal pane.
    Note: The Terminal is a command line interface to the softMC. It allows you to send commands and queries to the softMC, and receive responses in return.
    To confirm communication has been established, place the cursor in the Terminal pane.
    Query the firmware version: ?ver
    configurator-152b.png
    Make sure the response to the version query is 0.4.16.2 or later.
    If necessary, update the softMC firmware. For instructions, refer to Appendix B of this document and/or contact Technical Support.
  5. If the training system has not been used previously, skip to Procedure 6.
    If the training system has been used previously, program config.prg must first be cleared of all program lines. Contact Technical Support for instructions.


Step 6: Create a Configurator project.

Configurator online

  1. Open Configurator.
    Access through: Tools > softMC Configurator
    If using CANopen network, the Configurator online screen will look like this:
    configurator-172a.png
    If using EtherCAT network, the Configurator online screen will look like this:
    configurator-172b.png
    If using EtherCAT network, select the option: Use CODESYS
  2. Optional: In the MC Name field, enter a name for the softMC; e.g., DEMO_EX
  3. Create a Configurator project (called EX01) by saving a file to the softMC folder created previously (Step 3).
    configurator-16.png
    configurator-157.png
  4. In ControlStudio (online), go to the File Manager pane at the bottom of the screen.
    Select folder EX01 in the left pane, and look at the middle pane.
    If files do not appear, right-click in the middle pane > Refresh List
    You will see a file named EX01.mcfg = Configurator project file
    configurator-158.png



Step 7: Define axis A1 configuration settings

Configurator online

  1. Define Axis A1.
    If using EtherCAT devices/drives, they will automatically be detected and displayed. Skip to Step 7.3.
    configurator-159a.png
    If using CANopen devices/drives, right-click on CANopen in the navigation pane.
    Select New Device.
    configurator-159b.png
  2. If using CANopen devices/drives, select Servotronix > stepIM or CDHD.
    Click OK.
    configurator-130.png

  3. Depending on the selected device, stepIM or CDHD now appears in the Buses section of the navigation pane.
    Select a drive (stepIM or CDHD). Selected device is displayed in blue text.
    Enter settings as shown below.
    Initial Active OpMode = 8-Cyclic synchronous position
    Physical Address = 1
    Click Apply.
    Link Drive to Axis = A1.
    Click the Link arrow.
    configurator-131.png
    Note: For proper operation, Initial Active OpMode must be set to 8-Cyclic synchronous position
  4. Configurator displays the Axis:A1 screen.
    The screen has four tabs: General, Properties, Movement and Graph.
    In the General tab, enter settings as shown below.
    Axis Type = Rotary Gear
    Length Units = Degrees (default)
    Gear Ratio = 1.0
    configurator-160a.png
    Note: A gear ratio value is usually in the range 10—160.
    When using a Servotronix Demo Kit, Gear Ratio value = 1.
  5. Guidelines
    Most robotic applications are programmed in units of degree/second, that is, 360 deg = 1 revolution. Therefore:
    6 deg/sec = 1 rpm
    120 deg/sec = 20 rpm
    360 deg/sec = 60 rpm
    The instructions in this document use the following calculations and values, which are typical for a brushless DC motor:
    configurator-guidelines.png
    Use the same value for both acceleration and deceleration. However, if the Load to Motor Inertia Ratio ratio is less than 10 (optimal LMJR value), a higher acceleration can be used.
  6. In the Properties tab, click on the Limits bar to access Limit parameters.
    Change the values of the following parameters:
    Position Error Max = 10
    Velocity Max = 30000
    Acceleration Max = 900000
    Deceleration Max = 900000
    Jerk Max = 2700000
    After typing in a value, be sure to press Enter.
    configurator-161.png
  7. Save Configurator project (EX01.mcfg)


Step 8: Define axis A2 configuration settings

Configurator online

  1. Define the parameters for Axis A2 by repeating the steps in Step 7.
    configurator-136.png
  2. Save Configurator project (EX01.mcfg)


Step 9: Compile project files and send configuration to the softMC

Configurator online

  1. In the Configurator menu bar, click the Build & Run button.
    configurator-buildrun.png
  2. The Configurator generates files on the PC and sends them to the softMC.
    When complete, click Close.
    configurator-163.png
  3. Save Configurator project (EX01)

  4. ControlStudio online
    Note: Configurator generates a ControlStudio project file called EX01.APJ file.
    Configurator generates a folder called EXO1_Files
    In ControlStudio, go to the File Manager pane at the bottom of the screen.
    Select folder EX01 in the left pane, and look at the middle pane.
    If files do not appear, right-click in the middle pane > Refresh List
    Note: Files in the right pane reside in the softMC. Do not click on these files, or attempt to manipulate them.
    If using an EtherCAT network and devices and Use CODESYS option was selected, the EX01_Files folder will contain an additional file called softmc.devdesc.xml


Step 10: Verify the configuration by moving the axes

Configurator online

  1. Select Axis A1, and open the Movement tab.
    configurator-141a.png
  2. Refer to the units of motion table in Step 7.
    Change the values of the following parameters:
    Set Target = 360 (1 revolution)
    Set Velocity = 120
    Set Acceleration and Deceleration = 720000
    Set Jerk = 2160000
    Make sure Absolute option is not selected.
    Move the switch to Enabled.
    Click the Run button.
    Watch motor 1 load disk – it will rotate once.
     :configurator-142.png
    Enable the Absolute option.
    Set Target to 0.
    Click Run.
    When motor stops, note the Actual Position. It will show 0.000
  3. Select Axis A2, and in the Movement tab, and enter the same settings as above.
    Click the Run button.
    Watch motor 2 load disk – it will rotate once.
    Enable the Round Trip option.
    Click Run.
    Watch motor 2 load disk – it will rotate once in each direction.
  4. Disable both axes.
  5. Save the Configurator project.


Step 11: Record a motion

Configurator online

  1. Select Axis A1, and open the Movement tab.
  2. Change the values of the following parameters:
    Target = 360 (1 revolution)
    Velocity = 360 (60 rpm)
    Acc/Dec = 720000 deg/sec
    Jerk = 2160000 deg/sec
    Clear the Absolute option.
    Clear the Round Trip option.
    Enable the option Display Graph After Recording
    Select Variables: VCMD and VFB.
    Clear all other variables.
    Make sure drive is Enabled.
    Click Record &Move button
    configurator-144.png
  3. In a few moments, the recorded plot appears in the Graph tab.
    configurator-175.png
    Note: The recorded plot is saved in a A1.rec (A2.rec) file in a temp folder. The last recording always overwrites the previous recording.
    The Configurator recording function is only intended to provide initial confirmation of the axis configuration. For complete testing and adjustment, use the Recording function within ControlStudio.
  4. In the Movement tab, disable the axes
  5. Save the Configurator project.
    Exit Configurator


step 12: Work with softMC controller via Terminal

ControlStudio online

  1. If softMC has been power cycled, this step is required. Otherwise, skip to Step 12.3.
    In the Terminal pane, enter the command reset all
    Note: The command reset all does the following:
    1. Removes all system variables and tasks from controller RAM.
    2. Removes all files from controller RAM .
    3. Runs the CONFIG.PRG task
  2. If softMC has been power cycled, this step is required. Otherwise, skip to Step 12.3.
    In the Terminal pane, enter the command load startprg.prg
    Note: The command load startprg.prg loads all configuration data from controller Flash (non-volatile) memory to RAM. Data remains in Flash memory.
    Look at the messages in the Message Log pane.
    The system is now ready to receive commands.
  3. In the Terminal pane, enable the axes.
    1. Enable axis 1: a1.en=1
    2. Enable axis 2: a2.en=1
      Gently grasp the motor load disk and try to move them. Strong resistance indicates the motor is enabled.
  4. Note: The Move executes a point-to-point move from the current position to the target position of a single axis or a group of axes.
    Note: Use F3 as a shorcut to repeat last command entered
    In the Terminal pane, execute Move commands, and observe the response of the motors.
    • Move A1 and A2 to absolute position PFB 0:
    move a1 0 abs=1
    move a2 0 abs=1
    • Move A1 and A2 to absolute position PFB 3600 (10 revolutions from 0):
    move a1 3600 abs=1
    move a2 3600 abs=1
    • Move A1 one revolution counterclockwise:
    move a1 -360 abs=0
    • Move A2 two revolution clockwise:
    move a2 720
    • Move A1 and A2 to absolute position PFB 7200 at different speeds:
    move a1 7200 abs=1 vcruise=720
    move a2 7200 abs=1 vcruise=240
  5. Note: Jog moves the axis at a constant velocity.
    Use the Stop command to stop a Jog motion.
    In the Terminal pane, execute Jog commands, and observe the response of the motors:
    jog a1 720
    jog a2 240
    Allow both motors to run simultaneously.
    Then stop the motion:
    stop a1
    stop a2
    Disable the axes.


step 13: Write and run a program

ControlStudio online

  1. To begin writing a program for your motion application:
    In ControlStudio, select: FileNewFile
    configurator-176.png

  2. In the New' dialog box, do the following:
    Select
    Motion Controller Program File.
    Enter a name for your program (e.g.,
    MYPROG1).
    Note: A program name cannot exceed 8 characters.
    Browse to and select the path/folder containing your application files (e.g., EX01)
    configurator-177.png

  3. The Program Editor pane opens in ControlStudio.
    The pane has a tab for the new program, containing a blank program template.
    configurator-178.png

  4. Insert the cursor in the line below program.
    Enter the following program lines:
    program
    attach a1
    attach a2
    a1.En=1
    a2.En =1
    move a1 720 abs=1 vcruise= 360
    move a2 1440 abs=1 vcruise= 360
    delay a1 1000
    delay a2 1000
    move a1 0 abs=1
    cruise=360
    move a2 0 abs=1 vcruise= 360
    delay a1 10
    delay a2 10
    a1.En=0
    a2.En=0
    detach a1
    detach a2
    Print "End of MYPROG1"
    end program
  5. Save the program: File > Save
    Alternately, click the Save button on the toolbar.
    Check the File Manager pane at the bottom of the screen. Refresh if necessary.
    You now see the program in the application folder.
    configurator-180.png

  6. Send program MYPROG1 to the controller.
    Click the Save and Load button in the ControlStudio menu bar.
    configurator-181.png

  7. Run the program.
    Click the Continue Task button in the ControlStudio menu bar.
    configurator-182.png

    Observe the motion of the two motors.
    When motion stops, note the message in the Message Log pane:
    configurator-184.png

  8. Run the program one line at a time.
    Click the Step by Step button in the ControlStudio menu bar.
    configurator-183.png
    Continue clicking and observing the motion of the two motors.


Appendices

Appendix A: Uninstall previous ControlStudio installation

Windows

  1. Uninstall all previously installed softMC programs.
    You can identify and uninstall the programs to be removed according to the publisher name: Servotronix.
    Note: Do not uninstall ServoStudio by Servotronix.

Appendix B: Update the softMC firmware

ControlStudio online

  1. To update the firmware:
    Tools > Firmware Update
  2. At the prompt, click Update.
  3. Browse to the folder containing the firmware zip file.
    Select the file and click Open.
  4. Follow the prompts.
    During the firmware update, the controller power cycles automatically.
    The Communication status indication turns yellow.
    Wait for the yellow LED on the front of the Demo Kit to turn off.
    To reestablish communication, use the Reset Communication button in the Controller Monitor pane (or Ctrl+D).
  5. When finished, check the version again.
    If it does not appear to be updated, turn the controller off and then on again.
    Make sure Communication status indicates Connected.