5iMX宗旨:分享遥控模型兴趣爱好

5iMX.com 我爱模型 玩家论坛 ——专业遥控模型和无人机玩家论坛(玩模型就上我爱模型,创始于2003年)
查看: 6303|回复: 19
打印 上一主题 下一主题

制作同步轮,齿轮通用的方法

[复制链接]
跳转到指定楼层
楼主
发表于 2014-2-27 20:36 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
首先我给at125改成数控.使用的是42步进电机.我使用的步进电机扭距0.5N.m,X轴使用15:38的传动比.
Z轴使用15:60,都使用htd m3同步带连接.

如果仅仅是数控车,单边精度就够了.不需要给丝杠做消回差.

然后使用4x4的白钢条磨制一个齿型剖面.下面的这个是m3同步轮的剖面.
因为是单边精度,因此先磨一边,然后翻180磨另一侧.

然后使用该齿型剖面就可以制作同步轮了.

IMG_0301.jpg (187.44 KB, 下载次数: 85)

IMG_0301.jpg

IMG_0308.jpg (58.13 KB, 下载次数: 82)

这是磨好的m3的同步轮剖面

这是磨好的m3的同步轮剖面

htd.jpg (51.18 KB, 下载次数: 86)

HTD同步带标准

HTD同步带标准

欢迎继续阅读楼主其他信息

沙发
 楼主| 发表于 2014-2-27 20:46 | 只看该作者
硬件方面我使用的是arduino mega2560. 固件使用的是改进的3dprint固件marlin. github上可以找到源代码.marlin源码


我用OpenSCAD写了绘制HTD同步轮的程序.
该程序可以绘制全系的HTD同步轮.

有兴趣的可以到http://www.openscad.org/下载 OpenSCAD开源软件.
然后输入下面代码,点击编译.
pi = 3.1415926;

Pb=0;
R=1;
Hg=2;
R1=3;
A2=4;
/*
        HTD同步带型号
        m3最小10齿,m5最小14齿,m8最小22齿,m14最小28齿
*/
m3 = [[Pb,3],[R,0.91],[Hg,1.28],[R1,0.3],[A2,0.762]];
m5 = [[Pb,5],[R,1.56],[Hg,2.16],[R1,0.48],[A2,1.144]];
m8 = [[Pb,8],[R,2.57],[Hg,3.54],[R1,0.8],[A2,1.372]];
m14 = [[Pb,14],[R,4.63],[Hg,6.30],[R1,1.4],[A2,2.79]];
m20 = [[Pb,20],[R,6.84],[Hg,8.6],[R1,1.95],[A2,4.32]];
//单齿齿型
module htd_gear_cutter(z=15,h=10,model=m3)
{
        //dp节圆直径
        dp = z*lookup(Pb,model)/pi;
        //da外圆直径
        da = dp-lookup(A2,model);
        R = lookup(R,model);
        hg = lookup(Hg,model);
        r1 = lookup(R1,model);
        ra = da/2-hg+R;
        rb = da/2-r1;
        //通过余弦定理计算a
        a=acos((ra*ra+rb*rb-(R+r1)*(R+r1))/(2*ra*rb));
        //a = 5.2;
        translate([0,-ra,0])
        difference()
        {
                translate([0,ra,0])
                union()
                {
                        cylinder(r=R,h=h,$fn=24);
                        translate([-R-r1,0,0])cube([2*R+2*r1,30,h]);
                }
                for(a=[a,-a])
                rotate([0,0,a])translate([0,rb,-0.1])cylinder(r=r1,h=h+0.2,$fn=24);
        }
}
//htd_gear_cutter();
//绘制htd同步轮
module htd_wheel(z=15,h=10,model=m3)
{
        dp = z*lookup(Pb,model)/pi;
        da = dp-lookup(A2,model);
        R = lookup(R,model);
        hg = lookup(Hg,model);
        difference()
        {
                cylinder(r=da/2,h=h,$fn=64);
                for(a=[0:z])
                {
                        rotate([0,0,a*360/z])translate([0,da/2-hg+R,-0.1])
                        htd_gear_cutter(z=z,h=h+0.2,model=model);
                }
        }
}

