From 5375c6d876f115a2bd75ec45796e5333ba928082 Mon Sep 17 00:00:00 2001 From: Dawsyn Schraiber <32221234+dawsynth@users.noreply.github.com> Date: Fri, 20 Jun 2025 00:10:22 -0400 Subject: Big Kahuna - IREC 2025 - Dawsyn's Final Commit (#16) # Dawsyn's Final Commit This one is a little emotional as this is my final commit in this repository and as a member of Rocketry at Virginia Tech. This merges the changes seen in the branch known as 'big_kahuna' into main. This is the version of the ADS software as seen on [Roadkill](https://drive.google.com/file/d/120BvI-0ntliHo6i9UxcCn2pXAl-JsdP_/view?usp=drive_link) in the 2025 IREC competition. There are bound to be bugs, but I have found it useful to have the final competition version to be the one present on main at the end of every academic year. Hopefully this is useful to the next lead. ## Primary Changes + NEW I2C drivers to support sensors present on new ADS custom PCB + NEW logging library found in separate repository and pulled in as submodule ([pico-logger](https://github.com/rocketryvt/pico-logger)) + No longer dependent on different flash chip from one used for code storage! Compile executable as RP2040 'copy-to-ram' type to increase flash read/write speeds! + NEW fixed-point libraries to allow for increased performance and sensor sampling speeds on RP2040 that lacks FPU + FreeRTOS Simultaneous Multi-processing (SMP) architecture for task handling and easier introduction / testing of new features + Serial monitor / command system with task performance monitoring commands + WORKING Kalman filter that takes altitude from barometer as measurement and z-axis acceleration from IMU as control to generate state vector containing filtered altitude and vertical velocity + NEW CFD equations from the Ben-ogrithm (to replace the Chen-ogrithm) that includes: + Apogee prediction model that takes current drag force, altitude, and vertical velocity + Current Drag Force equation based on current deployment and vertical velocity to use for Apogee Prediction model + Desired Drag force equation based on current altitude and vertical velocity to generate what drag force is needed to reach 10K ft + Deployment percentage equation based on current velocity and desired drag force to map to flap deployment percentage --- tools/CMakeLists.txt | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'tools/CMakeLists.txt') diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8806fb0..a5a7ba6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,34 +1,42 @@ if (COMPILE_TOOLS) add_executable(read_flash - read_flash.c - ../src/spi_flash.c + read_flash.cpp + ${PROJECT_SOURCE_DIR}/src/ms5607.cpp + ${PROJECT_SOURCE_DIR}/src/adxl375.cpp + ${PROJECT_SOURCE_DIR}/src/iim42653.cpp + ${PROJECT_SOURCE_DIR}/src/mmc5983ma.cpp + ${PROJECT_SOURCE_DIR}/src/log_format.cpp + ${PROJECT_SOURCE_DIR}/src/heartbeat.cpp + ${PROJECT_SOURCE_DIR}/src/serial.cpp ) add_executable(servo_test servo_test.cpp - ../src/pwm.cpp + ${PROJECT_SOURCE_DIR}/src/pwm.cpp ) add_executable(alt_test alt_test.cpp - ) - - add_executable(imu_calib - imu_calib.cpp + ${PROJECT_SOURCE_DIR}/src/ms5607.cpp + ${PROJECT_SOURCE_DIR}/src/heartbeat.cpp ) # pull in common dependencies - target_link_libraries(read_flash pico_stdlib hardware_spi) - target_include_directories(read_flash PUBLIC ../include) + target_link_libraries(read_flash pico_stdlib pico_logger pico_flash pico_rand pico_multicore pico_sync hardware_i2c hardware_adc hardware_timer FreeRTOS-Kernel FreeRTOS-Kernel-Heap4) + target_include_directories(read_flash PUBLIC ${PROJECT_SOURCE_DIR}/include) + target_compile_definitions(read_flash PRIVATE + USE_FREERTOS=1 + DEBUG=1 + PICO_STDIO_STACK_BUFFER_SIZE=64 # use a small printf on stack buffer + ) + pico_set_binary_type(read_flash copy_to_ram) target_link_libraries(servo_test pico_stdlib hardware_pwm hardware_i2c) - target_include_directories(servo_test PUBLIC ../include) + target_include_directories(servo_test PUBLIC ${PROJECT_SOURCE_DIR}/include) target_link_libraries(alt_test pico_stdlib hardware_i2c hardware_gpio) - - target_link_libraries(imu_calib pico_stdlib hardware_i2c hardware_gpio) - target_include_directories(imu_calib PUBLIC ../include) - + target_include_directories(alt_test PUBLIC ${PROJECT_SOURCE_DIR}/include) + pico_enable_stdio_usb(read_flash 1) pico_enable_stdio_uart(read_flash 0) @@ -37,14 +45,10 @@ if (COMPILE_TOOLS) pico_enable_stdio_usb(alt_test 1) pico_enable_stdio_uart(alt_test 0) - - pico_enable_stdio_usb(imu_calib 1) - pico_enable_stdio_uart(imu_calib 0) - + # create map/bin/hex file etc. pico_add_extra_outputs(read_flash) pico_add_extra_outputs(servo_test) pico_add_extra_outputs(alt_test) - pico_add_extra_outputs(imu_calib) endif() -- cgit v1.2.3