1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-06 15:36:30 +02:00

Merge branch 'core_xy_improvements' of https://github.com/martinbudden/NopSCADlib into martinbudden-core_xy_improvements

This commit is contained in:
Chris Palmer
2021-12-12 23:07:20 +00:00
2 changed files with 30 additions and 27 deletions

View File

@@ -30,22 +30,25 @@ module coreXY_belts_test() {
plain_idler = coreXY_plain_idler(coreXY_type); plain_idler = coreXY_plain_idler(coreXY_type);
toothed_idler = coreXY_toothed_idler(coreXY_type); toothed_idler = coreXY_toothed_idler(coreXY_type);
pos = [100, 50];
coreXYPosBL = [0, 0, 0]; coreXYPosBL = [0, 0, 0];
coreXYPosTR = [200, 150, 0]; coreXYPosTR = [200, 150, 0];
separation = [0, coreXY_coincident_separation(coreXY_type).y, pulley_height(plain_idler) + washer_thickness(M3_washer)]; separation = [0, coreXY_coincident_separation(coreXY_type).y, pulley_height(plain_idler) + washer_thickness(M3_washer)];
pos = [100, 50]; x_gap = 10;
upper_drive_pulley_offset = [40, 10]; plain_idler_offset = [10, 5];
upper_drive_pulley_offset = [40, 0];
lower_drive_pulley_offset = [0, 0]; lower_drive_pulley_offset = [0, 0];
coreXY_belts(coreXY_type, coreXY_belts(coreXY_type,
carriagePosition = pos, pos,
coreXYPosBL = coreXYPosBL, coreXYPosBL,
coreXYPosTR = coreXYPosTR, coreXYPosTR,
separation = separation, separation,
x_gap = 10, x_gap,
upper_drive_pulley_offset = upper_drive_pulley_offset, plain_idler_offset,
lower_drive_pulley_offset = lower_drive_pulley_offset, upper_drive_pulley_offset,
lower_drive_pulley_offset,
show_pulleys = true); show_pulleys = true);
@@ -56,18 +59,18 @@ module coreXY_belts_test() {
// add the screws for the upper drive offset idler pulleys if required // add the screws for the upper drive offset idler pulleys if required
if (upper_drive_pulley_offset.x > 0) { if (upper_drive_pulley_offset.x > 0) {
translate(coreXY_drive_plain_idler_offset(coreXY_type)) translate(coreXY_drive_plain_idler_offset(coreXY_type) + plain_idler_offset)
translate_z(-pulley_offset(plain_idler)) translate([0, -upper_drive_pulley_offset.y, -pulley_offset(plain_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
translate(coreXY_drive_toothed_idler_offset(coreXY_type)) translate(coreXY_drive_toothed_idler_offset(coreXY_type))
translate_z(-pulley_offset(toothed_idler)) translate([0, -upper_drive_pulley_offset.y, -pulley_offset(toothed_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
} else if (upper_drive_pulley_offset.x < 0) { } else if (upper_drive_pulley_offset.x < 0) {
translate([-pulley_od(plain_idler), coreXY_drive_plain_idler_offset(coreXY_type).y]) translate([-pulley_od(plain_idler), coreXY_drive_plain_idler_offset(coreXY_type).y + plain_idler_offset.y])
translate_z(-pulley_offset(plain_idler)) translate([0, -upper_drive_pulley_offset.y, -pulley_offset(plain_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
translate([2*coreXY_drive_pulley_x_alignment(coreXY_type), coreXY_drive_toothed_idler_offset(coreXY_type).y]) translate([2*coreXY_drive_pulley_x_alignment(coreXY_type) + plain_idler_offset.x, coreXY_drive_toothed_idler_offset(coreXY_type).y])
translate_z(-pulley_offset(toothed_idler)) translate([0, -upper_drive_pulley_offset.y, -pulley_offset(toothed_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
} }
} }
@@ -79,18 +82,18 @@ module coreXY_belts_test() {
// add the screws for the lower drive offset idler pulleys if required // add the screws for the lower drive offset idler pulleys if required
if (lower_drive_pulley_offset.x < 0) { if (lower_drive_pulley_offset.x < 0) {
translate([-coreXY_drive_plain_idler_offset(coreXY_type).x, coreXY_drive_plain_idler_offset(coreXY_type).y]) translate([-coreXY_drive_plain_idler_offset(coreXY_type).x - plain_idler_offset.x, coreXY_drive_plain_idler_offset(coreXY_type).y + plain_idler_offset.y])
translate_z(-pulley_offset(plain_idler)) translate([0, -lower_drive_pulley_offset.y, -pulley_offset(plain_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
translate(coreXY_drive_toothed_idler_offset(coreXY_type)) translate(coreXY_drive_toothed_idler_offset(coreXY_type))
translate_z(-pulley_offset(toothed_idler)) translate([0, -lower_drive_pulley_offset.y, -pulley_offset(toothed_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
} else if (lower_drive_pulley_offset.x > 0) { } else if (lower_drive_pulley_offset.x > 0) {
translate([pulley_od(plain_idler), coreXY_drive_plain_idler_offset(coreXY_type).y]) translate([pulley_od(plain_idler), coreXY_drive_plain_idler_offset(coreXY_type).y + plain_idler_offset.y])
translate_z(-pulley_offset(plain_idler)) translate([0, -lower_drive_pulley_offset.y, -pulley_offset(plain_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
translate([-2*coreXY_drive_pulley_x_alignment(coreXY_type), coreXY_drive_toothed_idler_offset(coreXY_type).y]) translate([-2*coreXY_drive_pulley_x_alignment(coreXY_type) - plain_idler_offset.x, coreXY_drive_toothed_idler_offset(coreXY_type).y])
translate_z(-pulley_offset(toothed_idler)) translate([0, -lower_drive_pulley_offset.y, -pulley_offset(toothed_idler)])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
} }
} }
@@ -118,13 +121,13 @@ module coreXY_belts_test() {
translate([coreXYPosBL.x, coreXY_toothed_idler_offset(coreXY_type).y, 0]) translate([coreXYPosBL.x, coreXY_toothed_idler_offset(coreXY_type).y, 0])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
// add the screw for the left Y carriage plain idler // add the screw for the left Y carriage plain idler
translate([coreXYPosBL.x + separation.x + coreXY_plain_idler_offset(coreXY_type).x, separation.y + coreXY_plain_idler_offset(coreXY_type).y, separation.z]) translate([coreXYPosBL.x + separation.x + coreXY_plain_idler_offset(coreXY_type).x + (upper_drive_pulley_offset.x == 0 ? 0 : plain_idler_offset.x), separation.y + coreXY_plain_idler_offset(coreXY_type).y, separation.z])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
// add the screw for the right Y carriage toothed idler // add the screw for the right Y carriage toothed idler
translate([coreXYPosTR.x + separation.x, coreXY_toothed_idler_offset(coreXY_type).y, separation.z]) translate([coreXYPosTR.x + separation.x, coreXY_toothed_idler_offset(coreXY_type).y, separation.z])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
// add the screw for the right Y carriage plain idler // add the screw for the right Y carriage plain idler
translate([coreXYPosTR.x - coreXY_plain_idler_offset(coreXY_type).x, separation.y + coreXY_plain_idler_offset(coreXY_type).y, 0]) translate([coreXYPosTR.x - coreXY_plain_idler_offset(coreXY_type).x - (lower_drive_pulley_offset.x == 0 ? 0 : plain_idler_offset.x), separation.y + coreXY_plain_idler_offset(coreXY_type).y, 0])
screw(M3_cap_screw, 20); screw(M3_cap_screw, 20);
} }
} }

View File

@@ -90,13 +90,13 @@ module coreXY_half(type, size, pos, separation_y = 0, x_gap = 0, plain_idler_off
// toothed idler for offset stepper motor drive pulley // toothed idler for offset stepper motor drive pulley
p3t_type = coreXY_toothed_idler(type); p3t_type = coreXY_toothed_idler(type);
p3t = [ -size.x / 2 + (drive_pulley_offset.x > 0 ? 0 : 2 * coreXY_drive_pulley_x_alignment(type)), p3t = [ -size.x / 2 + (drive_pulley_offset.x > 0 ? 0 : plain_idler_offset.x + 2 * coreXY_drive_pulley_x_alignment(type)),
size.y / 2 + coreXY_drive_pulley_x_alignment(type) size.y / 2 + coreXY_drive_pulley_x_alignment(type)
]; ];
// y-carriage plain pulley // y-carriage plain pulley
p4_type = coreXY_plain_idler(type); p4_type = coreXY_plain_idler(type);
p4 = [ -size.x / 2 + pulley_od(p4_type) / 2 + pulley_od(p3d_type) / 2 + coreXY_drive_pulley_x_alignment(type) + plain_idler_offset.x, p4 = [ -size.x / 2 + pulley_od(p4_type) / 2 + pulley_od(p3d_type) / 2 + coreXY_drive_pulley_x_alignment(type) + (drive_pulley_offset.x == 0 ? 0 : plain_idler_offset.x),
-size.y / 2 + pulley_od(p4_type) / 2 + pos.y + separation_y / 2 -size.y / 2 + pulley_od(p4_type) / 2 + pos.y + separation_y / 2
]; ];