Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D printing with UR10e
#11
(05-11-2021, 07:14 AM)Kosiahn Wrote:
(05-10-2021, 09:08 PM)Albert Wrote: Try changing the line that causes issues for this:


Code:
set_standard_digital_out(5, False)

Hello,
i changed this and all the other lines by hand and it works.
I wonder about this because there is code in the postprocessor that is supposed to solve this.

def setDO(selfio_vario_value):
        """Set a Digital Output"""
        if type(io_value) != str# set default variable value if io_value is a number            
            if io_value > 0:
                io_value = 'True'
            else:
                io_value = 'False'
        
        if type(io_var) != str:  # set default variable name if io_var is a number
            newline = 'set_standard_digital_out(%s%s)' % (str(io_var), io_value)
        else:
            newline = '%s = %s' % (io_vario_value)
            
        self.addline(newline)

Hello, I have found the mistake. This was in the code I have added from your manual page (https://robodk.com/doc/en/Robot-Machinin...rint3Dpost).
   
    # Update the extruder speed when required
    if self.PRINT_LAST_SIGNAL is Noneor abs(extruder_signal - self.PRINT_LAST_SIGNAL) > 1e-6:
        self.PRINT_LAST_SIGNAL = extruder_signal
        # Use the built-in setDO function to set an analog output
        self.setDO(self.PRINT_E_AO,"%.3f" % extruder_signal)
        # Alternatively, provoke a program call and handle the integration with the robot controller
        #self.addline('ExtruderSpeed(%.3f)' % extruder_signal)

On the one hand, not the analog output is angesprocehn but the digital, I'll come back to that in a moment. When the digital output is called, the variable extruder_signal is converted to a string by "%.3f" and therefore falls through the query for a string in the "def set.DO" function.

More correctly it is therefore as follows
      self.setDO(self.PRINT_E_AO, extruder_signal)

Now to the analog output this is defined as follows and must be reprogrammed.

    def setAO(self, io_var, io_value):
        """Set an Analog Output"""
        self.setDO(io_var, io_value)

Since in "def setDO" always a digital output is called, no analog output can be called here by this function, also the query for a string in this function is not needed for the analog output.
#12
Thank you for your feedback. I recommend you to use the default post processor called Universal Robots, which generates a script file and a URP program with that script. Then, you can take the components you need from the 3D printing example. Unless you've calibrated your extruder, you'll need to customize a few things to properly integrate with your extruder, such as adjusting the flow ratio. You can do this in the post processor or probably in your slicer software as well.

You'll find the following setAO function with the default post processor:

Code:
  def setAO(self, io_var, io_value):
      """Set an Analog Output"""
      self.make_last_move_accurate()
      if type(io_value) != str: # set default variable value if io_value is a number            
          io_value = str(io_value)
     
      if type(io_var) != str:  # set default variable name if io_var is a number
          newline = 'set_standard_analog_out(%s, %s)' % (str(io_var), io_value)
      else:
          newline = '%s = %s' % (io_var, io_value)
         
      self.addline(newline)
#13
Hello,

could you explain to me the difference between .script file and .urp file?
After saving the program in RoboDK, I noticed while working with the robot that the code in the scipt is not as detailed as in the urp file. In addition, the information contained is not identical.

Best regards
J. Kosiahn
#14
(06-04-2021, 12:20 PM)Kosiahn Wrote: Hello,

could you explain to me the difference between .script file and .urp file?
After saving the program in RoboDK, I noticed while working with the robot that the code in the scipt is not as detailed as in the urp file. In addition, the information contained is not identical.

Best regards
J. Kosiahn

The picture with the 145 lines of code is the program from the script file the other picture is an extract from the program that was created from the URP file.


Attached Files Thumbnail(s)
       
#15
Hi,

Both files you sent me are .script files. None of those are URP.
Both UR post-processor (normal and URP) should generate the same program but in a different format.

I will need a bit more information on how you generated those files. Do you have the .rdk file?

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#16
Hi Jeremy,

what i forgot to say is, the second code is generatet by the robot after opening the URP-File.
In the atachments are the code from the robot after opening the URP-File as PFD and the little programm i made for testing the 3d printing. For generating this code i use the post prozessor i got from RoboDK with the changes for 3d printing from the manual and little changes made by me.

Best regards
J. Kosiahn


Attached Files
.rdk   3D Druck_10.05.21.rdk (Size: 4.26 MB / Downloads: 125)
.pdf   postprocessor.pdf (Size: 210.49 KB / Downloads: 119)
.pdf   P3D_FromURPFile.pdf (Size: 712.19 KB / Downloads: 100)
  




Users browsing this thread:
1 Guest(s)