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

Analog voltage input on STM32Fxxx driver #11

Open
jas-mic opened this issue Nov 27, 2024 · 4 comments
Open

Analog voltage input on STM32Fxxx driver #11

jas-mic opened this issue Nov 27, 2024 · 4 comments

Comments

@jas-mic
Copy link

jas-mic commented Nov 27, 2024

Hello,

I would like to test the plasma module with a board based on the STM32F1xx (STM32F103RC).
This is a "High-density" chip that has I/Os for reading and writing analog signals.
Datasheet of the STM32F103(RC)
The pins are labeled "ADC123_IN" in the documentation on page 13, and there are 3 12-bit ADCs.

Is it possible to use these inputs to read the reference voltage of the plasma arc (coming from a voltage divider, plasma plugin mode 1) ?
I don't think this is currently implemented in this driver, either through the ADC pins or via I2C ?

Thank you for your work
Best regards

@terjeio
Copy link
Contributor

terjeio commented Nov 28, 2024

It is possible but code has to be added to support both analog input and step injection. It can be ported over from the STM32F4xx driver, currently I have no plans to do so myself.

@jas-mic jas-mic changed the title Analog voltage input on STM32F1xx driver Analog voltage input on STM32Fxxx driver Nov 30, 2024
@jas-mic
Copy link
Author

jas-mic commented Dec 1, 2024

Thank you @terjeio. I will rather focus on an STM32F4xx since I don't have the skills to port the code.
I did notice the file that implements the analog input, either through GPIO or via I2C (using the MCP3221).

I understand that pin assignment is done in the x_map.h file, but I can’t find any functional examples to help me define the analog input. The web builder doesn’t seem to support this on this driver at the moment.

Please, could you let me know what steps to follow to enable the plasma plugin with a GPIO-based analog reading ?
Have a great day.

@terjeio
Copy link
Contributor

terjeio commented Dec 1, 2024

The board map has to include definition for at least one analog input, like this (it is in the only board map that has one defined for now). Analog ports/pins are defined here, which are available depends on the MCU variant.

Are you going to use a galvanically insulated front-end for the input?

@jas-mic
Copy link
Author

jas-mic commented Dec 2, 2024

Thank you, @terjeio, for the information and the links to the files. I’m going to order a board with an STM32F4xx to conduct some tests, most likely a 401 or a 411.

Yes, galvanic isolation will definitely be necessary to prevent electromagnetic disturbances from affecting the STM32. The method for igniting the plasma arc is also very important, even if isolation is implemented.

I hope to retrieve the reference voltage from the plasma cutter without directly measuring the arc voltage. I’ll need to open it up and check if there is an internal voltage divider.
I also need to verify if the STM32’s ADC is linear over 0-3.3V or if it would be better to use the MCP3221 for 0-5V.

I’d like the simplest solution with the fewest additional components.
I’ll keep you updated
Thanks

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

No branches or pull requests

2 participants