Skip to content

Added changes to use additional ADC channels #222

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

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

Igitigit2
Copy link
Contributor

Now, that all the ADC stuff for the B-G431B-ESC1 board is in hardware specific files anyway, I see no value in not supporting the additional ADC channels for the bus voltage, temp sensor and poti. The code for these was proposed long time ago already by @HoeckDK on the SimpleFOC community forum. To read e.g. the temp sensor of the board, apply this PR and the call

float Temp = _readADCVoltageInline(A_TEMPERATURE, currentSense.params);

It would be cool if this PR was accepted, this would safe me quite some time to apply it to all new versions over and over again...

@Igitigit2 Igitigit2 changed the title Addded changes tio use additional ADC channels Addded changes to use additional ADC channels Oct 10, 2022
@Igitigit2 Igitigit2 changed the title Addded changes to use additional ADC channels Added changes to use additional ADC channels Oct 10, 2022
@askuric
Copy link
Member

askuric commented Oct 12, 2022

I think this is perfectly reasonable. It is not really in the spirit of the simplefoc api but at least it will enable using this board a bit more optimally in the mean time. Did you notice any performance issues when you do 5 conversions instead of 3?
@runger1101001 do you have any thoughts about this?

@runger1101001
Copy link
Member

Ooof... lots of thoughts on this topic, but the important one for this specific PR is that if it is working we should merge it in the G431-specific code because it is something many users ask about and could use.

In general, as you know I've been working on the ADC code for RP2040 and SAMD, and I think we need to do another refactoring in the future, to enable the APIs to deal with things like

  • additional ADC channels for other needs (BUS voltage, BEMF, potentiometers, analog sensors, etc...)
  • multiple motors with current sensing
  • board-specific special configurations
  • external ADC chips

@Igitigit2
Copy link
Contributor Author

No, I did not notice any performance issues, but haven‘t tried it a lot with the latest dev branch.
@runger1101001, of course, the idea is to have it specific to the bg431 board. Since all the ADC stuff for this board is in board specific files, the PR should not make SimpleFOC in general less portable/ compatible.

@askuric
Copy link
Member

askuric commented Oct 15, 2022

OK, I'm merging this for v.2.2.3

@askuric askuric merged commit 94f45d9 into simplefoc:dev Oct 15, 2022
@Igitigit2
Copy link
Contributor Author

Excellent, thank you!

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.

3 participants