// Interactive configuration for Rohloff Speedhub 500/14 title "Rohloff Speedhub 500/14" version {@
Version 8.0, 21.4.2006
Reason driving.
Switchable lin/log scales

francois.roulet@epfl.ch

EPFL
Swiss Federal Institute of Technology
CH-1015 Lausanne
Switzerland
@} help {@
There's a whole Speedhub 500/14 simulator:

You can adjust all 5 sliders for each planet gear ratio,
or geometric progression reason slider,
and the 14 gears selector.

In the "Settings" menu,
you can toggle between sorted results or not.

With the Right-click,
you can choose linear or logarithmic scale
@} // TABLE 1 // WHEEL Number of Teeth // Sun 19 42 // Sun 20 35 // Sun 22 42 // Sun 23 35 // Sun 36 51 // Planet 18 // Stage 18a 24 // Stage 18b 32 // Planet 21 // Stage 21a 24 // Stage 21b 32 // Planet 38 // Stage 38a 20 // Stage 38b 26 // Ring gear 24 -90 // Ring gear 25 -90 // Ring gear 39 -96 // TABLE 2 // Clutch // <--- Brakes ---> <- Clutch -> // Gear Step 26 27 28 29 31 32 41 Gear Ratio Step Jump // 1st Gear x x 3.591 13.5% // 2nd Gear x x 3.163 13.8% // 3rd Gear x x 2.779 13.5% // 4th Gear x x 2.448 13.5% // 5th Gear x x 2.157 13.8% // 6th Gear x x 1.895 13.5% // 7th Gear x x 1.670 13.8% // 8th Gear x x x 1.467 13.5% // 9th Gear x x x 1.292 13.8% // 10th Gear x x x 1.135 13.5% // 11th Gear x x x 1.000 13.5% // 12th Gear x x x 0.881 13.8% // 13th Gear x x x 0.774 13.5% // 14th Gear x x x 0.682 -- // TABLE 3 // Clutch // Gear Step 90 91 92 93 95 96 41 Gear Ratio Step Jump // 1st Gear x x 3.591 13.5% // 2nd Gear x x 3.163 13.8% // 3rd Gear x x 2.779 13.5% // 4th Gear x x 2.448 13.5% // 5th Gear x x 2.157 13.8% // 6th Gear x x 1.895 13.5% // 7th Gear x x 1.670 13.8% // 8th Gear x x x 1.467 13.5% // 9th Gear x x x 1.292 13.8% // 10th Gear x x x 1.135 13.5% // 11th Gear x x x 1.000 13.5% // 12th Gear x x x 0.881 13.8% // 13th Gear x x x 0.774 13.5% // 14th Gear x x x 0.682 -- variable Re1, Re2 // Epicyclic ratios variable Rs1, Rs2 // Sun gears ratios variable Re3 // 3rd Epicyclic variable Carrier // Twin Carrier regime variable Ratios // Twin Planet ratios table variable Shifter // Gear selector variable Range // Full gears range variable alpha // Ideal logarithmic slope variable Sorted // Is sorted ? variable Reason // Geometric Progression Reason init (Re1, Re2, Rs1, Rs2, Re3, Carrier, Ratios, Shifter, Range, Reason, alpha, Sorted) = init make (Ratios) = calcRatios(Re1, Re2, Rs1, Rs2) menu "Sorted" _checkmark(Sorted) Sorted=toggle(Sorted) function {@ function (Re1, Re2, Rs1, Rs2, Re3, Carrier, Ratios, Shifter, Range, Reason, alpha, Sorted) = init subplots('Global Ratios Histogram\tTwin Planet Nomogram\nGears Organigram\tGears Ratios Sliders'); // Rohloff's Metrics Re1 = 1 + 2*24/42; // S1 = 42, F1 = 24, R1 = 90 (42+24=66 ?) Rs1 = 32/24*42/35; // S2 = 35, F2 = 32 (35+32=67 ?) Rs2 = 32/24*42/35; // S3 = 35, F3 = 32 Re2 = 1 + 2*24/42; // S4 = 42, F4 = 24, R2 = 90 Re3 = 1/(1 + 20/27*96/49); // R3 = 96, Big sun = 51, Small sun = 42 Reason = power(1/Re1 + 1, 1/3); // Cubic root Carrier = 1; Ratios = [1, 1.292, 1.467, 0.774, 1, 1.135, 0.682, 0.881, 1]; Range = ones(1, 2*9); alpha = Reason; Shifter = 1; Sorted = 1; function Sorted = toggle(Sorted) Sorted = ~Sorted; function drawSliders(Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter) slider(sprintf('1st Epicyclic = 1/%.2f\n1st Suns Ratio = %.2f\n2nd Suns Ratio = %.2f\n2nd Epicyclic = 1/%.2f\n3rd Epicyclic = %.3f\nReason = %.3f\nGear selector = %d', ... Re1, Rs1, Rs2, Re2, Re3, Reason, Shifter), [Re1; Rs1; Rs2; Re2; Re3; Reason; Shifter], [2,4; 1.5,2; 1.5,2; 2,4; 1/3,2/3; 1.08,1.14; 1,14], 'LLLLLL-', 'mmcckkk', 1); function (Ratios) = calcRatios(Re1, Re2, Rs1, Rs2) // Progressive order: 4, 9, 8, 1, 5, 3, 2, 7, 6 // Distributive order: 1, 3, 2, 7, 9, 8, 4, 6, 5 Ratios(1) = 1; Ratios(3) = 1/Re2 + 1; Ratios(2) = 1/(Rs2*Re2) + 1; Ratios(7) = Re1/(1 + Re1); Ratios(9) = Re1/(1 + Re1) * (1/Re2 + 1); Ratios(8) = Re1/(1 + Re1) * (1/(Rs2*Re2) + 1); Ratios(4) = Rs1*Re1/(1 + Rs1*Re1); Ratios(6) = Rs1*Re1/(1 + Rs1*Re1) * (1/Re2 + 1); Ratios(5) = Rs1*Re1/(1 + Rs1*Re1) * (1/(Rs2*Re2) + 1); function drawNomogram(Re1, Re2, Rs1, Rs2, Sorted, Shifter) scale('linlin', [-Rs1*Re1, Rs2*Re2, 0, 1+1/Re2]); line([1, 0], -Rs1*Re1, 'm-'); text(-Rs1*Re1, 1 + 1/Re2, 'S2', 'tl'); line([1, 0], -Re1, 'm-'); text(-Re1, 1 + 1/Re2, 'S1', 'tl'); line([1, 0], -1, 'c-'); text(-1, 1 + 1/Re2, 'R2', 'tl'); line([1, 0], 0); text(0, 1 + 1/Re2, 'C', 'tr'); line([1, 0], 1, 'm-'); text(1, 1 + 1/Re2, 'R1', 'tr'); line([1, 0], Re2, 'c-'); text(Re2, 1 + 1/Re2, 'S4', 'tr'); line([1, 0], Rs2*Re2, 'c-'); text(Rs2*Re2, 1 + 1/Re2, 'S3', 'tr'); line([0, 1], 1, '-'); // Zero Abscissa switch Sorted case 0 Index = [1,2,3,4,6,7,8, 1,2,3,4,6,7,8]; // Distributive Selector Index case 1 Index = [7,4,8,1,6,2,3, 7,4,8,1,6,2,3]; // Progressive Selector Index end switch Index(Shifter) // Progressive order: 1, 2, 4, 9, 7, 5, 8, 6, 3 // Distributive order: 7, 4, 1, 3, 6, 9, 2, 5, 8 case 7 Carrier = Re1/(1 + Re1); plot(0, Carrier, 'o'); plot([-Re1,1; -Re1,1], [0,1; 0,1], 'moM_'); // S1 blocked plot([Re2,-1; Rs2*Re2,-1], [Carrier,Carrier; Carrier,Carrier], 'coC_'); // S4 coupled case 4 Carrier = Rs1*Re1/(1 + Rs1*Re1); plot(0, Carrier, 'o'); plot([-Rs1*Re1,1; -Rs1*Re1,1], [0,1; 0,1], 'moM_'); // S2 blocked plot([Re2,-1; Rs2*Re2,-1], [Carrier,Carrier; Carrier,Carrier], 'coC_'); // S4 coupled case 1 Carrier = 1; plot(0, Carrier, 'o'); plot([-Re1,1; -Rs1*Re1,1], [1,1; 1,1], 'moM_'); // S1 coupled plot([Re2,-1; Rs2*Re2,-1], [Carrier,Carrier; Carrier,Carrier], 'coC_'); // S4 coupled case 3 Carrier = 1; plot(0, Carrier, 'o'); plot([-Re1,1; -Rs1*Re1,1], [1,1; 1,1], 'moM_'); // S1 coupled plot([Re2,-1; Re2,-1], [0,(1 + 1/Re2)*Carrier; 0,(1 + 1/Re2)*Carrier], 'coC_'); // S4 blocked case 6 Carrier = Rs1*Re1/(1 + Rs1*Re1); plot(0, Carrier, 'o'); plot([-Rs1*Re1,1; -Rs1*Re1,1], [0,1; 0,1], 'moM_'); // S2 blocked plot([Re2,-1; Re2,-1], [0,(1 + 1/Re2)*Carrier; 0,(1 + 1/Re2)*Carrier], 'coC_'); // S4 blocked case 9 Carrier = Re1/(1 + Re1); plot(0, Carrier, 'o'); plot([-Re1,1; -Re1,1], [0,1; 0,1], 'moM_'); // S1 blocked plot([Re2,-1; Re2,-1], [0,(1 + 1/Re2)*Carrier; 0,(1 + 1/Re2)*Carrier], 'coC_'); // S4 blocked case 2 Carrier = 1; plot(0, Carrier, 'o'); plot([-Re1,1; -Rs1*Re1,1], [1,1; 1,1], 'moM_'); // S1 coupled plot([Rs2*Re2,-1; Rs2*Re2,-1], [0,(1 + 1/(Rs2*Re2))*Carrier; ... 0,(1 + 1/(Rs2*Re2))*Carrier], 'coC_'); // S3 blocked case 5 Carrier = Rs1*Re1/(1 + Rs1*Re1); plot(0, Carrier, 'o'); plot([-Rs1*Re1,1; -Rs1*Re1,1], [0,1; 0,1], 'moM_'); // S2 blocked plot([Rs2*Re2,-1; Rs2*Re2,-1], [0,(1 + 1/(Rs2*Re2))*Carrier; ... 0,(1 + 1/(Rs2*Re2))*Carrier], 'coC_'); // S3 blocked case 8 Carrier = Re1/(1 + Re1); plot(0, Carrier, 'o'); plot([-Re1,1; -Re1,1], [0,1; 0,1], 'moM_'); // S1 blocked plot([Rs2*Re2,-1; Rs2*Re2,-1], [0,(1 + 1/(Rs2*Re2))*Carrier; ... 0,(1 + 1/(Rs2*Re2))*Carrier], 'coC_'); // S3 blocked end function drawHistogram(Re3, Ratios, Sorted) Index = [1,2,3,4,6,7,8]; // Usable Gears Index Range = [Re3*Ratios(Index), Ratios(Index)]; scale('linlin/linlog', [1,2*7, min(Range),max(Range)]); label('Gear'); line([0, 1], 1, '-'); switch Sorted case 0 // Unsorted bar(Range); case 1 // Sorted alpha = power(max(Range)/min(Range), 1/(2*7 - 1)); plot(1:2*7, min(Range)*power(alpha, 0:2*7-1), 'r'); bar(sort(Range)); end function drawOrganigram(Ratios, Re3, Sorted, Shifter) // plotoption('noygrid)' scale('linlin/loglin'); label('Ratio'); switch Sorted case 0 Index1 = [1,2,3,4,6,7,8, 1,2,3,4,6,7,8]; // Usable Gears Index Index2 = [1,1,1,4,4,7,7, 1,1,1,4,4,7,7]; // PGT1 Index case 1 Index1 = [7,4,8,1,6,2,3, 7,4,8,1,6,2,3]; // Usable Gears Index Index2 = [7,4,7,1,4,1,1, 7,4,7,1,4,1,1]; // PGT1 Index end Index3 = [Re3,Re3,Re3,Re3,Re3,Re3,Re3, 1,1,1,1,1,1,1]; // PGT3 Index for Pgt1 = 0:2 plot([1, Ratios(3*Pgt1 + 1); 1, Ratios(3*Pgt1 + 1)], [3,2; 3,2], 'mom_'); for Pgt2 = 1:3 plot([Ratios(3*Pgt1 + 1), Ratios(3*Pgt1 + Pgt2); ... Ratios(3*Pgt1 + 1), Ratios(3*Pgt1 + Pgt2)], [1,1;2,1], 'coc_'); for Pgt3 = 1:2 plot([Ratios(3*Pgt1 + Pgt2), Re3*Ratios(3*Pgt1 + Pgt2); ... Ratios(3*Pgt1 + Pgt2), Ratios(3*Pgt1 + Pgt2); ... Ratios(3*Pgt1 + Pgt2), Re3*Ratios(3*Pgt1 + Pgt2)], ... [0,0; 1,0; 1,0], 'bob_b_'); end end end // Active Gear Highlight plot([1,Ratios(Index2(Shifter)); Ratios(Index2(Shifter)),Ratios(Index1(Shifter))], [3,2;2,1], 'M_C_'); plot([Ratios(Index2(Shifter)); Ratios(Index1(Shifter))], [2;1], 'MoCo'); plot([Ratios(Index1(Shifter)),Index3(Shifter)*Ratios(Index1(Shifter))], [1,0], 'Y_'); plot(Index3(Shifter)*Ratios(Index1(Shifter)), 0, 'Yo'); text(max(Ratios), 3, 'Ring 1', 'tr'); line([0, 1], 2, '-'); text(max(Ratios), 2, 'Carrier', 'br'); line([0, 1], 1, '-'); text(max(Ratios), 1, 'Ring 2', 'br'); function (Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter, msg) = dragSliders(Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter, nb, x1) if isempty(nb) cancel; end msg = sprintf(''); switch nb case 1 Re1 = x1; case 2 Rs1 = x1; case 3 Rs2 = x1; case 4 Re2 = x1; case 5 Re3 = x1; case 6 Reason = x1; Re1 = 1/(Reason^3 - 1); Re2 = Re1; // Rs1 = 1/(Re1*(power(1 + 1/Re1, 2/3) - 1)); // from Re1 only Rs1 = 1/(Re1*(Reason^2 - 1)); // from Re1 & Reason Rs2 = Rs1; Re3 = power(Reason, -7); msg = sprintf('Ratio spread: %g', Reason^(2*7-1)); case 7 Shifter = fix(x1 + 0.5); // +0.5 = Slider Centering msg = sprintf('Degrees: %g', 21*(Shifter - 1)); // Camshaft Angle end @} figure "Global Ratios Histogram" draw drawHistogram(Re3, Ratios, Sorted) figure "Twin Planet Nomogram" draw drawNomogram(Re1, Re2, Rs1, Rs2, Sorted, Shifter) figure "Gears Organigram" draw drawOrganigram(Ratios, Re3, Sorted, Shifter) figure "Gears Ratios Sliders" draw drawSliders(Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter) mousedrag (Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter, _msg) = dragSliders(Re1, Re2, Rs1, Rs2, Re3, Reason, Shifter, _nb, _x1)