summaryrefslogtreecommitdiff
path: root/digital/avr/modules/motor/motor_model/motor_model_defs.host.c
blob: fddb16df718431c51936ba97a387b0865225ee24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/* motor_model_defs.host.c */
/* motor - Motor control module. {{{
 *
 * Copyright (C) 2011 Nicolas Schodet
 *
 * APBTeam:
 *        Web: http://apbteam.org/
 *      Email: team AT apbteam DOT org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * }}} */
#include "common.h"
#include "motor_model_defs.host.h"

#include <math.h>
#include <string.h>

/* RE25CLL with 1:10 gearbox. */
const motor_model_def_t motor_model_def_re25cll_x10 =
{
    /* Motor characteristics. */
    407 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
    23.4 / 1000,	/* Torque constant (N.m/A). */
    0,			/* Bearing friction (N.m/(rad/s)). */
    2.18,		/* Terminal resistance (Ohm). */
    0.24 / 1000,	/* Terminal inductance (H). */
    /* Gearbox characteristics. */
    10,			/* Gearbox ratio. */
    0.75,		/* Gearbox efficiency. */
    /* Load characteristics. */
    0.0,		/* Load (kg.m^2). */
    /* Hardware limits. */
    -INFINITY, +INFINITY,
};

/* RE25G with 1:20.25 gearbox. */
const motor_model_def_t motor_model_def_re25g_x20_25 =
{
    /* Motor characteristics. */
    407 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
    23.4 / 1000,	/* Torque constant (N.m/A). */
    0,			/* Bearing friction (N.m/(rad/s)). */
    2.32,		/* Terminal resistance (Ohm). */
    0.24 / 1000,	/* Terminal inductance (H). */
    /* Gearbox characteristics. */
    20.25,		/* Gearbox ratio. */
    0.75,		/* Gearbox efficiency. */
    /* Load characteristics. */
    0.0,		/* Load (kg.m^2). */
    /* Hardware limits. */
    -INFINITY, +INFINITY,
};

/* AMAX32GHP with 1:16 gearbox. */
const motor_model_def_t motor_model_def_amax32ghp_x16 =
{
    /* Motor characteristics. */
    269 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
    25.44 / 1000,	/* Torque constant (N.m/A). */
    0,			/* Bearing friction (N.m/(rad/s)). */
    3.99,		/* Terminal resistance (Ohm). */
    0.24 / 1000,	/* Terminal inductance (H). */
    /* Gearbox characteristics. */
    16,			/* Gearbox ratio. */
    0.75,		/* Gearbox efficiency. */
    /* Load characteristics. */
    0.0,		/* Load (kg.m^2). */
    /* Hardware limits. */
    -INFINITY, +INFINITY,
};

/* Faulhaber 2657 with 1:9.7 gearbox. */
const motor_model_def_t motor_model_def_faulhaber_2657_x9_7 =
{
    /* Motor characteristics. */
    274 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
    34.8 / 1000,	/* Torque constant (N.m/A). */
    0,			/* Bearing friction (N.m/(rad/s)). */
    2.84,		/* Terminal resistance (Ohm). */
    0.380 / 1000,	/* Terminal inductance (H). */
    /* Gearbox characteristics. */
    9.7,		/* Gearbox ratio. */
    0.80,		/* Gearbox efficiency. */
    /* Load characteristics. */
    0.0,		/* Load (kg.m^2). */
    /* Hardware limits. */
    -INFINITY, +INFINITY,
};

/* Faulhaber 2342 with 23/1 1:3.71 gearbox. */
const motor_model_def_t motor_model_def_faulhaber_2342_x3_71 =
{
    /* Motor characteristics. */
    366 * (2*M_PI) / 60,/* Speed constant ((rad/s)/V). */
    26.10 / 1000,	/* Torque constant (N.m/A). */
    0,			/* Bearing friction (N.m/(rad/s)). */
    7.10,		/* Terminal resistance (Ohm). */
    0.265 / 1000,	/* Terminal inductance (H). */
    /* Gearbox characteristics. */
    3.71,		/* Gearbox ratio. */
    0.88,		/* Gearbox efficiency. */
    /* Load characteristics. */
    0.0,		/* Load (kg.m^2). */
    /* Hardware limits. */
    -INFINITY, +INFINITY,
};

struct motor_model_def_table_t
{
    const char *name;
    const motor_model_def_t *def;
};

static const struct motor_model_def_table_t def_table[] =
{
      { "re25cll_x10", &motor_model_def_re25cll_x10 },
      { "re25g_x20_25", &motor_model_def_re25g_x20_25 },
      { "amax32ghp_x16", &motor_model_def_amax32ghp_x16 },
      { "faulhaber_2657_x9_7", &motor_model_def_faulhaber_2657_x9_7 },
      { "faulhaber_2342_x3_71", &motor_model_def_faulhaber_2342_x3_71 },
      { NULL, NULL }
};

const motor_model_def_t *
motor_model_def_get (const char *name)
{
    const struct motor_model_def_table_t *p = def_table;
    for (p = def_table; p->name; p++)
      {
	if (strcmp (p->name, name) == 0)
	    return p->def;
      }
    return NULL;
}