//计算节径
module htd_wheel_R(z=15,model=m3)
{
        dp = z*lookup(Pb,model)/pi;
        echo("Pb=",dp);
        da = dp-lookup(A2,model);       
        echo("Da=",da);
}

htd_wheel(z=30,model=m3);



screenshot.jpg (156.42 KB, 下载次数: 80)

screenshot.jpg
3
 楼主| 发表于 2014-2-27 21:02 | 只看该作者
关于HTD同步轮单齿剖面的g-code.我写了段程序用来产生全系的HTD同步轮的gcode
该程序是用LUA语言写的,当然如果你懂程序也许下面的代码能对你有帮助.

-----------------------------------
----下面是产生齿型的LUA代码
-----------------------------------
local math = require 'math'
--Z轴回差
local HZc = 0.6
--X轴回差
local HXc = 0.6

--[[
输出HTD同步带齿型的gcode
--]]
local M = {
        m3={Pb=3,R=0.91,Hg=1.28,R1=0.3,A2=0.762},
        m5={Pb=5,R=1.56,Hg=2.16,R1=0.48,A2=1.144},
        m8={Pb=8,R=2.57,Hg=3.54,R1=0.8,A2=1.372}
}

--[[
输出一个圆弧
圆心点[ox,oy],圆弧点[ax,ay],[bx,by]
将结果简单的输入到一个文件中
--]]
function moveto(x,y)
        print('G0 X'..-x..' Z'..y)
end

function speed(feedrate)
        print('G0 F'..feedrate)
end
--初始化位置但是不停止电机
function g101()
        print('G101')
end

function arc(ox,oy,ax,ay,bx,by,e)
        local R=math.sqrt((ax-ox)*(ax-ox)+(ay-oy)*(ay-oy))
        local C=math.sqrt((bx-ax)*(bx-ax)+(by-ay)*(by-ay))
        local s = math.acos((R*R+R*R-C*C)/(2*R*R))
        local b = math.acos((ax-ox)/R)
        local N=32
        for a=0,N do
                moveto(R*math.cos(b+e*a*s/N)+ox,R*math.sin(b+e*a*s/N)+oy)
        end
end

function circle(ox,oy,r)
        local N=180
        for a=0,N do
                moveto(r*math.cos(2*a*math.pi/N)+ox,r*math.sin(2*a*math.pi/N)+oy)
        end
end

--z齿数,model是HTD同步带的型号可以取m3,m5,m8
--刀胚的宽度width
function htd_half(z,model_name,width)
        local model = M[model_name]
        if not model then
                print("Can't found model name:"..model_name)
                return
        end
        --外圆
        local Da = z*model.Pb/math.pi - model.A2;
        --主圆弧中心
        local o1x = 0
        local o1y = Da-model.Hg+model.R
        local rb = Da-model.R1
        local dr = model.R+model.R1
        --圆角弧的中心,余弦定理
        local s=math.acos((o1y*o1y+rb*rb-dr*dr)/(2*o1y*rb))
        local o2x = rb*math.sin(s)
        local o2y = rb*math.cos(s)
        --起始点
        local Ax = o2x
        local Ay = o2y+model.R1
        local Bx = model.R*o2x/dr
        local By = model.R*(o2y-o1y)/dr+o1y
        --开始绘制
        local x,y
        x = width/2
        y = Ay
        speed(30)
        moveto(0,0)
        --顶角作为起始点,将白钢条的一角对准磨盘的顶角
        moveto(0,model.Hg+HZc)
        moveto(0,model.Hg)
        g101()
        speed(1)
        moveto(0,0)
        arc(o2x-x,o2y-y,Ax-x,Ay-y,Bx-x,By-y,1)
        arc(o1x-x,o2y-y,Bx-x,By-y,-x,o1y-model.R-y,-1)
end



4
 楼主| 发表于 2014-2-27 21:30 | 只看该作者
