Вы находитесь на странице: 1из 8

DRO for magnetic strip encoders

This project is released under GNU General Public License as published by the Free
Software Foundation either version 2 of the license or (at your option) any later version and
the CERNOSHW Version 1.1 License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.

Purpose of the project


The DRO project realizes a digital readout for mills, lathes or other devices using linear
magnetic strips with a magnetic pole length over both poles (N and S) of 2 mm. It contains
the sensor PCB that is based on an Austria Microsystems AS5311 encoder and a 3 channel
display PCB that is based on an Atmel ATMega8 microcontroller for each channel.
Magnetic strips are cheaper and smaller but a little less accurate than glass scales. On the
other hand they are more accurate and more reliable than caliper based readouts.

V. Besmens December 2012

Included in the project


This PDF document
Part list in PDF with Reichelt (a German component store) order numbers for some
parts.
Firmware source and HEX file for the ATMega8 written in GNU C (WinAVR package
and AVRStudio4. Refer to main.c file for details on optimization-, linker- and fuse-
settings.
Schematic, Layout (Altium designer and PDF files) and extended-Gerber files for the
display board and encoder board.
Drawings for a simple and small case for the sensor
Technical data
3 fully separate display blocks with 7-segment displays. Six digits plus sign. It is
possible to build the display for 1, 2 or 3 channels as the display blocks are fully
separate.
Maximum resolution on display is 0.001mm. Option to round values at 0.005mm.
Display shows inch or metric values.
Overall accuracy is strip-dependent. The resolution of the AS5311 is 488nm.
Two push buttons to zero the scale and to switch it to relative mode (temporary set it
to zero).
Lathe mode doubles the distance shown.
Simple menu to set different values (refer to menu description)
Contains all circuit to be used with caliper based scales. This functionality is currently
not included in the microcontroller software.

What you need to rebuild the firmware sources


A pre-build HEX-File for programming the controller is included within the project files.
If you want to build the firmware from the sources, you will need WinAVR and
AVRStudio4 which are both free. Make sure that you use the right fuse settings also
described in main.c.
What you need to build the display- and sensor- boards yourself
A PCB-manufacturer that accepts extended Gerber files to create the dual layer
PCB's. The PCB's are based on 6mil / 6mil (0.15mm / 0.15mm) technology for
structures and gaps with a minimum hole diameter of 0.4mm.
The ability to solder SMD parts with 0805 size and the AS5311 sensor with its
0.65mm pin distance.
A programmer that is capable of programming the ATMega8. A parallel programmer
is suggested because the serial programming pins are used by the circuit.

The display board


The display board is intended to be mounted into a case directly behind the front using 4
3mm screws with distance rolls. The case should have slots in its front that are covered by
acrylic glass inserts. Some thru-hole components are mounted on the back side of the PCB.
Two push buttons per channel and one LED that signals ABS/REL mode are connected via
J4 and placed separately on the front of the case. For cabling please refer to the schematic
within the project files.

There are two solder jumpers per channel on the bottom side of the board: Keep both open.

Some components were intended for caliper operation. As I never finished this part of the
software you can leave some components unpopulated. Refer to schematic for details.

Connection to the sensor boards that are mounted on the machine are done via a shielded
minimum 4 wire cable. Use connectors (like DB9) for each channel. I suggest placing ferrites
onto the cable for better noise immunity. For cabling please refer to the schematic within the
project files.

The display units needs an unregulated DC power supply with 7.5 to 9 Volts at 800mA or
above. I used a wall plug supply.
The sensor board
The sensor board is a little bit difficult to build because the AS5311 has a pin pitch of only
0.65mm. Make sure to mount it relatively straight at a 90 angle on the board for maximum
readout accuracy. The board is populated on both sides.

The board has a solder jumper (JP1) to enable the incremental mode of the AS5311. Keep it
open as the display unit uses the serial mode.

The mark S on the top side of the board shows the sensor axis of the AS5311. Later, when
adjusting the sensor case to the magnetic strip, you can use the build in field strength display
to adjust the sensor to the strip.

The board has solder pads for the cable that goes to the display unit. You will only need 5
pads. For cabling please refer to the schematic within the project files.
The sensor board case
I build a custom case made from PVC for the sensor board. You will probably find a standard
case for it. Drawings of the custom case are included in the project files. The fancy pins for
the holes in the drawing are not necessary (I CNC-machined the case) when you glue the
PCB into the case. When you build the case the way I did, cover the other side of the case
with a piece of 2mm sheet plastic and some glue.

Area for mounting-holes


Cover this

Cable
Make sure to position the PCB inside the case so that the AS5311, looking out of the case, is
flat with the outer surface of the case. Then use a 0.1mm adhesive film to cover the sensor
together with the case.

Sensor PCB

Case

0.1 mm adhesive film


AS5311

When using coolant together with the unit, make sure to cover the whole circuit with epoxy or
silicone to protect it.
The magnetic strips
The self-adhesive magnetic strips should be mounted in a groove to protect them from
coolant fluids. They are covered by a protective stainless steel cover tape that is usually
delivered with the strips. The strips must have a pole length of 1mm per pole (or 2mm per
pole pair N+S). Make sure to get the right ones as pole length are sometimes defined per
pole and sometimes per pole pair. They are also available in different overall accuracies.

I protected the most exposed axes by adding an aluminium profile to cover the whole
assembly.

The picture below shows the basic assembly looking from the side. The sensor is fixed while
the aluminium profile with the magnetic strip moves along the sensor. The distance between
the sensor cover tape and the strip should be as small as possible.
The display unit menu

The display unit has a basic menu to adjust some settings. Press the Zero-Button for around
1 second to access it. The display will show "SEt".
You can then switch between the different parameters by pressing the Zero-Button again and
alter the value by pressing the ABS/REL button.

Item Display Value Meaning


1 Inch 0 or 1 Toggle between inch (1) and mm (0)
2 Lth 0 or 1 Toggle to lathe mode (1) or normal mode (0). In
lathe mode distances are doubled.
3 rE 0 or 1 Revert direction
4 dE 2 or 3 Decimal point position from right side of display
5 rnd 0 or 1 Round last digit to 5 (1) or display whole
accuracy (0)
6 Magnetic n.a. Display the magnetic field strength as reported
strength from AS5311 sensor. Refer to AS5311
datasheet for details.
7 Flags n.a. Display flags from encoder. Refer to AS5311
datasheet for details.

To leave the menu, press the zero-button again for at least one second. This will store the
data into the EE-Prom of the controller.

Error reporting

The display reports errors and other information to the user. They can be reset by pressing
the ABS/REL button. It is unsure if the displayed values are then still correct!
Display Meaning
noEE No data in EEProm. Enter menu to set data.
boot Booting. Will disappear after some milliseconds
Error Number indicates error (COF, LIN) status bit value from AS5311. Refer to
its datasheet for more details.

Getting the parts

Most of the components are easily available. The AS5311 is available from Austria
Microsystems or DigiKey.
Magnetic strips are available from different vendors. The Austria Microsystems websites lists
some of them. You can also buy the strips from "OPTIMUM" machines as they do have the
right pole length.
References
Austria Microsystems (AS5311 encoder): http://www.ams.com
DigiKey (AS5311 encoder): http://www.digikey.com or http://www.digikey.de
Optimum (magnetic strips): http://www.optimum-machines.com/
chsner Messtechnik GmbH (magnetic strips, not sure if pole length is correct): http://www.oemt.de

Вам также может понравиться