Difference between revisions of "Firmware Parameter Configuration"

From Wiki
m (Mab moved page CPRog download Amp Configuration to Firmware Parameter Configuration: Einheitliche Benennung FW-Parameter; Branding-unabhängig)
(Moved parameter descriptions etc. from article External Axis)
Line 3: Line 3:
  
 
CPRog allows to set all firmware parameter of the motor controller. This is done either directly using the USB-CAN-Adapter, or via Ethernet and the TinyCtrl software on the embedded Linux board.  
 
CPRog allows to set all firmware parameter of the motor controller. This is done either directly using the USB-CAN-Adapter, or via Ethernet and the TinyCtrl software on the embedded Linux board.  
 
  
 
== General Procedure ==
 
== General Procedure ==
Line 10: Line 9:
 
* Upload the file again
 
* Upload the file again
  
 +
=== Download Configuration ===
 +
 +
* Open CPRog
 +
* Connect to the robot via the USB-CAN-Adapter or Ethernet
 +
* Check if all green LEDs on top of '''all''' motor modules are blinking green. If a module is not blinking green, it might not be configured correctly. Did you save the project, and restart the hardware?
 +
* Open the backstage menu by clicking "File" at the top left
 +
* Click "Get Amp configuration" (see the image below)
 +
* Now a backup file is written in C:/CPRog/Data/Backup
 +
 +
=== Upload Configuration ===
 +
 +
* Change the file according to your requirements using a text editor like Notepad or Notepad++ (see section Parameter File below)
 +
* Click "Set Amp configuration"
 +
* Choose the updated .dat file
 +
* Wait until all parameters are written, approx 20s
 +
* For some parameter, e.g. the encoder direction, the control needs a cold restart
 +
* Test if the changes result in a better performance.
 +
 +
[[File:CPRogAmpConfig.JPG|400px]]
 +
 +
=== Verification of Joint Operation ===
 +
* Now the correct operation of the joints need to be verified.
 +
* Familiarize yourself with the location of the '''emergency stop''' button. You will likely need it as setting parameters on an unknown axis is an iterative process.
 +
* Once the controller has booted up, the motor module LEDs are blinking green, '''connect''' the robot, '''reset''' and '''enable''' the robot. If the axis starts moving now, change the parameter <code>SwapEncoderDirection</code>.
 +
* Move the joint by clicking on the buttons in the jog section of CPRog/iRC. If the axis moves and stops when you let go of the button, the <code>SwapEncoderDirection</code> is set correctly. Otherwise it needs to be swapped using the process above. '''Power-cycling the Hardware is mandatory after the upload of new parameters.'''
 +
* In the Software click on '''Reference'''. Click on '''Reset''' and '''Enable'''. Then click on '''Reference axis''' next to '''External Axis 1'''. Observe the axis and prevent collisions using the emergency stop. If the joint shows up as "referenced" after the axis motion has finished. After referencing is complete, the robot needs to be '''reset''' and '''enabled''' to clear position lag errors. The referencing parameters have been set up correctly. You may need to change the type of reference motion, trigger edge, invert the reference direction as described above.
 +
* Next set up a program that moves the axis over 30-60min. Observe the motor and module temperature. Increase the motor current, if the axis is struggling to move and reduce the motor current, if the motor and/or motor module are getting hot.
  
 
== Parameter File ==
 
== Parameter File ==
Line 15: Line 41:
 
The parameter files contain a set of parameter for each joint of the robot:
 
The parameter files contain a set of parameter for each joint of the robot:
  
<code><Joint0 ID="16" ComTimeOut="2000" MaxCurrent="200" MaxLag="5000" PosP="1.000" PosI="0.000" PosD="0.000" PosAWU="30.000"  
+
<syntaxhighlight lang="XML">
Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False"
+
<!-- Parameter set for Commonplace Robotics robotics control  /-->
RefStraight="False" RefSinus="False" RefHalf="True" SinusRefTics="2000" SinusRefMaxCycles="6"
+
<!-- Target Robot: igus robolink                              /-->
Offset="0" RefSpeed="50" RefSpeedSlow="10" RefFromBothSides="True"
+
<!-- support@cpr-robots.com                                  /-->
SGThreshold="2" CSLoad="20" CSStart="20" CSIdle="6" CSRef="18" StartArea="200"
+
<AmpParameter>
MinSupplyVoltage="500" MaxTemperature="500" Microstepping="128"/></code>
+
    <Configuration ModuleType="RailStepperV02" NrOfJoints="3"/>
  
