TheArtBot controls a pen in 3 dimensions. It moves the pen in a path that produces a drawing. This path is calculated beforehand by computer analysis of an image.
The pen is always oriented perpendicular to the paper by a flat surface that clamps onto the pen and slides on the paper, called the car. The car's position is controlled by 3 control strings (fishing line) that pull on the car and are opposed by a single elastic wire that provides counter force and therefore tension on the control strings. Each of these control strings is pulled by a spool on an electric stepper motor. All 3 stepper motors are driven in real time by a PC running TheArtBot custom driver software. The PC communicates to the motors via a USB Input/Output card (I/O card) whose signals are amplified up to 15 volts via 12 transistors.
There are 2 main programs that are used by TheArtBot:
- TheArtBot path generator
- TheArtBot driver
Both are custom pieces of software written from scratch specifically for this project. Both use C++ and are designed to run on a PC.
|TheArtBot Path Generator||Run prior to drawing||An image in the .BMP format||A .PATH file that defines a path for the pen to travel. This path is encoded as a list of points to sequentially visit. This is a custom file type defined for TheArtBot; is not the same as any other .PATH file.|
|TheArtBot Driver||Runs in real time by the PC attached to TheArtBot||The .PATH file||Sequential voltages on 12 binary (on/off) wires controlling the 3 stepper motors (4 wires per motor). Every ~3 ms all 12 wires will receive a new voltage. The wires are connected directly to the 5-wire stepper motors (after amplification).|
In Depth Description
- 3 unipolar, 5-wire/4-phase, 1.7 degree, 15V stepper motors
- 2 6-transistor chips (pn: sn754410) for amplifying I/O card voltage (3.2V) to motor voltage (15V)
- 12 wire USB I/O Card
- Felt tip 0.4 mm pen; Car to keep pen vertical; Backboard with arms for motor mounting; fishing line control strings, elastic cord to provide opposing force to control strings, paper
Major design decisions:
No sensors: TheArtBot uses no sensors. The driver only produces output but never sees input. This greatly simplifies the machine but has the following main disadvantages:
- Requires basic position calibration every startup
- Machine can get offset without knowing
- String actuated car vs the more conventional X, Y, and Z rack and pinion gears: My technique was cheaper, lighter, and easier to build. But, my string actuated technique actually increases software complexity because it requires converting coordinate systems.
- Use of elastic string instead of gravity to provide string counter force: Using an elastic string allows for a light car which means less inertia and less friction
- Control on PC vs Arduino or similar: Using a PC allows for much faster computation. A fair amount of computation is done every step (3ms) so I do not know if an Arduino could handle it.
There are many parts to the machine that need to be optimized to provide the greatest precision with fastest draw time.
|Variable||Optimum Value||Downsides of non-optimum value|
|Static coefficient of friction (μ) of sliding surface on car||Low||Strings will build up tension before moving causing a loss of precision|
|'Height' of A&B motors above paper (in XY plane)||High||Excessive force will be put on control strings when car is at top of paper causing stretching|
|Width of A&B motors around paper (in XY plane)||High||Tension on control strings will be too low when car is at the bottom opposite corner|
|Spring Coefficient (k) of control strings||High||My software assumes an infinite spring coefficient which simplifies calculations. It would be possible to calculate the force and therefore stretch of the control strings which would increase accuracy (but not precision).|
|Elastic Tension||Medium/Balanced||Control strings will have too little tension causing inaccurate positioning or too much tension causing excessive stretch|
First a .PATH file is generated by the Path Generator program. Then it is read by the Driver during the drawing. The .PATH consists of many XY coordinates that the pen must travel to sequentially. It also contains information telling the pen when to lift (to move without leaving a mark) and lower. This .PATH file is unique to TheArtBot and is not the same file format used in any external program.
As stated previously this program takes a path and generates the stepper motor wire values during drawing.
|path_generator||Goes through .PATH file and sets the goal (goto) coordinate. Once the machine reaches the coordinate, it sets the next goal coordinate. Also when it hits a lift or lower instruction, it executes it.|
|goto_calc||When a goto function is set, the driver records the starting and ending points and follows the path closest to the line between them. Each step, goto_calc is called and finds the next point to go to. Each motor's direction variable is then set. The 3 directions are increase, decrease, or stay the same.|
|pos_calc||For each motor: given the current position and the direction, it sets the new position.|
|out_calc||For each motor: given the position, it will calculate the 4 bit value to assign the wires leading to the motor. Note that this function has variable out_method which allows easy changing between wave drive, full step, and half step.|
|out||It actually assigns each pin its value (high or low) through the I/O card.|
TheArtBot Path Generator:
The only part of this project that is currently a trade secret. Check back in the future to see if I release the code.
In order to calculate the correct signals to send to the motors, the driver needs to know the following values of the specific ArtBot it is driving:
- Length per step of each motor: This is the distance the string will move when the motor turns one step. This is also the theoretical limit of software precision of the specific ArtBot. My value = 1/300 inch
- Speed of motors when drawing and not drawing: non-drawing speed is faster for greater time efficiency while not sacrificing accuracy when needed
- Lift height: how high to lift pen above paper
- Distance between A and B motors
- Location of C motor in X, Y, and Z
- Edges of paper in X and Y
These are the only variables needed by the driver software. So, if you were to build an ArtBot of completely new dimensions you would only have to measure these values for correct calibration.
- Account for control string stretch: Calculate force on control string and use Hooke's law to take into account stretching with software.
- Pen acceleration: My design has a constant pen speed. When starting from a stop or making sharp turns it would be advantageous to slow down to reduce the affects of inertia.
- Lower friction: Remove sliding friction between car and paper by using wheels. Normal caster wheels are not good enough because they tend to apply a torque when turning. An optimum wheel would have a support similar to that in a ball mouse.