For this project we were tasked with designing a 2.5 DOF robot to draw shapes and plot user generated files from programs such as inkscape. Our design consists of 2 stepper motors and a linear actuator. One stepper motor drives a belt and pulley system that attaches to a whiteboard. The other stepper rotates an arm with a pen at the end which draws on the whiteboard. The linear actuator moves the pen up and down to make contact and break contact with the board. The actuator is located at the end of the arm. Our design also features an LCD display which displays messages to the user and shows the progress of the selected drawing as it is being run.
- Pen Plotter Project
For this project we were tasked with designing a 2.5 DOF robot to draw shapes and plot user generated files from programs such as inkscape. Our design consists of 2 stepper motors and a linear actuator. One stepper motor drives a belt and pulley system that attaches to a whiteboard. The other stepper rotates an arm with a pen at the end which draws on the whiteboard. The linear actuator moves the pen up and down to make contact and break contact with the board. The actuator is located at the end of the arm. Our design also features an LCD display which displays messages to the user and shows the progress of the selected drawing as it is being run.
Figure 1: 2.5 Degree of Freedom Pen Plotter
Crown: https://youtu.be/f95ZIqNQvaE
Square: https://youtube.com/shorts/aVhunRlC_zI?feature=share
Triangle: https://youtube.com/shorts/GlujE-NrSug?feature=share
- 3D Printer
- Hand Drill
- Drill Press with drillbits
- Chop Saw
- Belt sander
There are also many parts that we chose to 3D print for rapid prototyping and to avoid complex part manufacturing. These are in the 3D printed part list below. All the fusion files that we used can be found on our github repository.
The belt and pulley we found had gears that had holes that were too large to fit on the stepper motor shafts so we designed our own gears. To do this we used a program called openscad which allows you to easily change parameters like teeth, profile, and motor shaft diameter. Our belt was an XL profile so we chose that option. The link to our openscad file can be found in our github repository with our code.
Figure 2: OpenSCAD Program showing our gear design
We used flanges to fasten the square stock to the wood particle board:
We used elbow to join our square stock together at the corner joints:
This attachment connects the end of the linear actuator to the pen
This part connects the rotating arm to the actuator and pen. The pen slides though a hole when the actuator is not extended. The linear actuator housing is press fitted into the bottom in a square hole and is secured using a set screw.
This attachment meshes with the gear on the stepper motor shaft. It is bolted into the rotating arm using M3 bolts.
This part secures the stepper motor to the top of the base assembly.
- 3D print all connector parts. Pictures of these can be found in the 3D print section. Fusion and scad files have been provided in Github
- Cut aluminum square stock to the following lengths
- 2x 3.5”
- 2x 20.25”
- 2x 9.5”
- 1x 4.75”
- 1x 15.5”
- Sand off any burs on the square stock on a belt sander
- Perform a rough assembly of the design to determine where to drill holes into the square stock. This includes press fitting the stock into the flanges and elbows and holding the elbow brackets on and positions of the stepper motors.
- Drill all holes in square stock and 3D printed parts using drill press
- To assemble the base
- Drill holes in the particle board and bolt flanges to the particle board
- Assemble square stock frame and place into flanges
- Bolt stepper motors into square stock
- Put 3D printed gears onto stepper shaft and rotating shaft (through bearings)
- Use JB weld or other similar strength adhesive to attach the whiteboard to the belt Stretch belt around the gearsWe suggest not drilling holes for the flange that sits under the bearings until you can judge how much tension you want to put in the belt then place the flange properly.
- Arm assembly
- Bolt through the hole at the end of the linear actuator and attach to Pen holder 3D printed part Slide the pen through the hole in the pen holder
- Press fit actuator into arm attachment 3D printed part
- Ensure pen can slide through the hole for it
- Drill arm attachment into square tube for the arm Drill square tube onto gear attachment
- Drill holes through counterweight and attach to square tube using angle brackets
- Mount Microcontroller to the board Attach __ to microcontrollers Drill through particle board and bolt m3 bolts into ___.
- Nucleo STML476RG
- Shoe of Brian
- X-NUCLEO-IHM04A1 dual brush DC motor driver expansion board for STM32 Nucleo
- Dual Motor Driver BoardTMC4210 TMC2208Capacitor
- 2x Power Supply = HP 6543A DC Power Supply
- Linear Actuator
- 2x Stepper Motors
- I2C Serial LCD Screen
- Wiring
- Wire cutters
- Soldering Iron
All wiring is done using the screw terminals located on the Shoe of Brian, Motor Driver Board and X-Nucleo.
To start we were given the motor driver board with surface mount components pre-soldered. We soldered the pins for connections with the Shoe of Brian and limit switches as well as the capacitor and the connections to the two MOT chips. We then attached a heat sink to the top of each chip using adhesive. For the connections between the Shoe of Brian and the stepper driver board we used pre-crimped wires that were put into a rectangular wiring harness to keep our wiring organized. Our wiring can be seen in the picture below.
Figure 1: Shoe of Brian screw terminal connections from Stepper Board
Figure 2: Wiring harness connections on the Stepper Board.
To connect the stepper motors, we had to modify them. We stripped off the PCB that they came with by heating the pads and then applying a levering force. We checked which wires are in phase with a multimeter and soldered them directly to the 4 exposed terminals and then paired them to put into matching screw terminals (1A & 1B, 2A & 2B). We twisted together each wire pair that was in phase to keep track of them easier. We connected the power supply to the Ground and MVIN screw terminals on the stepper board.
Figure 4: Stepper Motor Soldered Connections.
Our design takes an hpgl file created in Inkscape and processes the image using a Newton Rapson algorithm. We scaled the values of the hpgl file so that any size will still fit on our whiteboard. The code is structured using cooperative multitasking and shared variables between tasks. We wrote classes for the TMC4210, TMC2208, and actuator. We created tasks for the user interface, data processing, and motor driving. The user interface was originally supposed to include a manual input setting to run preinstalled files, but we had trouble implementing the functionality so we chose to scrap the idea. As a result, task user mostly just involves running the I2C LCD display that serves as our "bell and whistle." Task data takes the positional data from the html file and runs it through the Newton Raphson function to generate theta values that correspond to the position values. It then interpolates between them to smooth the drawing. The interpolated data for the two motors is put into a list to be sent to task motor one at a time as the machine draws. Task motor receives the positional data, converts it to ticks, and then sends the target position to each motor to draw as it runs. Task motor also handles the actuator object that triggers when it begins to draw and raises when it finishes drawing.
We used a Newton Raphson algorithm to convert the desired positional values to theta values that the motors could use. We developed equations for the system that related the motion of each motor with respect to the x and y axes on the whiteboard. This was achieved by using the zeroing capabilities of the Newton Raphson and adding the desired values to the original function so that it finds the zero at the desired location. Our Newton Raphson hand calculations and example code are provided in the following link:
https://github.com/kylehammer118/ME405-Pen-Plotter-Project/blob/main/HW0x02Kinematics%20(4).ipynb
Our Newton Rapson algorithm live plots the drawing in Jupyter Notebook. Although we did not include live plotting in our final design here is a screenshot of the liveplotting.
Our design features an LCD display that shows the user messages and tracks the progress of the drawing. The LCD also displays user messages from task user so that the user doesn't have to refer to the serial monitor.
We didn't end up implementing this in our task user, but we planned on using it. In the user interface the user can select from different template drawings that are already loaded onto the nucleo: triangle, circle, square. The user can also import their own hpgl file.
Our design draws fast and is easy to iterate because we can erase the board in between runs. This is definitely needed because of the inconsistencies created by the counterweight.
Our manufacturing plan wasn't planned out very well and we spent a lot of time figuring out how we were going to make our design work.
Our biggest challenge was finding a way to support the arm. Since the actuator added so much mass to the arm we didn't want to apply a torque to our stepper motor. Our initial idea was to have a cross bar that the arm would slide across, but our stepper didn't have enough torque to move the arm with that setup.
We instead chose to use a counterweight on the other side of the arm. This created a large amount of inertia in our arm. The arm has a good amount of sway at high accelerations and velocities, so we are unable to draw as quickly as we would like to.
This sway led to us having to tweak our motor driver because there was different amounts of sway depending on which way the stepper was rotating.
A better support mechanism for the arm that doesn't introduce friction or inconsistent inertia would improve the accuracy of our design. Each drawing we made we had to tweak our motor driver registers because of the inconsistency of the inertia of the arm. A good goal would be for the design to draw any shape perfectly without having to tune our motor driver.