Floating point values have to be separated by '.', not by ','!
+
    <Joint0 ID="16" Version="Product 0x42 FW 0x02 0x10"
 +
        ComTimeOut="2000" MaxCurrent="200" MaxLag="5000" EncoderErrorDetection="0" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="30"
 +
        Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
 +
        RefStraight="False" RefSinus="False" RefHalf="True" SinusRefTics="2000" SinusRefMaxCycles="6"
 +
        Offset="0" RefSpeed="50" RefSpeedSlow="10" RefFromBothSides="True"
 +
        SGThreshold="2" CSLoad="18" CSStart="18" CSIdle="6" CSRef="15" StartArea="200"
 +
        MinSupplyVoltage="500" MaxTemperature="500" Microstepping="0"
 +
        />
  
The most important parameter are:
+
    <Joint1 ID="32" Version="Product 0x42 FW 0x02 0x10"
* Offset: This value defines the offset between reference position and zero position. The unit is encoder tics. In the c:/CPRog/Data/Robots/ folder you can find a .xlsx sheet for translation degree <-> encoder tics.
+
        ComTimeOut="2000" MaxCurrent="200" MaxLag="5000" EncoderErrorDetection="0" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="30"
* CSLoad: Defines the motor current while running. Values from 1 (minimum) and 31 (maximum) are allowed.
+
        Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
* CSStart: Defines the motor current while starting (low rpm). Values from 1 (minimum) and 31 (maximum) are allowed.
+
        RefStraight="False" RefSinus="False" RefHalf="True" SinusRefTics="2000" SinusRefMaxCycles="6"
* CSIdle: Defines the motor current while not running. Values from 1 (minimum) and 31 (maximum) are allowed.
+
        Offset="891" RefSpeed="-50" RefSpeedSlow="-10" RefFromBothSides="True"
* CSRef: Defines the motor current while referencing. Values from 1 (minimum) and 31 (maximum) are allowed.
+
        SGThreshold="2" CSLoad="26" CSStart="26" CSIdle="10" CSRef="20" StartArea="200"
 +
        MinSupplyVoltage="500" MaxTemperature="500" Microstepping="0"
 +
        />
  
The following parameter should only be changed when you are aware of the usage:
+
    <Joint2 ID="48" Version="Product 0x42 FW 0x04 0x07"
* PosP: Proportional parameter of the position PID control. Around 1.0 for robots with motor encoder
+
        ComTimeOut="3000" MaxCurrent="0" MaxLag="5000" EncoderErrorDetection="1000" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="0"
 +
        Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
 +
        RefStraight="True" RefSinus="False" RefHalf="False" SinusRefTics="500" SinusRefMaxCycles="6"
 +
        Offset="-1" RefSpeed="40" RefSpeedSlow="5" RefFromBothSides="True"
 +
        SGThreshold="2" CSLoad="10" CSStart="10" CSIdle="3" CSRef="8" StartArea="200"
 +
        MinSupplyVoltage="500" MaxTemperature="430" Microstepping="0"
 +
        />
 +
 +
</AmpParameter>
 +
</syntaxhighlight>
  
The files are stored in two locations:
+
* The file that you have opened is XML, hence '''care must be taken not to break the syntax.'''
* <code>c:/CPRog/Data/Backup/filewithdateandtime.dat</code> for the backup files from your robot
+
* The last parameter Block, starting (here) with <code>Joint5 ID="88"</code> is the one to be configured. (note that the joint number starts at 0, so joint 5 would be the sixth module.)
* e.g. <code>c:/CPRog/Data/Robots/igus_5DOF_BV/igus_5DOF_BV_DiscHalfRef_AmpParameter.dat</code> for general presets based on the robot type
 
  
 +
'''Please only change the values in  quote marks, do not delete any quote marks, do not use decimal separators. This config file is case sensitive, so lower case and upper case matters.'''
  
== Download Configuration ==
+
====Encoder Parameters====
 +
If the additional external axis is equipped with a motor encoder enter the parameters as shown below:
  
* Open CPRog
 
* Connect to the robot via USB-CAN-Adapter or Ethernet
 
* Open the backstage menu by clicking "File" at the top left
 
* Click "Get Amp configuration" (see the image below)
 
* Now a backup file is written in c:/CPRog/Data/Backup
 
  
== Upload Configuration ==
+
'''All numbers, other than those for PosP PosI and PosD must be integer.'''
 +
