Commit 621eabca authored by Jake Read's avatar Jake Read
Browse files

example program moves some axis

parent 8f18e341
......@@ -27,7 +27,7 @@ function ATKSerialLink() {
state.portStatus = 'closed' // or we hope it will be
atkSerialLink.init = function(){
findSerialPort()
//findSerialPort()
}
/*
......@@ -74,7 +74,7 @@ function ATKSerialLink() {
serialport = new SerialPort(state.portName, {
baudRate: 250000
})
state.portStatus = 'opening'
//state.portStatus = 'opening'
serialport.on('open', function() {
state.portStatus = 'open'
})
......@@ -150,6 +150,7 @@ function ATKSerialLink() {
// we'll make sure it's what we think it will be
// console.log("PORT DATA")
var dtArray = new Array()
console.log('sp data', data)
if (Buffer.isBuffer(data)) {
for (var i = 0; i < data.length; i++) {
dtArray[i] = data[i]
......
This diff is collapsed.
......@@ -20,12 +20,12 @@
"inputs": {},
"outputs": {},
"state": {
"portName": "COM3",
"portName": "---",
"connect": {
"type": "button",
"label": "click to find and connect"
},
"portStatus": "open"
"portStatus": "closed"
}
},
"ATKStepper-0": {
......@@ -76,7 +76,7 @@
"label": "test network"
},
"message": "click above to test network",
"route": "0,3",
"route": "0,0",
"rate": 2000,
"axis": "X",
"spu": 200,
......@@ -137,10 +137,10 @@
"label": "test network"
},
"message": "click above to test network",
"route": "0,0",
"route": "0,3",
"rate": 2000,
"axis": "Y",
"spu": -200,
"spu": 200,
"rawMove": -10,
"makeMove": {
"type": "button",
......@@ -196,7 +196,7 @@
"route": "0,5",
"rate": 2000,
"axis": "Y",
"spu": 200,
"spu": -200,
"rawMove": -10,
"makeMove": {
"type": "button",
......@@ -257,13 +257,13 @@
"route": "0,1",
"rate": 2000,
"axis": "Z",
"spu": 200,
"spu": -200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": -6000,
"lead": 0,
"position": 0
}
},
......@@ -433,8 +433,8 @@
"alt": "movements -> acceleration planned moves",
"path": "./modules/motion/planner.js",
"position": {
"left": 822,
"top": 1020
"left": 693,
"top": 1015
}
},
"inputs": {
......@@ -472,7 +472,12 @@
},
"moveComplete": {
"emits": "number",
"calls": []
"calls": [
{
"parentId": "Multi-line Text Input-12",
"key": "req"
}
]
}
},
"state": {
......@@ -493,12 +498,12 @@
0,
0
],
"isRunning": 1,
"isRunning": 0,
"netWindow": 3,
"netState": [
3,
3,
3
0,
0,
0
]
}
},
......@@ -585,19 +590,19 @@
"type": "multiline",
"label": "lines complete",
"rows": 11,
"value": "\n\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10"
"value": ""
},
"now": {
"type": "multiline",
"label": "line just out",
"rows": 1,
"value": "G0 X20Y20Z0"
"value": ""
},
"incoming": {
"type": "multiline",
"label": "future lines",
"rows": 36,
"value": "G0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n"
"value": "G0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n"
}
}
}
......
{
"description": {
"name": "new program",
"counter": 12
},
"modules": {
"Serialport ATK Link-1": {
"description": {
"id": "Serialport ATK Link-1",
"name": "Serialport ATK Link",
"alt": "window into hardware world",
"path": "./modules/hardware/atkseriallink.js",
"isHardware": true,
"isLink": true,
"position": {
"left": 1922,
"top": 383
}
},
"inputs": {},
"outputs": {},
"state": {
"portName": "COM3",
"connect": {
"type": "button",
"label": "click to find and connect"
},
"portStatus": "open"
}
},
"ATKStepper-0": {
"description": {
"id": "ATKStepper-0",
"name": "ATKStepper",
"alt": "software representation of stepper motor",
"path": "./modules/hardware/atkstepper.js",
"isHardware": true,
"position": {
"left": 1427,
"top": 127
}
},
"inputs": {
"trapezoid": {
"accepts": "move instruction"
},
"accel": {
"accepts": "number"
},
"rmtrig": {
"accepts": "event"
}
},
"outputs": {
"ack": {
"emits": "move acknowledgement",
"calls": []
},
"position": {
"emits": "number",
"calls": []
}
},
"state": {
"reset": {
"type": "button",
"label": "reset hardware"
},
"test": {
"type": "button",
"label": "test network"
},
"message": "click above to test network",
"route": "0,3",
"rate": 2000,
"axis": "X",
"spu": 200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": 0,
"position": 0
}
},
"ATKStepper-2": {
"description": {
"id": "ATKStepper-2",
"name": "ATKStepper",
"alt": "software representation of stepper motor",
"path": "./modules/hardware/atkstepper.js",
"isHardware": true,
"position": {
"left": 1432,
"top": 504
}
},
"inputs": {
"trapezoid": {
"accepts": "move instruction"
},
"accel": {
"accepts": "number"
},
"rmtrig": {
"accepts": "event"
}
},
"outputs": {
"ack": {
"emits": "move acknowledgement",
"calls": []
},
"position": {
"emits": "number",
"calls": []
}
},
"state": {
"reset": {
"type": "button",
"label": "reset hardware"
},
"test": {
"type": "button",
"label": "test network"
},
"message": "click above to test network",
"route": "0,0",
"rate": 2000,
"axis": "Y",
"spu": -200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": 0,
"position": 0
}
},
"ATKStepper-3": {
"description": {
"id": "ATKStepper-3",
"name": "ATKStepper",
"alt": "software representation of stepper motor",
"path": "./modules/hardware/atkstepper.js",
"isHardware": true,
"position": {
"left": 1438,
"top": 871
}
},
"inputs": {
"trapezoid": {
"accepts": "move instruction"
},
"accel": {
"accepts": "number"
},
"rmtrig": {
"accepts": "event"
}
},
"outputs": {
"ack": {
"emits": "move acknowledgement",
"calls": []
},
"position": {
"emits": "number",
"calls": []
}
},
"state": {
"reset": {
"type": "button",
"label": "reset hardware"
},
"test": {
"type": "button",
"label": "test network"
},
"message": "click above to test network",
"route": "0,5",
"rate": 2000,
"axis": "Y",
"spu": 200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": 0,
"position": 0
}
},
"ATKStepper-4": {
"description": {
"id": "ATKStepper-4",
"name": "ATKStepper",
"alt": "software representation of stepper motor",
"path": "./modules/hardware/atkstepper.js",
"isHardware": true,
"position": {
"left": 1440,
"top": 1248
}
},
"inputs": {
"trapezoid": {
"accepts": "move instruction"
},
"accel": {
"accepts": "number"
},
"rmtrig": {
"accepts": "event"
}
},
"outputs": {
"ack": {
"emits": "move acknowledgement",
"calls": []
},
"position": {
"emits": "number",
"calls": []
}
},
"state": {
"reset": {
"type": "button",
"label": "reset hardware"
},
"test": {
"type": "button",
"label": "test network"
},
"message": "click above to test network",
"route": "0,1",
"rate": 2000,
"axis": "Z",
"spu": 200,
"rawMove": -10,
"makeMove": {
"type": "button",
"label": "test move"
},
"lead": -2000,
"position": 0
}
},
"ATKBBB-Servo-5": {
"description": {
"id": "ATKBBB-Servo-5",
"name": "ATKBBB-Servo",
"alt": "software representation of networked hardware object",
"path": "./modules/hardware/atkbreadboard.js",
"isHardware": true,
"position": {
"left": 1886,
"top": 1362
}
},
"inputs": {
"servoVal": {
"accepts": "number"
},
"adcRequest": {
"accepts": "event"
}
},
"outputs": {
"servoConf": {
"emits": "event",
"calls": []
},
"adcValue": {
"emits": "number",
"calls": []
}
},
"state": {
"reset": {
"type": "button",
"label": "reset hardware"
},
"test": {
"type": "button",
"label": "test network"
},
"message": "click above to test network",
"route": "0,2",
"servoButton": {
"type": "button",
"label": "SEND VALUE"
},
"servoVal": 0,
"adcButton": {
"type": "button",
"label": "REQUEST ADC CONVERSION"
}
}
},
"Button-7": {
"description": {
"id": "Button-7",
"name": "Button",
"alt": "for clicking",
"path": "./modules/ui/button.js",
"position": {
"left": 591,
"top": 332
}
},
"inputs": {
"thru": {
"accepts": "any"
}
},
"outputs": {
"whammy": {
"emits": "number",
"calls": [
{
"parentId": "delay-9",
"key": "thru"
},
{
"parentId": "number output-8",
"key": "evt"
}
]
}
},
"state": {
"button": {
"type": "button",
"label": "WHAM"
}
}
},
"number output-8": {
"description": {
"id": "number output-8",
"name": "number output",
"alt": "for clicking",
"path": "./modules/ui/number.js",
"position": {
"left": 586,
"top": 566
}
},
"inputs": {
"thru": {
"accepts": "any"
},
"evt": {
"accepts": "any"
}
},
"outputs": {
"out": {
"emits": "number",
"calls": [
{
"parentId": "Multi-line Text Input-12",
"key": "req"
}
]
}
},
"state": {
"number": 10,
"button": {
"type": "button",
"label": "WHAM"
}
}
},
"delay-9": {
"description": {
"id": "delay-9",
"name": "delay",
"alt": "in ... out",
"path": "./modules/util/delay.js",
"position": {
"left": 589,
"top": 464
}
},
"inputs": {
"thru": {
"accepts": "any"
}
},
"outputs": {
"out": {
"emits": "any",
"calls": [
{
"parentId": "Lookahead-Motion-Planner-10",
"key": "run"
}
]
}
},
"state": {
"ms": 100
}
},
"Lookahead-Motion-Planner-10": {
"description": {
"id": "Lookahead-Motion-Planner-10",
"name": "Lookahead-Motion-Planner",
"alt": "movements -> acceleration planned moves",
"path": "./modules/motion/planner.js",
"position": {
"left": 822,
"top": 1020
}
},
"inputs": {
"instruction": {
"accepts": "move instruction"
},
"acks": {
"accepts": "move acknowledgement"
},
"run": {
"accepts": "boolean"
}
},
"outputs": {
"moves": {
"emits": "move instruction",
"calls": [
{
"parentId": "ATKStepper-0",
"key": "trapezoid"
},
{
"parentId": "ATKStepper-2",
"key": "trapezoid"
},
{
"parentId": "ATKStepper-3",
"key": "trapezoid"
},
{
"parentId": "ATKStepper-4",
"key": "trapezoid"
}
]
},
"moveComplete": {
"emits": "number",
"calls": []
}
},
"state": {
"axisIDs": "X,Y,Z",
"reset": {
"type": "button",
"label": "reset planner"
},
"accel": 200,
"jd"