-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharcus_3d_p1.py
More file actions
59 lines (47 loc) · 1.92 KB
/
arcus_3d_p1.py
File metadata and controls
59 lines (47 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
from machinekit import rtapi as rt
from machinekit import hal
from machinekit import config as c
from fdm.config import base
from fdm.config import storage
from fdm.config import motion
import bebopr as hardware
import rc_servo as servo
# initialize the RTAPI command client
rt.init_RTAPI()
# loads the ini file passed by linuxcnc
c.load_ini(os.environ['INI_FILE_NAME'])
motion.setup_motion(kinematics='itripodkins')
hal.Pin('itripodkins.Bx').set(c.find('MACHINE', 'TRIPOD_BX'))
hal.Pin('itripodkins.Cx').set(c.find('MACHINE', 'TRIPOD_CX'))
hal.Pin('itripodkins.Cy').set(c.find('MACHINE', 'TRIPOD_CY'))
hardware.init_hardware()
storage.init_storage('storage.ini')
# reading functions
hardware.hardware_read()
hal.addf('motion-command-handler', 'servo-thread')
hal.addf('motion-controller', 'servo-thread')
# Axis-of-motion Specific Configs (not the GUI)
# XYZ axes
for i in range(3):
base.setup_stepper(section='AXIS_%i' % i, axisIndex=i, stepgenIndex=i, thread='servo-thread')
servo.setup_servo_axis(servoIndex=0,section='AXIS_5',axisIndex=5,pwm='hpg.pwmgen.00.out.00', thread='servo-thread')
servo.setup_servo_axis(servoIndex=1,section='AXIS_3',axisIndex=3,pwm='hpg.pwmgen.00.out.01', thread='servo-thread')
#hal.Pin('motion.digital-out-10').link('mirror-deploy')
#servo.setup_servo_toggle(servoIndex=1,section='MIRROR',pwm='hpg.pwmgen.00.out.01', selectSignal='mirror-deploy', thread='servo-thread')
#errorSignals = ['temp-hw-error', 'watchdog-error', 'hbp-error']
errorSignals = []
base.setup_estop(errorSignals, thread='servo-thread')
base.setup_tool_loopback()
# Probe
base.setup_probe(thread='servo-thread')
# Setup Hardware
hardware.setup_hardware(thread='servo-thread')
# write out functions
hardware.hardware_write()
# read storage.ini
storage.read_storage()
# start haltalk server after everything is initialized
# else binding the remote components on the UI might fail
#hal.loadusr('haltalk', wait=True)
hal.loadusr('linuxcncrsh')