Test Description: Testing the interface between CDH and ADCS with focus on operating and configuring the gyroscope "in flight". *NOTE* This test can be performed in parallel with the FM Magnetometer Test.
Completed:
Documented by: Riley Sweeney
Resources Required:
Tools: Required tools such as cleaning equipment, chemicals, jigs, hand tools, etc.
Hardware and Equipment: LISSA FM FlatSat, power supply, Microsemi fusion, Atmel ICE, USB to TTL device, laptop to interface with both boards.
PPE: FM testing will 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-6964. R-LIB-ADC-032-6371. R-LIB-ADC-240-7001.
Pass Criteria: The gyroscope shall be able to change its configuration upon command from CDH (R-LIB-ADC-005-6964) (ADC-032-6371). The gyroscope shall output rotation data to CDH at a minimum of 5 Hz (R-LIB-ADC-240-7001).
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_GYROSCOPES in main.h, and comment out any other defines if needed. This will run a3g4250d_read_data_polling.c, which initializes, configures, and collects data from the gyroscope.
In a3g4250d_read_data_polling.c, add a breakpoint on line 263, after the line where a3g4250d_angular_rate_raw_get is called.
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 variable data_raw_angular_rate and scroll down the option menu to click on "add to watch". The variable 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.
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_GYROSCOPES 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.
On CDH, edit the testSPI script to send all gyroscope configuration commands to AODCS. These are as follows:
ADCS_GYRO_GET_ODR, // 0x16
receive response (1 B) // 0x00
ADCS_GYRO_SET_ODR, // 0x17
A3G4250D_ODR_100Hz // 0x0F
ADCS_GYRO_GET_LP_BANDWIDTH, // 0x18
receive response (1 B) // 0x00
ADCS_GYRO_SET_LP_BANDWIDTH, // 0x19
A3G4250D_CUT_OFF_MEDIUM // 0x01
ADCS_GYRO_GET_HP_BANDWIDTH, // 0x1a
receive response (1 B) // 0x00
ADCS_GYRO_SET_HP_BANDWIDTH, // 0x1b
A3G4250D_HP_LEVEL_0 // 0x00
ADCS_GYRO_GET_HP_MODE, // 0x1c
receive response (1 B) // 0x00
ADCS_GYRO_SET_HP_MODE, // 0x1d
A3G4250D_HP_NORMAL_MODE_WITH_RST // 0x00
ADCS_GYRO_GET_HP_REFERENCE_VALUE, // 0x1e
receive response (1 B) // 0x00
ADCS_GYRO_SET_HP_REFERENCE_VALUE, // 0x1f
uint8_t hp_reference // 0x00
ADCS_GYRO_GET_FILTER_PATH, // 0x20
receive response (1 B) // 0x00
ADCS_GYRO_SET_FILTER_PATH, // 0x21
A3G4250D_LPF1_HP_LPF2_ON_OUT // 0x06
ADCS_GYRO_GET_MEASUREMENT, // 0x15
receive response (6 B) // 0x00 (x 6)
Connect logic analyzer to the SPI ports on the J2 header of CDH.
When ready, build the CDH code and flash it to the board. Simultaneously begin capturing on the logic analyzer.
You should see commands and responses for both CDH and AODCS 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.
Open the saved capture in Logic. Zoom in on the MOSI channel, and confirm the command sequence follows that which was provided in the procedure steps, and responses from AODCS (on the MISO line) make sense.