我绘制的at125 CAD模型,设计的时候可以简单的比划下.不知道怎么上传文件,直接上代码了,同样需要openscad打开

vex=0.2;
mex=0.1;
//大托板平台
module at_table()
{
        difference()
        {
                cube([64.9,84.9,21]);
                //下燕尾槽
                translate([14.5,-0.10,0])cube([33.3,84.9,21-14]);
                translate([31,-0.1,-5])rotate([-90,0,0])rotate([0,0,-30])cylinder(r=24.5,h=85.9,$fn=3);
                //T型槽
                for(y=[15.8,60.9])
                translate([-0.1,y,21-10.2])
                {
                        cube([64.9+0.2,8.1,10.3]);
                        translate([0,-(13.8-8.1)/2,0])
                                cube([64.9+0.2,13.8,5.9]);
                }
                //推动螺丝安装空
                translate([64.9/2,84.9/2,12])cylinder(r=8.8/2,h=20);
                                translate([64.9/2,84.9/2,0])cylinder(r=5.2/2,h=20);
                //侧面压母
                for(y=[10,84.9-10,30,84.9-30,84.9/2])
                {
                        translate([-0.1,y,3.5])rotate([0,90,0])cylinder(r=2.5/2,h=20,$fn=8);
                }
        }
                //推动螺母
        translate([64.9/2-10.4/2,84.9/2-10.4/2,-3])
        difference()
        {
                cube([10.4,10.4,10.4]);
                translate([10.4/2,-0.1,10.4/2])rotate([-90,0,0])cylinder(r=4,h=11);
        }
        //塞铁

}

//主导轨
module at_slide()
{
        translate([0,-380,0])
        difference()
        {
                cube([60.4,380,75.5]);
                //主燕尾
                for(off=[12-10*cos(30),60.4+10*cos(30)-12])
                translate([off,-mex,75.5+10*sin(30)-7.5])
                rotate([-90,0,0])
                        rotate([0,0,30])cylinder(r=10,h=380+vex,$fn=3);
                //上部凹槽
                translate([60.4/2-10,-10,75.5-3.2+mex])cube([20,315,3.2]);
                translate([60.4/2,315-10,75.5-3.2+mex])cylinder(r=10,h=3.2);
        }
}

//传送带轮
module at_wheel(R,H=27.2/3,Deep=5.5)
{
        cylinder(r=R,h=1);
        translate([0,0,1])cylinder(r1=R,r2=R-2*Deep,h=2);
        translate([0,0,3])cylinder(r=R-2*Deep,h=H-6);
        translate([0,0,H-3])cylinder(r1=R-2*Deep,r2=R,h=2);
        translate([0,0,H-1])cylinder(r=R,h=1);
}

//床头,卡盘法兰
module at_head()
{
        difference()
        {
                translate([0,-66.1,75.5-7.5])cube([60.6,66.1,108.4]);
                        //4个固定孔
                for(offx=[0,54])
                for(offz=[0,-66])
                translate([3+offx,-10+mex,75.5+125/2+29+offz])
                        rotate([-90,0,0])cylinder(r=3/2,h=10,$fn=12);
                //通孔
                translate([60.6/2,2,75.5+125/2])
                        rotate([90,0,0])cylinder(r=12/2,h=100);
        }
        //铣头夹
        translate([0,-66.1,75.5-7.5+108.4+0.2])cube([60.6,66.1,20]);
        //主轴法兰
        translate([60.6/2,-66.1-2,75.5+125/2])rotate([90,0,0])
        difference()
        {
                cylinder(r=37.6/2,h=5);
                cylinder(r=12/2,h=10);
        }
        //主轴mt1
        translate([60.6/2,63.9+2,75.5+125/2])rotate([90,0,0])
        difference()
                {
                        cylinder(r=8,h=63.9);
                        translate([0,0,-mex])cylinder(r=9/2,h=63.9+vex);
                }

