-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
112 lines (74 loc) · 4.62 KB
/
README
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Jog Dial for ChiliPeppr
This code is meant to allow button, jog, and shuttle events from
a Contour ShuttleXpress controller to flow to CNC machines
The original branch of this code was developed for communication
with the Serial Port JSON server typically used with ChiliPeppr
driven CNC machines.
The latest version adds communication to CNC machines driven with bCNC.
Interface to Shuttle Contour Xpress based on "Contour ShuttlePro
v2 interface" by Eric Messick.
Configuration instructions:
1. Edit shuttlecp.c and update the following items at the top of the file:
#define CNC_HOST "localhost" // Hostname where SPJS or bCNC is running
#define CNC_PORT "8989" // Port for SPJS or bCNC. Typically 8989 for Chillipeppr and 8080 for bCNC
#define DEVICE_PATH "/dev/ttyACM0" // Path for SPJS to connect to GRBL or TinyG. Not used for bCNC
#define TINYG 0 // set to 1 if you are using a TinyG
#define BCNC 0 // set to 1 if you are using bCNC instead of Chilipeppr
#define CYCLE_TIME_MICROSECONDS 100000 // time of each main loop iteration
#define MAX_FEED_RATE 1500.0 // (unit per minute - initially tested with millimeters)
#define OVERSHOOT 1.06 // amount of overshoot for shuttle wheel
2. For ChiliPeppr, make sure ChiliPeppr is already connected to the SPJS
and opened the connection to the board, as this utility sends commands
assuming that CP has already opened the port at the correct baud rate.
For bCNC, make sure that bCNC is running and connected to the GRBL board.
Build instructions:
(written for Raspbian, but should work for others)
1. Ensure openssl dev libraries are installed:
sudo apt-get install libssl-dev build-essential libcurl4-openssl-dev
2. Download the nopoll library from here: http://www.aspl.es/nopoll/downloads/
(I'm currently using version 0.2.7.b164 because I got a strange linking error when
I tried to compile 0.2.8.b184 for some odd reason. Feel free to try both).
Extract, configure, make, and install the nopoll library with the usual:
./configure
make
sudo make install
3. Download the cURL library from here: https://curl.haxx.se/download.html
Extract, configure, make, and install the cURL library with the usual:
./configure
make
sudo make install
4. If you will have leds or switches hooked to a raspberry pi, take a git clone
of the wiringPi utility and use their included build script to build and install
the library. Instructions are here: http://wiringpi.com/download-and-install/
If you aren't using led's and switches, just edit the Makefile and change the
GPIO_SUPPORT to 0 to disable it. You can also remove -lwiringPi from the libs
line.
5. Go into the ShuttleCP directory and run "make". Make sure you've edited
any items from the "Configuration" section above first.
make
I also do the following to install shuttlecp so that it can be run regardless
of which folder you are in when you execute the program.
sudo make install
Running:
1. For ChiliPeppr, first, make sure SPJS is already running and ChiliPeppr has
already opened a connection to your machine. I run SPJS on the same raspberryPi
that I run the ShuttleCP utility on.
For bCNC, make sure that bCNC is running and is connected to the GRBL board.
All alarms must be clared and the CNC machine state is reported as "Idle".
2. Start up shuttlecp with an argument that is the device interface for your
ShuttleXpress. Mine is /dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00
Use sudo so that wiringPi has access to GPIO pins:
sudo ./shuttlecp /dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00
Or, you can use the "./shuttle" script, which effectively does the same thing.
Autorun the shuttle script on boot using systemd in Raspbian Jessie:
Reference and more details at: http://www.raspberrypi-spy.co.uk/2015/10/how-to-autorun-a-python-script-on-boot-using-systemd/
We first need to add a unit file that tells systemd that we want it to launch the shuttle script on boot once the GPIO service has been activated. To do so, simply copy the file shuttle.service found in the shuttleCP directory by using the following command:
sudo cp /home/pi/shuttleCP/shuttle.service /lib/systemd/system/
Next, the permission on the unit file needs to be set to 644 :
sudo chmod 644 /lib/systemd/system/shuttle.service
Last, we can tell systemd to start the script during the boot sequence and reboot the RPi:
sudo systemctl daemon-reload
sudo systemctl enable shuttle.service
sudo reboot
You can confirm the new service is running by checking it's status:
sudo systemctl status shuttle.service