Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:52:53 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Unstable analog inputs
Pages: 1 2 »   Go Down
Print
Author Topic: Unstable analog inputs  (Read 255 times)
0 Members and 1 Guest are viewing this topic.
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« on: January 31, 2012, 04:03:39 PM »

I’m using two 10K pots for analog inputs through a ModIO for FRO and Speed % DROs The DROs float around about + and – 2% from set point. Is there a way to buffer or smooth out the inputs. I could write a macro with 100 “deadspots” but that doesn’t seem to be the way to go. Any help would be appreciated.

Thanks,

Tony
Logged
Peter Homann
ModIO Adviser
Active Member

Offline Offline

Posts: 354




View Profile WWW
« Reply #1 on: January 31, 2012, 04:23:52 PM »

Hi,
It is most likely from ripple in the power supply. The best way to deal with it is to filter it in software as you suggest.
Also think about putting in a +/- 5% dead band at the 100% point

Cheers,

Peter
Logged

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com/store
email: peter at homanndesigns.com
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« Reply #2 on: January 31, 2012, 04:36:09 PM »

Thanks Peter,

I'm using the +5V from the ModIo. Could I use an external power supply say from the PC and have less ripply? How about a good stand alone power supply?

Thanks,

Tony
Logged
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« Reply #3 on: January 31, 2012, 04:41:36 PM »

Will the floating feed rate overwork Mach while running a program?

Thanks,
Tony
Logged
Peter Homann
ModIO Adviser
Active Member

Offline Offline

Posts: 354




View Profile WWW
« Reply #4 on: February 01, 2012, 03:33:37 PM »

Hi Tony,

No it won't be an issue as mach processes it regardless of whether it changes or not.  Most put a deadband in though. It just means that you don't have to be so spot on with the positioning of the knob.

Cheers,

Peter.
Logged

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com/store
email: peter at homanndesigns.com
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« Reply #5 on: February 02, 2012, 08:28:14 AM »

Hi Peter,

I was concerned that during a machining operation Mach might not keep up with calculating the vector velocity components of a multi axis feed twenty times a second.

Here’s the code I used in a macropump to buffer it a little. It is pretty jittery so I had to use wide deadbands.

Sub FRO()

a = getinput(64)
b= Fix(a/6.8267)   ‘150%
If b < (GetVar(607)-2.5) Or b > (GetVar(607)+2.5) Then
SetVar(607,b)
If GetVar(607) < 103 And GetVar(607) > 98 Then
SetDro(21,100)
DoOemButton(1014) 'reset overide
Exit Sub
End If
SetDro(21,GetVar(607))
End If
End Sub

Thanks for all your help.

Tony

Logged
stirling
Global Moderator
*
Offline Offline

Posts: 1,190

UK


View Profile WWW
« Reply #6 on: February 02, 2012, 09:51:46 AM »

Hi Tony - if I've understood your requirement properly you want to "band" your input?

x = int(y / z) * z

x will be y banded into divisions of z with an automatic dead zone at the top. Season to taste.

Ian
« Last Edit: February 02, 2012, 10:03:21 AM by stirling » Logged
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« Reply #7 on: February 02, 2012, 10:49:46 AM »

Thanks Ian,

One problem is, as I see it, with distinctive bands is that if the set point is near the edge of the band the output will be hunting between the two bands.
With “If b < (GetVar(609)-2.5) Or b > (GetVar(609)+2.5) Then
SetVar(609,b)” I was trying to get a fixed width band with variable location. This keeps sampling and keeping the output in the center of the band. I realize the “2.5” doesn’t do much good with the integers. Oops.

I probably misunderstood your formula. Relating to mine would it be:
b  =  INT (a/6.8267)* ?? EDIT: now that I look at it again doesn't (Y/Z)*Z = Y?

What I’m trying to avoid is the feed rate hunting while machining in FRO

I do like your way of thinking.

Tony

« Last Edit: February 02, 2012, 10:56:58 AM by Tony Bullard » Logged
stirling
Global Moderator
*
Offline Offline

Posts: 1,190

UK


View Profile WWW
« Reply #8 on: February 02, 2012, 01:16:00 PM »

I see what your saying - I'll have a think...

But meanwhile...
now that I look at it again doesn't (Y/Z)*Z = Y?
Yes indeed it does BUT... INT(Y/Z)*Z does not ALLWAYS = Y and that's why it bands Wink

Ian
Logged
Tony Bullard
Active Member

Offline Offline

Posts: 83


View Profile
« Reply #9 on: February 02, 2012, 02:07:14 PM »

Yeah but if Y = analog input then it is always an integer, Right?

Then (Y/Z)*Z = Y = INT(Y/Z)*Z

Only when Y is not an integer will (Y/Z)*Z  not = INT(Y/Z)*Z

Just gives me something else to think about.
Thanks,
Tony


Logged
Pages: 1 2 »   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!