// Juste un test avec 2 bobine pour démontrer le couple qu'on peut obtenir // allviews rotor rotor-hole stator cover shaft // testviews assemblage assemblage-part testrotor testrotor-hole // testviews teststator testcover holder lock testmagnet include include <../cadlib.h> stator_nbpole=6; rotor_nbpole=4; stator_shaft=6; //stator_ray=50+35; stator_ray=50; stator_thick=2; mag_thick=10+0.5; mag_width=22+0.5; mag_height=48; rotor_ray=stator_ray+0.5+mag_thick+2+1; rotor_thick=2; rotor_thick2=6; rotor_thick3=12; rotor_side=12; magnet_len=48; shaft_width=18; shaft_width2=15; // C'est le support qui tient le stator et rotor ensemble // Cela aurait pu être une seule pièce (stator et shaft) // mais comme on risque de recommencer le stator, ça évite de trop imprimer module shaft() { // Une plaque pour visser difference (){ basew=40; translate([-basew/2,-basew/2,0]) cube ([basew,basew,2]); translate([0,0,-1]){ b=basew/2-4; translate([-b,-b,0]) cylinder(r=2,h=4,$fn=40); translate([-b, b,0]) cylinder(r=2,h=4,$fn=40); translate([ b,-b,0]) cylinder(r=2,h=4,$fn=40); translate([ b, b,0]) cylinder(r=2,h=4,$fn=40); } } w2=shaft_width/2; h1=magnet_len/2; translate([-w2,-w2,2]) cube([shaft_width,shaft_width,h1]); w4=shaft_width2/2; translate([-w4,-w4,2+h1]) cube([shaft_width2,shaft_width2,10]); h2=magnet_len+4-rotor_thick3+4; // +4 tempo cylinder(r=stator_shaft+1,h=stator_thick+h2,$fn=80); cylinder(r=stator_shaft,h=stator_thick+h2+20,$fn=80); } module rotor(nbpole,hole){ r2=rotor_ray-2-mag_thick; difference(){ union(){ if (hole){ difference(){ cylinder(r=rotor_ray+2,h=rotor_thick,$fn=80); translate([0,0,-1]) cylinder(r=stator_shaft+0.3,h=rotor_thick+2,$fn=80); } }else{ cylinder(r=rotor_ray+2,h=rotor_thick,$fn=80); translate([0,0,rotor_thick]) cylinder(r=stator_shaft+3,h=rotor_thick3,$fn=80); for (i=[1:nbpole]){ rotate([0,0,360/nbpole*(i-1)]){ ws=4; translate([0,-ws/2,rotor_thick]) cube([rotor_ray,ws,ws]); translate([r2-3,-mag_width/2-2,rotor_thick]) cube([mag_thick,mag_width+4,rotor_thick2]); translate([r2+2,-mag_width/2-2,0]) cube([mag_thick,mag_width+4,18+1]); } } } } union(){ // Trou pour l'arbre du stator translate([0,0,-1]) cylinder(r=stator_shaft+0.3,h=22,$fn=80); // Trou au bout pour insérer des aimants céramique de 22 x 10 // On va mettre 2 aimants ensemble translate([0,0,-1]){ for (i=[1:nbpole]){ rotate([0,0,360/nbpole*(i-1)]) translate([r2,-mag_width/2,0]) cube([mag_thick,mag_width,mag_height+2]); } } // Trous triangulaires pour sauver du plastique pendant les tests translate([0,0,-1]) for (i=[1:4]){ rotate([0,0,i*360/4+45]){ translate([40,0,0]) rotate([0,0,90]) triangle_isocel (45,30,rotor_thick+2); } } } } if (!hole){ // Rainure au fond pour supporter le stator durant le test *translate([0,0,rotor_thick]) difference(){ ray=stator_ray; cylinder(r=ray,h=rotor_thick2,$fn=80); translate([0,0,-1]) cylinder(r=ray-4,h=12,$fn=80); } } } holder_len=8; holder_width=12; holder_height=15; module holder(){ len=holder_len; difference(){ w=holder_width; cube([len,w,holder_height]); nutw=8.5+0.5; nutt=3.2+1.5; boltr=2+0.2; union(){ translate([len-nutt,w/2,7+2]) rotate([0,90,0]) nut(nutw,nutt+1,true); translate([-1,w/2-boltr,5+2+2]) cube([len+2,2*boltr,15]); translate([len+1,w/2,7+1]) rotate([0,-90,0]) cylinder(r=boltr,h=len+2,$fn=40); } } } stator_trim=4; // Ajustement pour que la plaque metallique // ne touche pas a l'aimant module stator_plate(nbpole){ difference(){ union(){ cylinder(r=stator_ray-stator_trim,h=stator_thick,$fn=80); cylinder(r=12,h=stator_thick+3,$fn=80); } w=shaft_width2+0.3; w2=w/2; translate([0,0,-1]) union(){ translate([-w2,-w2,0]) cube([w,w,stator_thick+2+3]); // Do some holes for wires for (i=[1:nbpole]){ rotate([0,0,360/nbpole*i+12]) translate([25,0,0]) cylinder(r=5,h=stator_thick+2,$fn=80); } } } } module stator(nbpole){ stator_plate(nbpole); *translate([0,0,stator_thick]) difference(){ cylinder(r=15,h=10,$fn=80); union(){ translate([0,0,-1]) cylinder(r=10,h=12,$fn=80); for (i=[1:nbpole]){ rotate([0,0,360/nbpole*(i-1)]) translate([0,-5,0]) { translate([-1,5,5]) rotate([0,90,0]) cylinder(r=2,h=stator_ray,$fn=40); translate([-1,3,5]) cube([stator_ray,4,10]); } } } } intersection(){ cylinder(r=stator_ray-stator_trim,h=holder_height,$fn=80); for (i=[1:nbpole]){ rotate([0,0,360/nbpole*(i-1)]){ //translate([15,-5,stator_thick]) holder(); //translate([10+5+1,-2,5]) cube([24,4,4]); // Renfort translate([10,-6,stator_thick]) cube([stator_ray-stator_trim,3,3]); // Attache pour le boulon translate([stator_ray-holder_len-stator_trim,-holder_width/2,0]) holder(); } } } } module lock(){ difference(){ h=4; translate([0,3,0]) cube([8,4,h]); translate([-1,5,h]) rotate([0,90,0]) cylinder(r=2,h=14,$fn=40); } } // Couvre le stator et immobilise les bobines module cover(nbpole){ stator_plate(); for (i=[1:nbpole]){ rotate([0,0,360/12*(i-1)]){ translate([20,-5,2]) lock(); translate([stator_ray-10-2,-5,2]) lock(); } } } module slice(width){ cylinder(r=15,h=30,$fn=40); s1=stator_ray+30; rotate([0,0,-75]) translate([0,s1,0]) rotate([0,0,180]) triangle_isocel (width,s1,30); } module teststator(){ difference(){ intersection(){ rotate([0,0,-15]) slice(40); stator(stator_nbpole); } translate([0,0,stator_thick+1]) 3darc(16,10,12,50,340,40); } } module testrotor(hole){ intersection(){ slice(42); rotate([0,0,15]) rotor(rotor_nbpole,hole); } } module main_view(view){ if (view=="rotor"){ rotor(rotor_nbpole,false); }else if (view=="rotor-hole"){ rotor(rotor_nbpole,true); }else if (view=="stator"){ stator(stator_nbpole); }else if (view=="cover"){ cover(2); }else if (view=="assemblage"){ translate([0,0,magnet_len+15]) rotate([180,0,0]) rotor(rotor_nbpole); shaft(); translate([0,0,magnet_len/2+3]) stator(stator_nbpole); //translate([0,0,35]) rotate([180,0,0]) cover(12); }else if (view=="assemblage-part"){ testrotor(false); r1=rotor_thick+rotor_thick2+0.5; translate([0,0,r1]) teststator(); translate([0,0,r1+12.5]) testrotor(true); }else if (view=="testrotor"){ testrotor(false); }else if (view=="testrotor-hole"){ testrotor(true); }else if (view=="testmagnet"){ difference(){ cube([mag_thick+4,mag_width+4,2]); translate([2,2,-1]) cube([mag_thick,mag_width,4]); } }else if (view=="teststator"){ teststator(); }else if (view=="testcover"){ intersection(){ slice(); cover(2); } }else if (view=="holder"){ holder(); }else if (view=="lock"){ lock(); }else if (view=="shaft"){ shaft(); } }