Add v3 connector board calibration#181
Conversation
|
All contributors have signed the CLA. Thanks! |
|
I have read the CLA Document and I hereby sign the CLA |
|
To match our current standards this should be converted to a ux/ui based utility before it can be merged. |
|
Also dependencies need to be managed properly - we do not manually install deps anywhere else in the repo and have put lots of effort in to get away from that. |
|
Yeah, I had envisioned this working and being positioned similarly to the camera calibration utilities. Except, the hardware calibration tool will likely only be called once. Though you could still call it through the UI. The idea is that when you install Pitrac, the build script will automatically call the calibration tool. (or if you try to run Pitrac with a version three board before it's been calibrated and the settings are placed in the user_settings json file, PiTrac will error out. Agreed on the deps. I forgot we had worked with that as a workaround, and didn't expect it in the PR. The best fix is to get me to rebuild and package the 2.2.3 version of the liblgpio1 library and get Conor's help getting it positioned correctly in pour PiTrac deps area on GitHub. |
My biggest issue with that is a lot of folks get the Pi first. And will image it and be able to play in the UI and use the testing tools to check integrations and such. Or - first boot or install will happen on a bench and not with the assembled pitrac hardware. People don't read the docs generally - so if things have an option to not be 100% reliant on order and can be done independently through the UI i think it will provide the best possible experience. Especially if we want to capture the less technical golf community |
|
I definitely installed PiTrac on my Pi before connecting everything, so people do that The calibration would also need to be re-run any time the LED is swapped (not sure how often this will happen). There is also a non-zero chance that the calibration will change with temperature, so there may be a slightly different calibration value on a "cold" LM vs a "warm" one. So it's possible we may want to run the calibration periodically and not just once at setup. |
|
Changing this to a draft to swap spi_0 and spi_1, this will keep the current MOSI pin for strobing |
jamespilgrim
left a comment
There was a problem hiding this comment.
I see. Yeah, let's try to get the package updated in the repo. Working on that now... :)
|
And for posterity, here's the error we were getting when trying to use the newer python GPIO functions: Which is why this worked as a quick fix: |
7abd454 to
7399165
Compare
|
Updated calibration script to use spi1 for the ADC and DAC. Updated wiring diagram and documentation. Added dtoverlay=spi1-2cs to configure-cameras.sh to enable spi1 Ready for review now |
This should be put on hold until it's in the UI. Command line scripts took a lot of work to remove so adding them back is not the direction we want to go. I can rewrite into ui if needed |
Do you mean adding a button to the UI to call the calibration script or re-writing it in another language? I think @jamespilgrim is working on the former but I know he'll be out for a while traveling. @connorgallopo can you take a quick look at the changes I made to build.sh and configure_cameras.sh to see if you would implement those changes differently? I don't know anything about the packaging/build |
There was a problem hiding this comment.
Removed 1-2 rpi and replaced with just 1 rpi
There was a problem hiding this comment.
New wiring guide for rpi5, cameras, v3 connector board, and V3 strobe led.
There was a problem hiding this comment.
This should probably be copied or moved to the enclosure build documentation, but that documentation needs a significant re-write with current build info!
There was a problem hiding this comment.
2 changes to this file:
- if cameras are not found, it no longer skips the entire configuration, just the camera configuration. Other non-camera changes to config.txt are still made even if the cameras aren't found.
- add
dtoverlay=spi1-2csto config.txt to enable spi1 with 2 chip selects. This will be used for communicating with the DAC and ADC.
There was a problem hiding this comment.
Added new python runtime depencies. @connorgallopo is this the right place to add them or will these be tracked elsewhere?
No - I mean following the patterns used by the entire web ui python application you are adding this to. I will open a PR with the changes, the python code is not something that should be merged in its current state as it has a lot of issues. The change to configure cameras is fine - but the build script is incorrect as that is not how python dependencies are managed |
|
Totally hear you - not trying to nitpick. The script proves it out well - but its just not production ready yet. Ill try to have something by end of day. It's beefy. Trying to write tests to make sure I don't break anything.
So looking at it I think 1 or 2 might stay as apt deps (just higher up as the CLI stuff is not the web-app), and then whatever doesnt need apt will be moved to |
|
This can be closed - i used this as the head of a new branch. all your commit are still there, just with mine after This should also be tested and verified because i do not currently have my pitrac setup - nor was i involved in this dev effort originally. |
|
Closing PR with commits integrated into #186 |
Description
Add python script for calibration of the LED strobe for V3 connector board
What does this PR do?
This PR adds a python script to the web-server folder that finds the DAC value that corresponds to the target current of the strobe LED
Why is this change needed?
The default behavior without calibration is to send the max current through the LEDS (15+ amps)
Changes Made
Testing Performed
Test Environment
Test Results
Calibration script was tested on 100W amazon LED with target current of 7A and V3 LED board with target current of 10A. The output current was verified with an oscilloscope.
Test Commands Run
Breaking Changes
Dependencies
[ ] New dependencies added:
sudo apt install --allow-downgrades liblgpio1=0.2.2-1~rpt1+trixie python3-lgpio python3-rpi-lgpio python3-gpiozeroHardware Compatibility
Documentation
AI (Vibe-Coded) Content Description
None of this code was AI generated
Checklist
Code Quality
Build & Test
./packaging/build.sh buildSubmission Requirements
git rebase -i HEAD~n)[PR TYPE] Brief descriptionAdditional Context
sudoto get optimal performancesudo apt install --allow-downgrades liblgpio1=0.2.2-1~rpt1+trixie python3-lgpio python3-rpi-lgpio python3-gpiozero