Analog Input in realtime
- rajsekhar
- Offline
- Elite Member
Less
More
- Posts: 204
- Thank you received: 11
05 Aug 2022 15:51 #249126
by rajsekhar
Analog Input in realtime was created by rajsekhar
Dear Friends..
I want to know the ways to have a sensor analog output to be read into linuxcnc in realtime.
The application I am looking for is adaptive feed control in lathe/mill via power (current sensor) measurement.
Earlier, I have sucessfully taken integer input from arduino (usb connected) into hal (via python). But that I think was not in realtime.
How realtime float input is possible??
I want to know the ways to have a sensor analog output to be read into linuxcnc in realtime.
The application I am looking for is adaptive feed control in lathe/mill via power (current sensor) measurement.
Earlier, I have sucessfully taken integer input from arduino (usb connected) into hal (via python). But that I think was not in realtime.
How realtime float input is possible??
Please Log in or Create an account to join the conversation.
- Henk
- Offline
- Platinum Member
Less
More
- Posts: 395
- Thank you received: 80
05 Aug 2022 16:47 #249131
by Henk
Replied by Henk on topic Analog Input in realtime
Best sollution is probably one of Mesa's THCAD cards. It is basically an A/D converter that outputs a signal that can be counted with one of the encoder inputs
There is a 10v and a 300v version
There is a 10v and a 300v version
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17950
- Thank you received: 4817
05 Aug 2022 16:55 #249132
by PCW
Replied by PCW on topic Analog Input in realtime
A 7I87 is another possibility if you need multiple channels
Also there is a crude (8bit) 4 channel analog input capability on many Mesa daughtercards
(7I73,7I76,7I77,7I84)
Also there is a crude (8bit) 4 channel analog input capability on many Mesa daughtercards
(7I73,7I76,7I77,7I84)
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19471
- Thank you received: 6530
05 Aug 2022 17:17 #249136
by tommylight
Replied by tommylight on topic Analog Input in realtime
Or write a driver for using analog Line Inputs on the motherboard, 2 inputs at high resolution, but also high sensitivity (usually 1VPP).
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
05 Aug 2022 22:25 #249165
by andypugh
Replied by andypugh on topic Analog Input in realtime
Or: Use a PWM output into a filter, and a (physical) comparator to feed back if your pwm is higher or lower than the measured voltage, then a PID loop in HAL trying to achieve a value of 0.5 in the feedback will track the external voltage.
Probably.
I have never actually tried this, but its basically a crude "tracking ADC" implemented in HAL. It will cost you two IO pins, though.
You could also bitbang an I2C ADC: www.ebay.co.uk/itm/195025832761 or similar, but that might not be fast enough (it will take 32mS to bitbang a 16 bit value out of it)
If you are using a Mesa card, then there is an SPI module in the firmware, and then an external ADC could be sampled at 1kHz.
Probably.
I have never actually tried this, but its basically a crude "tracking ADC" implemented in HAL. It will cost you two IO pins, though.
You could also bitbang an I2C ADC: www.ebay.co.uk/itm/195025832761 or similar, but that might not be fast enough (it will take 32mS to bitbang a 16 bit value out of it)
If you are using a Mesa card, then there is an SPI module in the firmware, and then an external ADC could be sampled at 1kHz.
Please Log in or Create an account to join the conversation.
Time to create page: 0.061 seconds