Calculating distance from sensor

I have linear sensor(0,7metres) with analog 4-20 mA signal,
how i can calculate total distance, when sensor goes up and down while the program is running, i.e. sensor starts from 0 goes to max. 0,7 metres and back to zero -> 1.4 metres

The information you get from your sensor is the position. To obtain the overall length of all the displacements (Distance) you have to :
1/ calculate the instant speed : make consecutive readings of the position at defined time intervals, and divide the difference between the positions (DeltaPos) by the DeltaT. The lower the DeltaT, the higher the sensitivity to tiny displacements, but also to signal noise...
2/ integrate the absolute value of speed over time.
Not difficult again : get the absolute value of the speed, multiply by the DeltaT (?!), then add to the previous distance to get the new one.
As you can see there is a kind of stupid operation here : division then multiplication by DeltaT. Well, if you don't need specifically the speed inform
ation, you can suppress this step and just calculate Sum(Abs(DeltaPos)).
The attached vi is an example of what you could do.
Does that help, or am I missing something ?
Chilly Charly    (aka CC)
         E-List Master - Kudos glutton - Press the yellow button on the left...        
Attachments:
Position.tiff ‏4 KB

Similar Messages

  • Calculatin​g distance from sensor

    I have linear sensor(0,7metres) with analog 4-20 mA signal, how i can calculate total distance, when sensor goes up and down while the program is running, i.e. sensor starts from 0 goes to max. 0,7 metres and back to zero -> 1.4 metres or 0 to 0,4 and back to 0,1 ?

    Hi Jani!
    In response to your last post, I saw the same behavior that you were talking about. I made some modifications to the VI and now it does reset to zero when you press "reset."
    I hope this helps!
    Take care,
    Travis H.
    National Instruments
    Travis H.
    LabVIEW R&D
    National Instruments
    Attachments:
    Accumulated_Distance3.vi ‏42 KB

  • Calculated value from multiple rows in selection set

    Consider this query
    SELECT WELL.UWI
    FROM geo_formation A, WELL
    WHERE ( (select min(top_depth)
    from geo_formation B
    where B.uwi = A.uwi
    and form_id = 'WDBD' )
    (select min(top_depth)
    from geo_formation C
    where C.uwi = A.uwi
    and form_id = 'VKNS' )
    ) > 10
    AND A.uwi = WELL.UWI
    AND A.FORM_ID IN ('WDBD','VKNS')
    ORDER BY WELL.UWI, A.FORM_ID
    The question asked by the query is
    Show me all the entities (entities are identified by WELL.UWI)
    where the distance between the geological formations (identified by WDBD and VKNS)
    is greater than 10
    The distance in question of course is calculated in the
    (select min(top_depth)
    from geo_formation B
    where B.uwi = A.uwi
    and form_id = 'WDBD' )
    (select min(top_depth)
    from geo_formation C
    where C.uwi = A.uwi
    and form_id = 'VKNS' )
    portion of the where clause.
    ** My question:
    Is there any way to get this calculated value to be part of the selection list
    ie.
    SELECT WELL.UWI, 'the calculated value in question'
    FROM geo_formation A, WELL ...

    Thanks Barbara; once again your solution to one of my problems works like a charm.
    On top of that, I learned something important; I did not know that one can essentially achieve the same results as creating a temporary table by including the appropriate (select ...) in the from clause.
    Thanks again.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Barbara Boehmer ([email protected]):
    SELECT a.uwi, (bmin - cmin) distance
    FROM well a,
    (SELECT uwi, MIN (top_depth) bmin
    FROM geo_formation
    WHERE form_id = 'WDBD'
    GROUP BY uwi) b,
    (SELECT uwi, MIN (top_depth) cmin
    FROM geo_formation
    WHERE form_id = 'VKNS'
    GROUP BY uwi) c
    WHERE b.uwi = a.uwi
    AND c.uwi = a.uwi
    AND bmin - cmin > 10
    ORDER BY a.uwi
    /<HR></BLOCKQUOTE>
    null

  • Distance from a Zip Code

    I have a list of 500 names with corresponding zip codes and I want Numbers to automatically tell me the distance the person's zip code is from a default zip code.  Is there any way to do this so I don't have to put each one individually into Google Maps?  Any help is appreciated!

    "Once you know the coordinates of the two you can computer a distance by:
    assuming LAT is x and LONG is y:
    D = sqrt((x1 - x2)^2 + (y1 - y2)^2)
    or the square root of the sum of the squares"
    Works well if the earth is flat. But it's not, and the Pythagorean equation is a bit too simple.
    Here's an example: two pairs of coordinates; both pairs with the same NS difference and the same EW difference in location, measured in degrees and minutes.
    Austin to San Diego
    San Diego is at N 32° 42' W 117° 10'
    Austin is at      N 30° 16' W 97° 44'
    Difference:           2° 26', 19° 26'
    ? to Spokane
    Spokane is at  N 47° 40' W 117° 26'
    - same Difference: 2  26        19  26
    ? is at             N 45° 14' W  98° 00'  (near Aberdeen SD).
    x1 and x2 are the same in both cases, as are y1 and y2.
    But the 'crow's flight' distance from Austin to Sandiego is 1860 km, and from near Aberdeen to Spokane is 1509 km, using the calculator at http://www.movable-type.co.uk/scripts/latlong.html
    Even those are described as 'close enough in most cases, as they're based on the assumption the earth is a (perfect) sphere. Not accounting for the equatorial bulge results in errors of up to 0.3%, according to the site linked above.
    The site also includes the necessary equations.
    The site also notes that 'for short distances' the Pythagorean calculations 'may be close enough.'
    Regards,
    Barry

  • How to see data in BAM from sensor on BPEL activity?

    Hello, I 'am working with BPEL on Jdeveloper (last version).
    I have putted sensors on some activity of my process. On an other machine I have putted the BAM server (last version) which is ON and I have the BAM connection on Jdevlepper. Now I try to see data on BAM from sensor but I can't.
    Can someone explain me how to do?
    (I just can build some data just like in a data base with BAM architect but I can't read and put to graphics the ones from the sensors)
    Thank's much
    JAck

    Hello,
    To answer your question, I have install BAM on the same machine where BPEL server is running.
    Now I steel can't get sensor's data from BPEL:
    With BAM architect I can build data, with BAM studio I can use that data to design graphics but when I try to feed data from BPEL it doesn't work because I just can't press the OK button!!
    In BPEL : When I try to Create BAM sensor action (from structure panel), I can't generate the xsl map file no action is done when pressing OK, create mapping or edit mapping button!

  • Speed vs distance from cabinet

    Hi
    Hopefully a quick question. My cab is about to be enabled for fibre and I estimate my house is approx 300m away from the cabinet. I know there are many variables but as a very rough guide what do you guys think I will see in download speeds?
    (Getting excited!).
    Thx in advance

    this graph will give you an idea of the fibre degredation over distance from cabinet
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Switched long distance from At&t to verizon in February still no long distance capabilites, WHY?

    Switched long distance from At&t to verizon in February still no long distance capabilites, WHY? I have made numerous calls in the last few months and still am not able to make a long distance call. Do I need to switch back to AT&T. I have been using Skype but doesn't Verizon want the business?

    Some verizon people do look here but this forum is mostly for user to user help.
    Try "contact us" http://www.verizon.com/contactus

  • Calculating Distance given a 4 point 2D image

    Hi All,
    3d n00b so play nice :-)
    I'm trying to use a Wii remote camera to calculate real world distance from an object in Java.
    The Wiimote will supply me the x and y coordinates of the 4 point object, which is actually 4 lights on the floor in this configuration.
    I know the exact measurements of the 4 objects and the distance between them in the real world.
    I know the 2D co-ordinates as represented on a 1024x768 screen.
    I know the Angle of the Wiimote.
    The lights will only ever be on a flat horizontal plane.
    Is there anyway to reverse transform the 2D image from the camera back into 3D, taking into account the fact that the image may be rotated, and thus calculate the distance in the real world?
    I'm guessing its some clever trig and some wizzy transformations although its been 20 years since I was in school! :-)
    If you need any more explenation I'd be happy to attach some drawings.
    Thanks in advance.
    Uzerfriendly

    hi
    did you ever find out anything regarding your query?
    i was trying to solve maybe a similar problem
    though i'm not sure
    how can i calculate the distance of an object of a known size (say, a person) that appears in a picture
    presupposing the picture was image is not magnified or is somehow "sstandardized" or somehow "like" human vision
    does it make any sense?
    be happy to hear
    thanks
    doron

  • How to paste calculated values from Numbers?

    When I copy calculated values from Numbers and paste into a table in Pages, I get an image like the one below.  Non calculated values paste fine.
    To get around this issue, I paste the calculated values into TextWrangler, then copy from there and paste into Pages.  Is there a way to go directly from Numbers to Pages with calculated values?

    Hi 4th Space,
    I you are pasting into a table in Pages, follow Jeffs instructions.
    I you are not pasting into a table, this works. Copy the cells in Numbers. Go to your Pages document and under the Edit Menu > Paste and Match Style. It works like Paste Values.
    Ian.

  • Mesh Distance from Root AP to Mesh AP

                       Hi all,
    In 5508 WLC  what does this mean
    Mesh Root AP  to Mesh AP  11000 Feet.
    Need to understand what does Root AP  and MEsh AP mean?
    IS this distance from WLC  to AP?
    Thanks
    MAhesh

    RAP-to-MAP ratio—Recommended maximum ratio is 20 MAPs per RAP.
      * AP-to-AP distance—A spacing of no more than of 2000 feet (609.6 meters) between each mesh access point is recommended. When you extend the mesh network on the backhaul (no client access), use a cell radius of 1000 feet (304.8 meters).
    For more clarity please go through the below link:
    http://www.cisco.com/en/US/docs/wireless/technology/mesh/7.0/design/guide/MeshAP_70.html

  • My wifi-connection stops by taking some distance from my router, let's say 4 meters (12feet) reseting network setting etc, doesn't help

    my wifi-connection stops by taking some distance from my router, let's say 4 meters (12feet) reseting network setting, etc, doesn't help!
    any suggestions?
    jonathan

    neuwerld wrote:
    Ohh thanks guys!
    It worked as a charm, and thanks Brisbin33 for the autostart.sh tip.
    So the thing that caused my whole system not to work as it should was that I forgot to put a "&" after conky?
    haha that´s kinda anoying I have been sitting and looking through like a milllion files looking for the answer
    But again, really thanks!
    /Neuwerld
    that little "&" sends the conky process to the background freeing up the current process (your autostart.sh script) to finish doing what it's doing so you can move on to running openbox itself.  with this in mind, it should be obvious why keeping conky in the foreground would cause problems.
    also, replacing it with (sleep 1 && conky) & means... wait a second, when that's done successfully (&&) run conky, and put all of that () to the background.  that way openbox comes up immediatly and only a second later you've got your panel and monitor.
    all this after .xinitrc and before openbox

  • What is the longest distance from the cabinet that...

    Hi,
    I've seen the charts and tables now I would like to know what the longest distance from the cabinet anyone has actually achieved 25Mbps with FTTC please ?
    Best regards,
    dfenceman

    It's hard to say, I'm between 800 - 1000m I would imagine and get 26Mbps.
    31db Attenuation which seems a bit wrong to me, though an engineer told me that so it may be incorrect.
    The charts are only a ratio as well with basis of an average line, you may have a bad line or a good quality line.
    You could find out but I doubt you will find the volunteers and wish to put months of hard work into it.
    If this helped you please click the Star beside my name.
    If this answered your question please click "Mark as Accepted Solution" below.

  • What distance from the Cab ?

    Hi All I,m after some info regarding speeds you get on Infinity , what distance from the green cabinet do you have to be to get 40meg speed  ? thanks 
    JamJar62

    You'll never see 40 on a speedtest, not at the moment anyway. With a 40meg sync, your profile would be around 38710. On a speedtest you'll get about 37
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Sensor_read_temp: failure reading temperature from sensor 0

    I have a Temperature sensor driver error as follows:
    2011 Mar 17 19:53:28 GB2FCC202EA %MODULE-4-MOD_WARNING: Module 12 (serial: JAF1435BFPG) reported warning due to Temperature sensor driver error in device 49 (device error 0xc310020b)
    2011 Mar 18 03:09:15 GB2FCC202EA %PLATFORM-4-MOD_TEMPFAIL: Module-12 temperature sensor 1 failed
    exception information --- exception instance 2 ----
    Module Slot Number: 12
    Device Id         : 49
    Device Name       : Temperature-sensor
    Device Errorcode  : 0xc310020b
    Device ID         : 49 (0x31)
    Device Instance   : 00 (0x00)
    Dev Type (HW/SW)  : 02 (0x02)
    ErrNum (devInfo)  : 11 (0x0b)
    System Errorcode  : 0x00000046 Temperature sensor driver error
    Error Type        : Warning
    PhyPortLayer      : Fibre Channel
    Port(s) Affected  : none
    Error Description : sensor_read_temp: failure reading temperature from sensor 0
    DSAP              : 0 (0x0)
    UUID              : 0 (0x0)
    Time              : Thu Mar 17 19:53:28 2011
                        (Ticks: 4D8258A8 jiffies)
    Temperature:
    Module   Sensor        MajorThresh   MinorThres   CurTemp     Status
                           (Celsius)     (Celsius)    (Celsius)        
    12       Outlet1         n/a             n/a         n/a        Failure              
    It looks a match for CSCsw41181 - however we don't see the following condition against any interface:
    'Error disabled - SFP vendor not supported'
    We tried reseating an SFP on this module but still no SFP vendor not supported condition.
    Any other known bugs or do we have to treat it as a hardware issue?
    thanks

    Hi,
    If it is related to CSCsw41181, a reload of the module would clear the condition.
    If you can schedule a maintenance window to reload the module, that may be the least
    intrusive next step (keep in mind that reloading the module will be disruptive to all the ports
    on that module).
    Regards,
    Ken

  • File transfer speed and distance from base station?

    I tested the file transfer time (outside with no obstructions) by moving a large video file between my MacBook and a computer wired to an Airport base station.   The times were the same as distance increased until the connection dropped.  Why?

    Do the calculations.
    (Although wireless qualifies more for voodoo project than science).
    500MB translates to 5.7MB/s which is near enough to 46Mbits/s
    500MB in 94sec is 42.6Mbits/s
    That is really slow for 5ghz at such close distance to the airport.
    What OS are you running? Please open the wireless diagnostics.
    About Wireless Diagnostics - Apple Support
    Run the wireless utility.
    And get the actual link speed and how well it is working.
    Then use iperf to get actual network speeds. Rather than moving a file test the link rates.
    iperf is included in Mac OS and is available via terminal.
    This post gives some clues. http://acidx.net/wordpress/2013/05/testing-a-network-connection-with-iperf/
    I think your seeing a hold up due to slow ethernet say.. 100mbit ethernet will ruin any numbers you are trying to get in tests. As well as older slow Mechanical hdd in laptops.
    But the link speed in the Utility will tell you the story.. if you link at 450Mbps which should be possible up close.. and it drops to say 200Mbps at a range of 130M you are still far faster than the rate determining step.. very likely to be a slow disk plus slow ethernet.
    Go to the performance tab.. and keep it running as you move the computer from next to the Airport to the 130M point. You should see a pretty large drop in connect speed.. but you also need to keep this running as you transfer files.. since it tends to vary greatly during a file transfer.
    For science experiments.. this is already a pretty good one.. you are trying to determine the rate determining step in a network system and why wireless is not causing the problem you expected. The use of actual diagnostic tools is great.. almost like science.
    The big spike in this graph is me changing from 2.4ghz to 5ghz.

Maybe you are looking for