        //传送带轮
        translate([60.6/2,2+6,75.5+125/2])
        rotate([-90,0,0])
        {
                //主轴承座
                color("red")translate([0,0,-8])cylinder(r=68/2,h=3);
                color("red")translate([0,0,-6])cylinder(r=50/2,h=6);
                color("gray")at_wheel(R=68/2);
                color("gray")translate([0,0,27.2/3])at_wheel(R=64/2);
                color("gray")translate([0,0,27.2*2/3])at_wheel(R=55/2);
        }
        //切换车铣
        translate([60.6/2,27.2+5+2,75.5+125/2])
                rotate([-90,0,0])cylinder(r=42.2/2,h=12);
        //齿轮架
        translate([60.6/2,32+2,30])
                rotate([90,0,0])cylinder(r=12/2,h=32);
}

//主丝杠及安装位
module at_screw()
{
        translate([-34.5,-66.1,75.5-41.3-7.5])
        difference()
        {
                cube([34.5,66.1,41.3]);
                translate([-0.2,-mex,-0.1])cube([16,66.1+vex,41.3-25.7]);
        }
        translate([-26,-380,75.5-41.3-7.5])
                cube([26,18.5,40.7]);
        translate([-26+13,0,75.5-41.3-7.5+25])
        color("gray")rotate([90,0,0])cylinder(r=12/2,h=380);
        translate([-26+13,32+2,75.5-41.3-7.5+25])
        rotate([90,0,0])cylinder(r=24/2,h=32);
}

//电机
module at_motor()
{
        translate([102+22,-26,36+12])
        rotate([90,0,0])
        {
                translate([0,0,-45])cylinder(r=12/2,h=50);
                color("gray")translate([0,0,-45])at_wheel(R=32/2);
                color("gray")translate([0,0,-45+27.5/3])at_wheel(R=24/2);
                color("black")cylinder(r2=82/2,r1=70/2,h=18);
                color("black")translate([0,0,18])cylinder(r=82/2,h=140-36);
                color("black")translate([0,0,140-18])cylinder(r1=82/2,r2=70/2,h=18);
        }
}
open=1;
close=80;
//机箱
module at_box(H=close)
{
        translate([-52,0,15])
        difference()
        {
                cube([230,H,170]);
                translate([-223,0,100])rotate([0,30,0])translate([0,-1,0])cube([200,82,200]);
        }
}
//钻铣头z主进给,mz微进给
module at_milling(z=20,a=10,mz=0)
{        translate([60.6/2,-66.1/2,0])
        rotate([0,0,a])translate([-60.6/2,-66.1/2,196]){
        translate([60.6/2,66.1/2,0])cylinder(r=45/2,h=65);
        translate([0,0,z])
        difference()
        {
                union()
                {
                        cube([60.6,66.1,108]);
                        translate([-1,-150,36])cube([60.6-2,150,72]);
                }
                translate([-mex,67,0])rotate([4,0,0])cube([60.6+vex,66.1,400]);
        }
        color("gray")translate([60.1/2,-120,30-mz+z])cylinder(r=20,h=50);
}}

//齿轮架,简略画法
module at_gearframe(ang=0)
{
        color("blue")
        translate([-26+13,0,75.5-41.3-7.5+25])
                rotate([0,110+ang,0])
                        translate([0,12+32,0])
                                rotate([90,0,0])
        difference()
        {
                union()
                {
                        //cylinder(r=54,h=12);
                        cylinder(r=32/2,h=12);
                        translate([-32/2,0,0])cube([32,54,9]);
                        rotate([0,0,60])translate([-32/2,0,0])cube([27,100,9]);
                }
                translate([0,0,-0.1])cylinder(r=18/2,h=13);
                rotate([0,0,60])translate([-5,30,-0.1])cube([5,65,10]);
                translate([12,45,-0.1])rotate([0,0,90])cube([5,25,10]);
        }
}
/*
        一些基本的调整参数
*/
module at125(x=0,y=0,z=0,a=-0)
{

        at_slide(); //主导轨
        at_head(); //主轴
        at_screw(); //主丝杠
        at_motor(); //电机
        at_box(H=open); //机箱
        at_gearframe(); //齿轮架
        at_milling(z=0,a=a,mz=10);
        translate([-20,-150,80])rotate([0,0,-90])at_table();
}

