Files
cnc_wams/web-rtcp-5axis-xyzbc-trt-sim-plan/app/src/profiles/xyzbc-trt.js
2026-07-02 08:57:59 -04:00

141 lines
5.3 KiB
JavaScript

import { xyzacTrtProfile } from "./xyzac-trt.js";
import { getSourceReferencesForProfile } from "./source-reference-map.js";
import { xyzacTrtPyvcpPanelSchema } from "../panel-schema/xyzac-trt-pyvcp.js";
const sourceReferenceObjects = getSourceReferencesForProfile("xyzbc-trt");
export const xyzbcTrtProfile = {
...xyzacTrtProfile,
id: "xyzbc-trt",
title: "XYZBC table rotary tilting",
iniPath: "configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.ini",
pyvcpXmlPath: "configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.xml",
generatedHalPath: null,
toolTablePath: "configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.tbl",
machineName: "sim-xyzbc-trt-kins (switchkins)",
display: {
...xyzacTrtProfile.display,
geometry: "XYZB",
openFile: "./demos/xyzbc_switchkins.ngc",
pyvcp: "./xyzbc-trt.xml",
},
rs274ngc: {
...xyzacTrtProfile.rs274ngc,
parameterFile: "xyzbc.var",
},
machineFileStaging: {
defaultProgramFilename: "xyzbc_switchkins.ngc",
wasmDir: "/work/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt",
},
coordinates: ["X", "Y", "Z", "B", "C"],
joints: ["joint.0", "joint.1", "joint.2", "joint.3", "joint.4"],
kinematics: "xyzbc-trt-kins",
kinematicsModuleId: "xyzbc-trt",
kinematicsParameters: {
...xyzacTrtProfile.kinematicsParameters,
switchkinsTypes: [
{ value: 0, label: "identity", mdiCommand: "M429", webKinsType: "identity" },
{ value: 1, label: "XYZBC TCP", mdiCommand: "M428", webKinsType: "tcp-xyzbc" },
{ value: 2, label: "USERK", mdiCommand: "M430", webKinsType: "userk" },
],
},
hal: {
...xyzacTrtProfile.hal,
halcmd: {
...xyzacTrtProfile.hal.halcmd,
loadusr: ["xyzbc-trt-gui"],
feedbackNets: [
{ signal: "table-x", source: "joint.0.pos-fb", target: "xyzbc-trt-gui.table-x" },
{ signal: "saddle-y", source: "joint.1.pos-fb", target: "xyzbc-trt-gui.saddle-y" },
{ signal: "spindle-z", source: "joint.2.pos-fb", target: "xyzbc-trt-gui.spindle-z" },
{ signal: "tilt-b", source: "joint.3.pos-fb", target: "xyzbc-trt-gui.tilt-b" },
{ signal: "rotate-c", source: "joint.4.pos-fb", target: "xyzbc-trt-gui.rotate-c" },
],
offsetNets: [
{ signal: "tool-offset", source: "motion.tooloffset.z", target: "xyzbc-trt-kins.tool-offset" },
{ signal: "tool-offset", source: "xyzbc-trt-kins.tool-offset", target: "xyzbc-trt-gui.tool-offset" },
{ signal: "x-offset", source: "xyzbc-trt-kins.x-offset", target: "xyzbc-trt-gui.x-offset" },
{ signal: "z-offset", source: "xyzbc-trt-kins.z-offset", target: "xyzbc-trt-gui.z-offset" },
],
initialSets: [
{ pin: "x-offset", value: -20 },
{ pin: "z-offset", value: -15 },
{ pin: "xyzbc-trt-kins.x-rot-point", value: 0 },
{ pin: "xyzbc-trt-kins.y-rot-point", value: 0 },
{ pin: "xyzbc-trt-kins.z-rot-point", value: 0 },
{ pin: "xyzbc-trt-kins.conventional-directions", value: 0 },
],
},
},
traj: {
...xyzacTrtProfile.traj,
coordinates: "XYZBC",
},
axisLimits: {
X: xyzacTrtProfile.axisLimits.X,
Y: xyzacTrtProfile.axisLimits.Y,
Z: xyzacTrtProfile.axisLimits.Z,
B: { min: -36000, max: 36000, maxVelocity: 30, maxAcceleration: 300 },
C: { min: -36000, max: 36000, maxVelocity: 30, maxAcceleration: 300 },
},
jointConfig: [
xyzacTrtProfile.jointConfig[0],
xyzacTrtProfile.jointConfig[1],
xyzacTrtProfile.jointConfig[2],
{ id: 3, axis: "B", type: "ANGULAR", home: 0, min: -100, max: 50, maxVelocity: 30, maxAcceleration: 300 },
{ id: 4, axis: "C", type: "ANGULAR", home: 0, min: -36000, max: 36000, maxVelocity: 30, maxAcceleration: 300 },
],
halPins: [
"motion.switchkins-type",
"motion.analog-out-03",
"motion.tooloffset.z",
"xyzbc-trt-kins.tool-offset",
"xyzbc-trt-kins.x-offset",
"xyzbc-trt-kins.z-offset",
"xyzbc-trt-kins.x-rot-point",
"xyzbc-trt-kins.y-rot-point",
"xyzbc-trt-kins.z-rot-point",
"xyzbc-trt-kins.conventional-directions",
"halui.mdi-command-00",
"halui.mdi-command-01",
"halui.mdi-command-02",
],
offsets: {
x: -20,
z: -15,
xRotPoint: 0,
yRotPoint: 0,
zRotPoint: 0,
conventionalDirections: 0,
},
sourceReferences: sourceReferenceObjects.map((reference) => reference.path),
sourceReferenceObjects,
panelSchema: {
...xyzacTrtPyvcpPanelSchema,
id: "xyzbc-trt-switchkins-pyvcp",
profileId: "xyzbc-trt",
sourceXmlPath: "configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzbc-trt.xml",
groups: xyzacTrtPyvcpPanelSchema.groups.map((group) => ({
...group,
controls: group.controls.map((control) => (
control.id === "kinstype-legends"
? {
...control,
legends: ["0:IDENTITY", "1: XYZBC ", "2: USERK "],
}
: control.id === "type1-button"
? {
...control,
text: "TCP:XYZBC",
webAction: { type: "SET_KINS_TYPE", kinsType: "tcp-xyzbc" },
}
: control
)),
})),
},
samplePrograms: [
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/xyzbc_switchkins.ngc",
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/boat-xyzbc.ngc",
],
};