-
Notifications
You must be signed in to change notification settings - Fork 6
/
remora-ec500.hal
54 lines (34 loc) · 1.8 KB
/
remora-ec500.hal
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
# Basic HAL config file for NVEM controller board running Remora firmware
# Configured for 3 joints (A, Y, Z axes) with home and limit switches
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
# load the Remora real-time component
loadrt remora-eth-3.0 PRU_base_freq=500000
# estop and SPI comms enable and feedback
net user-enable-out <= iocontrol.0.user-enable-out => remora.enable
net user-request-enable <= iocontrol.0.user-request-enable => remora.reset
net remora-status <= remora.status => iocontrol.0.emc-enable-in
# add the remora and motion functions to threads
addf remora.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf remora.update-freq servo-thread
addf remora.write servo-thread
# joint 0 setup (X axis)
setp remora.joint.0.scale [JOINT_0]SCALE
setp remora.joint.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net j0pos-cmd joint.0.motor-pos-cmd => remora.joint.0.pos-cmd
net j0pos-fb remora.joint.0.pos-fb => joint.0.motor-pos-fb
net j0enable joint.0.amp-enable-out => remora.joint.0.enable
# joint 1 setup (Y axis)
setp remora.joint.1.scale [JOINT_1]SCALE
setp remora.joint.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net j1pos-cmd joint.1.motor-pos-cmd => remora.joint.1.pos-cmd
net j1pos-fb remora.joint.1.pos-fb => joint.1.motor-pos-fb
net j1enable joint.1.amp-enable-out => remora.joint.1.enable
# joint 2 setup (Z axis)
setp remora.joint.2.scale [JOINT_2]SCALE
setp remora.joint.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
net j2pos-cmd joint.2.motor-pos-cmd => remora.joint.2.pos-cmd
net j2pos-fb remora.joint.2.pos-fb => joint.2.motor-pos-fb
net j2enable joint.2.amp-enable-out => remora.joint.2.enable