Jump to content

LISP routine for 2D internal involute gears.


Chiefsmack

Recommended Posts

Hello everyone,

 

I am looking for a LISP routine to draw a 2D internally toothed involute gear (running AutoCAD 2004)... I did a search on the forum with no luck. This is no ordinary gear, I'm looking at a 200" Pitch Dia. with 400 teeth and an internal diameter of 199.4" .... I've found some real good LISP routines on this forum but the best one I've found only draws external... Any help would be greatly appreciated.

 

Thanks,

Chief

Link to comment
Share on other sites

Give this a try and see if it meets your needs.

Copy the files to AutoCAD support path, load Truegear.lsp using Appload and run the Tooth command.

 

Also, there is the 2Dgear.lsp, which may help as well.

 

Steve

2Dgear.lsp

Edited by StevJ
Added 2Dgear.lsp
Link to comment
Share on other sites

Thanks StevJ. The 2Dgear.lsp is the one that I have... It works great but as far as I know it only draws external gears. I tried the other one you requested and it also seems to only draw external.

Link to comment
Share on other sites

I've looked for a lisp routine for doing this but have been unable to find one. Better start programming one yourself or hire someone to do it for you.

 

Another alternative would be to head over to The Swamp and inquire there.

Link to comment
Share on other sites

How accurate do you need this 2D profile?

 

The proper tooth form for an internal involute gear is the inverse of the external involute, though in fabrication, the addendum of the internal tooth is slightly shortened to prevent interference and reduce the need for undercutting as well some other adjustments for clearance.

 

Because the internal gear is reversed relative to the external gear, the tooth parts are also reversed relative to the ordinary (external) gear. Tooth proportions and standards are the same as for external gears except that the addendum of the gear is reduced to avoid trimming of the teeth in the fabrication process.

 

Tooth thickness of the internal gear can be calculated with equations 9 (T = pc/2 = pi/2Pd) and 20 (B = Tstd - Tact = Delta T)), but one must remember that the tooth and space thicknesses are reversed, (see Figure 1.35). Also, in using equation 10 (T2 = T1 * (R2/R1) - 2R2 (inv theta2 - inv theta1)) to calculate tooth thickness at various radii, it is the tooth space that is calculated and the internal gear tooth thickness is obtained by a subtraction from the circular pitch at that radius.

 

 

Just subtract an external profile from a circular region.

 

If it needs to be super accurate, there are programs that can be purchased that will output a DXF.

 

 

 

 

See if this will suffice, I got it from the Internet a long time ago, not sure if I ever used it.

 

