summaryrefslogtreecommitdiff
path: root/m/motors
diff options
context:
space:
mode:
authorschodet2005-12-04 21:08:10 +0000
committerschodet2005-12-04 21:08:10 +0000
commiteef72722eb82a18440d1824671c9cc81215eaf4c (patch)
treee99bb2a5f44bb43d37c263deb025af443c1d55c6 /m/motors
parentb07b3af91aa8640f8c60deb261a9118d06433977 (diff)
Ajout du RE025G et présentation en colones.
Diffstat (limited to 'm/motors')
-rw-r--r--m/motors/motors.pl55
1 files changed, 41 insertions, 14 deletions
diff --git a/m/motors/motors.pl b/m/motors/motors.pl
index 8e49a1c..aeeb387 100644
--- a/m/motors/motors.pl
+++ b/m/motors/motors.pl
@@ -20,6 +20,11 @@ my %motors = (
n_0 => 4860, # Vitesse à vide, tr/min
M_H => 129, # Couple de démarage, mNm
},
+ 'RE025G' => {
+ U => 12, # Tension nominale, V
+ n_0 => 6800, # Vitesse à vide, tr/min
+ M_H => 146, # Couple de démarage, mNm
+ },
);
my %gears = (
@@ -81,24 +86,46 @@ sub comp_cod_res
return $r_ * 2 * $pi / $$g{i} / $cod;
}
+sub compute_begin
+{
+ print <<EOF;
+m d motor gears V_0 a_H res tau_m_G
+EOF
+}
+
+sub compute_end
+{
+ print <<EOF;
+
+m : masse (kg)
+d : diamètre des roues (mm)
+V_0 : vitesse à vide (m/s)
+a_H : accélération au démarrage (m/s^2)
+res : résolution du codeur (mm)
+tau_m_G : temps pour arriver à 63% de la vitesse (s)
+EOF
+}
+
sub compute
{
my ($r, $mn, $gn) = @_;
my ($m, $g) = ($motors{$mn}, $gears{$gn});
- #my ($in, $out, $def) = ("", "", "");
- my ($in, $out, $def) = ("\e[31m", "\e[33m", "\e[0m");
- print "m: $in$$r{m}$def, d: $in$$r{d}$def, motor: $in$mn$def, gears: $in$gn$def\n";
- printf " vitesse max à vide : $out%.2f$def m/s\n", comp_max_speed ($r, $m, $g);
- printf " accélération au démarage : $out%.2f$def m/s^2\n", comp_a_H ($r, $m, $g);
- printf " résolution codeur : $out%.4f$def mm\n", comp_cod_res ($r, $m, $g) * 1000;
- printf " tau_m_G : $out%.2f$def s (temps avant 63%% de la vitesse)\n",
+ printf "%2d %2d %-8s %-5s %7.3f %7.3f %7.4f %7.3f\n",
+ $$r{m}, $$r{d}, $mn, $gn,
+ comp_max_speed ($r, $m, $g),
+ comp_a_H ($r, $m, $g),
+ comp_cod_res ($r, $m, $g) * 1000,
comp_tau_m_G ($r, $m, $g);
- print "\n";
}
-compute ({ m => 10, d => 80 }, 'RE025CLL', 10);
-compute ({ m => 10, d => 80 }, 'RE025CLL', 20.25);
-compute ({ m => 10, d => 60 }, 'RE025CLL', 10);
-compute ({ m => 10, d => 60 }, 'RE025CLL', 20.25);
-compute ({ m => 10, d => 40 }, 'RE025CLL', 10);
-compute ({ m => 10, d => 40 }, 'RE025CLL', 20.25);
+compute_begin;
+for (keys %motors)
+{
+ compute ({ m => 10, d => 80 }, $_, 10);
+ compute ({ m => 10, d => 80 }, $_, 20.25);
+ compute ({ m => 10, d => 60 }, $_, 10);
+ compute ({ m => 10, d => 60 }, $_, 20.25);
+ compute ({ m => 10, d => 40 }, $_, 10);
+ compute ({ m => 10, d => 40 }, $_, 20.25);
+}
+compute_end;