10264 - Drawing with Assistant May 2018
Assembly Time: 8 - 10 Hours
Approximate Cost: $287.83
- 3d print the assets in this directory.
- Laser cut this file out of .125 inch thick acrylic.
- Laser cut this file out of .25 inch thick acrylic.
- Order the hardware and electrical components listed in the bill of materials.
First, prepare the acrylic mounting plate for all of the electronics. Use a variety of standoffs to mount the electronics. The Keyestudio CNC board requires M3 screws while the raspberry pi requires M2.5 screws. Mount the dual output power supply flush to the plate with two M3 screws. Once everything is in place, the electronics can be wired. Wire the power input for the CNC GRBL board to 12 volts at output number 2. Wire the power input for the raspberry pi to 5 volts at output number 1.
Next, wire the board for power and connect the Raspberry Pi to the CNC board via USB. After joining the Raspberry Pi to the CNC board, begin to populate the motor driver sockets. There is three drivers total. One driver for the x-direction, one for the y-direction, and one for the z-direction, which actuates the marker color.
The pen turret allows the machine to hold 5 markers at once, so posters can feature multiple colors. The turret assembly is mostly 3d printed but contains a few pieces of hardware. Before assembling the two major printed components, load each cylinder of the changer with linear bearings. Attach the pen guides with the actuating tabs matching each of the 5 slots.
Join the lower and upper assemblies with a .25" metal shaft, which runs through the two flanged bearings contained in the upper assembly. Then, place a GT2 pulley on top to provide power from the Z-axis motor.
- Cut rail to length
The gantry movement depends on the two lengths of MakerSlide, one for the x-dimension and one for the y-dimension. For the x-dimension, cut one length of MakerSlide that is 16" long. For the y- dimension, cut another piece of MakerSlide that is 22" long. The ends of each piece have two holes in the center of the rails. Tap the holes on each of these ends with an M5 tap to be able to attach the motors and pen turret.
- Assemble the center bearing hub.
- The center bearing hub will move along the x-rail and hold the y-rail.
To assemble the bearing hub, install four smooth idler pulleys on the top side of the lower plate. Next, install four V-wheels on the underside of the bottom plate so it can travel along the x-rail. Place eccentric spacers in the larger holes on the bottom plate and attach the wheels with M5 screws through the eccentric spacers. Simply insert screws into the slightly smaller holes to attach the other two wheels. Install 4 V-wheels on the top side of the upper plate for the y-rail to travel through, again using eccentric spacers for two of the wheels. Using M3 screws and 20mm M3 standoffs, connect the top and bottom plates together to complete the center bearing hub. Slide the center bearing hub onto a length of the MakerSlide to verify the preload and make adjustments by rotating the eccentric spacers.
- Prep Rail Sub- Assemblies
Tap the four small holes, which surround the large hole in the top of each motor bracket using an M5 tap. Attach a motor bracket to one side of the 16" length of MakerSlide, then slide it through the wheels on the bottom of the center bearing hub, and fasten another motor bracket to the other side. Slip the pen turret assembly onto either end of the 22" length of MakerSlide and mark the locations for two M3 retention screws in the slots on each side. Drill a hole in each location and bore it with an M3 tap.
Tap the belt clamp (m5 tap) and attach the clamp to the belt retaining plate with an m5 screw. both the belt retaining plate and the 3rd motor bracket to the back of the 22" length of MakerSlide. Attach the x- and y-motors to their respective sides of the 16" length of MakerSlide. Route and tension the belt, referring to the core xy configuration if necessary. Tension the belt, tighten the belt clamp, and trim any excess belt. Attach the color selection motor to the 3rd motor bracket on the back of the 22" length of MakerSlide. Loosen the screws that hold the pen turret on the front of the 22" length of MakerSlide and install the closed loop belt between the pulleys on the color select motor and the pen turret. Pull the pen turret away from the color select motor to tension the belt then tighten the screws to secure the turret and belt tension.
Refer to this .dxf of the base gantry and motor pattern. Use the pattern to create a unique base for your machine. Ensure that your drawing surface 1.75 inches from the bottom of the 16" inch rail.
Download the latest Arduino ide.
Download the correct ch341 driver for your operating system.
Download this version of the GRBL library and import into the Arduino ide.
Connect the Keyestudio CNC GRBL board to your computer via USB
Flash the GRBL board with the GRBL library we previously downloaded.
Once the flash is complete, enter the following commands.
Open the Arduino serial terminal and enter the following commands:
$22=1
$23=3
$25=1000.000
$102=640.000
$110=5000.000
$111=5000.000
$112=2000.000
$120=150.000
$121=150.000
$122=150.000
$130=70.000
$131=100.000
There are three high-level components to the Assistant Poster Makers' software system that interact to create dynamic drawing output from speech input.
The poster art is generated in a browser using Paper.js, a vector graphics scripting framework. It offers complex drawing functionality such as offsets, scaling, and intersections for simple shape manipulation.
Google's Assistant SDK library for Python enables a conversational user interface for the machine. By leveraging custom device actions, we can control physical actions via pre-defined voice commands without having to leave the Google Assistant context.
A Node.js application running an Express web server acts as the "glue" for the system. Redis Pub/Sub is used as a messaging channel between the Python application and the Express server, and WebSockets are used for pushing data between that server and the frontend client. The Node.js app also uses a custom library to convert SVG (exported from Paper.js) to Gcode (runs on Grbl CNC controller).
- Download and install "Raspbian Stretch with Desktop" from the Raspberry Pi downloads page
- Connect the Pi to your network and SSH into the device:
$ ssh pi@IP_ADDRESS
- Clone the repository in the home (/home/pi) directory:
$ git clone https://github.com/Deeplocal/assistant-poster-machine.git
- Change directory:
$ cd assistant-poster-machine
- Set up Redis: See Redis Quick Start
- Set up Node.js application
- Install Node.js (we used v6.14.2 LTS Boron)
- Install application dependencies:
$ cd assistant-poster-node; npm install
- Set up Python module
- Follow all steps in the Embed the Google Assistant guide to configure audio, create a developer project, register the device model, and run the sample code
- Replace
assistant-poster-pi/misc/credentials.json
with your resulting credentials file - Replace PROJECT_ID with your project ID in
assistant-poster-pi/misc/deploy-actions-package.sh
- Replace ASSISTANT_DEVICE_ID with your device model ID in the contructor of
assistant-poster-pi/custom-assistant/_assistant_thread.py
- Replace
- Deploy action package
$ cd misc; ./deploy-action-package.sh
- Activate virtual environment and install dependencies:
$ python -m pip install pymysql pyserial redis
- Follow all steps in the Embed the Google Assistant guide to configure audio, create a developer project, register the device model, and run the sample code
- Run the system (all relative to
~/assistant-poster-machine
)- Start Redis server:
$ cd assistant-poster-node; redis-server redis.conf
- Activate the virtual environment and start Python module:
$ source ../env/bin/activate; cd assistant-poster-pi; python -um custom-assistant
- Start Node.js module
$ cd assistant-poster-pi; npm start
- Open frontend in browser
- Speak commands to start generating poster
- Start Redis server:
- Ensure correct version of Grbl firmware
- Ensure the correct serial device in the
run()
method inassistant-poster-pi/custom-assistant/_plotter_thread.py
- Troubleshooting the Google Assistant Library