Read Analog Input

More
31 Mar 2021 16:22 #204239 by elisa
Read Analog Input was created by elisa
Hi everybody,

I would like to read an analog value from Arduino and save the current joint angles when this value overcomes an offset

My questions are:

1. How can I read an analog input from Arduino in Linuxcnc?

2. Can I use the command "Log" to save joint angles into a text file?

Please write soon!

Please Log in or Create an account to join the conversation.

More
31 Mar 2021 19:34 #204277 by aleksamc
Replied by aleksamc on topic Read Analog Input
If you need, linuxcnc can read analog value from mesa 7i77 board for example.
But I must say Elisa, that you have purposes that linuxcnc doesn't have as default.
Look this topic as example, possibly you will find something to solve your question.

As I know arduino, it's only microcontroller that work from your program.
As I imagine you can use USB interface or COM inteface to comunicate arduino and PC. Have you successed in comunication of PC and your Arduino program?

Please Log in or Create an account to join the conversation.

More
31 Mar 2021 20:57 #204295 by tommylight
Replied by tommylight on topic Read Analog Input
You can always use Arduino to measure analogue voltages and convert them to frequency, LinuxCNC is very good at counting frequency. No other hardware required, no serial anything.
The same principle is used for THCAD used to measure Plasma cutting voltage and subsequently adjust the height of the Z axis to follow the material in real time.
The following user(s) said Thank You: elisa

Please Log in or Create an account to join the conversation.

More
01 Apr 2021 08:12 #204371 by elisa
Replied by elisa on topic Read Analog Input
Where can I find information about that?

Please Log in or Create an account to join the conversation.

More
01 Apr 2021 09:43 #204379 by rodw
Replied by rodw on topic Read Analog Input
Linuxcnc has an encoder component that will read a frequency from two pins of a parallel port.
Many of the Mesa cards have encoder inputs which can handle higher frequencies.
Also some mesa cards (like the 7i76e) also have some analog to digital inputs but you would need a signal amplifier as they go to 32 volts or so..

To output a frequency from an Arduino, you could establish a timer interrupt service routine that toggled a digital pin on and off and vary that time interval based on the analog input.

But it would be worth describing your application because if you are coding for an Arduino it would not be hard to convert to writing a custom component in Linuxcnc which may negate the need to use an Arduino.

Please Log in or Create an account to join the conversation.

More
01 Apr 2021 14:41 - 01 Apr 2021 14:41 #204391 by PCW
Replied by PCW on topic Read Analog Input
Yes, the application is important, USB should be fine if you don't need high speed.
For example one LinuxCNC user implemented temperature compensation for spindle
growth with a Arduino measuring the spindle temperature and sending the data to
LinuxCNC via a userspace component.
Last edit: 01 Apr 2021 14:41 by PCW.
The following user(s) said Thank You: elisa

Please Log in or Create an account to join the conversation.

More
01 Apr 2021 18:03 #204411 by tommylight
The following user(s) said Thank You: elisa

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum