Skip to content

Bruce working branch#50

Open
brucelikeeat wants to merge 60 commits into
UBCSailbot:mainfrom
brucelikeeat:bruce-working-branch
Open

Bruce working branch#50
brucelikeeat wants to merge 60 commits into
UBCSailbot:mainfrom
brucelikeeat:bruce-working-branch

Conversation

@brucelikeeat

Copy link
Copy Markdown

mast encoder implementation should be done.

MichaelGreenough and others added 30 commits April 21, 2024 23:04
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
* Addressed all test related problems (UBCSailbot#19)

* I2C_ErrorResetCycle in error.c (UBCSailbot#21)

* I2C_ErrorResetCycle in error.c

* error fix

* Wingsail rudder encoder (UBCSailbot#23)

* bare bones encoder code

* Start of encoder code

* Add position output and zeroing

* Create readme.md

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

* Limited Error Handling.1

Part one of error handling and encapsulation

Signed-off-by: Christian Conroy <47986458+ChristianConroy@users.noreply.github.com>

---------

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Christian Conroy <47986458+ChristianConroy@users.noreply.github.com>
Co-authored-by: Christian Conroy <47986458+ChristianConroy@users.noreply.github.com>

* Rudder imu (UBCSailbot#24)

* Create readme.md

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

* Add files via upload

Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>

* Basic IMU code

* Update readme.md

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

* Fixed timer reset

* Add files via upload

Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>

* Delete projects/rudder-controller/IMU-Code/.project

Deleted redundant file

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

---------

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>
Co-authored-by: hml04 <160178026+hml04@users.noreply.github.com>

* Wingsail wind sensor (UBCSailbot#25)

* Create wind_sensor.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create wind_sensor.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* MAIN.C file, only "  HAL_UART_Receive_DMA(&huart2, rx_buffer, 1);" is needed here to enable DMA

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update wind_sensor.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update wind_sensor.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

---------

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>
Co-authored-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Servo solenoid (UBCSailbot#27)

* Create servosolenoid.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create servosolenoid.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Delete projects/servo-solenoid/servosolenoid.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Delete projects/servo-solenoid/Core/servosolenoid.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create servosolenoid.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create servosolenoid.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create main.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Create main.c

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update servosolenoid.h

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update servosolenoid.c angle parameter comment

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update servosolenoid.c Fixed pin layout comments

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Update servosolenoid.c Fixed comments in moveServo() function

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

---------

Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>
Co-authored-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>

* Add files via upload (UBCSailbot#26)

Initial commit for the Motor_PID.

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Co-authored-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>

* Minor Changes

* Add files via upload

Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>

* Added source linking

* Lol I deleted the entire repo. jk just testing Github

---------

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Signed-off-by: Christian Conroy <47986458+ChristianConroy@users.noreply.github.com>
Signed-off-by: hml04 <160178026+hml04@users.noreply.github.com>
Signed-off-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>
Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Co-authored-by: Peter Kim <63937643+vento277@users.noreply.github.com>
Co-authored-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: Christian Conroy <47986458+ChristianConroy@users.noreply.github.com>
Co-authored-by: hml04 <160178026+hml04@users.noreply.github.com>
Co-authored-by: faaiqm7 <148652388+faaiqm7@users.noreply.github.com>
Co-authored-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Co-authored-by: Faaiq Majeed <faaiqmajeed2004@gmail.com>
Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
Initial CAN Servo library for in-water testing

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Few setup fixes

Signed-off-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
georgesleen and others added 27 commits October 25, 2025 16:00
…Module Hardware (UBCSailbot#38)

* Update .ioc definition for UART2 DMA

* Change NMEA handle to take the UART2 handle

* Update launch file for flashing to mcu

* Test initialization of UART2 with DMA

* Update clangd compile commands to hopefully link with drv-modules

* Move .clangd to be visible for all firmware

* Update UART2 interrupt scheme to match on character

* Try to link .c files with .h files using clangd lsp

* Update compile_commands.json so that clangd can find source files

* Get rid of redundant DMA activation in main

* Transmission from AD3 to Nucleo working (sort of...)

* Start reading NMEA0183 messages in main

* Update nmea0183 read logic to overwrite oldest data in buffer rather than hard fault

* Some print debugging

* Update ioc definition for actual sense module

* Write more information for a bad message

* Create a new WIND_SENSOR source file for handling the wind sensor

* Create a WIND_SENSOR type

* Remove custom implementation of stdbool.h

* Print out whole message when recieving

* Update character matching and error clearing for robust NMEA0183 message parsing

* Object management function prototypes

* Update for proper clangd linting

* Add some very simple unit testing for nmea messages

* Update documentation

* Update documentation

* Update gitignore

* Add a simple make helper for running unit tests

* Define interface for wind sensor

* Update AGENTS.md to reflect intended comment style

* Implement the stuff?

* Add unit tests for wind sensor

* Update unit test structure

* Update makefile to include clean target

* Factor out more common functionality

* Add a nice little print helper

* Ignore machine specific development artifacts

* Add some testing for the print functions while I don't have access

* Update makefile so I can regenerate my config easiy

* Remove build artifact

* Add unit testing for the AIS transponder

* Merge conflicts resolved?

* Update to always print whether the data is valid or not

* Remove AGENTS.md from history

* Only print valid updates to wind sensor data

* Add a little helper script to generate valid NMEA0183 messages

* Update to check for message type and for temperature messages

* Compare strings properly

* Fix comparing message types

* Update makefile and start work on canfd communication

* Do a stupid cubeide thing :((((((

* Write CAN transmission code for the wind sensor

* Add unit testing

* Update constant names to be clearer

* CAN loopback test

* Debug bad can message sending

* Simple loopback test for windsail can messages

* Naive implementation of transmitting AIS can messages

* Add unit tests

* Add a function to transmit all recienved ships over CAN

* Update unit tests

* Update unit testing

* Fix compilation error

* Simple AIS loopback test

* Update test to include more fields

* Add a GPS driver

* Update wind sensor to have a non-consuming pattern

* Add a bunch of unit testing

* Create a simple little scheduler to manage all the nmea stuff

* Write simple test for multi-drop nmea0183 bus

* Format files

* Fix unit tests

* Some unit testing

* Match pinout of breakout board

* Turn wind sensor gate on

* Implement requirement to send empty ship frame if no ships. Also fix some bugs in parsing

* Fix name collision

* Unit testing update

* Fix some parsing logic

* Remove debug statements from firmware to diagnose issue (hardware issue)

* Add AIS/GPS/wind parsing and CAN scheduling to wingsail-controller (UBCSailbot#40)

* Update makefile and start work on canfd communication

* Do a stupid cubeide thing :((((((

* Write CAN transmission code for the wind sensor

* Add unit testing

* Update constant names to be clearer

* CAN loopback test

* Debug bad can message sending

* Simple loopback test for windsail can messages

* Naive implementation of transmitting AIS can messages

* Add unit tests

* Add a function to transmit all recienved ships over CAN

* Update unit tests

* Update unit testing

* Fix compilation error

* Simple AIS loopback test

* Update test to include more fields

* Add a GPS driver

* Update wind sensor to have a non-consuming pattern

* Add a bunch of unit testing

* Create a simple little scheduler to manage all the nmea stuff

* Write simple test for multi-drop nmea0183 bus

* Format files

* Fix unit tests

* Some unit testing

* Match pinout of breakout board

* Turn wind sensor gate on

* Implement requirement to send empty ship frame if no ships. Also fix some bugs in parsing

* Fix name collision

* Unit testing update

* Fix some parsing logic

* Remove debug statements from firmware to diagnose issue (hardware issue)

* Some more unit testing

* Tentative fix

* Update prescaler value so that can parameters match specs

* Update compile_commands.json make target

* Formatting fixes

* Write gate drivers high

* Update pinout for chopped board

* Power cycle stuff on reset

* Parse and log a bunch of messages from the GPS

* add a bunch of logging stuff

* Add lots of conditional printing

* Remove scheduler printing

* Trim tab integration (UBCSailbot#41)

* Add files via upload

Initial commit for complete CAN Servo library

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>

* Move into drv-modules

* Add some clamping logic for the servo

* Add can-servo to wingsail-controller target

* Stop rounding GPS data...

* Add a bunch of conditional logging

* Partial fix

* Vibe code some fixes hopefully

* moar logs

* Print debugging canservo

* Don't send invalid lat/lon messages

* Update .ioc for correct canspi settings

* update gpio to be correct...

* Enable the CS pin for the canservo

* Remove double macro definiton (via chat suggestion)

* Remove debug hello print

* Do a bit of logging

* Sail Controller CAN Library Update (UBCSailbot#42)

* can.h first commit

Should work? unless I overlooked something or tested it wrong

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* can.c first commit

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documentation of can.c

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documented can.h

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documentation complete can.c

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* fixed frame range

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* filter works...too much

- receives out of range IDs

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* CANFD project file

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Update can.c

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Update can.h

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* fixed parsing in test_canfd.c

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Updated can.c with CAN_Receive and fixed definition error

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Updated can.h

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* FDCAN_Serial_Testing Zip CUBEIDE project file

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* com-modules update

* removed files

* Moved can files (UBCSailbot#37): accepted CAN files move to CANFD dir, removed from base-library dir

* updated README on flle usage + cleanup

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* changed CAN_Receive to use a CAN_Frame rx pointer

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* correct CAN_Receive function signature

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* fdcan-library-test now has the project to test

* fdcan-library-test is now a project

---------

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <alishashahid6704@gmail.com>
Co-authored-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

---------

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Co-authored-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <alishashahid6704@gmail.com>
Co-authored-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>

* Fixed ROT, and TWOs compliment (UBCSailbot#43)

* Update variables and constants related to ROT to use the new unsigned convention

---------

Signed-off-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: JoshuaO956 <148372526+JoshuaO956@users.noreply.github.com>
Co-authored-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <alishashahid6704@gmail.com>
Co-authored-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
* can.h first commit

Should work? unless I overlooked something or tested it wrong

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* can.c first commit

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documentation of can.c

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documented can.h

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* Documentation complete can.c

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* fixed frame range

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>

* filter works...too much

- receives out of range IDs

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* CANFD project file

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Update can.c

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Update can.h

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* fixed parsing in test_canfd.c

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Updated can.c with CAN_Receive and fixed definition error

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Updated can.h

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* FDCAN_Serial_Testing Zip CUBEIDE project file

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* com-modules update

* removed files

* Moved can files (UBCSailbot#37): accepted CAN files move to CANFD dir, removed from base-library dir

* updated README on flle usage + cleanup

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* changed CAN_Receive to use a CAN_Frame rx pointer

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* correct CAN_Receive function signature

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* fdcan-library-test now has the project to test

* fdcan-library-test is now a project

* Add heartbeat functionality to CANFD module

Updated CAN_Init to include heartbeat ID and added heartbeat functionality with TIM7.

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Modify CAN_Init to accept hardware ID parameter

Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>

* Updated fdcan-library-test with overnight test code, includes heartbeat

* Update to include CAN heartbeat

---------

Signed-off-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Signed-off-by: Alisha Siddiqui <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <143849351+alisha1697@users.noreply.github.com>
Co-authored-by: alisha1697 <alishashahid6704@gmail.com>
Co-authored-by: Michael Greenough <43833591+MichaelGreenough@users.noreply.github.com>
- Implemented main.c for the mast encoder using the Briter library.
- Tested the implementation using both an oscilloscope and the actual rudder encoder hardware.
- Successfully produced real-time floating-point outputs for both the raw encoder value and the computed mast angle.
@MichaelGreenough

Copy link
Copy Markdown
Contributor

Hey Bruce, could you modify this PR to point to the wingsail-working-branch. We'll merge it there first with George and Joshua's code, then merge it into main.

...actually, lets talk in person. It looks like you have forked the repo, which is not really what we want (but totally fixable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants