Average of deviation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Average of deviation

    Is there any code to calculate average deviation of 150 points with entering only starting and ending point so it would automatically add deviations of all 150 points and divide by 150?
    From "LOC1.X.DEV to LOC150.X.DEV
    I use 3.5 MR2
    Thanks,
    Zoran

  • #2
    You could loop it into an array but the column width for an array is 256 chars.
    <internet bumper sticker goes here>

    Comment


    • #3
      Too many points for that.

      Comment


      • #4
        Code:
         
                    ASSIGN/V4[1] = ARRAY(LOC18.MEAS,LOC19.MEAS,LOC20.MEAS,LOC21.MEAS,LOC22.MEAS,LOC23.MEAS,LOC24.MEAS)
                    ASSIGN/V4[2] = ARRAY(LOC25.MEAS,LOC26.MEAS,LOC27.MEAS,LOC28.MEAS,LOC29.MEAS,LOC30.MEAS,LOC31.MEAS)
                    ASSIGN/V4[3] = ARRAY(LOC32.MEAS,LOC33.MEAS,LOC34.MEAS,LOC35.MEAS,LOC36.MEAS,LOC37.MEAS,LOC38.MEAS)
                    ASSIGN/V4[4] = ARRAY(LOC39.MEAS,LOC40.MEAS,LOC41.MEAS,LOC42.MEAS,LOC43.MEAS,LOC44.MEAS,LOC45.MEAS)
                    ASSIGN/V4[5] = ARRAY(LOC46.MEAS,LOC47.MEAS,LOC48.MEAS,LOC49.MEAS,LOC50.MEAS,LOC51.MEAS,LOC52.MEAS)
                    ASSIGN/V4[6] = ARRAY(LOC53.MEAS)
                    ASSIGN/BBLENGTH_AVG = V4/36
        F9         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                    NOM/XYZ,<BBLENGTH_AVG,0,0>,$
                    MEAS/XYZ,<BBLENGTH_AVG,-839.5005,518.8612>,$
                    NOM/IJK,<0,0,1>,$
                    MEAS/IJK,<0,0,1>
        $$ NO,This is the everage length of the ballbar for programming use
        DIM LOC55= LOCATION OF POINT F9  UNITS=MM ,$
        GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=NONE
        AX       MEAS    NOMINAL       +TOL       -TOL        DEV     OUTTOL
        X    684.0725   530.8423     0.0100     0.0100   153.2302   153.2202 ----------------->
        END OF DIMENSION LOC55
        sigpic GDTPS - 0584

        Comment


        • #5
          Does PCDMIS need to display this info?

          You could send it to Datapage and get the average. You could send it to a text file and have Excell do the average. You could also write a script to do it but your naming convention would have to be hard coded. Unless you write them to a text file, then have your script open the text file and read them in then set a variable in your program through automation. Setting a variable would require hard coding as well though so you could have your script write it to a text file for PCDMIS to read in from.

          I guess it all depends on what your goal is.
          <internet bumper sticker goes here>

          Comment


          • #6
            I need to use the average ot make an Off-set in the program itself.

            Comment


            • #7
              212 is creating a multidimensional array, that is a good way to do it. You could probably loop it to make it less code and more generic.
              <internet bumper sticker goes here>

              Comment


              • #8
                Originally posted by zoran View Post
                I need to use the average ot make an Off-set in the program itself.
                Why not just do a BEST-FIT or even an ITERATIVE alignment?
                sigpic
                Originally posted by AndersI
                I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                Comment


                • #9
                  Im with 212. You could also use the variable for your offset...

                  Comment


                  • #10
                    Can you just use a feature control set and tolerance the scan with max/min.

                    Of course this may not be the information you are looking for.
                    Robert Horne
                    Va.

                    Comment


                    • #11
                      It’s little confusing, but I'll try to explain:

                      I use this program to make adjustment on the CNC, cutout line is on compound angle. It's working fine but instead me guessing how much off set to put it's easier if know the average. They can not move individual points, only the whole line. After they cut the part, I mark the nominal cutout line on the part(paint dots), than measure trim points along the actual cutout. Than from looking all the data I decide how much off set to put on each axis. Using the measured value of the trim points and assigned offset I simulate CNC cut with that offset and look how far will be from the nominal line. I change the offset until I get very close to the nominal line. All this is in the program and doesn't take that long to run it. It took me a while to write it. With knowing the average I can guess the offset quicker.

                      Comment


                      • #12
                        Thanks to all of you for the replies, lots of good ideas.

                        Comment


                        • #13
                          Originally posted by zoran View Post
                          Thanks to all of you for the replies, lots of good ideas.
                          What about a if loop adding the dev to a variable. Then divide the result by 150?

                          Something like:
                          Count = 1
                          v1=0
                          If count <=150
                          v1=v1+feat'count'.dev
                          count=count+1
                          end if
                          v2=v1/150

                          The actual code is a little diff but this would be generic for any number of points for any feature name.
                          Last edited by Wingman; 08-09-2007, 01:06 PM.
                          Bill Jarrells
                          A lie can travel half way around the world while the truth is putting on its shoes. - Mark Twain

                          Comment


                          • #14
                            I do this a lot and use something very similar to 212. It's a lot of typing, but once it is done, it runs very smoothly.


                            Jan.
                            ***************************
                            PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
                            Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

                            Comment


                            • #15
                              Originally posted by Wingman View Post
                              What about a if loop adding the dev to a variable. Then divide the result by 150?

                              Something like:
                              Count = 1
                              v1=0
                              If count <=150
                              v1=v1+feat'count'.dev
                              count=count+1
                              end if
                              v2=v1/150
                              So simple. Why that didn't occur to me I havn't the slightest. Something like that would probably be the best bet.
                              <internet bumper sticker goes here>

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X