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 Aux Inputs on Due #24

Closed
JackDaviesDesign opened this issue May 20, 2024 · 4 comments
Closed

Analog Aux Inputs on Due #24

JackDaviesDesign opened this issue May 20, 2024 · 4 comments

Comments

@JackDaviesDesign
Copy link

JackDaviesDesign commented May 20, 2024

I am trying to add an analog input to measure the arc voltage of a plasma cutter using the THC plugin.

This is with no changes to the ramps_smart_map.h file.

[PIN:A. 14,Aux in 0,Cutter up]
[PIN:D. 0,Aux in 1,Cutter down]
[PIN:D. 2,Aux in 2,Arc ok]

I then added these lines to the ramps_smart_map.h file

#define AUXINPUT3_PORT      PIOB
#define AUXINPUT3_PIN       20   // Analog input for THC - Due D65/A11  // AUX-2 Connector

This is the result of $pins

[PIN:A. 14,Aux in 0,P0]
[PIN:D. 0,Aux in 1,Cutter up]
[PIN:D. 2,Aux in 2,Cutter down]
[PIN:B. 20,Aux in 3,Arc ok]

Everything got shifted down a level. Do I need to define that this pin (B20) is an analog pin somewhere?

@terjeio
Copy link
Contributor

terjeio commented May 20, 2024

I have not added analog input capability to this driver yet so it is not possible to use voltage driven THC until that is done.

How do plan to connect arc voltage? More or less directly to an analog capable MCU pin? Or via galvanic isolation?

FYI Phil Barrett has made an I2C ADC board that provides isolation, aimed at plasma use. Adding support for that may be a tad easier (and safer) than using a MCU pin.

Anyway code has to be added and I am not able to do that for a while since I am away and without access to a dev board. If you are capable of adding it then the driver that might have the closest matching bits could be the STM32Fxx driver, the most complex part is in this file.

@JackDaviesDesign
Copy link
Author

Thank you for the feedback, that would explain it!

I have since purchased an ADC board from Phil based on your recommendation. Would be great if you could look at implementing this for the SMART Ramps when you are back/have time. I looked at your examples but it goes a bit over my head!

Thank you in advance!

@terjeio
Copy link
Contributor

terjeio commented Jun 20, 2024

MCP3221 support added in the latest commit - but not yet available from the Web Builder.

@terjeio
Copy link
Contributor

terjeio commented Jun 25, 2024

MCP3221 support now available in the Web Builder, enable in the Optional inputs tab.

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