How to use MovJ function for assembling


#1

Hello!

I am using Dobot MG400 to automate and scaleup my design work. I did try using the MovJ function to move my artifacts form one point to another. I would want to keep my artifact on the x coordinate whilst I make the the dobot to move on the y coordinate by changing it distance value and then keep the value of z constant and r position constant as well. The double end efffectors is what I would be using for the assembly.

My last try with the MovJ wasn’t successful cos the dobot drags on J1 whilst the idea was for it to be jumping to the figure feed into the X coordinate.

Please any help with blockly code?


#2

Here is some example code that might help. It creates a waypoint coordinate, then you can set the waypoint coordinate to have the same X/Y/Z/R/etc value as another destination point, then move the robot to that point through MovL and it will go one axis at a time.

Code:
WaypointTemp = createPointFromCurrentPosition(Waypoint)
WaypointTemp.coordinate[4] = DSTFirstAir.coordinate[4]
MovL(WaypointTemp)
WaypointTemp.coordinate[1] = DSTFirstAir.coordinate[1]
MovL(WaypointTemp)
WaypointTemp.coordinate[2] = DSTFirstAir.coordinate[2]
MovL(WaypointTemp)

function:

function createPointFromCurrentPosition(CurrentPosition)
local P={coordinate={0,0,0,0},user=0, tool = 0}
for i = 1, #P.coordinate, 1 do
P.coordinate[i] = CurrentPosition.coordinate[i]
end
P.user = CurrentPosition.user
P.tool = CurrentPosition.tool
return P
end