渐开线圆柱齿轮几何参数计算的计算机辅助设计系统的设计(4)
作者:佚名; 更新时间:2014-10-22

       private void button1_Click(object sender, EventArgs e)      //外啮合计算

        {

            if (tBoxα.Text != "20")                               //判断输入是否为标准输入

                str = "请输入标准齿形角α!\n";

            else if (Convert.ToInt32(tBoxβ.Text) < 0 || Convert.ToInt32(tBoxβ.Text) > 45)

                str += "请选择合理的螺旋角β!\n";

            else if (Convert.ToInt32(tBoxha.Text) != 1)

                str += "请选择合理的齿顶高系数!\n";

            else if (Convert.ToDouble(tBoxc.Text) != 0.25)

                str += "径向间隙系数选择不正确,请重新填写!\n";

            else if (Convert.ToDouble(tBoxr.Text) != 0.38)

                str += "齿根圆角半径系数选择不够准确!\n";

            else if (Convert.ToDouble(Convert.ToInt32(Convert.ToDouble(tBoxZ1.Text))) != Convert.ToDouble(tBoxZ1.Text) || Convert.ToDouble(Convert.ToInt32(Convert.ToDouble(tBoxZ2.Text))) != Convert.ToDouble(tBoxZ2.Text))

                str += "齿数请输入为整数!\n";

            else                                                    //分别把输入的值赋给各变量

            {

                α1 = Convert.ToInt32(tBoxα.Text);

                β1 = Convert.ToDouble(tBoxβ.Text);

                α2 = Math.PI * α1 / 180;

                β2 = Math.PI * β1 / 180;

                n = Math.Cos(β2);

                u = 1;

                m = Convert.ToDouble(tBoxm.Text);

                ha = Convert.ToInt32(tBoxha.Text);

                hat = ha * n;

                c = Convert.ToDouble(tBoxc.Text);

                ct = c * n;

                r = Convert.ToDouble(tBoxr.Text);

                rt = r * n;

                if (tBoxpa_s.Enabled)                                //标准齿轮几何参数计算

                {

                    Z0 = Convert.ToInt32(tBoxZ1.Text);

                    ha01 = ha * m;

                    hf0 = 1.25 * m;

                    h0 = ha01 + hf0;

                    if (tBoxβ.Text != "0")

                    {

                        a0 = Z0 * m / n;

                        d0 = m * Z0 / n;

                    }

                    else

                    {

                        a0 = Z0 * m;

                        d0 = m * Z0;

                    }

                    a = a0;

                    da0 = d0 + 2 * ha01;

                    df0 = d0 - 2 * hf0;

                    db0 = d0 + Math.Cos(α2);

                    pa = Math.PI * m * Math.Cos(α2);

                    //标准齿轮齿厚计算

                    sc0 = 0.5 * Math.PI * m * Math.Cos(α2) * Math.Cos(α2);

                    hc0 = ha01 - Math.PI * m * Math.Sin(2 * α2) / 8;

                    invαt = Math.Tan(α2) - α2;

                    if (tBoxβ.Text != "0")

                    {

                        s0 = m * Z0 * Math.Sin(Math.PI * n * n * n / (2 * Z0)) / (n * n * n);

                        ha02 = 0.5 * da0 - (0.5 * m * Z0 / (n * n * n)) * (Math.Cos(Math.PI * n * n * n / (2 * Z0)) - Math.Sin(β2) * Math.Sin(β2));

                        k0 = (α1 / 180) * Z0 + 1;

                        W0 = (Math.PI * (k0 - 0.5) + Z0 * invαt) * m * Math.Cos(α2);

                    }

                    else

                    {

                        s0 = m * Z0 * Math.Sin(Math.PI / (2 * Z0));

                        ha02 = 0.5 * da0 - 0.5 * m * Z0 * Math.Cos(Math.PI / (2 * Z0));

                        k0 = (α1 / 180) * Z0 + 1;

                        W0 = (Math.PI * (k0 - 0.5) + Z0 * invαt) * m * Math.Cos(α2);

                    }

                }

  计算外啮合和内啮合各种齿轮,原理基本一样,重点注意的是取值的精确度问题,以及弄清各参数之间的关系,以便于计算,避免数值的混淆。

  2、确定部分重要精度参数的取值函数

public static int fpb_value(double x, double y, string z)      //基节极限偏差fpb取值

     {…}

     public static int Fβ_value(int x, string y)                   //齿向公差Fβ取值

     {…}

     public static double fa_value(double x, string y)              //中心距极限偏差fa取值

     {…}

     public static int fpt_value(double x, double y, string z)     //齿距极限偏差fpb取值

      {…}

     public static int Fr_value(double x, double y, string z)      //齿圈径向跳动公差Fr取值

      {…}

     public static double br_value(string x, double d)             //切齿径向进刀公差br取值

      {…}

      public static char code_value(double x)                      //偏差代号

      {…}

  3.4.2软件实现和传统人工计算的比较

  对齿轮进行设计时,传统的人工计算具有很大的局限性,下面就列举两个比较突出的例子进行比较说明。

  1、在计算几何参数时,已知参数invα且invα=tanα-α,要番过来求α的值,此设计中我使用的二分法查找的思想来求解(代码如下),其中取值的精度精确到了10-8。如果如此庞大的计算量进行人工计算,工作量可想而知,而且有存在很大的误差甚至是错误的可能,但借用了此计算机辅助软件,立刻就可以得到满意的答案。

        private double inv(double x)

        {

            double f = 0, r = Math.PI / 2, b, fun;         //设置变量f,r,b,fun

            b = Math.PI / 4;                               //因为0<α<(π/2),所以取第一个二分时b=π/4

            fun = Math.Tan(b) - b;                       //求出当b=π/4时fun的值

            while (Math.Abs(fun - x) > 0.00000001)    //当误差小于10-8时跳出循环

            {

                if (fun - x > 0)                           //若fun大于x,取中间值的左边区间进行循环

                {

                    r = b;

                    b = (f + r) / 2;                        //取新区间的中值

                    fun = Math.Tan(b) - b;

                }

                else if (fun - x < 0)          //若fun小于x,取中间值的右边区

                {                                             间进行循环

                    f = b;

                    b = (f + r) / 2;                        //取新区间的中值

                    fun = Math.Tan

核心期刊快速发表
Copyright@2000-2030 论文期刊网 Corporation All Rights Reserved.
《中华人民共和国信息产业部》备案号:ICP备07016076号;《公安部》备案号:33010402003207
本网站专业、正规提供职称论文发表和写作指导服务,并收录了海量免费论文和数百个经国家新闻出版总署审批过的具有国内统一CN刊号与国际标准ISSN刊号的合作期刊,供诸位正确选择和阅读参考,免费论文版权归原作者所有,谨防侵权。联系邮箱:256081@163.com