Test Description: Testing the interface between CDH and ADCS with focus on operating and configuring the magnetometer "in flight". *NOTE* This test can be performed in parallel with the FM Gyroscope Test.
Completed:
Documented by: Riley Sweeney
Resources Required:
Tools: Required tools such as cleaning equipment, chemicals, jigs, hand tools, etc.
Hardware and Equipment: UMS-0866 ADCS FM CCA, UMS-0802 CDH FM CCA, UMS-0803 Power FM CCA, power supply, Microsemi fusion, Atmel ICE, USB to TTL device, laptop to interface with both boards.
PPE: FM testing will likely occur in the clean room. Please follow all clean room safety guidelines. Please wear an ESD bracelet and use ESD mat when working with electronics.
Verification Activities: R-LIB-ADC-005-6965, R-LIB-ADC-031-6972. R-LIB-ADC-043-6977.
Pass Criteria: The magnetometer shall be able to change its configuration upon command from CDH (R-LIB-ADC-005-6965) (ADC-031-6972). The magnetometer shall send magnetic field data to CDH at a minimum of 10 Hz (R-LIB-ADC-043-6977).
This test will occur on the FM FlatSat.
Check the connections between PCBs on the FlatSat. The power PCB should be connected to a power supply with two wires for power and ground. This PCB should also connect to CDH using an intermodular connector.
The CDH PCB should have two intermodular connectors, one coming from the Power PCB, and one going to the AODCS PCB.
The gyroscope is located on the AODCS PCB. No other peripheral sensors or actuators need to be connected to AODCS.
With the FlatSat set up, this section focuses on setting up the necessary software for the PCBs and data collection.
CDH:
Connect the Microsemi fusion to the debug port on the CDH CCA. Connect the other end of the Microsemi fusion to your laptop via USB.
Using SoftConsole, comment/uncomment test scripts in the CDH code as needed. Be sure to build before uploading.
Disconnect the Microsemi fusion.
AODCS:
Connect the Atmel ICE to the debug port on the AODCS PCB. Connect the other end to your laptop via USB.
Using VS code, uncomment the AODCS test scripts in the main.h file as needed. For this test it will be TEST_GYROSCOPES.
Build the project and upload by running in debug mode.
Disconnect the Atmel ICE when upload is complete.
Debugging/Recording signals:
Connect the USB to TTL device to the UART pins on the J1 header on CDH. Connect the device to your laptop to receive data from CDH.
Connect the USB to TTL device to the UART pins on the J1 header on AODCS. Connect the device to your laptop to receive data from AODCS.
The first part of the test will check for function on the AODCS board itself.
Set the output voltage on the power supply to 6.4 V, which is approximately bus voltage.
Turn on the power supply. The power PCB will boot into critical hold mode, you must wait for this period to end for power to be supplied to CDH and AODCS. The output current on the power supply will jump when this period ends.
Uncomment TEST_MAGNETOMETERS in main.h, and comment out any other defines if needed. This will run the function TestMag(), which initializes, configures, and collects data from the magnetometer.
Inside TestMag(), add a breakpoint on line 190, the line with "_delay_ms(10); // Wait before next read".
Build the project and run in debug mode to flash the AODC board MCU. The code should run up to the breakpoint.
Right click on the variables x, y, and z and scroll down the option menu to click on "add to watch". The variables should show up in the toolbar on the left.
Click continue to loop to the breakpoint again, the values of the variable should change slightly due to noise.
To confirm function, hold a bar magnet near the AODCS board (there is a level with a weak bar magnet in the ASIF) and loop back to the breakpoint. There should be a significant jump in the sensor readings.
The second part of the test involves configuring and collecting data from the gyroscope using commands from CDH.
On the AODCS code, comment out TEST_MAGNETOMETERS and uncomment ADCS_MAIN. This will enable the AODCS to process commands from CDH.
Build and run the code as before to flash the board MCU. There should be no breakpoints in the code.
On CDH, edit the testSPI script to send all magnetometer configuration commands to AODCS. These are as follows:
ADCS_MAGNETOMETER_SET_BANDWIDTH, // 0x23
ADCS_MAGNETOMETER_SET_OPERATION_RATE, // 0x24
ADCS_MAGNETOMETER_SET_AUTO_RESET, // 0x25
ADCS_MAGNETOMETER_SET_ODR, // 0x26
ADCS_MAGNETOMETER_SET_CONTINUOUS_MODE, // 0x27
ADCS_MAGNETOMETER_GET_MEASUREMENT, // 0x22
Connect logic analyzer to the SPI ports on the J2 header of CDH.
When ready, build the CDH code, begin capturing on the logic analyzer, then flash the code to the board.
You should see commands and responses for CDH on MOSI and AODCS on MISO while the test runs.
Once the code has run, stop capturing the logic analyzer, and save the capture for documentation.
Disconnect the USB to TTL device upon test completion.
Turn off the power supply.
The FlatSat does not need to be disassembled.
Board test - no magnet
Board test - no magnet
Boad test - with magnet
The results of this test will include two magnetometer configurations and two sets of timestamped magnetometer data. This data does not have a "ground truth" to reference to assess the accuracy of the data. In addition, the PCB will be stationary on the FlatSat. Analysis is focused on the effects of different configuration changes on what should be a relatively constant magnetic field.
Create plots for both sets of magnetometer data.
Compare and contrast these results. In particular, look for differences in the prevalence of noise, output data rate, and drift. Since the magnetometer position and magnetic field nominally remain constant during data collection, these effects should be clear.
These configurations can be transferred to the guidance system gimbal test to help improve its performance. That test will provide a better evaluation of the magnetometer's measurement accuracy.