Commit bdc5db07 authored by Jan Koniarik's avatar Jan Koniarik
Browse files

added units to config file and rewritten generation of config for legs, we now...

added units to config file and rewritten generation of config for legs, we now generate leg_pos() itself
parent c356ecad
......@@ -7,36 +7,3 @@ module raspbi_holes(){
translate([x, y, 0])
children();
}
module leg_pos(){
translate(legs_rr_pos)
rotate(legs_rr_rot)
mirror(legs_rr_mirror)
children();
translate(legs_fr_pos)
rotate(legs_fr_rot)
mirror(legs_fr_mirror)
children();
translate(legs_mr_pos)
rotate(legs_mr_rot)
mirror(legs_mr_mirror)
children();
translate(legs_ml_pos)
rotate(legs_ml_rot)
mirror(legs_ml_mirror)
children();
translate(legs_fl_pos)
rotate(legs_fl_rot)
mirror(legs_fl_mirror)
children();
translate(legs_rl_pos)
rotate(legs_rl_rot)
mirror(legs_rl_mirror)
children();
}
// rendered by script, do not edit manually!
strip_t = 2;
leg_holder_h = 1.0381;
plate_t = 2;
mount_screw_d = 0.003;
strip_w = 20;
t = 0.004;
t = 4;
strip_t = 0.002;
plate_t = 0.002;
strip_w = 0.02;
include <../base.scad>;
include <../servo/horn.scad>;
include <config.scad>;
use <../leg_pos.scad>;
module battery_strip_base(){
......@@ -40,19 +41,36 @@ module raspbi_mount(){
module bottom_plate() color("orange"){
module top_leg_plate() color("orange"){
difference(){
hull(){
leg_pos()
horn_mount(2);
battery_mount();
raspbi_mount();
leg_pos(){
holder_top_base();
}
}
leg_pos()
horn_hole(n=2) ;
battery_mount_neg();
raspbi_neg();
leg_pos(){
holder_hole();
}
}
}
bottom_plate();
module bottom_leg_plate() color("orange") translate([0, 0, -leg_holder_h-plate_t])
{
difference(){
hull(){
leg_pos(){
rotate([0, 0, -90])
horn_mount(n=1);
}
}
leg_pos(){
rotate([0, 0, -90])
horn_hole(n=1);
}
}
}
\ No newline at end of file
// rendered by script, do not edit manually!
coxa_arm = [0,12.5,-28.15];
rpi_screw_d = 0.0025;
rpi_holes_y = 0.049;
rpi_holes_x = 0.058;
rpi_offset = [-0.02,0,0];
rpi_screw_d = 2.5;
rpi_holes_y = 49;
rpi_holes_x = 58;
rpi_offset = [-20,0,0];
femur_arm = [0,40,0];
battery_dim = [80,12,35];
battery_offset = [-5,0,0];
legs_fr_rot = [0,0,-150];
legs_fr_pos = [40,-25,0];
legs_fr_mirror = [1,0,0];
legs_rr_rot = [0,0,150];
legs_rr_pos = [-40,-25,0];
legs_rr_mirror = [0,0,0];
legs_mr_rot = [0,0,180];
legs_mr_pos = [0,-30,0];
legs_mr_mirror = [1,0,0];
legs_rl_rot = [0,0,30];
legs_rl_pos = [-40,25,0];
legs_rl_mirror = [1,0,0];
legs_ml_rot = [0,0,0];
legs_ml_pos = [0,30,0];
legs_ml_mirror = [0,0,0];
legs_fl_rot = [0,0,-30];
legs_fl_pos = [40,25,0];
legs_fl_mirror = [0,0,0];
tibia_arm = [-5,50,0];
battery_dim = [0.08,0.012,0.035];
battery_offset = [-0.005,0,0];
// rendered by script, do not edit manually!
clearance = 10;
clearance = 0.01;
camera_holder_t = 3;
camera_holder_t = 0.003;
yaw_rot = [0,0,180];
yaw_pos = [9.0,0.0,39.1];
yaw_pos = [0.009,0.0,0.0391];
horn_a = 6.5;
horn_d2 = 2.5;
horn_b = 12.5;
horn_angle = -10;
horn_d = 6;
horn_angle = -0.174532925199;
horn_holes_step = 0.002;
horn_holes_first = 0.0045;
horn_holes_n = 6.0;
horn_d = 0.0071;
horn_d2 = 0.001;
camera_offset = [25,5.5,-21.5];
camera_offset = [0.025,0.0055,-0.0215];
pitch_offset = [-12.5,-5.85,17.05];
pitch_offset = [-0.0125,-0.00585,0.01705];
t = 3;
t = 0.003;
cam_screw_h = 4;
cam_screw_d = 2;
cam_screw_pos = [9.35,21.85];
cam_base_pos = [9.0,0,25];
cam_screw_h = 0.004;
cam_screw_d = 0.002;
cam_screw_pos = [0.00935,0.02185];
cam_base_pos = [0.009,0,0.025];
pi_screw_d = 2.5;
pi_screw_distance = 49.0;
pi_y_offset = -2;
pi_screw_d = 0.0025;
pi_screw_distance = 0.049;
pi_y_offset = -0.002;
......@@ -9,8 +9,8 @@ include <config.scad>;
module horn_holes(){
cylinder(d=horn_d, center=true, h=1000);
for(x=[horn_a, horn_b])
translate([x, 0, -10])
for(i=[0:horn_holes_n])
translate([i*horn_holes_step + horn_holes_first, 0, 0])
cylinder(d=horn_d2,h=1000, center=true);
}
......
include <servo/horn.scad>;
include <base_plate/config.scad>;
include <strengthen/servo.scad>
use <servo/sg9.scad>;
module holder_top_base(){
cylinder(d=mount_screw_d + t*2, h=plate_t);
}
module holder_hole()
{
cylinder(d=mount_screw_d, h=1000, center=true);
}
module tibia() {
translate([-mg90s_turret_diameter/2, 0, 0])
rotate([90, 0, -90])
rotate([0, 0, 90]){
mg90s();
color("DarkGray")
translate([0, 11, -4.5])
rotate([0, 0, 90])
import("leg.stl");
}
}
module femur(length){
translate([-mg90s_turret_diameter/2 - servo_horn_h - mg90s_turret_height, 0, 0])
rotate([0, -90, 0]){
rotate([0, 0, 90])
horn();
translate([0, length, 0])
rotate([0 ,0, -90])
horn();
translate([0, length/2, 3])
rotate([0 ,0, -90])
horn();
translate([0, length/2, 3])
rotate([0 ,0, 90])
horn();
}
}
module coxa(){
translate([0, 0, -mount_h]){
translate([0, 0, -mg90s_servo_height])
rotate([0, 180, 90]){
mg90s();
rotate([0, 0, 0])
mirror([1, 0, 0])
servo_strengthen();
translate([0, 0, mg90s_horn_offset]){
horn();
}
}
translate(mg90s_gimbal_vector)
rotate([90, 0, -90])
rotate([0, 0, 180]) {
mg90s();
}
}
}
\ No newline at end of file
include <leg_modules.scad>;
module fr_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module fr_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module fr_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module fr_leg()translate([0.055, -0.025, 0])rotate([0, 0, -2.6179938779914944])mirror([0, 0, 0]){
fr_alfa_joint_pos() fr_beta_joint_pos() fr_gama_joint_pos();
}
module rr_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module rr_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module rr_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module rr_leg()translate([-0.055, -0.025, 0])rotate([0, 0, 2.6179938779914944])mirror([1, 0, 0]){
rr_alfa_joint_pos() rr_beta_joint_pos() rr_gama_joint_pos();
}
module mr_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module mr_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module mr_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module mr_leg()translate([0, -0.03, 0])rotate([0, 0, 3.141592653589793])mirror([1, 0, 0]){
mr_alfa_joint_pos() mr_beta_joint_pos() mr_gama_joint_pos();
}
module rl_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module rl_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module rl_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module rl_leg()translate([-0.055, 0.025, 0])rotate([0, 0, 0.5235987755982988])mirror([0, 0, 0]){
rl_alfa_joint_pos() rl_beta_joint_pos() rl_gama_joint_pos();
}
module ml_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module ml_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module ml_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module ml_leg()translate([0, 0.03, 0])rotate([0, 0, 0])mirror([0, 0, 0]){
ml_alfa_joint_pos() ml_beta_joint_pos() ml_gama_joint_pos();
}
module fl_beta_joint_pos() translate([0, 0.0125, -1.02105]) rotate([0, 0, 0]){
femur(0.045);
children();
}
module fl_alfa_joint_pos() translate([0, 0, 0]) rotate([0, 0, 0]){
coxa();
children();
}
module fl_gama_joint_pos() translate([0, 0.045, 0]) rotate([-1.5707963267948966, 0, 0]){
tibia();
children();
}
module fl_leg()translate([0.055, 0.025, 0])rotate([0, 0, -0.5235987755982988])mirror([1, 0, 0]){
fl_alfa_joint_pos() fl_beta_joint_pos() fl_gama_joint_pos();
}
module legs(){
fr_leg();
rr_leg();
mr_leg();
rl_leg();
ml_leg();
fl_leg();
}
module leg_pos(){
translate([0.055, -0.025, 0])rotate([0, 0, -2.6179938779914944])mirror([0, 0, 0])children();
translate([-0.055, -0.025, 0])rotate([0, 0, 2.6179938779914944])mirror([1, 0, 0])children();
translate([0, -0.03, 0])rotate([0, 0, 3.141592653589793])mirror([1, 0, 0])children();
translate([-0.055, 0.025, 0])rotate([0, 0, 0.5235987755982988])mirror([0, 0, 0])children();
translate([0, 0.03, 0])rotate([0, 0, 0])mirror([0, 0, 0])children();
translate([0.055, 0.025, 0])rotate([0, 0, -0.5235987755982988])mirror([1, 0, 0])children();
}
......@@ -6,6 +6,7 @@ use <gimbal/gimbal.scad>;
use <servo/sg9.scad>;
use <strengthen/servo.scad>;
use <base_plate/plate.scad>;
use <leg_pos.scad>;
......@@ -24,120 +25,20 @@ module raspbpi(){
}
module tibia() {
translate([-mg90s_turret_diameter/2, 0, 0])
rotate([90, 0, -90])
rotate([0, 0, 90]){
mg90s();
color("DarkGray")
translate([0, 11, -4.5])
rotate([0, 0, 90])
import("leg.stl");
}
}
module femur(){
translate([-mg90s_turret_diameter/2 - servo_horn_h - mg90s_turret_height, 0, 0])
rotate([0, -90, 0]){
rotate([0, 0, 90])
horn();
translate([0, femur_arm[1], 0])
rotate([0 ,0, -90])
horn();
}
}
module coxa(){
horn();
translate([0, 0, -mg90s_horn_offset]){
rotate([0, 0, 90])
mg90s();
translate(mg90s_gimbal_vector)
rotate([90, 0, -90])
rotate([0, 0, 180]) {
mg90s();
}
}
}
module axis(name, angle=[0,0,0]){
color("yellow")
rotate(angle)
cylinder(d=2, h=50, center=true);
}
module arm(name, vector){
color("Green")
hull(){
sphere(d=2);
translate(vector)
sphere(d=2);
}
}
module kinematics(d=3){
color("SeaGreen") hull(){
leg_pos()
sphere(d=d);
translate(cam_base_pos) rotate(yaw_rot)
translate([0, 0, camera_holder_t])
sphere(d=d);
}
translate(yaw_pos) rotate(yaw_rot) {
axis("yaw");
arm("yaw", pitch_offset );
translate( pitch_offset ){
axis("pitch", [90, 0, 0]);
arm("pitch", [camera_offset[0], -pitch_offset[1], 0]);
color("blue", 0.3)
translate([camera_offset[0], -pitch_offset[1], 0])
rotate([0, 90, 0])
cylinder(d1=1, d2=20, h=40);
}
}
leg_pos(){
arm("coxa", coxa_arm);
axis("coxa");
translate(coxa_arm){
arm("femur", femur_arm);
axis("femur", [0, 90, 0]);
translate(femur_arm){
arm("tibia", tibia_arm);
axis("tibia", [0, 90, 0]);
}
}
}
}
module body(){
color("gray")
bottom_plate();
color("gray"){
top_leg_plate();
bottom_leg_plate();
}
battery();
color("gray")
translate([0, 0, -45])
cross();
translate([0, 0, 5]){
translate([0, 0, 25]){
rotate([180, 0, 0])
raspbpi();
}
......@@ -148,22 +49,11 @@ module body(){
module model() {
//kinematics();
union(){
body();
leg_pos(){
coxa();
translate(coxa_arm){
femur();
translate(femur_arm){
tibia();
}
}
}
legs();
translate(yaw_pos) rotate(yaw_rot) {
camera_yaw();
......
// rendered by script, do not edit manually!
servo_horn_a = 6.5;
servo_horn_b = 12.5;
servo_horn_d = 7.1;
servo_horn_h = 6;
servo_horn_d2 = 2.5;
servo_horn_t = 2;
servo_horn_d = 0.0071;
servo_horn_h = 0.006;
servo_horn_d2 = 0.001;
servo_horn_t = 0.002;
servo_horn_holes_step = 0.002;
servo_horn_holes_first = 0.0045;
servo_horn_holes_n = 6;
mg90s_horn_offset = 11.1;
mg90s_gimbal_vector = [-5.85,12.5,-17.05];
mg90s_servo_width = 12.5;
mg90s_servo_length = 22.9;
mg90s_servo_height = 22.9;
mg90s_turret_diameter = 11.7;
mg90s_turret_margin_y = 11.2;
mg90s_turret_margin_x = 0.4;
mg90s_turret_height = 5.2;
mg90s_frame_length = 32.2;
mg90s_frame_v_offset = 16;
mg90s_frame_thickness = 2.45;
mg90s_axle_diameter = 4.82;
mg90s_axle_screw_diameter = 2;
mg90s_axle_height = 3.9;
mg90s_horn_offset = 0.0111;
mg90s_gimbal_vector = [-0.00585,0.0125,-0.01705];
mg90s_servo_width = 0.0125;
mg90s_servo_length = 0.0229;
mg90s_servo_height = 0.0229;
mg90s_turret_diameter = 0.0117;
mg90s_turret_margin_y = 0.0112;
mg90s_turret_margin_x = 0.0004;
mg90s_turret_height = 0.0052;
mg90s_frame_length = 0.0322;
mg90s_frame_v_offset = 0.016;
mg90s_frame_thickness = 0.00245;
mg90s_axle_diameter = 0.00482;
mg90s_axle_screw_diameter = 0.002;
mg90s_axle_height = 0.0039;
mg90s_mounting_hole_slot = 1;
mg90s_mounting_hole_diameter = 2;
mg90s_mounting_hole_center_offset_y = 2.0;
mg90s_mounting_hole_diameter = 0.002;
mg90s_mounting_hole_center_offset_y = 1.001;
mg90s_mounting_hole_center_offset_x = 0.00625;
......@@ -5,19 +5,18 @@ module horn_hole(h=10, n=1) {
cylinder(d=servo_horn_d, h=h, center=true);
for(angle=[0:360/n:360])
rotate([0, 0, angle])
for(x=[servo_horn_a, servo_horn_b])
translate([x, 0, 0])
for(i=[0:servo_horn_holes_n])
translate([i*servo_horn_holes_step + servo_horn_holes_first, 0, 0])
cylinder(d=servo_horn_d2,h=h, center=true);
}
module horn_mount(n=1){
cylinder(d=servo_horn_d + t*2,h=plate_t);
for(angle=[0:360/n:360])
rotate([0, 0, angle])
hull() for(x=[servo_horn_a, servo_horn_b])
translate([x, 0, 0])
hull() for(i=[0:servo_horn_holes_n])
translate([i*servo_horn_holes_step + servo_horn_holes_first, 0, 0])
cylinder(d=servo_horn_d2 + t*2,h=plate_t);
}
......@@ -28,12 +27,12 @@ module horn(n=1) difference(){
for(angle=[0:360/n:360])
rotate([0, 0, angle])
hull() for(x=[servo_horn_a, servo_horn_b, 0])