<syntaxhighlight lang="bash">
 +
ComTimeOut="2000"              #defines the max missed communication message before entering an error state
 +
MaxCurrent="200"                #defines...
 +
MaxLag="5000"                  #How many encoder tics is the encoder signal allowed to lag behind the desired motor position
 +
EncoderErrorDetection="0"      #detects a broken encoder
 +
PosP="1.000"                    #PID control parameter P
 +
PosI="0.0000"                  #PID control parameter I
 +
PosD="0.000"                    #PID control parameter D
 +
PosAWU="30"                    #defines...
 +
Encoder="True"                  #Encoder present?
 +
SwapEncoderDirection="False"    #inverts the encoder direction with respect to the motor.
 +
</syntaxhighlight>
  
* Change the file according to your requirements, e.g. adapting the offsets
+
====Reference/Ini Sensor Parameters====
* Click "Set Amp configuration"
+
'''All numbers must integer.'''
* Choose the updated .dat file
+
<syntaxhighlight lang="bash">
* Wait until all parameters are written, approx 20s
+
EndSwitchRising="True"          #Trigger on the rising edge by entering "True", trigger on the falling edge by entering "False"
* For some parameter, e.g. the encoder direction, the control needs a cold restart
+
StopOnEndSwitch="False"         #Should the axis motion stop during referencing when the end-switch trigger is received?
* Test if the changes result in a better performance.
+
UseIndexAsRef="False"          #Should the index pulse of the encoder be used as reference indicator?
 +
RefStraight="False"            #"True" for linear axes, "False" for rotary axes
 +
RefSinus="False"                #Should a sinusoidal search motion be performed?
 +
                                #("False" for linear axes, "True" for rotary axes with pin-ini)
 +
RefHalf="True"                  #"True" for half-disc inis on rotary axes. "False" for Linear axes.
 +
SinusRefTics="2000"            #How many encoder tics should  the sinusoidal search motion be incremented by per period
 +
SinusRefMaxCycles="6"          #How many periods of sinusoidal search motion should be performed
 +
Offset="-18405"                #How many encoder tics is the 0 position of the axis away from the position of the reference sensor?
 +
                                #To invert the direction of the offset, reverse the sign (+/-) of the number
 +
RefSpeed="50"                  #Sets the initial referencing speed: lower is slower.  
 +
                                #To invert the direction of movement, reverse the sign (+/-) of the number
 +
RefSpeedSlow="10"              #Sets the precision referencing speed: lower is slower and more precise
 +
                                #To invert the direction of movement, reverse the sign (+/-) of the number
 +
RefFromBothSides="True"        #Should the midpoint of the trigger signal be used instead of the rising/falling edge?
 +
</syntaxhighlight>
  
[[File:CPRogAmpConfig.JPG|400px]]
+
====Motor Parameters====
 +
'''All numbers must be integer.'''
 +
<syntaxhighlight lang="bash">
 +
SGThreshold="2"                #defines...
 +
CSLoad="16"                    #Current under load conditions (arbitrary units). Values between 1 and 32 are allowed.
 +
                                #Smaller is less current.
 +
                                #Large values will overheat the motor/module, small values will stall the robot under load.
 +
CSStart="16"                    #Current when starting a motion (arbitrary units). Values between 1 and 32 are allowed.
 +
                                #Smaller is less curent.
 +
                                #Large values will overheat the motor, small values will stall the robot under load.
 +
CSIdle="6"                      #Current when position is held (arbitrary units). Values between 1 and 32 are allowed.
 +
                                #Smaller is less curent.
 +
                                #Large values will overheat the motor, small values will stall the robot under load.
 +
CSRef="12"                      #Current during referencing (arbitrary units). Values between 1 and 32 are allowed.
 +
                                #Smaller is less current.
 +
                                #Large values will overheat the motor, small values will stall the robot under load.
 +
StartArea="200"                #defines...
 +
MinSupplyVoltage="500"          #not used. Set to 500.
 +
MaxTemperature="500"            #Sets thermal shutdown temperature (arbitrary units). Select a value between 450 and 500.
 +
Microstepping="0"              #Set to 0.
 +
</syntaxhighlight>
  
For questions please [[Support Routes|get in contact]]!
 
 
[[Category:CPRog]]
 
[[Category:CPRog]]

Revision as of 13:17, 3 February 2021