;For Internal Involute Gears:
;you must reverse the inputs for the addendum and dedendum
;and enter the tooth space instead of the tooth thickness.
;The program does draw from the base diameter out to the tip so it would
;require alot of trimming but the form would be accurate.  You would also have
;to fillet the root as the program draws a sharp intersection.
(defun c:gear ()
 (setq numt (getint "Number of Teeth:<24> "))
 (if (= numt nil)
   (setq numt 24))
   (setq diap (getreal "Diametral Pitch:<1.00> "))
 (if (= diap nil)
   (setq diap 1.000))
   (setq prsa (getreal "Pressure Angle:<20.0> "))
 (if (= prsa nil)
   (setq prsa 20.0))
   (setq adum (getreal "Addendum:<1.0000> "))
 (if (= adum nil)
   (setq adum 1.0000))
   (setq ddum (getreal "Dedendum:<1.1571> "))
 (if (= ddum nil)
   (setq ddum 1.1571))
   (setq tt (getreal "Arc Tooth Thickness :<1.5708> "))
 (if (= tt nil)
   (setq tt 1.5708))
   (setq filr (getreal "Fillet Radius:<0.235> "))
 (if (= filr nil)
   (setq filr 0.235))
   (setvar "orthomode" 0)
   (setvar "coords" 1)
;START CALCULATIONS
;
 (setq pnts 19) ;determines involute curve accuracy
 (setq prsa (/ (* prsa pi) 180.0)) ;pressure angle to radians
 (setq pitr (/ numt (* diap 2.0))) ;calc pitch radius
 (setq irad (- pitr ddum))         ;calc inside radius
 (setq orad (+ pitr adum))         ;calc outer radius
 (setq basr (* pitr (cos prsa)))   ;calc base radius of gear
 (setq z (- (expt orad 2.0) (expt basr 2.0)))  ;three lines of
 (setq x (sqrt z))                             ;code to make
 (setq paodd (atan (/ x basr)))                ;an arccosine
 (setq incr (/ paodd pnts))
 (setq p 0.0)
 (setq tt (* diap (/ tt numt)))
 (GRAPHSCR)
 (setq p2 '(0 0))     ;Center of Gear
 (setq x2 (CADR p2))
 (setq y2 (CAR p2))
 (setq y5 (+ y2 basr))
 (setq y6 (+ y2 irad))
 (setq p6 (list x2 y6))
 (setq p5 (list x2 y5))
 (setq pz1 (polar p2 1.95 (* basr 0.9)))
 (setq pz2 (polar p2 1.35 (* orad 1.5)))
  (COMMAND "CIRCLE" P2 pitr) ;place pitch circle
  (COMMAND "CIRCLE" P2 basr) ;place base circle
  (COMMAND "CIRCLE" P2 irad) ;place inside circle
 (COMMAND "ZOOM" "w" pz1 pz2) ;Window for drawing curve
 (setq s (ssadd))
 (setq le (entlast))
;
;begin a loop for placement of coordinate pairs
;the command pline will be used to generate a polyline whose
;vertices will be computed by a standard involute curve formula
;
 (setq test 0)
 (COMMAND "PLINE" p5)
 (setq p (+ incr p))
 (while (> pnts 0)
   (setq e1 (sin p))
   (setq e2 (cos p))
   (setq e (/ e1 e2))
   (setq j (- e p))
   (setq x1 (* (/ (sin j) (cos p)) basr))
   (setq y1 (* (/ (cos j) (cos p)) basr))
   (setq x3 (+ x2 x1))
   (setq y3 (+ y2 y1))
   (setq p3 (list x3 y3))
   (COMMAND p3)
   (setq p (+ incr p))
   (setq pnts (- pnts 1))
   (if (/= test 1)
     (PROGN
       (setq hyp (sqrt (+ (expt x1 2) (expt y1 2))))
       (if (> hyp irad)
         (progn
           (setq pint p3)
           (setq test 1)))))
   )
 (COMMAND "")
 (initget "Y y N n")
 (setq ans Y)
 (if (/= ans "N")
   (PROGN
     (setq pz3 (polar p2 (* pi 1.25) (* orad 1.6)))
     (setq pz4 (polar p2 (* pi 0.25) (* orad 1.6)))
;    (COMMAND "ZOOM" "W" pz3 pz4)
     (setq ang13 (/ (sin prsa) (cos prsa)))
     (setq ang11 (- ang13 prsa))
     (setq x11 (* (sin ang11) pitr))
     (setq y11 (* (cos ang11) pitr))
     (setq p11 (list x11 y11))
     (setq ang (angle p2 p11))
     (setq angi (- ang tt))
     (setq p12 (polar p2 angi (/ ORAD 0.))
     (setq beta (angle p2 p3))
     (setq ang2 (- (* angi 2.0) beta))
     (setq p15 (polar p2 ang2 orad))
     (setq adj1 (- ang2 j))
     (setq adj2 (+ adj1 (/ (* pi 2.0) numt)))
     (setq adj3 (+ adj2 0.3))
     (setq p22 (polar p2 adj3 basr))
     (setq p17 (polar p2 adj2 irad))
     (setq p18 (polar p2 adj2 basr))
     (setq angr (* (+ ang11 tt) (/ 180.0 pi)))
     (setq p21 (polar p2 ang2 (/ orad 0.))
     (setq angm (+ angi (/ pi numt)))
     (setq p19 (polar p2 angm irad))
     (setq p20 (polar p2 angm (+ irad filr)))
     (COMMAND "ARC" p15 "c" p2 p3)
;     (COMMAND "ARC" p19 "E" P5 "R" filr)
;     (COMMAND "ARC" p6 "c" p2 p17)
;    (COMMAND "LINE" p2 p12 "")
;    (COMMAND "LINE" p2 p20 "")
     (COMMAND "MIRROR" "W" p22 p21 "" p2 p12 "")
;   (COMMAND "MIRROR" "W" P18 P21 "" P2 P12 "")
     (COMMAND "ROTATE" "w" pz3 pz4 "" p2 angr)
     (while (setq le (entnext le))
       (ssadd le s)
     )
     (COMMAND "ARRAY" s "" "p" p2 numt "" "")
)  )
 (Prompt "\nDone!  ")
 (princ)
)

 

 

This is called 3D gear but it output a 2D polyline and needed rescaled. :?

3dgear.zip

Link to comment
Share on other sites

 

Just subtract an external profile from a circular region.

 

 

Thanks for the reply! .. Correct me if I'm wrong but this would equal out to simply using the inside profile of an external, correct? ... If that's the case I could just use the AutoLISP I have now for 2D external involute gears without having to subtract from a region. The problem is, and to answer your first question is it does needs to be more precise.

 

 

 

 

See if this will suffice, I got it from the Internet a long time ago, not sure if I ever used it.

 

 

Tried it out with no luck. I believe the engineer I was doing this for decided to try and draw this one manually. Basically drawing one tooth profile and rotating .9 degrees for 360 to get 400 teeth. I am still interested in having a solution for this in the future though.

Link to comment
Share on other sites

  • 7 years later...
On 1/22/2013 at 5:58 AM, StevJ said:

Give this a try and see if it meets your needs.

Copy the files to AutoCAD support path, load Truegear.lsp using Appload and run the Tooth command.

 

Also, there is the 2Dgear.lsp, which may help as well.

 

Steve

2Dgear.lspUnavailable

Hi sir can you please provide the lisp file for the 2d gear its unavailable

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...