Download presentation
Presentation is loading. Please wait.
Published byClinton Horn Modified over 9 years ago
1
Magnetometer Testing Board Presented by Jianer Shi 04/25/2011
2
SECTIONS
3
Sections 1.Background 2.Board Design 3.Code 2.1Microcontroller 2.2Graphic User Interface (GUI) 4.From here on…
4
BACKGROUND Section 1/4
5
Background Toque coil is used to produce a magnetometer dipole which controls the satellites attitude. In order for the toque coil to behave as expected, an accurate measurement of magnetic field is required. Magnetometer is an essential part to determine the earth magnetic field
6
Background Previous testing done by Ryne Beeson in 2009 shows noise of 0.02 Gauss, which is unacceptable for accurate attitude determination and control. Further testing is suggested and a magnetometer testing board is built for easy testing and lower electronic noise.
7
BOARD DESIGN Section 2/4
8
Board Summary PCB Laying Tool: Eagle 5.11.0 Microcontroller: PIC18F2221-I Communication Port: Mini – USB B Power: Mini-USB 5V Crystal Oscillator: 11.0592Mhz UART Communication Baud Rate: 57600 Communication: Serial-USB (FT232RL)
9
Design Criteria Microcontroller – Support I2C – Support UART Board – Small size – Mountable User Interface – Able to pool and save Matlab friendly data for later process Communication – Error tolerance
10
Microcontroller PIC18F2221-I – Minimum Pin Number to satisfy the requirement – Small size (SOIC Package) – Has 1 UART and 1 I2C – 5V Power Supply from USB – Errata page provided by manufacturer has no significant problem with UART and I2C – Compare to other Microcontrollers, this is the minimum one satisfies the design criteria.
11
Power and Communication Mini-Usb Port – Small size – Provide both 5V power and communication FT232RL USB-Serial Chip Provide 3.3V output - eliminate 2 voltage regulators and has 500mA cutoff current protection Provide UART to USB link
12
Crystal Oscillator 11.0592Mhz – This choice will resulte in 0% error with a wide range of baud rate choice. – We choose 57600 baud rate
16
MICROCONTROLLER CODE Section 3.1/4
17
Microcontroller Task Overview
18
I2C Communication between magnetometer and microcontroller Library provided by i2c.h and pic18f2221.h from C18 Compiler
19
I2C Write
20
I2C Read
21
Magnetometer I2C Slave address (0x32) for write (0x33) for read
22
Magnetometer I2C Functions (0x40) Accelerometer Data of 3 axis (0x45) Magnetometer Data of 3 axis (0x50) Heading Data of 3 axis (0x55) Tilt Data of 3 axis Return value: 6 byte, 2 byte per axis (in hex: xxxx) (0x82) Reset the processor, no return value
23
Magnetometer Spec 500ms power up delay before extract data 1ms delay for each read
24
3.3V to 5.5V I2C Logic Level Conversion Logic Level conversion is necessary because components operate on different power Magnetometer3.3V Microcontroller5V
25
3.3V to 5.5V I2C Logic Level Conversion Source:
26
UART Library – Usart.h 2 Pins – TXfor sending – RXfor receiving
27
Serial Protocol In order to send information that the computer side can decode, all information pulling from the magnetometer is sent through a protocol (in hex) (eeeeeeee) (00) (function 1 byte xx)(data 2 byte xxxx)(ffffffff)
28
Serial Protocol (eeeeeeee) (00) (function 1 byte xx)(data 2 byte xxxx)(ffffffff) (eeeeeeee) starting flag (ffffffff) end of line (00) There are still new function data to be transferred
29
Serial Protocol (eeeeeeee) (00) (function 1 byte xx)(data 2 byte xxxx)(ffffffff) Functions (41) Accelerometer X (42) Accelerometer Y (43) Accelerometer Z (51) Heading X (52) Heading Y (53) Heading Z (46) Magnetometer X (47) Magnetometer Y (48) Magnetometer Z (56) Tilt X (57) Tilt Y (58) Tilt Z
30
GRAPHICAL USER INTERFACE (GUI) Section 3.2/4
31
Complete GUI
32
GUI Programing Language Python – Pyserial – wxtools Qt4 – Matplotlib Toolchain – Pyqt4
33
Python State Machine to decode protocol – 24 State to decode serial protocal – Error Tolerance imbedded even though the UART will in theory result in 0% communication error
34
Qt4
35
Data Saving Button All raw data will be saved in a tabular format, This can be easily imported into a matlab vector. Button to control start saving data and stop saving data Reason to keep raw data – Decimal data will result Matlab underrun (not enough precision)
36
Real Time Plot Based on the open source code developed by Eli Bendersky 3 colors to display the 3 axis data on the same graph simultaneously
37
FROM HERE ON... Section 4/4
38
From here on The board will handed over to whoever is going to test the magnetometer Since the GUI has been revised many times for easy testing, the tester will find the whole system easy to use and test
39
THANKS!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.