Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use <_lib_/scad-utils/transformations.scad>
- use <_lib_/scad-utils/linalg.scad>
- include <_lib_/dict.scad>
- use<_parts_/motor_N20.scad>
- use <_parts_/gears.scad>
- tt=0; // assembled
- //tt=1; // exploded
- //////////////////////////////////////////////////////////////////
- gap=0.3;
- rearaxle_gear_AA_n = 14;
- clutch_gear_AA_n = 10;
- clutch_gear_BB_n = 24;
- motor_A_gear_BB_n = 24;
- motor_A_gear_AA_n = 32;
- motor_B_gear_AA_n = 20;
- rearaxle_x = 0;
- rearaxle_z = 0;
- rearaxle_clutch_angle=45;
- clutch_x = (rearaxle_gear_AA_n+clutch_gear_AA_n+gap)/4*cos(rearaxle_clutch_angle);
- clutch_z = (rearaxle_gear_AA_n+clutch_gear_AA_n+gap)/4*sin(rearaxle_clutch_angle);
- clutch_motor_A_angle=45;
- motor_A_x = clutch_x + (clutch_gear_BB_n+motor_A_gear_BB_n+gap)/4*cos(clutch_motor_A_angle);
- motor_A_z = clutch_z + (clutch_gear_BB_n+motor_A_gear_BB_n+gap)/4*sin(clutch_motor_A_angle);
- motor_A_motor_B_angle=0;
- motor_B_x = motor_A_x + (motor_A_gear_AA_n+motor_B_gear_AA_n+gap)/4*cos(motor_A_motor_B_angle);
- motor_B_z = motor_A_z + (motor_A_gear_AA_n+motor_B_gear_AA_n+gap)/4*sin(motor_A_motor_B_angle);
- //////////////////////////////////////////////////////////////////
- function twin_vars(key) = dict([
- ["clutch_x", clutch_x],
- ["clutch_z", clutch_z],
- ["clutch_gear_AA_n", clutch_gear_AA_n],
- ["clutch_gear_AA_h", 5],
- ["clutch_gear_BB_n", clutch_gear_BB_n],
- ["clutch_gear_BB_h", 1],
- ["motor_A_x", motor_A_x],
- ["motor_A_y", 2],
- ["motor_A_z", motor_A_z],
- ["motor_A_rotation_x", 90],
- ["motor_A_rotation_y", 90],
- ["motor_A_rotation_z", 0],
- ["motor_B_x", motor_B_x],
- ["motor_B_y", 5],
- ["motor_B_z", motor_B_z],
- ["motor_B_rotation_x", 90],
- ["motor_B_rotation_y", 90],
- ["motor_B_rotation_z", 0],
- ["motor_A_gear_AA_n", motor_A_gear_AA_n], // 32
- ["motor_A_gear_AA_h", 1],
- ["motor_A_gear_BB_n", motor_A_gear_BB_n], // 20
- ["motor_A_gear_BB_h", 5],
- ["motor_B_gear_AA_n", motor_B_gear_AA_n],
- ["motor_B_gear_AA_h", 3],
- ["align_A_x", (motor_A_x+motor_B_x)/2+3],
- ["align_A_z", (motor_A_z+motor_B_z)/2+8],
- ["align_B_x", (motor_A_x+motor_B_x)/2+3],
- ["align_B_z", (motor_A_z+motor_B_z)/2-8],
- ["align_C_x", motor_A_x/2-10],
- ["align_C_z", motor_A_z],
- ["mount_A_x", clutch_x-5],
- ["mount_A_z", clutch_x+5],
- ["mount_B_x", clutch_x-5],
- ["mount_B_z", clutch_x+10],
- ],key);
- //////////////////////////////////////////////////////////////////
- twin_csg_colors = [
- ["motor_A_gear_AA", ["white"]],
- ["motor_A_gear_BB", ["gold"]],
- ["motor_A_gearbox_shell", ["orange"]],
- ["motor_A_gearbox_gears", ["white"]],
- ["motor_A_motor", ["lightgrey"]],
- ["motor_B_gear_AA", ["silver"]],
- ["motor_B_gearbox_shell", ["orange"]],
- ["motor_B_gearbox_gears", ["white"]],
- ["motor_B_motor", ["lightgrey"]],
- ["clutch_axle", ["khaki"]],
- ["clutch_gear_AA", ["darkseagreen"]],
- ["clutch_gear_BB", ["darkseagreen"]],
- ["p1", ["slategrey"]],
- ["p2", ["slategrey"]],
- ];
- //////////////////////////////////////////////////////////////////
- twin_csg_transforms = [
- ["motor_A_gearbox_shell",[
- ["motor_A_motor",
- translation([
- 0,0,-motor_N20_vars("gearbox_z")-8*tt])] ]],
- ["motor_A_gearbox_gears",[
- ["motor_A_gear_BB",
- translation([
- 0,0,20*tt+4+motor_N20_vars("gearbox_axle_step_h")])] ]],
- ["motor_B_gearbox_shell",[
- ["motor_B_motor",
- translation([
- 0,0,-motor_N20_vars("gearbox_z")])] ]],
- ["motor_B_gearbox_gears",[
- ["motor_B_gear_AA",
- translation([
- 0,0,0.5+motor_N20_vars("gearbox_axle_step_h")+tt*15])] ]],
- ["p2",[
- ["p1", translation([0,tt*-40,0])],
- ["motor_A_gearbox_shell",
- translation([
- twin_vars("motor_A_x"),
- twin_vars("motor_A_y")+tt*-25,
- twin_vars("motor_A_z")]) *
- rotation([
- twin_vars("motor_A_rotation_x"),
- twin_vars("motor_A_rotation_y"),
- twin_vars("motor_A_rotation_z")])],
- ["motor_B_gearbox_shell",
- translation([
- twin_vars("motor_B_x"),
- twin_vars("motor_B_y")+tt*-15,
- twin_vars("motor_B_z")]) *
- rotation([
- twin_vars("motor_B_rotation_x"),
- twin_vars("motor_B_rotation_y"),
- twin_vars("motor_B_rotation_z")])],
- ["clutch_axle",
- translation([0,-20*tt,0])] ]],
- ["clutch_axle",[
- ["clutch_gear_BB",
- translation([0,-25*tt,0])] ]],
- /////////////////////////////////////////
- ["CAM",[
- ["p1",
- rotation([90,0,0])*
- translation([-twin_vars("motor_A_x"),2,-twin_vars("motor_A_z")])],
- ["p2",
- rotation([-90,0,0])*
- translation([-twin_vars("motor_A_x"),-20,-twin_vars("motor_A_z")])] ]]
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement