Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #########################################
- # Valve Bucket Tool #
- # For measuring bucket-to-cam tolerance #
- # in OHC engines #
- # Version: 1.0 #
- #########################################
- #
- # NOTE: Im not perfect and neither is my code or computers, Use this program at your own discretion
- #
- #############################################################
- # 1) Number all of your intake and exhaust valve buckets; 1-4 and 9-12 should be intake valves; 5-8 and should be echaust valves
- # this is important because intake and exhaust valve buckets require different clearances
- #
- # 2) Measue the existing clearances for each valve buket and enter them into the 'measuredclerance' table on line 30,
- # enter them in sequential order so that valve 1 is the first entry and valve 16 is the last entry.
- #
- # 3) Measure the size of the valve buckets with a micrometer and enter them into the 'bucketsize' table, like the last step
- # you should enter them in sequential order so that bucket 1 is first and bucket 16 is last.
- #
- ##################### WARNING! ##########################
- # Failure to enter the clearances and bucket sizes in order #
- # WILL result in incorrect calculations. #
- # Incorrectly inputing values into the tables will also #
- # give incorrect calculations, be careful and double check #
- # everything. #
- #############################################################
- #
- # 4) Your setup may call for a set of tolerances different than what Subaru OEM specifies, the current values are what Subaru specifies
- # for a 2006 Impreza STI EJ257, refer to your years manual to get the correct values for your year and model. For aftermarket cams,
- # you should refer to datasheets provided by the manufacturer or a shops reccomendations like OUTFRONT MOTORSPORTS INC.
- # To change the tolerance specifications, simply edit the values of 'tolintakemax', 'tolintakemin' for intake cams, and 'tolexhaustmax', 'tolexhaustmin'
- # for exhaust cams. Variables with 'min' at the end are the tightest tolerance you want to run, and 'max' is the maximum tolerance.
- #
- # 5) Finally, you can tweak the precision of the round() calculations, its set to 3 which should be sufficient for imperial measurements but for metric you may
- # want to use a higher value like 4 or 5
- #
- # 6) RUN THE CODE! The program should spit out two data tables in the terminal, the first is a condensed reference and gives you a quick look at the minimum,
- # maximum, and reccomended values for bucket sizes, as well as telling you which valves the program thinks are exhaust and intake valves, just so you know
- # exactly what calculation was taking place.
- # The second table tells you which valve buckets are still suitable and where you can use them! This should help you save a good bit of money if you need
- # new buckets. Cheers, hope this program helps you with your engine rebuild!
- #
- ######################################### TWEAKABLE VARIABLES ##########################################
- ## Which valve to start and end on, use numbers greater than 0 and not more than the maximum of your car
- currentvalve = 1
- maxvalve = 16
- ##Feeler gauge measurments
- measuredclearance = [0.009, 0.013, 0.015, 0.012, 0.010, 0.011, 0.005, 0.014, 0.004, 0.003, 0.0025, 0.003, 0.006, 0.005, 0.006, 0.006]
- ##Micrometered bucket sizes
- bucketsize = [0.199, 0.195, 0.195, 0.194, 0.196, 0.197, 0.198, 0.195, 0.197, 0.196, 0.197, 0.196, 0.196, 0.197, 0.191, 0.188]
- ##Intake
- tolintakemax = .0079 + .0008
- tolintakemin = .0079 - .0008
- ##Exhaust
- tolexhaustmax = .0138 + .0008
- tolexhaustmin = .0138 - .0008
- ##Precision
- P=3
- ##################################################### ACTUAL CODE ########################################################
- #get recommended bucket size for a given valve
- #Smallest bucket, largest gap
- def recBucketSizemin(mclear, bsize, valve) :
- if determine(valve) == "intake" :
- buck = (mclear + bsize) - tolintakemax
- return buck
- elif determine(valve) == "exhaust" :
- buck = (mclear + bsize) - tolexhaustmax
- return buck
- ##largest bucket, smallest gap
- def recBucketSizemax(mclear, bsize, valve) :
- if determine(valve) == "intake" :
- buck = (mclear + bsize) - tolintakemin
- return buck
- elif determine(valve) == "exhaust" :
- buck = (mclear + bsize) - tolexhaustmin
- return buck
- ##Reccomended, right in the middle
- def recBucketSize(mclear, bsize, valve) :
- if determine(valve) == "intake" :
- buck = ((mclear + bsize) - ((tolintakemax+tolintakemin)/2))
- return buck
- elif determine(valve) == "exhaust" :
- buck = ((mclear + bsize) - ((tolexhaustmax+tolexhaustmin)/2))
- return buck
- #decide if valve is intake or exhaust
- def determine(cvalve):
- #print(valve)
- if (cvalve == 1) or (cvalve == 2) or (cvalve == 3) or (cvalve == 4) or (cvalve == 9) or (cvalve == 10) or (cvalve == 11) or (cvalve == 12):
- return "intake"
- else:
- return "exhaust"
- #checks which valves are valid
- def checkBuckets(valve):
- bmin = round(recBucketSizemin(measuredclearance[valve-1], bucketsize[valve-1], valve), P)
- bmax = round(recBucketSizemax(measuredclearance[valve-1], bucketsize[valve-1], valve), P)
- buckets = []
- for i in bucketsize:
- if (i>=bmin) and (i<=bmax):
- buckets.append(i)
- return buckets
- ##spacer
- print("----------------------------------------------------")
- #main loop
- while currentvalve <= maxvalve:
- bmin = round(recBucketSizemin(measuredclearance[currentvalve-1], bucketsize[currentvalve-1], currentvalve), P)
- bmax = round(recBucketSizemax(measuredclearance[currentvalve-1], bucketsize[currentvalve-1], currentvalve), P)
- brec = round(recBucketSize(measuredclearance[currentvalve-1], bucketsize[currentvalve-1], currentvalve), P)
- print(currentvalve, ": min:", bmin, ": max:", bmax, ": rec:", brec, ":", determine(currentvalve))
- currentvalve += 1
- ##spacer
- print("----------------------------------------------------")
- ## data loop
- currentvalve = 1
- #reset count
- while currentvalve <= maxvalve :
- print(currentvalve, ":", checkBuckets(currentvalve))
- currentvalve += 1
- ##spacer
- print("----------------------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement