Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CarbonixCubeOrange: fix inverted pwr monitor pins #127

Merged

Conversation

robertlong13
Copy link
Collaborator

Needs testing on hardware

@robertlong13 robertlong13 requested a review from Jono453 May 3, 2024 00:11
@ghost
Copy link

ghost commented May 3, 2024

Will test on my IronBird today and merge the code if working.

@ghost
Copy link

ghost commented May 3, 2024

Thanks for the PR @robertlong13

@@ -2,6 +2,12 @@

include ../CubeOrange/hwdef.dat

# Invert the logic for the Brick and Aux valid pins
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recommended to put in the board detail
"Inverted the logic for the Brick and Aux valid pins for board version CX13042008 F and below"

@ghost
Copy link

ghost commented May 3, 2024

image
Test Result on ironBird

@ghost
Copy link

ghost commented May 3, 2024

image

@Jono453
Copy link
Contributor

Jono453 commented May 3, 2024

That screenshot looks better. I had error in the pixhawk carrier table with only Lipo - should be 3 not 1, 1 was with my test setup where I didn't have valid power on the Vservo line. I have correct it now in the confluence page. Ill add your ironbird test result there.

@Jono453
Copy link
Contributor

Jono453 commented May 3, 2024

For my understanding, the existing CubeOrange hwdef.dat already had

Power flag pins: these tell the MCU the status of the various power
supplies that are available. The pin names need to exactly match the
names used in AnalogIn.cpp.
PB5 VDD_BRICK_nVALID INPUT PULLUP
PB7 VDD_BRICK2_nVALID INPUT PULLUP

Did we miss this in the migration to Ardupilot 4.3 which caused the inverted result? The Schematic shows
image
which does appear to be pull-up already? Or does the supervisory circuit mess that up?

@robertlong13 robertlong13 force-pushed the feature/SW-173-hwdef-fix-for-power-monitoring-pin-to-be-reversed branch from fb70833 to 0ec0670 Compare May 6, 2024 03:35
@robertlong13 robertlong13 force-pushed the feature/SW-173-hwdef-fix-for-power-monitoring-pin-to-be-reversed branch from 0ec0670 to c346964 Compare May 6, 2024 03:37
@robertlong13
Copy link
Collaborator Author

For my understanding, the existing CubeOrange hwdef.dat already had

Power flag pins: these tell the MCU the status of the various power supplies that are available. The pin names need to exactly match the names used in AnalogIn.cpp. PB5 VDD_BRICK_nVALID INPUT PULLUP PB7 VDD_BRICK2_nVALID INPUT PULLUP

Did we miss this in the migration to Ardupilot 4.3 which caused the inverted result? The Schematic shows which does appear to be pull-up already? Or does the supervisory circuit mess that up?

The existing hwdef does have these pins defined but has them defined as inverted logic. The net names in the CX13042008 schematic suggest they were intended to be inverted logic too, but the chip in question pulls low when the voltage is not detected, and floats and pulls high when the voltage is detected. This PR just redefines them to use the uninverted logic that the hardware has implemented. This isn't due to the migration to 4.3; it's always been messed up (I'm assuming).

We should add a comment in the schematic explaining this error in the labelling, and that we have compensated for it in software, but I don't think we should change the behavior in future revisions. Easier and better to keep all the board behaviors the same.

@robertlong13 robertlong13 requested a review from a user May 6, 2024 04:03
@ghost ghost merged commit 77a9d45 into CxPilot May 7, 2024
17 checks passed
@robertlong13 robertlong13 deleted the feature/SW-173-hwdef-fix-for-power-monitoring-pin-to-be-reversed branch June 17, 2024 07:04
This pull request was closed.
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.

2 participants