This section applies for: robolink DCI, robolink, drylin gantry or drytech delta with modular control, both via USB and embedded. It does not apply for the Mover robots.

CPRog allows to set all firmware parameter of the motor controller. This is done either directly using the USB-CAN-Adapter, or via Ethernet and the TinyCtrl software on the embedded Linux board.

General Procedure

  • Make a backup of the current firmware parameter
  • Adapt the values in the backup file
  • Upload the file again

Download Configuration

  • Open CPRog
  • Connect to the robot via the USB-CAN-Adapter or Ethernet
  • Check if all green LEDs on top of all motor modules are blinking green. If a module is not blinking green, it might not be configured correctly. Did you save the project, and restart the hardware?
  • Open the backstage menu by clicking "File" at the top left
  • Click "Get Amp configuration" (see the image below)
  • Now a backup file is written in C:/CPRog/Data/Backup

Upload Configuration

  • Change the file according to your requirements using a text editor like Notepad or Notepad++ (see section Parameter File below)
  • Click "Set Amp configuration"
  • Choose the updated .dat file
  • Wait until all parameters are written, approx 20s
  • For some parameter, e.g. the encoder direction, the control needs a cold restart
  • Test if the changes result in a better performance.

CPRogAmpConfig.JPG

Verification of Joint Operation

  • Now the correct operation of the joints need to be verified.
  • Familiarize yourself with the location of the emergency stop button. You will likely need it as setting parameters on an unknown axis is an iterative process.
  • Once the controller has booted up, the motor module LEDs are blinking green, connect the robot, reset and enable the robot. If the axis starts moving now, change the parameter SwapEncoderDirection.
  • Move the joint by clicking on the buttons in the jog section of CPRog/iRC. If the axis moves and stops when you let go of the button, the SwapEncoderDirection is set correctly. Otherwise it needs to be swapped using the process above. Power-cycling the Hardware is mandatory after the upload of new parameters.
  • In the Software click on Reference. Click on Reset and Enable. Then click on Reference axis next to External Axis 1. Observe the axis and prevent collisions using the emergency stop. If the joint shows up as "referenced" after the axis motion has finished. After referencing is complete, the robot needs to be reset and enabled to clear position lag errors. The referencing parameters have been set up correctly. You may need to change the type of reference motion, trigger edge, invert the reference direction as described above.
  • Next set up a program that moves the axis over 30-60min. Observe the motor and module temperature. Increase the motor current, if the axis is struggling to move and reduce the motor current, if the motor and/or motor module are getting hot.

Parameter File

The parameter files contain a set of parameter for each joint of the robot:

<!-- Parameter set for Commonplace Robotics robotics control  /-->
<!-- Target Robot: igus robolink                              /-->
<!-- support@cpr-robots.com                                   /-->
<AmpParameter>
    <Configuration ModuleType="RailStepperV02" NrOfJoints="3"/>

    <Joint0 ID="16" Version="Product 0x42 FW 0x02 0x10"
         ComTimeOut="2000" MaxCurrent="200" MaxLag="5000" EncoderErrorDetection="0" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="30"
         Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
         RefStraight="False" RefSinus="False" RefHalf="True" SinusRefTics="2000" SinusRefMaxCycles="6"
         Offset="0" RefSpeed="50" RefSpeedSlow="10" RefFromBothSides="True"
         SGThreshold="2" CSLoad="18" CSStart="18" CSIdle="6" CSRef="15" StartArea="200"
         MinSupplyVoltage="500" MaxTemperature="500" Microstepping="0"
        />

    <Joint1 ID="32" Version="Product 0x42 FW 0x02 0x10"
         ComTimeOut="2000" MaxCurrent="200" MaxLag="5000" EncoderErrorDetection="0" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="30"
         Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
         RefStraight="False" RefSinus="False" RefHalf="True" SinusRefTics="2000" SinusRefMaxCycles="6"
         Offset="891" RefSpeed="-50" RefSpeedSlow="-10" RefFromBothSides="True"
         SGThreshold="2" CSLoad="26" CSStart="26" CSIdle="10" CSRef="20" StartArea="200"
         MinSupplyVoltage="500" MaxTemperature="500" Microstepping="0"
        />

    <Joint2 ID="48" Version="Product 0x42 FW 0x04 0x07"
         ComTimeOut="3000" MaxCurrent="0" MaxLag="5000" EncoderErrorDetection="1000" PosP="1.000" PosI="0.0000" PosD="0.000" PosAWU="0"
         Encoder="True" SwapEncoderDirection="False" EndSwitchRising="True" StopOnEndSwitch="False" UseIndexAsRef="False"
         RefStraight="True" RefSinus="False" RefHalf="False" SinusRefTics="500" SinusRefMaxCycles="6"
         Offset="-1" RefSpeed="40" RefSpeedSlow="5" RefFromBothSides="True"
         SGThreshold="2" CSLoad="10" CSStart="10" CSIdle="3" CSRef="8" StartArea="200"
         MinSupplyVoltage="500" MaxTemperature="430" Microstepping="0"
        />
		
