Hello Guest it is March 28, 2024, 05:33:44 AM

Author Topic: Unstable analog inputs  (Read 6506 times)

0 Members and 1 Guest are viewing this topic.

Unstable analog inputs
« 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
Re: Unstable analog inputs
« 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
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Unstable analog inputs
« 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
Re: Unstable analog inputs
« Reply #3 on: January 31, 2012, 04:41:36 PM »
Will the floating feed rate overwork Mach while running a program?

Thanks,
Tony
Re: Unstable analog inputs
« 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.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Unstable analog inputs
« 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

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Unstable analog inputs
« 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 »
Re: Unstable analog inputs
« 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 »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Unstable analog inputs
« 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 ;)

Ian
Re: Unstable analog inputs
« 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