Final Report - University of Victoria

advertisement
ENGR 499 Project 6
Laser Projector
"LE BOX"
Honorable Mention, Spring 2010
Supervisor: Mihai Sima
Supervisor Contact: msima@ece.uvic.ca
University of Victoria
Department of Electrical and Computer Engineering
Laboratory of Reconfigurable Computing Engineering
PO Box 3055, STN CSC
Victoria, B.C. V8W 3P6
CANADA
phone: +1-250-721-8680
fax: +1-250-721-6052
Students
Jacob Schwartz: malachi@uvic.ca
Kendall Olsen-Maier: kao@uvic.ca
Travis Danniels: tdanniel@uvic.ca
Phil Kostaluk: philk@uvic.ca
Group Contact: engr499@googlegroups.com
Special Thanks
Mantis Cheng, Ph. D., P. Eng
Kin Fun Li, Ph. D., P. Eng
Lynn Palmer
Andrew Garber
Polemesh
The Department of Computer and Electrical Engineering
The Institute of Electrical and Electronics Engineers (IEEE)
Innovation and Development Corporation (IDC)
List of Tables and Figures
Table 1: Observed Power Consumption of Components.......................................42
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
1: System Overview...............................................................................8
2: Laser Module Block............................................................................9
3: Human Eye Sensitivity to Laser Light Colour [1]...................................10
4: Galvanometer Preamp Block..............................................................11
5: OpenGL Flow Design.........................................................................14
6: Mouse Event Registration Process.......................................................15
7: Points Buffer...................................................................................15
8: Deliverables....................................................................................18
9: ILDA 12/30K Test Pattern..................................................................21
10: AVR Xplain....................................................................................22
11: LASER Unit....................................................................................23
12: Galvanometers...............................................................................23
13: Finalized Galvanometer and Laser Module Circuit................................24
14: Heatsink.......................................................................................27
15: Assembled Hardware......................................................................28
16: Assembled Hardware Schematic (inches, not to scale).........................29
17: Microcontroller Software Block Diagram.............................................30
18: Example DACA Configuration...........................................................32
19: Example DMA Configuration.............................................................32
20: Configuring TCD0 and Event System.................................................33
21: Using EBI and XPlain SDRAM...........................................................33
22: Double Buffered Output...................................................................34
23: Le Circles......................................................................................35
24: Number One..................................................................................36
25: Number Two..................................................................................36
26: Number Three................................................................................36
27: Number Four.................................................................................36
28: Fun Number Four...........................................................................37
29: Number Five..................................................................................37
30: ClickDraw.c...................................................................................37
31: Random Point Generator Snapshot 1.................................................38
32: Random Point Generator Snapshot 2.................................................38
33: Filter Grid Traversal Algorithm..........................................................39
34: ILDA Test Pattern (as displayed by LE BOX).......................................40
35: Laser Modulation Test Circuit...........................................................42
36: Laser Test Setup............................................................................43
37: 1Hz Square Wave Response.............................................................44
38: 25kHz Square Wave Response.........................................................44
Appendix III
Figure A: Jacob, Control Software, and Poster
Figure B: LE BOX and Flower Projection
Figure C: Image Published in the Victoria Times Colonist, Sunday March 28, 2010
Table of Contents
Table of Contents ................................................................................ 1
1.0 Introduction.................................................................................. 2
1.1 Purpose ....................................................................................... 2
1.2 Scope.......................................................................................... 2
1.3 Team Roles .................................................................................. 2
2.0 Problem Description...................................................................... 3
3.0 Design........................................................................................... 3
3.1 Requirements ............................................................................... 3
3.2 System Design ............................................................................. 4
3.3 Hardware Design .......................................................................... 6
3.4 Software Design ........................................................................... 8
3.5 Past and Alternate Approaches.......................................................13
4.0 Process ....................................................................................... 14
4.1 Milestones................................................................................... 14
4.2 Team Responsibilities ................................................................... 14
4.3 Safety Precautions ....................................................................... 16
4.4 Integration Plan ........................................................................... 16
4.5 Test Plan .................................................................................... 16
5.0 Hardware Implementation .......................................................... 19
5.1 Off The Shelf Components............................................................. 19
5.2 Control Circuits ............................................................................ 20
5.3 Assembly .................................................................................... 23
5.4 Physical Layout............................................................................ 24
6.0 Software Implementation ........................................................... 26
6.1 Microcontroller............................................................................. 26
6.2 Personal Computer ....................................................................... 31
7.0 Results ........................................................................................ 36
7.1 Summary.................................................................................... 36
7.2 Test Results ................................................................................ 37
7.3 Test Conclusions .......................................................................... 42
7.4 Challenges, Reflections, Limitations ................................................42
7.5 Future Improvements ................................................................... 43
Appendix I: Software Tools ............................................................... 45
Appendix II: References ................................................................... 46
Appendix III: Media .......................................................................... 49
Appendix IV: Other Documents ......................................................... 51
Appendix V: Source Code .................................................................. 52
Page 1 of 52
1.0 Introduction
1.1 Purpose
The ability to project large, sharp, highly visible vector images or animations on flat
surfaces has the potential to enable interesting new approaches to data visualization. This
should be realized in a portable, affordable, and user-friendly device so as to maximize its
number of potential users.
This project focuses on the design and implementation of a computer-controlled laser
projector which can display large, visually stunning vector images and animations on a
variety of surfaces. This can be applied to diverse fields such as education, manufacturing,
art, and marketing. Though such devices exist in the market today, they are generally
either prohibitively expensive, professional-grade systems making use of lasers dangerous
to the human eye, or simplistic with limited capabilities.
Our team aims to bridge this gap with a highly configurable laser projection system
designed with the goals of affordability and portability in mind. At a high level, the system
woks by tracing an image onto a surface using a laser beam. This is done at a sufficient rate
so as to give the impression of a complete image or animation being "projected" on to the
surface. The system is controlled entirely through software and is thus capable of displaying
custom images and animations.
1.2 Scope
Our efforts focus on the creation of a projector capable of displaying large vector images
and animations that are visible at a significant distance, especially indoors or at night. We
will build or purchase our hardware components according to our goal of affordability, and
produce our own custom software to allow users to create and display their own images.
The projector itself will be assembled as a prototype version, without regard for its visual
impact. This project consists mainly of a functional and affordable proof-of-concept, and will
not attempt to achieve a product with a marketable appearance. Instead the focus will be
on demonstrating a capable prototype, at low cost, with sufficient power consumption and
size for portability.
The system will be able to display built-in patterns or a custom feed of points streamed in
real time from an attached PC. Additionally, proof-of-concept software applications will be
created and used to demonstrate the hardware.
1.3 Team Roles
Kendall
•
•
•
•
Olsen-Maier: Project Manager
Team Leader
Documentation Leader
Process Management
Web and Poster Presentation
Page 2 of 52
Jacob Schwartz: Software Architect
• System Design
• Component Selection
• Lead Development
• Microcontroller Software
Travis Danniels: Hardware Architect
• Laser Module
• Component Assembly
• Hardware Integration
• Hardware Debugging
Phil Kostaluk: Software Developer
• Applications Research
• PC Software Design
• Hardware Integration
• Team Facilitation
2.0 Problem Description
There are many application domains in which the need for large graphic displays can arise.
Some examples include the arts, manufacturing, advertising, and education. In
manufacturing, large graphic displays can be used to precisely measure, cut, or assemble.
In education, they can be used to enhance a student's learning experience.
For many of these groups, the solution must also be affordable and portable, consuming
reasonable amounts of power. These displays must also be visible under variable light
conditions. To achieve this goal, lasers are the clear economical solution. This brings
another group of individuals to attention: beginners or other non-professionals aspiring to
create their own laser shows, whether beam or screen.
Outside of lasers, current solutions include standard TFT, LDC, or DLP projectors. While they
are available in a range of prices, these suffer from a fixed focus, which makes it difficult to
produce sharp images at long distances. For existing laser solutions, consumers have the
option of low cost novelty products, or high-end solutions which are often prohibitively
expensive.
Our solution aims to achieve a middle ground to appeal to the mass market, affording users
crisp images at range in variable conditions, without consuming excessive amounts of power
or funds.
3.0 Design
3.1 Requirements
The laser projector will display the ILDA 12/30K test pattern acceptably at a minimum of 8
degrees. Output should be capable of displaying 20,000 points per second either from builtin test images or from a realtime USB feed provided by a PC. The laser should be capable of
digital blanking allowing a complete on to off transition at 20kHz.
Page 3 of 52
Images will be visible when projected from 10m minimum before a noticeable decay in
quality due to dispersion.
3
Components will altogether be capable of fitting inside a 20cm space. The assembled
projector will be light enough for a single person of average strength to lift and transport it
without difficulty.
Power consumption must be low enough that the device could be operated for several hours
using a typical notebook battery which provides 50-100 Watt-hours of power.
The projector will be able to be connected to any modern (developed and sold after the year
2000) personal computer either of Apple Macintosh or Microsoft Windows variety.
PC to projector interfacing will be done using a standard USB device interface. If possible,
an existing device should be emulated and adapted such as a USB speaker or printer to
avoid the need to write a custom driver.
The total cost for components will remain below $300 CAD.
3.2 System Design
The final system will consist of four major components.
1.
2.
3.
4.
Personal Computer with Control Software
Control Module
X-Y Scanning Module
LASER Module
The project will consist of developing or purchasing all four components and integrating
them to create a single colour, high resolution laser vector display unit.
Page 4 of 52
Figure 1: System Overview
For the X-Y scanning module, manufactured closed-loop galvanometers offer the best
reliability and precision of control at low cost. By leveraging off-the-shelf components where
possible, the project can be directed towards software applications without having to divert
attention towards hand-assembling underlying hardware components.
The laser module will be a low cost, low to medium power Diode-pumped Solid State
(DPSS) laser. We will use one in the 500-560nm range of the green light spectrum for best
perceived visibility.
For the computer control unit, the two main options are to either output control signals
directly from a laptop or PC, or to control the system through an embedded device. The
trade-offs inherent in this decision were researched and are discussed in the Alternatives
section. The conclusion we drew from this was that the scanning and laser modules would
be controlled with a microcontroller, allowing for real time direct control of the hardware.
Lastly, the nature of the control software will depend significantly on the computer control
unit. The minimum software required will be a library for converting images and animations
to tables of X-Y coordinates, and driver software for sending these coordinates to the
control unit. Additionally, a more friendly user interface can be implemented depending on
the time available.
Page 5 of 52
3.3 Hardware Design
Physical Layout
For the purpose of this project, the components are mounted on a single flat board of wood.
Because the mounting block is non conductive no care must be taken to electrically isolate
the various components. All power will be provided by a standard North American AC 120V
3-prong connector.
In future designs the hardware would be mounted in a self-contained, portable 'lunch-box'
style enclosure containing a USB port for communications, a glass-covered aperture for
laser output, and optionally a DC power input for the charging of the battery power supply.
However, it was deemed unnecessary to provide this level of presentation as the plausibility
of the system could be determined without this.
Laser Module
The laser module will consist of a self-contained unit with three inputs: a power (3.0V), a
ground, and a modulation control.
Figure 2: Laser Module Block
The modulation control must allow on/off (digital) blanking of the laser. Ideally an analog,
variable intensity control could be implemented. 0V should correspond to no laser being
emitted, and 3.3V should correspond to a full power laser. If time becomes available, an
analog blanking signal can be implemented to allow for varying degrees of laser brightness.
The laser will be a <5mW low cost DPSS laser, of the common laser pointer variety.
Although there are no restrictions on laser pointers within Canada, self contained laser
pointers above 5mW are restricted in some countries including the United States. A 5mW
Page 6 of 52
laser will provide adequate brightness, comparable or exceeding that of a standard LCD
projector such as those used in classrooms.
A 532nm green laser was selected as it provides the highest perceived brightness at a low
power. A 5mW green laser can appear up to 50x as bright as a red or blue laser of similar
power.
Figure 3: Human Eye Sensitivity to Laser Light Colour [1]
0V will correspond to no laser emission for safety considerations. The control system uses
traditional logic so while it is in an invalid state (such as powering on, or reset by watchdog
timer) the control lines will lose power, thus triggering the laser to stop.
The modulation signal should be able to blank the laser completely from full brightness to
full darkness ideally at 20kHz or higher.
A separate power input is required as the current and voltage requirements of different
lasers may vary significantly and can not be matched by the control system. The typical
laser is expected to be approximately 3V and in the hundreds of milliamps range for current
consumption.
For this reason either a BJT transistor or a MOSFET may be used to provide the required
switching frequency and power requirements at low cost.
Galvanometer Preamp (Differential Amplifier)
The closed-loop galvanometers selected for the project conform to the ILDA convention for
control inputs. A Galvanometer Preamp circuit must translate the control signals from our
custom microcontroller signal into a compatible signal.
Page 7 of 52
Figure 4: Galvanometer Preamp Block
The SCANLSP20k galvanometers are operated by inputting a voltage signal with a potential
between -10V and +10V. -10V corresponds to full deflection left (or up) and +10V
corresponds to a full deflection right (or down). A 0V signal must correspond to no
deflection.
The control circuit will use a digital to analog converter which can only output single ended
signals in the range of 0V to 3.2V with minimal current.
The galvanometer preeamp circuit must take these two single-ended, low current signals
from the Digital to Analog Converter (DAC) and provide a larger current double ended
control signal which can be connected directly to the galvanometers control circuitry.
Keeping with portability, and low cost, the obvious choice for components is common analog
components (op amps, capacitors, resistors.)
3.4 Software Design
Microcontroller
The microcontroller software can be divided into two separate blocks running on seperate
processors which communicate through a bidirectional channel.
The portion of the software running on the ATxmega128A1 is referred to as block 1.
ATxmega128A1 - Block 1
One purpose of this block is to provide a constant stream of control outputs to the
galvanometer preamplifier and laser module.
Page 8 of 52
The galvanometer X and Y outputs will be analog voltage signals in the range of 0-3.3V. The
laser module output will be a digital blanking signal of either 0V for off, or 3.3V for on.
Timing must be as precise as possible, outputting values at a fixed rate of 20kHz.
The current control stream being output is based on a user-selected display mode. This
block is also responsible for managing of display modes.
Accessing of display modes will be done by pressing one of the eight microswitches. A single
press will place the system in a display mode corresponding to that button, and the
corresponding LED adjacent to the switch will be illuminated to indicate the current mode.
The seven display modes will be:
1.
2.
3.
4.
5.
6.
7.
DEFAULT
ILDA 12/30k PATTERN
TEST 1
TEST 2
ANIMATION 1
COMMUNICATION
DISABLED
In the Default mode a simple, rounded, and small test pattern will be displayed, such as a
Rhodonea Curve. This should provide immediate indication that the projector is operating
without putting stress on any of the components. No blanking is used and all angles are
small, with only a fraction of the maximum deflection used.
Mode 2 will provide a fixed output of the ILDA 12/30K test pattern at a fixed rate of 20,000
points per second over maximum deflection. This will allow manual adjustment of the
galvanometers and other calibration.
Modes 3 and 4 will cause the display of interesting frames containing as many points as can
be displayed by the hardware. These will provide interesting patterns for demonstration
purposes and demonstrate the capabilities and limitations of the low cost design.
Mode 5 will display a pre-calculated animation such as a waving flag.
Mode 6 will be the communication mode, which will enable the display of a point feed
provided over USB by an attached PC.
Mode 7 is activated by the 'kill switch' and watchdog timers. In this mode the laser module
is continuously fed an 'off' signal, and the galvanometers are continuously sent a neutral
position signal.
A watchdog timer should be implemented which will trigger the 'kill switch' if the system is
caught in an invalid state, for example by a communication error or hardware failure.
As much of the code will be developed and tested on block 1, a communications UART will
be implemented to allow the outputting of short debug ASCII strings to a connected PC
console.
Communications between the PC and the microcontroller will be done using the
AT90USB1287 and this software will be referred to as block 2.
Page 9 of 52
AT90USB1287 - Block 2 - Optional
Minimally block 2 will act as a communication gateway for debug strings to be delivered to
the PC from block 1.
The xmega has a Universal Asynchronous Receiver/Transmitter (UART) on UARTC0 which is
connected to the AT90. The XPlainBridge software provided by [2], LUFA, will be a
component of block 2 and allow the AT90 to act as a virtual COM port operating at 9600
BAUD, 8 bits, 1 stop bit, no parity, no flow control (9600 8N1). When connected to the PC a
communications channel can be opened using a terminal program such as PUTTY and short
ASCII debug strings can be displayed.
If adequate time is available then block 2 can be fully implemented, and utilized so the PC
applications can send point data to the projector for display instead of using only OpenGL
simulation.
Communications with the PC can be done through a custom device driver, or by emulating a
common device such as a USB speaker, for which a driver is likely already present on the
host machine.
Both block 1 and block 2 software implementation will be dictated by the constraints and
specifications of the xmega and AT90 microcontrollers, as well as the Xplain demonstration
board. The design was developed after careful inspection of Atmel AVR datasheets,
hardware user guides, and application notes [3] [4] [5].
Personal Computer
Goals
The PC's responsibility is to provide point data to the MCU, in the format in which it
processes Digital to Analog. The MCU expects X and Y coordinates to be 12bit integers,
making the range of the grid 4096x4096 with the origin at 0,0.
An OpenGL C program was designed to provide visual graphics testing and create, fill, and
provide the data structure of points to the MCU.
OpenGL C Program Design
The Open Graphics Library is to provide visual assurance that the point data sent to the
MCU represents the expected image. Points are to be generated using C code, put into the
structure that the MCU is expecting, and displayed with OpenGL. The process is outlined in
Figure 5.
OpenGL is able to draw a green line between points. If a point has the parameter "laser"
turned off, then the green line should not connect it with the next point. Conversely if the
parameter "laser" is on, the green line will be drawn between it and the next point.
Page 10 of 52
Figure 5: OpenGL Flow Design
Mouse Event Click Draw Design
OpenGL provides mouse callbacks for clicks, drags, and movement [6]. The process is
illustrated in Figure 6.
The Main Task is responsible for registering the callback from the mouse event. When a
click is made an event or interrupt is triggered to call the function mouseClicked().
MouseClick() must share a mutex with updateSimulation() in order to concurrently share
the mouse_data struct.
Page 11 of 52
Figure 6: Mouse Event Registration Process
Communication Diagram
The idea of the real time system is to provide streaming communication from the PC to the
MCU. USB offers this solution and is readily available. The following figure illustrates the
data structure to be streamed.
Figure 7: Points Buffer
Challenges
Due to the nature of the interactive style of development taken, some aspects of scale and
origin conventions were redesigned. To help adapt redesign during integration steps,
constants were used as scaling factors of screen images to ease design change in external
components (MCU).
Other challenges include the nature of image size variance. Images that are made up of less
points than others will be repeated more often. This encourages image sizes to be made up
of common factors.
Page 12 of 52
PC Overview
The PC interface is meant to be extensible to various interactive applications. Such designs
include GUI buttons that generate particular animations that can easily be switched at
runtime. Such animations require an open streaming channel from the PC to the MCU and
back. USB has been chosen to allow for ease of implementation and mainstream adoption.
3.5 Past and Alternate Approaches
Our main inspiration for the project and estimations of the work involved were based off of
a laser projector hobbyist who goes by the screen name of ChaN. His homemade laser
projector is discussed on his website, where he also provides an overview of his design and
implementation process including circuit diagrams and component schematics [7].
From this, we were able to conclude that building a consumer-grade product was indeed
feasible as a three month project, and that it would be possible to do so while aiming for
portability and affordability within the limits of the course.
ChaN's project consists of similar basic components: X-Y scanning galvanometers, laser
module (with cooling unit), power supply, and control software. He also chose to use a
green 5mW DPSS laser, however his model allows for up to 20mW of power with
adjustments. The containment box for the laser module includes temperature sensors
controlled by an ATmega8515 microcontroller to power off the laser if needed.
We choose not to use a high-powered laser for safety considerations, and concluded that
temperature control was unnecessary for the purpose of this project. For mounting our
projector, we opted for a non-conductive material such as wood. We also decided that
placing the components on a board would be sufficient, rather than building a stand for the
projector.
ChaN also built his own servo amplifiers. We investigated this option, determining that an
impressive, but minimal, laser scanner should be able to handle about 12,000 points per
second (12KPPS) with a deflection approaching 8 degrees.
In the worst case scenario, the mirror must tilt through 8 degrees, 12,000 times per
second. Calculating from this, our servo motor would need to spin at a speed of about
16,000 RPM. The fastest servo motors we could locate spin at speeds closer to 9,000 RPM,
meaning we would need to employ other techniques to approach our design goals.
While the servo solutions would be extremely affordable, the techniques required to achieve
an acceptable speed with them would cause our points to appear to snap to a grid, rather
than being truly analog. The complexity involved for low payoff dissuaded us from this
choice.
We considered using piezoelectric actuators, but unfortunately they are out of our price
range. After consulting with Dr. Colin Bradley of the University of Victoria, we learned that
another option we considered, MEMs mirrors, are also priced too high for a single prototype.
Moving to production, these would become affordable and offer more projecting options.
Closed-loop galvonometers were assembled by ChaN using other parts, which is an option
we also investigated for our project. For price considerations this would be more affordable,
but our aim was to focus on software applications rather than hardware.
Page 13 of 52
Looking into pre-assembled galvanometer kits, we narrowed our options down to the
following, listed in order of preference:
•
•
•
•
•
SCANLSP
SCANECO
SCANPRO
spacelas SP
DT-30
We were able to locate sellers for all of these products. While affordable, we could not find a
single review for the spacelas SP20K or 30K, and so ruled them out. The DT-30 and
SCANPRO are too expensive. We ended up with our first choice, the SCANLSP kit, as we
were able to acquire one for a lower price than normal. This allowed our project to focus on
assembly and software, rather than building components from the ground up.
The next major design decision we were required to make concerned the source of control
of the system, specifically whether to output control signals directly from a PC or to use an
embedded device. Our research indicated that using a PC or laptop would lead to more
significant design complexity and communication overhead. We decided to use a
microcontroller to allow for fast, direct control of the scanning and laser modules.
4.0 Process
4.1 Milestones
Jan. 22 - Progress report I
Jan. 26 - Begin: research part specifications, documentation
Feb. 01 - Finalize and order parts
Feb. 08 - Finish assembly portion of report (block diagrams, etc.)
Feb. 22 - Research interface/software development options, begin testing
Feb. 26 - Progress report II, parts arrive
Mar. 01 - Begin assembly, build control circuits
Mar. 04 - MCU arrives, begin development
Mar. 10 - Preliminary website design online
Mar. 18 - Circuits completed
Mar. 20 - Physical construction finalized
Mar. 22 - PC Control Software producing useful images
Mar. 24 - Project completed
Mar. 26 - Poster presentation
Apr. 01 - Finished gathering test data
Apr. 08 - Preliminary final report
Apr. 15 - Final report and website completed
4.2 Team Responsibilities
The project was divided into several identifiable deliverables and responsibility for the
individual portions of the project, as illustrated in Figure 8.
Page 14 of 52
Figure 8: Deliverables
All members of the group are responsible for participating in the report creation process.
This represents only a rough idea of where the workload actually falls: collaboration is
common to most deliverables.
Page 15 of 52
4.3 Safety Precautions
LASER Handling
Following ILDA and other well-known safety guidelines, we have chosen to consider only
lasers with 5mW of power for the purposes of this project. The use of a 5mW laser is not
strong enough to damage the human eye, but precaution to avoid prolonged direct contact
with the eye is recommended [8].
We will ensure proper caution is exercised when handling and powering up the laser,
especially around the galvonometers. Once our implementation is sufficiently far along to
have both components integrated, care will be taken to point the projector away from our
persons at surfaces others are unlikely to cross in front of.
For testing the visibility of our projections at range, we will use the wall of the ECS building
adjacent to the ELW lab provided for our work. 5mW lasers are classified as a mere
nuisance at distances greater than 50 feet [9]; this will provide us with at least that
distance within which no passers-by will cross.
For demonstrations of our project, we will ensure the projection is directed across an area
inaccessible by viewers, and remain vigilant of those wishing to visually examine the
projector more closely.
Component Integrity
The development method will be structured such that the critical components of the system
are protected. When a change is made, the integration of each component will be completed
to ensure this.
Additionally, all components of the system will be tested in isolation as much as possible
throughout the implementation process. Integration will be planned for ahead of time, and
thorough testing will be performed prior to the final steps of testing and debugging intercomponent communication and operation.
4.4 Integration Plan
Each component communication pair will be tested at each incremental step. The X-Y
Scanning Module is the most expensive and therefore will be integrated using a safeguard
process. Every time a change is made, the integration test process will be restarted and
possibly modified.
The safeguard process will use an oscilloscope to verify that the microcontroller and
differential amplifier are outputting the correct control signals.
4.5 Test Plan
Hardware Modules
The two principal hardware modules, the laser module and the galvanometer preamp, will
each be tested in isolation before integrating them into the rest of the system.
Page 16 of 52
The laser module's blanking input will be connected to 3.3Vpp, 1Hz - 20kHz square wave
signal with a 1.65V DC offset, and its output will be observed. The expected result is that
the laser module's output, a laser beam, will be capable of being switched at a frequency of
up to 20kHz. This will be measured by capturing the module's output with a phototransistor
and observing the rate at which the phototransistor switches from on to off.
The galvanometer preamp will be tested by passing it two 3.3Vpp, 1Hz - 20kHz sine wave
signals with a 1.65V DC offset and observing that its X and Y differential outputs range
between +/-10V, in phase with the input signal.
After the laser module and galvanometer preamp have been verified, they will both be
connected to an external circuit which outputs a known test pattern (see the following
section, "Test Pattern"). This external circuit essentially mimics the MCU, though it is only
capable of outputting a single pattern.
Following this, the output of the partial system will be compared with the expected output
and adjustments will be made as necessary. This will have completed the hardware
verification process, and the partial system will be ready to have the MCU added to it.
Test Pattern
The ILDA test pattern is a test metric promoted by the International Laser Display
Association [10] [11]. The test pattern allows for the tuning of closed-loop galvanometer
based projection systems and aims to provide consistency in image reproduction at a given
point transfer rate.
Although not a complete test of all capabilities, the ILDA test pattern is a useful metric to
quickly describe the performance characteristics of a projector. Shown in Figure 9 is a
computer plot of the ILDA 12/30K test pattern. The image contains 1,191 individual points.
Each point consists of a signed big endian 16bit X, and Y, and a 1bit blanking signal.
When displayed on a correctly-tuned projector the large hexagonal shape surrounding the
square in the centre will be displayed as a smooth circle contained just inside the square.
This is the circle-in-square test. The circle-in-square test provides a measure of
galvanometer speed tuning.
The horizontal lines at the top, as well as the scattered points in the bottom centre
demonstrate the laser blanking. These points in lines are a useful measure of the blanking
characteristics of the laser.
The test pattern will be used to experimentally determine our angle of deflection and verify
the successful completion and tuning of our system. By placing the laser projector at some
known distance from a flat surface and measuring the width and height of the projection,
we will be able to measure the angle at which we are able to project.
The test pattern will also inform us of where any further changes might need to be made to
tune the system, and whether or not blanking of the laser is functioning properly.
Page 17 of 52
Figure 9: ILDA 12/30K Test Pattern
Power Consumption
A multimeter will be used to measure the current and voltage of both the AC input and DC
output of our power supply. We will turn on and off the various components of the system
to determine which portion consumes the most power to aid in future plans to optimize the
design.
Additionally, the efficiency of the provided AC to DC power supply will be measured and
considered for possible improvement.
LASER Modulation
The rate at which the laser can be modulated, that is switched from full power to completely
off, will be tested. Laser response will be measured by using a phototransistor. Voltage drop
across the phototransistor will be measured using an oscilloscope.
The phototransistor is sensitive to infrared (IR) light, not visible light. However, a large
component of a low cost DPSS laser's power output is in the infrared spectrum. To keep
Page 18 of 52
costs down no infrared filter is attached. It will be assumed henceforth that phototransistor
response will be a sufficient indicator of visible light output.
A square wave control signal between 1Hz and 25kHz will be fed into the laser module and
plotted against the phototransistor response. Ideally, a square wave input at 20kHz should
result in a clean measured square wave output of the same frequency with minimal delay or
distortion.
It is expected that the actual charge time of the laser will be nonlinear and may limit the
maximum frequency to a much lower number due to capacitance and operating
characteristics of the DPSS laser.
5.0 Hardware Implementation
5.1 Off The Shelf Components
The project will use the following hardware components.
PC
Responsible for user interface, line art generation, and synchronization. Communication with
the MCU is done over a streaming USB interface, similar to a USB speaker. Performance
requirements are minimal, as the PC does not need to perform any expensive computation.
A standard laptop or netbook would do the job well.
The final prototype did not implement a USB interface so a PC was not necessary for the
demonstration. However, future iterations of the system will critically depend on an external
PC, as it provides the interactive component.
Microcontroller
The AVR Xplain is a demonstration board manufactured by ATMEL. The board provides an
ATxmega128A1 microcontroller, an AT90USB1287 communication chip, two high speed
12bit Digital to Analog converters, 8mb of SDRAM, as well as DMA for high speed data
transfers and various customizable timers.
Figure 10: AVR Xplain
Page 19 of 52
LASER Module
The laser module is assembled using a generic low cost DPSS (diode-pumped solid state)
5mW 532nm 3V laser unit ordered from China. The laser unit is supplied by a 3V linear
regulator and is placed in series with a transistor, allowing digital modulation of the laser's
power in the kHz range, forming a complete laser module. See the Design and
Implementation sections for further details on the laser module.
Figure 11: LASER Unit
Galvanometer Kit
The SCANLSP20K galvanometer kit consists of a power supply, two galvanometers arranged
in an X,Y scanning arrangement, and two driver boards for closed-loop operation. The
galvanometers supplied with the kit are rated at 20 kpps (thousand points per second)
when displaying the ILDA test pattern at a maximum deflection of 8 degrees.
This particular kit was chosen for its high speed and extremely low cost. The main downside
to purchasing this kit is that due to its low price, documentation and support are limited.
Additionally, the kit ships with a DMX board which allows for playing preset animations.
Figure 12: Galvanometers
5.2 Control Circuits
This section includes concrete, finalized hardware designs for the galvanometer preamp and
the laser module, as well as the analysis which lead to the designs.
Page 20 of 52
Figure 13: Finalized Galvanometer and Laser Module Circuit
Galvanometer Preamp
The galvanometer preamp circuit's requirements are as follows. The circuit was required to
take as an input two 0-3.3V, 0-20kHz signals, each representing an X or Y coordinate.
These signals were required to be amplified and output as +/-10V differential signals.
Additionally, the preamp was to take an additional 0-3.3 V binary input which would act as
an on/off signal.
A design satisfying the above requirements is shown in Figure 13, in the lower half of the
diagram. The circuit consists of two identical amplifiers for each of the X and Y input signals.
The amplifiers each consist of two stages.
In the first stage a differential amplifier linearly transforms the input signal at the noninverting input from 0-3.3V to -5-5V, assuming that the "output enable" signal is at 3.3V.
The next stage uses a voltage follower and unity-gain inverting amplifier to output both a
Page 21 of 52
±0-5V and ±0-5V signal, for a combined ±10V differential signal. An initial design lacked
the voltage followers. However, it was later recommended that they be added in order to
avoid using a loaded signal as an input to the second stage inverting amplifier.
Though not shown in Figure 13, each op-amp is connected to +15V and -15V supply
voltages, as these were available directly from the power supply included with the
SCANLSP20k kit. This eliminated the need for additional regulators. Though convenient, this
imposed an additional requirement on the op-amps; namely, that they could accept +/-15V
supply voltages. Lastly, 1 μF tantalum and 100 nF ceramic capacitors were placed in parallel
across each op-amp's supply inputs to ensure smooth operation.
Laser Module
The laser module circuit's requirements are as follows. The circuit was required to take a
binary 0-3.3V, 0-20kHz input representing a "blanking" signal and disable the laser when
the "blanking" signal was less than 3.3V.
A design satisfying the above requirements is shown in Figure 13, in the upper half of the
diagram. The transistor is an n-channel MOSFET with a gate threshhold voltage of 2.1V at
1mA. Thus, the 3.3V input from the MCU is more than sufficient.
As specified, current is able to pass through the laser only when a logical "high" voltage is
applied to the gate of the transistor. When a logical "low" voltage is applied to the gate of
the transistor, no current flows between its source and drain and the laser remains off.
Component Selection
After designing the galvanometer preamp and laser module, it was necessary to select their
components. The interesting component choices included the op-amps for the preamp, the
transistor for the laser module, as well as regulators to supply the laser. These component
choices are discussed in turn.
Requirements on the op-amps were mainly related to their slew rates, as they needed to be
able to switch at 20kHz. The op-amps also needed to to be able to take +/-15V supply
voltages. The component that was ultimately selected was the LF411, as it was available
and neatly satisfied the requirements with its 10V/μs slew rate. A brief calculation showing
the sufficiency of a 10V/μs slew rate for our requirements follows.
Assume a 20kHz sinusoidal signal with amplitude 3.3V:
x(t) = 3.3sin(2Π*20000t)V
x(t)'s maximum slope is:
max(dx(t)/dt) = 3.3*2Π*20000 V/s = 4.15*10^5 V/s = 0.415 V/μs
The required slew rate is less than the available slew rate of 10V/μs, justifying our
component choice.
The transistor for the laser module was required to be an N-type device which would pass
current with <3.3V and <10 mA into its base/gate, as it would be driven by an MCU. An
NPN BJT was initially selected, though later rejected because it required too much base
current. We ultimately decided on the 2N7000, an N-type enhancement-mode MOSFET
Page 22 of 52
which was readily available and met all requirements.
Lastly, the project required a voltage regulator which would accept at least a 15V supply
and output 3.3V for the laser. The group also wanted to go with a linear regulator for
guaranteed stability at the expense of efficiency.
This turned out to be more challenging than expected, as none of the available 3.3V
regulators were able to take 15V as a supply. Also, no adjustable-output regulators were
available at the time. We ended up placing a 7805 5V regulator (with a 15V supply) in
series with a 3.3V regulator in order to get around this issue.
5.3 Assembly
For the purposes of our prototype, the control circuits for the galvanometers and the LASER
module were implemented by assembling them both on a single breadboard.
During one of the final phases of our testing, the LASER module was inadvertently
connected to a 15V lead, causing it to become inoperable. We had planned ahead for this
risk, purchasing a 30mW laser pointer early in the term with our own funds. Swapping this
out was physically simple due to our setup, and the control module was modified as
illustrated in Figure 13 above.
We next encountered difficulties with running the projector for extended periods of time.
After several tests, we determined the cause to be an overheating regulator. The
overheating was caused by the newly added 30 mW laser, which drew a much higher
current than the previous 5 mW one. Due to time constraints, we implemented a quick fix to
this problem by using a heatsink, seen in Figure 14.
Page 23 of 52
Figure 14: Heatsink
This heatsink does not represent what we would consider to be an ideal solution. Other
possibilities are discussed in the Challenges section of this report.
5.4 Physical Layout
For the physical assembly of our components into one product, we began by tracing their
outlines onto our mounting board. We then pre-drilled holes, and attached components by
screwing them in according to their bracket placement.
For the driver boards, this meant screwing them in from below. An unfortunate side-effect is
that the tops of their heatsinks end up flush to the board, severely limiting their
effectiveness. This created another source of concern regarding heat for the project.
Page 24 of 52
Figure 15: Assembled Hardware
The power supply has been placed at the back of the board, the galvanometers and the
laser at the front, with the breadboard, driver boards, and microcontroller in between. The
laser is placed between two blocks of wood to mount it at the correct height to align with
the mirrors.
This assembly can be seen in Figure 15. Rough measurements for the size of the projector
and its component placement are listed in Figure 16 below. The microcontroller's placement
was not measured since it is still removable to allow for ease of its programming.
The scale begins at 0,0 in the top left corner, as standard. For demonstrations, we moved
the microcontroller to an outside corner of the board to allow the cord to reach further to a
PC. The placement of the USB port on the microcontroller (in the centre of a long edge) is
somewhat inconvenient for this layout as well.
Page 25 of 52
Figure 16: Assembled Hardware Schematic (inches, not to scale)
6.0 Software Implementation
6.1 Microcontroller
At the end of the project, block 1, the ATxmega128A1 software, was implemented as
designed and allowed for all of the display modes with the exception of the PC
communications mode.
Block 2 was not implemented due to time constraints, however it would be possible to
implement this as a future extension of the project. The decision to focus entirely on block 1
allowed for the project to be completed and demonstrated in partial form on time despite
other portions of the project overrunning initial estimates for completion dates.
This section discusses some of the key components of the software implementation for block
2. Due to the low level nature of the implementation some portions are omitted and only
small code snippets are provided. For further details please consult the full source code
included in alpha_final.zip (see Appendix V).
The xmega provides many hardware resources. A large portion of the developed software
serves only to correctly configure and initialize these modules. Once the initial configuration
has been completed much of the software operates automatically and without user
Page 26 of 52
intervention or the need of a control loop.
The following diagram illustrates which hardware resources were used and how these were
connected to the rest of the projector.
Figure 17: Microcontroller Software Block Diagram
Clock
The clock timer TCC0 is used to trigger an interrupt for polling the microswitches. TCD0 is
used to trigger the output of control signals at 20kHz.
Page 27 of 52
DACA
The xmega provides two Digital to Analog Converters (DACs), each with two output
channels. The XPlain demonstration board exposes the physical pin connections only for
DACA.
Because of this DACA was selected for analog output. Channel 0 was selected for X, and
channel 1 for Y.
It is important to note that manual calibration of the DAC was attempted using the
provided OFFSETCAL and GAINCAL registers, however usage of this only resulted in clipped
signals or no noticable improvement.
Eventually it was decided to disregard the calibration registers and instead just use the
factory calibrated defaults which were within a few percent of ideal. This appears to be a
known issue with the xmega microcontroller and is mentioned in the hardware users guide
[3].
As a future improvement, the DAC could be configured to instead use the 1V voltage
output DAC_REFSEL_INT1V_gc to avoid xmega quirks and other known issues. Also, an
automatic DAC calibration could be performed by internally rerouting the DAC to the ADC.
This would allow configuration of the calibration registers to high precision without user
intervention.
PORTA
DACA channel 0 is connected to PINA2. This is used for galvanometer X output. Similarily
DACA channel 1 is connected to PINA3 and used for Y.
PORTD
PIND5 is used as a digital out to control the laser module.
DMA
The general purpose DMA controller is used to copy blocks of memory in either 1, 2, or 8
byte bursts depending on the application.
EVSYS
The event system is used as a multiplexer and link to attach the clock timer TCD0 to DMA
transfer of X,Y, and blanking signals. Additionally, the event system is also used to trigger a
DAC conversion after the DMA transfer is complete. This ensures that all conversions
happen in sync with each other and that precise timing constraints are kept.
Microswitches
Microswitches are accessed on PORTF of the xmega and are polled at a fixed frequency of
200Hz. Button presses are debounced in software using a circular buffer recording the
previous eight values. When a button is pressed the current display mode is updated.
Page 28 of 52
LEDs
The XPlain provides 8 LEDs on PORTE. When the current display mode is changed PORTE is
updated to illuminate the respective LED.
DAC and DMA Configuration
The DAC can be configured to run in many modes. For this purpose, dual channel mode was
selected with output triggered on an event.
// Analog X, and Y.
// init dac in dual channel mode, trigger on event.
DACA.CTRLB = DAC_CHSEL_DUAL_gc | DAC_CH0TRIG_bm;
DACA.CTRLC = DAC_REFSEL_AVCC_gc; // ~3.3V
DACA.CTRLA = DAC_CH0EN_bm|DAC_CH1EN_bm;
DACA.TIMCTRL = DAC_CONINTVAL_32CLK_gc |
DAC_REFRESH_512CLK_gc;
DACA.EVCTRL = DAC_EVSEL_1_gc;
DACA.CTRLA |= DAC_ENABLE_bm;
Figure 18: Example DACA Configuration
Timing constraints are strict and ideally the MCU should be free for other processing. The
data values are sent to the DAC using DMA. The xmega DMA channel 0 was used for X,
channel 1 for Y, and channel 2 for blanking signals.
The xmega DMA module is extremely flexible and useful, however detailed discussion of it is
beyond the scope of this report. For output of analog X,Y values it was configured to copy a
BUFFER_LEN block, 2-bytes at a time to the DAC. This again was set to trigger on an event.
// Analog CH0 (x)
ptr = (void*)&DACA.CH0DATA;
DMA.CH0.ADDRCTRL = DMA_CH_SRCRELOAD_TRANSACTION_gc |
DMA_CH_SRCDIR_INC_gc
| DMA_CH_DESTRELOAD_BURST_gc |
DMA_CH_DESTDIR_INC_gc;
DMA.CH0.TRIGSRC = DMA_CH_TRIGSRC_DACA_CH0_gc;
DMA.CH0.DESTADDR0 = ((uint16_t) ptr) & 0xFF;
DMA.CH0.DESTADDR1 = ((uint16_t) ptr >> 8) & 0xFF;
DMA.CH0.DESTADDR2 = 0x00;
void* ptr = &dataBuffers[dataIndex].x;
DMA.CH0.TRFCNT = BUFFER_LEN;
DMA.CH0.SRCADDR0 = ((uint16_t) ptr) & 0xFF;
DMA.CH0.SRCADDR1 = ((uint16_t) ptr >> 8) & 0xFF;
DMA.CH0.SRCADDR2 = 0x00;
DMA.CH0.CTRLA = DMA_CH_ENABLE_bm | DMA_CH_SINGLE_bm |
DMA_CH_BURSTLEN_2BYTE_gc;
Figure 19: Example DMA Configuration
Page 29 of 52
The entire data transfer system is operated at a fixed frequency using the event system,
attached to the timer TCD0, configured to at 20kHz.
// set timer TCD0 to trigger an event on overflow
EVSYS.CH1MUX = EVSYS_CHMUX_TCD0_OVF_gc;
// 32Mhz / 1600 -> 20Khz
TCD0.CTRLA = TC_CLKSEL_DIV1_gc;
TCD0.PER = 1600;
Figure 20: Configuring TCD0 and Event System
SDRAM
The XPlain board provides 8MB of SDRAM which is accessible using an External Bus
Interface (EBI)
Although this was not used in the prototype, the SDRAM is configured to extend the
xmega's addressable memory starting at location 0x4000. If the prototype were futher
developed to include PC communications or more elaborate test patterns, this 8MB of
memory would provide ample room for communication buffers and multiple test patterns.
The snippet in Figure 21 demonstrates how EBI is configured based on the AVR application
note AVR1312.
EBI_Enable( EBI_SDDATAW_4BIT_gc,
EBI_LPCMODE_ALE1_gc,
EBI_SRMODE_ALE12_gc,
EBI_IFMODE_3PORT_gc );
EBI_EnableSDRAM( EBI_CS_ASPACE_8MB_gc,
(void *) SDRAM_ADDR,
false,
true,
EBI_SDCOL_10BIT_gc,
EBI_MRDLY_1CLK_gc,
EBI_ROWCYCDLY_1CLK_gc,
EBI_RPDLY_1CLK_gc,
EBI_WRDLY_1CLK_gc,
EBI_ESRDLY_1CLK_gc,
EBI_ROWCOLDLY_1CLK_gc,
0x03FF,
0x0100 );
Figure 21: Using EBI and XPlain SDRAM
An extremely crucial detail omitted in the AVR documentation is that AVR-GCC only uses
16bits internally to store its pointers. This creates a hard limitation on the software that no
16
memory location beyond address 2 (64k bytes) can be accessed.
Page 30 of 52
To access beyond this boundary the 16bit pointers must be extended to 24bits using a
custom assembly macro. A macro to do this, GET_FAR_ADDRESS(), was written by Carlos
Lamas and can be found in morepgmspace.h (see Appendix V).
Once a valid 24bit pointer is created using the above macro, data can be transferred in
8byte bursts using the general purpose DMA system.
Application Loop
Upon device bootup, the software sets the microcontrollers clock speed to 32MHz,
configures all of the required hardware resources specified above, and enters the main
application loop.
Two small 512-entry buffers of X,Y and blanking data are maintained by the application
loop.
#define BUFFER_LEN 512
struct {
uint16_t x[BUFFER_LEN];
uint16_t y[BUFFER_LEN];
uint8_t beam[BUFFER_LEN];
} dataBuffers[3];
volatile uint8_t dataIndex = 0;
Figure 22: Double Buffered Output
It is the application loop's responsibility to determine if the current buffer has been
completely output, as indicated by DMA interrupt flags, and trigger a swap of the current
buffer and initiate the filling of the now unused buffer.
The application will proceed, endlessly filling the buffers based on which of the 7 possible
display modes is currently selected.
6.2 Personal Computer
Open Graphics Library (OpenGL)
OpenGL is the standard API that was used to design and draw the 2D graphics suitable for
the projector to produce. OpenGL was used to visually check that image points resembled
the desired projective images. Python was used along with the OpenGL libraries initially,
and ported to C to integrate with the USB driver that sends to the micro-controller.
Quadratic Bézier Curves
The quadratic Bézier curve allows for easy point scaling and rounding of circular vector
images. It allows one to select three points and interpolate a curve from the first to the
third based on the second point. This algorithm referenced from [12] provides easy scaling
customization in the production and design of the vector image point sets.
Page 31 of 52
Circles
The C drawing program was extended to provide a function that takes in a parameter and
draws the appropriate sized circle. Each circle is approximated by sin and cos respectively.
Figure 23: Le Circles
Numeral Images
Using varying scaling factors and boldness, numbers from 5 to 1 were created and
simulated using OpenGL (Figure 24, Figure 25, Figure 26, Figure 27, Figure 28, Figure 29).
Number 3 (Figure 26) and 5 (Figure 29) harnessed the use of the quadratic Bézier curve.
Page 32 of 52
Figure 24: Number One
Figure 25: Number Two
Figure 26: Number Three
Figure 27: Number Four
Page 33 of 52
Figure 28: Fun Number Four
Figure 29: Number Five
Real Time ClickDraw
ClickDraw is the C program designed to draw points using a clicked mouse, while
continuously updating point data to the MCU over streaming USB.
Figure 30: ClickDraw.c
ClickDraw uses event data from callbacks generated by mouse interrupts. The location of
the mouse cursor when clicked is dynamically added to the point collection that is forwarded
to the USB stream.
Page 34 of 52
Space Screen Saver
A randomly generated point distrubution across all four quadrants was introduced as a
dynamic screen saver feature. The screen saver approach offers casual image projection
during event intermission, or could be dynamically adapted to compliment music or child
entertainment.
Random Points
The space screen saver implementation would distribute one quarter of the desired
maximum points per quadrant. This ensures slightly better even distrubution across the full
screen size. Points were restricted from being displayed near the edge, the X axis, and the Y
axis.
Once points are randomly scattered over the quadrant, they move closer to the corner with
each loop iteration. Once a point reaches the edge it disappears and a new one in the same
quadrant is recreated. Each point generated is a circle specified by an adjustable radius and
points-per-circle constant. The speed of the motion outwards can be tweaked by adjusting
the MILLISEC_PER_FRAME constant in the .h file (see Appendix V).
Figure 31: Random Point Generator Snapshot Figure 32: Random Point Generator Snapshot
1
2
A further implementation of the screen saver orders the random points and passes them
through a point filter. The point filter ensures that no two consecutive points have a
distance greater than the maximum laser movement requirement. This requirement is
roughly 10% of the screen size and aims to prevent the laser from moving too fast in
between points.
The filter uses the algorithm illustrated in Figure 33 to organize the points in the order in
which they require the least movement from the laser.
Page 35 of 52
Figure 33: Filter Grid Traversal Algorithm
Starting in the center, the filter moves along the traversal and adds the necessary points to
ensure that no two points along the traversal are more than 10% of the screen distance
apart. The points added can be visible or invisible, but are necessary to protect the X-Y
Scanning Module from moving too fast.
7.0 Results
7.1 Summary
We successfully assembled the components of our system and projected several preloaded
images and animations from the microcontroller. The button inputs on the microcontroller
can be used to switch between projections and to simply idle the system.
Interactive control software for a PC, ClickDraw, was created and tested. It allows users to
draw with their cursors and translates these images into a series of points that can be safely
used for projection. Unfortunately, time constraints prevented us from completing the USB
communication to allow for this in real time.
Our final prototype measures 19 inches by 11.75 inches, the majority of which represents
the board on which it has been assembled. It is light enough for any one of us to carry
easily, with the bulk of the weight again coming from the board.
With the death of our 5mW LASER, we were forced to switch to our backup 30mW option.
This required modifying our control circuit and increasing safety considerations accordingly.
Due to heat produced, we occasionally powered down our system while using it for
extended periods of time. We also learned it emits a wonderful woody smell while in
operation.
The resulting projections were bright enough that we decided to place two density filters in
front of the LASER module when operating the system indoors. Outside, the largest distance
Page 36 of 52
at which we tested the system was from a third floor ELW window across to the wall of ECS,
where the image was crystal clear.
7.2 Test Results
ILDA Test Pattern
Indoors, we projected the test pattern onto a bulletin board at a distance of 70.5 inches, as
seen in Figure 34. Because the board was propped up with a chair, the projector was not
centered and our surface was not perfectly perpendicular to the floor. The projector also
rested on a chair which was not level. As a result, our calculations should be taken as
approximations.
Figure 34: ILDA Test Pattern (as displayed by LE BOX)
The measurements we took for the test pattern are as follows:
• Top: 43.0 inches
• Right-edge: 41.25 inches
• Left-edge: 40.5 inches
To calculate the angle at which we are projecting, we used simple trigonometry. The test
pattern is not square, partially due to our projector setup not being perpendicular, so the
larger of the two height values was used in our calculations. The calculated arcs, rounded to
the nearest degree, are:
Page 37 of 52
• 33 degrees (vertical)
• 34 degrees (horizontal)
Expected results, based on the +/-20 degrees left or right deflection of the galvanometers,
were for the projection to sweep out in a 40 degree arc.
The difference is due to a lack of tuning options to map the output of the microcontroller's
DAC to the analog circuits. The DAC outputs roughly 3.2V at maximum, and the analog
circuit maps this to roughly +5V. There is no potentiometer or other way provided to tune
the analog circuit. The DAC calibration registers were tested but gave a poorer wave form,
and because of this are not being used.
A listing of the notable errors in the group's ILDA test pattern display and their likely causes
follows:
• The "circle" in the center of the pattern is noticeably distorted in two specific ways.
The first flaw is that the "circle" is actually an ellipse. This is indicative of a phase
difference between the two scanners, i.e., they are not moving at the same speed.
The second flaw is that the "circle" does not touch the midpoints of the sides of its
bounding square. This is indicative of the scanners being underdriven, i.e., they are
not deflecting as much as they should be at a given voltage. It should be possible to
resolve these issues by further calibrating the galvanometers and/or scaling their
control signals.
• There are stray lines in the image which should not be present. It is difficult to
determine the cause of this without a detailed analysis of both the system's
hardware and software. Possible causes include clipping occurring in one or more of
the signal amplification stages, timing errors in the control software, or crosstalk
from the laser modulation circuit.
• The image is generally "jittery" in that successively scanned lines do not overlap
exactly. It is also difficult to determine the root cause of this issue, though
mechanical vibrations and EMI are likely candidates.
Power Consumption
Using a multimeter, we attached probes to the AC input and DC output (+/-24V) of our
project's power supply in order to measure the current. We powered on and off the
galvanometers and LASER module throughout these tests, the results of which are
summarized in Table 1. We recorded the peak values observed.
The power consumption of the microcontroller is provided in its own documentation [4], and
is less than 400 mA. The consumption is code-dependent, mostly based on set frequency.
Code optimization could be improved by programing the microcontroller to sleep when idle,
and utilizing some of the advanced power saving features provided by the xmega and AT90.
We have calculated the power of our test states using the standard calculation of
multiplying the current by the voltage. The power and efficiency of the 4 states of the power
supply are listed below.
Idle consumption = 0.12A*24.0V + 0.14A*24.0V = 6.2 Watts
Galvanometers consumption = 0.73A*24.0V + 0.78A*24.0V = 36.2 Watts
LASER consumption = 0.14A*24.0V + 0.36A*24.0V = 12.0 Watts
Galvanometers and LASER consumption = 0.75A*24.0V + 0.98A*24.0V = 41.5 Watts
Page 38 of 52
The power consumption seems reasonable for a prototype but is a little high for a final
product. The ideal idle power consumption would be very close to zero.
At line voltage (120V)
AC input to power
supply
At -24V
DC
output
At +24V
DC
output
Idle consumption
0.13 amps
0.12 amps
0.14 amps
Galvanometers on
0.54 amps
0.73 amps
0.78 amps
LASER module on
0.21 amps
0.14 amps
0.36 amps
Both on, projecting ILDA test
0.61 amps
0.75 amps
pattern
Table 1: Observed Power Consumption of Components
0.98 amps
A source of this is the analog circuit, which is inefficient due to having heat concerns in the
regulator. The consumption loss during idle is 15% of the maximum consumption. To
remedy this, the regulator could be replaced with a transformer to reduce the power loss
due to heat.
From our calculations of approximately 42 +- 0.9 Watts we can conclude that the current
prototype would run off a laptop battery for up to a few hours.
LASER Blanking
We began by using a lab signal generator to output a 3.2Vpp square wave with a DC offset
of 1.6V and used this as our input to the laser module at frequencies between 1Hz and
25kHz.
The test circuit specified in section 4.5 was implemented using a TIL78 phototransistor and
a 1K resistor in series, as shown in Figure 35. The switching speed of the TIL78 is in the
GHz range, which far exceeds the test frequency ranges being experimented with. The IR
output of the laser is sufficient to fully saturate the transistor when directly illuminated.
Figure 35: Laser Modulation Test Circuit
Page 39 of 52
The X oscilloscope probe (top waveform) was connected across the phototransistor as
shown in Figure 36. The Y oscilloscope probe (bottom waveform) was connected directly to
the signal generator which was providing the control signal to the laser module.
Figure 36: Laser Test Setup
Figure 37: 1Hz Square Wave Response
Page 40 of 52
As shown in Figure 37, the response to a 1Hz modulation signal (top waveform) produces a
matching 1Hz response across the phototransistor (bottom waveform). There is little
distortion and no ringing to be seen. Due to the type of transistor employed, a laser-off
signal (0V in upper waveform) results in a positive voltage flow displayed here as a peak on
the lower waveform.
Figure 38: 25kHz Square Wave Response
At higher frequencies the non-linearity and delay of the laser output can be clearly seen, as
in Figure 38. Using a control frequency of 25kHz the response is shown to be a rounded
wave resembling out of phase ski moguls instead of the desired square wave.
By visually inspecting the above plot it can be seen that the laser requires a 'charging' time
of approximately 20 microseconds from an on signal, shown as the rising edge of the square
wave, until the phototransistor reaches saturation, shown as the rounded wave hitting its
lowest point.
When the control signal switches to off, as indicated by the falling edge of the control
square wave, it can be seen that approximately 15 microseconds elapse until the response
reaches its zero point, shown as the high peak of the rounded wave.
Due to this characteristic of the laser, using the laser module as designed a maximum
frequency of approximately 10kHz was attainable. The charging time was visibly and
measurably longer than the discharging time. This resulted in a delay in lines that had a
gradual fade-in and rapid fade-out.
The maximum 10kHz frequency attained was below that of the ideal 20kHz or higher goal
set forth in the design, but is sufficient for common applications of the projector. In typical
images it is unlikely that the laser will need to be switched on or off for every single point.
Instead, long spans of "beam on" and "beam off" points will occur.
Page 41 of 52
To compensate for delayed or nonlinear blanking, rest points could be added to keep the
laser beam in a fixed position while it charges or discharges from its current state. This
additional delay of 20 microseconds before and after points requiring precision is of no real
consequence to the system.
7.3 Test Conclusions
We have successfully met the majority of our project requirements. The prototype was
successful in demonstrating that all of the original goals set forth could be reached.
In full daylight we are able to see a projection clearly at a distance of over 1m. At night,
with clear conditions, projections are easily visible being projected a distance of
approximately 30m onto an unsurfaced concrete wall using the 30mW laser module.
We did not manage to satisfactorily display the ILDA 12/30K test pattern. More tuning of
both the control software and the analog components is needed. This ILDA compatibility
should pose no challenge based on our component selection or assembly. Once issues
involving noise and blanking are resolved ILDA compatibility can be reached. No significant
distortion or serious display errors were detected.
We did not meet our ideal goal of 20kHz modulation for the laser module, however
acceptable blanking performance was attainable at a rate of 10kHz. Further hardware
tuning, or small software modifications could be used to overcome this limitation.
The projector has negligible weight. It is easy to carry even in prototype form and affixed to
a large plank of wood. As shown in the project summary, our components could be easily
3
assembled into a compact design less than 20cm .
Power consumption tests indicate that we would be capable of running our projector off of a
laptop battery for a reasonable period of time of 1-2hrs without improvements. With
improvements it may be possible to greatly increase this.
Our final cost for components was under the $300 CAD goal.
Overall, our projector comes close to matching our initial requirements, and represents a
significant milestone towards a finished product. Fine-tuning work with regards to the
accurate projection of images and animations, as well as efficiency of our analog circuit, is
reccomended for future versions. However, we have successfully created an initial proof-ofconcept system.
7.4 Challenges, Reflections, Limitations
The major limitation of our projector is its inability to perfectly display the ILDA test pattern.
With more time to test and tune our system, and more debugging of the circuitry, we could
achieve a much better end-product. The hardware components themselves behave as
expected, and are unlikely to be defective. Therefore, this is either the result of minor flaws
in our design, or simply an issue of calibration.
Due to the heat incurred by the regulator and the way the galvanometers' driver boards are
attached to the wooden board by the top of their heatsinks, LE BOX becomes hot very
quickly. We found ourselves powering it down occasionally throughout long periods of
testing to allow it to cool, for fear of scorching the wooden board or damaging components.
Page 42 of 52
In retrospect, while creating a truly visually attractive, marketable product was outside the
scope of this project, it would have been feasible to produce a more compact assembly, and
possibly create a cover of some kind to improve presentability.
We also wished to move away from a breadboard implementation and use a more
permanent form of wiring such as a soldered stripboard. While the current presentation is
not ideal, the end result is that it allowed us enough flexibility to respond to unexpected
events that required changes to our design near the end of the project's development.
To tackle the previously discussed issues we ran into with heat, we could make a couple of
changes. The first move would be to address the issue of heatsink placement in our physical
assembly for the galvanometers' driver boards.
By either re-designing and creating a different containment box for the projector, or by
removing them and finding a different way to attach them to the board, we could expose
the largest part of the heatsinks to the open air and allow them to function correctly.
The mitigate the heat loss from the regulator, we could simply replace it with another option
that would better manage the voltage drop. This would be a good alternative to a heatsink,
simplifying our circuitry.
We could also approach the heat issues by implementing a temperature control of some
kind, similar to how this is done in [7]. This option is less attractive, as it inconveniences
users by forcing them to wait for LE BOX to cool enough for them to be able to restart it.
7.5 Future Improvements
Given more time and resources, there are several avenues for improvement and extension
that could be explored for this project.
The first step would be to tune and finalize our design to ensure everything reliably operates
exactly as expected, projecting the ILDA test pattern satisfactorily and making full use of
the capabilities of our hardware components.
The USB communication could be completed to finish integration with ClickDraw to make
our projector truly interactive in real time. With our analysis regarding heat loss and
component sizes, we could change materials and compact the physical layout to improve
portability.
To achieve true portability, the other elements of our design to address would be battery
operation and physical assembly. From our test results we have concluded that LE BOX
could be run off of a laptop-caliber battery for a few hours. Creating proper portable
housing, including this battery, would allow for true mobility for users.
For a more impressive visual display, two different-coloured lasers could be used in
combination with dichroic mirrors to produce multicoloured projections (2 lasers would
produce 3 colours, and with analog modulation a huge range between the 3 hues)
Another way to improve interactivity is to add the option to interface with other peripherals,
such as Nintendo Wiimotes, cameras, and iPods. We could create new software to allow the
display to change based on the music playing on the iPod (or other MP3 player), similar to
visualizations provided through programs such as Windows Media Player.
Page 43 of 52
Wiimotes could be used to play games using vector graphics, like Pong or Asteroids.
Another option is to add a camera to detect either human fingers at close range, or other
laser pointers at a distance. Upon detecting these, displayed options could be chosen by
users, or new lines could be drawn with the projector.
If producing LE BOX on a large scale, we could choose to use other, better technologies
such as MEMs. While MEMs is unattainable for a project such as this, when moving to
production it becomes very affordable and would greatly improve our projector.
Page 44 of 52
Appendix I: Software Tools
Google Applications
Google Docs was used to create, store, and concurrently merge work on project
documentation and reporting.
Google Groups was used to store files, and consolidate email conversations.
OpenGL (Open Source Graphics Library)
OpenGL is used from a C program to connect points with a green line, and visually display
the resulting graphic. OpenGL is used as a visual logic test for x-y point data and
modulation.
IDE (AVR Studio)
AVR Studio combined with AVR-GCC is used to build, and compile C code for the
microcontroller.
Flip 3.4.0
Flip is an acronym for FLexible In-system Programmer. Flip is used to load the compiled
program binaries onto the microcontroller.
OmniGraffle Professional 5.2.1 (v138.12.0.121252)
OmniGraffle has been used to construct all necessary non-circuit diagrams.
XCircuit
XCircuit has been used to construct all necessary circuit diagrams.
Other
The free graphical editing program Paint.NET has been used to crop and resize pictures for
this report, as well as to sample colours to use in the creation of our demonstration day
poster.
Adobe PhotoShop was also used during the creation process of the poster, which is available
on our project website (see Appendix III).
Notepad++ has been used in developing the project website, along with several browsers
for testing its appearance. The site is hosted on UVic's provided webspace.
Page 45 of 52
Appendix II: References
Cited
[1] Power Technology Inc., "Visible laser light & eye color sensitivity,"
powertechnology.com, 2004. [Online]. Available:
http://www.powertechnology.com/PDFs/WP_eyecolorsensitivity.pdf.
[Accessed: Apr. 13, 2010].
[2] D. Camera, "LUFA (2010)," Memos From the Cube, 2010. [Online]. Available:
http://www.fourwalledcubicle.com/LUFA.php. [Accessed: Feb. 5, 2010].
[3] Atmel Corporation, "ATAVRXPLAIN," Atmel Products, 2010. [Online]. Available:
http://www.atmel.com/dyn/products/tools_card_v2.asp?tool_id=4506. [Accessed:
Feb. 6, 2010].
[4] Atmel Corporation, "8/16-bit AVR XMEGA A1 Microcontroller," Atmel Products, 2010.
[Online]. Available:http://www.atmel.com/dyn/resources/prod_document/
doc8067.pdf. [Accessed: Feb. 6, 2010].
[5] Atmel Corporation, "Application Notes," Atmel Products, AVR1001, AVR1317, AVR335,
AVR1300, AVR1301, AVR1304, AVR1306, AVR1307, AVR1309, AVR1312, AVR1313,
AVR1907, 2010. [Online]. Available: http://www.atmel.com/dyn/products/
app_notes_v2.asp?family_id=607. [Accessed: Apr. 1, 2010].
[6] OpenGL, "GLUT Specification", The Industry Standard for High Performance Graphics,
2010. [Online]. Available: http://www.opengl.org/documentation/specs/glut/
spec3/node50.html. [Accessed: May. 8, 2010].
[7] "Home Built Laser Projector," Electronic Lives Manufacturing, 2006. [Online]. Available:
http://elm-chan.org/works/vlp/report_e.html. [Accessed: Jan. 11, 2010].
[8] "FAQ," Laser Pointer Safety. [Online]. Available: http://www.laserpointersafety.com/
FAQ/FAQ.html. [Accessed: Jan. 24, 2010].
[9] "ILDA Pushes for Pilot Training: Laser/Aircraft Incidents Highlight Information Gap," The
Laserist. [Online]. Available: http://www.laserist.org/Laserist/Safety_3.html.
[Accessed: Apr. 6, 2010].
[10] Pangolin Laser Systems Inc., "About the ILDA Test Pattern," Pangolin Laser Systems
Inc., 2007. [Online]. Available: http://www.pangolin.com/ILDAtest.html.
[Accessed: Apr. 6, 2010].
[11] B. Benner and P. Murphy, "How to Tune to the ILDA Test Pattern," Laser Effects The
Light Show Quarterly, 1994. [Online]. Available: http://www.laserfx.com/
Backstage.LaserFX.com/Systems/Scanning1.html. [Accessed: Mar. 1, 2010].
[12] Wikipedia contributors, "Bézier curve," Wikipedia, The Free Encyclopedia, 2010.
[Online]. Available: http://en.wikipedia.org/wiki/Bézier_curve. [Accessed:
Mar. 1, 2010].
Page 46 of 52
General
[13] Lasershowparts, "SCANLSP20," Lasershow Parts, 2009. [Online]. Available:
http://www.lasershowparts.com/files/Manuals/SCANLSP/SCANLSP20.pdf.
[Accessed: Mar. 21, 2010].
[14] Lasershowparts, "SCANLSP program board manual," Lasershow Parts, 2009. [Online].
Available: http://www.lasershowparts.com/files/Manuals/SCANLSP/SCANLSPPB.pdf.
[Accesed: Mar. 21, 2010].
[15] M. Cheng, "An Engineering Design Process," March 2010. [Online]. Available:
http://webhome.csc.uvic.ca/~mcheng/466/notes/designprocess.html. [Accessed:
Jan. 30, 2010].
[16] "At Home with Five Decades of Color in the US," COLOURlovers, 2007. [Online].
Available: http://www.colourlovers.com/blog/2007/04/30/the-past-five-decadesof-color-in-the-us/. [Accessed: Mar. 7 2010].
[17] RCA EDP, "SPECTRA 70 RCA/EDP Systems," Computer History Museum Archives,
1965. [Online]. Available: http://archive.computerhistory.org/resources/text/RCA/
RCA.SPECTRA70.1965.102646099.pdf. [Accessed: Mar. 6, 2010].
[18] H. Bronleigh, "How to Cite References - IEEE Syle," Murdoch University Library, 2008.
[Online]. Available: http://wwwlib.murdoch.edu.au/find/citation/ieee.html.
[Accessed: Apr. 6, 2010].
[19] Laser F/X, "Standards - ISP-BD25," LaserFX.com, 2008. [Online]. Available:
http://www.laserfx.com/Backstage.LaserFX.com/Standards/ISP-DB25.html.
[Accessed: Mar. 31, 2010].
[20] Physik Instrumente, "Piezo Ceramic Motors / Piezo Linear Motor Stages / Non
Magnetic Ceramic Actuators," PI-USA.us, 2010. [Online]. Available:
http://www.pi-usa.us/products/Piezo_Motors_Stages/Piezo_Motors_Stages.htm.
[Accessed: Jan. 19, 2010].
[21] Cambridge Technology, "Galvanometer Based Optical Scanner: 6200H Moving Magnet
Closed Loop," camtech.com, 2008. [Online]. Available: http://www.camtech.com/
products/6200/6200.html. [Accessed: Mar. 1, 2010].
[22] "Mini-review of new (and very affordable) ScanLSP-20 scanners from
LaserShowParts.com," Photonlexicon.com, 2009. [Online]. Available:
http://www.photonlexicon.com/forums/showthread.php/?p=112326. [Accessed:
Jan. 30, 2010].
[23] "Lasershowparts: SCANPRO20K + DMX board review," LaserFreak.net, 2008. [Online].
Available: http://www.laserfreak.net/forum/viewtopic.php?f=6&t=43436.
[Accessed: Jan. 29, 2010].
[24] Lasershowparts, "SCANECO20 Economy 20Kpps Galvonometer Kit + 'Lasershow Player
Board'," Lasershow Parts. [Online]. Available: http://lasershowparts.com/
store/index.php?_a=viewProd&productId=7. [Accessed: Jan. 21, 2010].
Page 47 of 52
[25] D. Camera, "Loading the XPLAIN Bridge code into the XPLAIN board," Memos From
the Cube, 2010. [Online]. Available: http://fourwalledcubicle.com
/blog/archives/508. [Accessed: Feb. 11, 2010].
[26] AVR Freaks contributors, "Documentation:Tutorials gcc AT90UsbKey," AVR Freaks
Wiki, 2010. [Online]. Available: http://www.avrfreaks.net/wiki/index.php/
Documentation:Tutorials_gcc_AT90UsbKey. [Accessed: Mar. 10, 2010].
[27] G. Hunka, "Circuit Grounds and Grounding Practices," University of Pennsylvania.
[Online]. Available: http://www.ese.upenn.edu/rca/instruments/misctutorials/
Ground/grd.html. [Accessed: Mar. 18, 2010].
[28] Digi-Key Corp., "Digikey Corp. Homepage," digikey.com, 2010. [Online]. Available:
http://www.digikey.com. [Accessed: Feb. 6, 2010].
[29] S. M. Goldwasser, "Diode Lasers," Sam's Laser FAQ, 2009. [Online]. Available:
http://members.misty.com/don/laserdio.htm. [Accessed: Jan. 27, 2010].
[30] Linux-Laser.org, "Homepage," 2006. [Online]. Available: http://www.linux-laser.org.
[Accessed: Mar. 1, 2010].
[31] "Laser Pointer Forums," Jelsoft Enterprises Ltd., 2010. [Online]. Available:
http://laserpointerforums.com. [Accessed: Jan. 24, 2010].
[32] Laser F/X, "How Laser Shows Work - Scanning System," LaserFX.com, 2008. [Online].
Available: http://www.laserfx.com/Works/Works3S.html. [Accessed: Jan. 30,
2010].
[33] Photondream, "Laser Frame Database," photondream.com, 2007. [Online]. Available:
http://www.photondream.com/frames/index.php?pid=2. [Accessed: Mar. 25,
2010].
[34] Laser F/X, "About Laser F/X - Laser Clip Art," LaserFX.com, 2008. [Online]. Available:
http://www.laserfx.com/Services/ClipArt.html. [Accessed: Mar. 25, 2010].
[35] Wikipedia contributors, "Rose (mathematics)," Wikipedia, The Free Encyclopedia,
2010. [Online]. Available: http://en.wikipedia.org/wiki/Rose_(mathematics).
[Accessed: Mar. 25, 2010].
Page 48 of 52
Appendix III: Media
Pictures
This section contains pictures taken during our project demonstration on Friday March 26,
2010, along with appearances in other media.
Figure A: Jacob, Control Software, and Poster
Figure B: LE BOX and Flower Projection
Page 49 of 52
Figure C: Image Published in the Victoria Times Colonist, Sunday March 28, 2010
Website
Our website can be accessed at the following location:
http://www.web.uvic.ca/~kao/499/
Online documentation, source code, pictures, and other media such as the demonstration
day poster are available.
Page 50 of 52
Appendix IV: Other Documents
Final Summary
What is LE BOX?
3
LE BOX is a flexible, inexpensive laser projection system. Measuring less than 20cm and
controlled via USB, LE BOX is designed as a consumer grade projector. Possible applications
include LASER light shows, art, advertising, entertainment, manufacturing, education, and
data visualization.
The system consists of a high intensity green laser and two steering mirrors controlled by a
micro-controller. Current professional-grade systems are prohibitively expensive, starting in
the thousands of dollars, and involving dangerously powerful LASERs and high voltage.
Consumer-grade solutions are simplistic and only allow the display of primitive shapes and
animations. Our product is designed to bridge the gap between these two extremes.
Designed as an affordable (under $300) projection system, LE BOX is capable of displaying
complex shapes and animations.
Progress Report I
Our first progress report is available for download in PDF format on our project website. The
direct link is: http://www.web.uvic.ca/~kao/499/Progress_Report_I.pdf
Progress Report II
Our second progress report is available for download in PDF format on our project website.
The direct link is: http://www.web.uvic.ca/~kao/499/Progress_Report_II.pdf
Page 51 of 52
Appendix V: Source Code
All of our source code, including the code for ClickDraw and for the microcontroller, is
available for download in its original format on our project website. Direct links are as
follows:
alpha_final.zip: http://www.web.uvic.ca/~kao/499/alpha_final.zip
AVR XPlain Microcontroller Demonstration Board Application.
C/C++, AVR Studio, AVR-GCC.
lebox_final.zip: http://www.web.uvic.ca/~kao/499/lebox_final.zip
OpenGL / SDL application. Used for exporting binary ILDA frames to text header files. Also
used as a test framework to display animated vector art and interactive software.
C/C++, XCode, SDL.
flower_final.zip: http://www.web.uvic.ca/~kao/499/flower_final.zip
Generates a header file containing points of a flower test pattern.
C/C++, XCode.
viewpython_final.zip: http://www.web.uvic.ca/~kao/499/viewpython_final.zip
Minimal viewer script to parses and display a binary ILDA frame such as the ILDA test
pattern.
python, pyopengl
LeDragDraw.zip: http://www.web.uvic.ca/~kao/499/LeDragDraw.zip
Displays the path of the dragged mouse as a green line in the OpenGL Window.
C/C++, Xcode, OpenGL
LeRamdomPoints.zip: http://www.web.uvic.ca/~kao/499/LeRamdomPoints.zip
Displays the generation of random points filtered for consistency and order.
C/C++, Xcode, OpenGL
LeCountdown.zip: http://www.web.uvic.ca/~kao/499/LeCountdown.zip
Displays hardcoded numbers from 5-1 using Bézier curves for 3 and 5 and a circle function
to draw many circles in place of zero.
C/C++, Xcode, OpenGL
Page 52 of 52
Download