</AmpParameter>
  • The file that you have opened is XML, hence care must be taken not to break the syntax.
  • The last parameter Block, starting (here) with Joint5 ID="88" is the one to be configured. (note that the joint number starts at 0, so joint 5 would be the sixth module.)

Please only change the values in quote marks, do not delete any quote marks, do not use decimal separators. This config file is case sensitive, so lower case and upper case matters.

Encoder Parameters

If the additional external axis is equipped with a motor encoder enter the parameters as shown below:


All numbers, other than those for PosP PosI and PosD must be integer.

ComTimeOut="2000"               #defines the max missed communication message before entering an error state
MaxCurrent="200"                #defines...
MaxLag="5000"                   #How many encoder tics is the encoder signal allowed to lag behind the desired motor position
EncoderErrorDetection="0"       #detects a broken encoder
PosP="1.000"                    #PID control parameter P
PosI="0.0000"                   #PID control parameter I
PosD="0.000"                    #PID control parameter D
PosAWU="30"                     #defines...
Encoder="True"                  #Encoder present?
SwapEncoderDirection="False"    #inverts the encoder direction with respect to the motor.

Reference/Ini Sensor Parameters

All numbers must integer.

EndSwitchRising="True"          #Trigger on the rising edge by entering "True", trigger on the falling edge by entering "False"
StopOnEndSwitch="False"         #Should the axis motion stop during referencing when the end-switch trigger is received? 
UseIndexAsRef="False"           #Should the index pulse of the encoder be used as reference indicator?
RefStraight="False"             #"True" for linear axes, "False" for rotary axes
RefSinus="False"                #Should a sinusoidal search motion be performed? 
                                #("False" for linear axes, "True" for rotary axes with pin-ini)
RefHalf="True"                  #"True" for half-disc inis on rotary axes. "False" for Linear axes.
SinusRefTics="2000"             #How many encoder tics should  the sinusoidal search motion be incremented by per period
SinusRefMaxCycles="6"           #How many periods of sinusoidal search motion should be performed
Offset="-18405"                 #How many encoder tics is the 0 position of the axis away from the position of the reference sensor?
                                #To invert the direction of the offset, reverse the sign (+/-) of the number
RefSpeed="50"                   #Sets the initial referencing speed: lower is slower. 
                                #To invert the direction of movement, reverse the sign (+/-) of the number
RefSpeedSlow="10"               #Sets the precision referencing speed: lower is slower and more precise
                                #To invert the direction of movement, reverse the sign (+/-) of the number
RefFromBothSides="True"         #Should the midpoint of the trigger signal be used instead of the rising/falling edge?

Motor Parameters

All numbers must be integer.

SGThreshold="2"                 #defines...
CSLoad="16"                     #Current under load conditions (arbitrary units). Values between 1 and 32 are allowed. 
                                #Smaller is less current. 
                                #Large values will overheat the motor/module, small values will stall the robot under load.
CSStart="16"                    #Current when starting a motion (arbitrary units). Values between 1 and 32 are allowed. 
                                #Smaller is less curent.
                                #Large values will overheat the motor, small values will stall the robot under load.
CSIdle="6"                      #Current when position is held (arbitrary units). Values between 1 and 32 are allowed. 
                                #Smaller is less curent.
                                #Large values will overheat the motor, small values will stall the robot under load.
CSRef="12"                      #Current during referencing (arbitrary units). Values between 1 and 32 are allowed. 
                                #Smaller is less current.
                                #Large values will overheat the motor, small values will stall the robot under load.
StartArea="200"                 #defines...
MinSupplyVoltage="500"          #not used. Set to 500.
MaxTemperature="500"            #Sets thermal shutdown temperature (arbitrary units). Select a value between 450 and 500.
Microstepping="0"               #Set to 0.