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

Follow-up Questions on Smart Motion API (Constrained Space & Pulse per

#1
Hello RoboDK Team,

Following previous discussions with Raphael Voyer regarding Smart Motion and external-axis applications, one of our customers evaluated Smart Motion as an alternative to Collision Free Planner.

During the evaluation, the customer confirmed that Smart Motion can successfully generate avoidance paths using Joint Targets and Constrained Space, including applications with an external axis.

While implementing the solution through the RoboDK API, the customer encountered the following questions.


We have two questions regarding Smart Motion and the RoboDK API.

Question 1: Constrained Space Control

We confirmed that Smart Motion can successfully generate avoidance paths when Constrained Space is enabled.

However, we could not find a way to enable or disable Constrained Space through the RoboDK API.

We tested the following PluginCommand names:

- setConstrainedSpace
- getConstrainedSpace
- onConstrainedSpaceClicked
- ConstrainedSpace
- constrainedSpace
- chkConstrainedSpace

All of them returned "Unknown command".

Questions:

1. Is it possible to control the Constrained Space option through the RoboDK API?
2. If so, which API method or PluginCommand should be used?

--------------------------------------------------

Question 2: Pulse per Degree Parameter

We investigated the effect of changing the robot's Pulse per Degree parameter.

We observed the following:

- The Pulse per Degree setting affects the output generated by RoboDK's standard post processor.
- However, changing the same setting had no effect on the output generated through our RoboDK API workflow.
- We could not find any API method that retrieves the Pulse per Degree values.

Questions:

1. Does the RoboDK API use the Pulse per Degree parameter?
2. If so, which API functions reference this parameter?
3. Is it possible to retrieve the Pulse per Degree values through the RoboDK API?

Environment:
- RoboDK 6.0.1

Thank you very much for your support.
#2
I'm sorry for the delays. We just published this example which shows how to use the Smart Motion via the API:
https://robodk.com/doc/en/PythonAPI/exam...art-motion

If you set the constrained space via the API (setConstrainedSpace) it should enable it. Let us know if it does not produce the expected results. If you can send us the project file and sample code you use it would be helpful for us to troubleshoot.

You can also find the documentation of the smart motion plugin here:
https://robodk.com/doc/en/Smart-Motion.html

About the pulses per degree question, you can get and set them via the API using the PulsesXdeg parameter:
Code:
# retrieve pulses/degree:
values = robot.setParam("PulsesXdeg")
# values is a comma separated list of values as a string
# set the pulses/degree
robot.setParam("PulsesXdeg", values)
#3
A follow-up on both points. Can you confirm if this worked?

You should make sure you are using the latest version of the Smart Motion add-in. After updating, this should work:
Code:
from robodk.robolink import Robolink
RDK = Robolink()
print(RDK.PluginCommand("Smart Motion", "setConstrainedSpace", "true"))  # prints: true
print(RDK.PluginCommand("Smart Motion", "getConstrainedSpace"))          # prints: true

A few details that are easy to miss:
  1. The plugin name passed to PluginCommand must be exactly "Smart Motion".
  2. The value must be true, 1 or on to enable; any other value disables.
  3. Enabling Constrained Space turns off Lock TCP automatically, and vice versa.
  4. The motion commands (moveTarget, moveJoint, generatePath) return the result as a string, for example Final path generated in 2.5 seconds or No path found, and no message boxes are shown while a command runs, so always check the returned string.
If the updated Add-in still reports "Unknown command", please send us the station and the script and we will try to reproduce it.
  




Users browsing this thread:
1 Guest(s)