Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Set robot machining settings using the API - Synchronized turntable

#1
I used the python API to automatic generate the machining settings before without synchronized external axes. However, the panel of machining settings with synchronized external axes is more complicated. Is there any example to show how to control the panel? How to disable the "Optimize turntable"?


Attached Files Thumbnail(s)
1.png   
#2
You can control the robot machining parameters using the API including the turntable optimization settings. Using the API is a bit more complex than using the User Interface but it allows you to automate and customize your workflow.

The 4 main settings you can control about the turntable optimization for a robot machining project are the following API machining settings you can use:
  • TurntableActive (set to 1 to activate it)
  • TurntableOffset (offset of 0 deg is the same as 0)
  • TurntableRZcomp (set to 1 to have the default automatic compensation)
  • TurntableKeepPos (set to 1 to prioritize the position of the TCP instead of the orientation of the Z vector)
You can find an example about how to get or set these robot machining parameters here:
https://robodk.com/doc/en/PythonAPI/exam...g-settings

You can also take a look at the following forum threads where similar topics have been discussed:
#3
Hello,

I have the same problem here. I am trying to change the machining parameters using the Matlab API, see the code bellow. The machining project is created and updated properly, and the generated program is also executed accordingly. However, the turntable optimization parameter does not change. Is there something wrong on the code? I will also like to change the "Path to tool offset" parameter, which is the setting I will need for this?

Code:
%% Create machining project
path_settings = RDK.AddMachiningProject('Path settings');

% SET PATH CONFIGURATION
path_params = 'TurntableActive=0';

% Create program
prog = path_settings.setMachiningParameters('', object_curve, path_params);
path_settings.Update;

% Run the program
RDK.setSimulationSpeed(50);
prog.RunProgram;
#4
Hello caa,
I'm not sure whether the MATLAB API works the same way as the python API.
You need to get the machining setting data structure. It might be a key-value data structure.
Here is my code with Python.
Code:
milling_project = RDK.AddMachiningProject(f"{project_name} Settings", robot_item)
milling_project.setMachiningParameters(part=object)

milling_project.setParam("ApproachRetract", "Normal 100")
milling_project.setParam("Visible", 0)

machiningsettings = milling_project.setParam("Machining")
machiningsettings["AutoUpdate"] = 0
machiningsettings["PointApproach"] = 0.01
machiningsettings["TurntableActive"] = 0
# machiningsettings["TurntableOffset"] = 0
# machiningsettings["TurntableKeepPos"] = 1
milling_project.setParam("Machining", machiningsettings)

I think you use the wrong API. As far as I know, "setMachiningParameters" is for setting path curve. 
You need to use "setParam" to get the data structure you want and set the parameters.
I think "setPose" can change the "Path to tool offset" parameter
#5
Exactly, you should use setParam and also pass a valid JSON dictionary.

For example, if you want to control the behavior of the turntable using Matlab code you should do:
Code:
machiningsettings = '{TurntableActive: 0}';
milling_project.setParam("Machining", machiningsettings);
#6
Thank you both for your replies, I have changed the data structure. However now I get this error message. The path for the RoboDK API of matlab is set appropiately (see the image below). Why is the setParam command not recognized?

Code:
path_settings = RDK.AddMachiningProject('Path settings');

machiningsettings = '{TurntableActive: 0}';
path_settings.setParam("Machining", machiningsettings);

prog = path_settings.setMachiningParameters('', object_curve);

Error:
Unrecognized method, property, or field 'setParam' for class 'RobolinkItem'.
Error in my_file (line 88)
path_settings.setParam("Machining", machiningsettings);


Attached Files Thumbnail(s)
setpath.PNG   
#7
Are you using the latest version of the Matlab API? You should find the latest version of the Matlab API here:
https://github.com/RoboDK/RoboDK-API/tree/master/Matlab

The latest version includes the function setParam function.
#8
Thank you very much for your reply Albert!

I updated the version of my Matlab API as well as the path on Matlab and I can change now the machining parameters!
#9
Excellent! Thank you for your feedback.
  




Users browsing this thread:
1 Guest(s)