include <MCAD/stepper.scad>
//分度机构
module index()
{
        //涡轮盘,被固定在主轴尾部
        color("red")
                translate([60.6/2,62+3,75.5+125/2])
                rotate([90,0,0])
                cylinder(r=28/2,h=10);
        //蜗杆
        translate([30,62+2-4,75.5+125/2-19])rotate([0,90,0])
        {
                translate([0,0,-31])cylinder(r=5,h=80);
                translate([0,0,40])rotate([0,0,45])motor(Nema17);
                //蜗杆框架
                difference()
                {
                        union()
                        {
                                translate([-10,-9,-30])cube([25,18,72]);
                                translate([-26,-9,36])cube([52,18,5]);
                                //接触垫片
                                translate([-10,-16,25])rotate([0,50,0])cube([40,7,25]);
                        }
                        translate([-18,10,0])rotate([90,0,0])cylinder(r=16,h=20);
                        //安装孔
                        translate([8,10,25])rotate([90,0,0])cylinder(r=5/2,h=30,$fn=12);
                }
        }
        //y轴电机
        translate([-16,45,100])
                rotate([0,50,0])
                rotate([90,0,0])motor(Nema17);
}

at125();
index();


screenshot.jpg (166.81 KB, 下载次数: 76)

screenshot.jpg
5
发表于 2014-2-27 21:38 | 只看该作者
哇塞,高手啊,佩服
6
发表于 2014-2-27 21:43 | 只看该作者
关心老大你那个白钢刀齿形是咋样磨得,一般这种复杂形状成型刀,可以考虑线切割出来。
7
发表于 2014-2-27 21:47 | 只看该作者
太深奥了。不懂。
8
发表于 2014-2-27 21:47 | 只看该作者
真是强人,软硬件都精通,佩服佩服!
9
 楼主| 发表于 2014-2-27 22:16 | 只看该作者
BJ-FANG 发表于 2014-2-27 21:43
关心老大你那个白钢刀齿形是咋样磨得,一般这种复杂形状成型刀,可以考虑线切割出来。

这个是原理图.
步进电机控制x,z做齿型剖面线运动.

2.jpg (13.29 KB, 下载次数: 51)

2.jpg
10
发表于 2014-2-28 19:38 | 只看该作者
LZ高手,能编一个直接出G代码的铣同步轮脚本吗
11
发表于 2014-3-1 10:14 | 只看该作者
johnxm 发表于 2014-2-27 20:46
硬件方面我使用的是arduino mega2560. 固件使用的是改进的3dprint固件marlin. github上可以找到源代码.marl ...

楼主高人呀,能帮我写个G代码解释程序吗?

12
发表于 2014-3-2 12:30 ——“来自手机” | 只看该作者
强人
13
发表于 2014-3-3 23:04 | 只看该作者
要是能单独一个小软件就好了。以前俺做动画时就用里maya 里的命令编程。很是费脑细胞。不过程序出来都有单独窗口  填写数据   后来行业不景气失业了,不再写程序。程序使用很方便。背后很辛苦。
14
发表于 2014-3-4 03:03 | 只看该作者
我是来看编程大神的。
15
发表于 2014-3-4 11:43 | 只看该作者
大师!!!!!!!
16
发表于 2014-3-4 13:16 | 只看该作者
看的人头晕,厉害啊
17
发表于 2014-3-4 21:24 | 只看该作者



厉害
第一句话把我看晕了。。。
太深奥噢
想起一篇博士论文《回锅肉的做法》
第一节 如何养猪。。。


18
发表于 2014-3-4 21:38 | 只看该作者
楼主你知道得太多了,也太有杀伤力了!
19
发表于 2014-3-16 22:52 | 只看该作者
唉,这些东西看见都头晕,更搞不懂
20
发表于 2014-3-17 11:15 | 只看该作者

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

关闭

【站内推荐】上一条 /1 下一条

快速回复 返回顶部 返回列表