Commit from zer0 on branch b_zer0 (2007-12-06 09:57 CET)
=================================
Add missing files, update pid : modifying derivate filter does
not impact the gain.
aversive Makefile
1.35.4.6
aversive config/config.in
1.42.4.14
aversive modules/base/scheduler/test/.config
1.5.4.12
+ aversive modules/base/scheduler/test/timer_config.h
1.1.2.1
+ aversive
modules/devices/control_system/control_system_manager/test/pid_config.h 1.1.2.1
aversive modules/devices/control_system/filters/pid/pid.c
1.5.4.5
aversive modules/devices/control_system/filters/pid/pid.h
1.4.4.6
+ aversive modules/ihm/rdline/config/rdline_config.h
1.1.2.1
+ aversive modules/ihm/rdline/test/Makefile
1.1.2.1
+ aversive modules/ihm/rdline/test/error_config.h
1.1.2.1
+ aversive modules/ihm/rdline/test/rdline_config.h
1.1.2.1
aversive projects/example1/.config
1.5.4.6
+ aversive projects/example1/error_config.h
1.3.4.2
+ aversive projects/example1/scheduler_config.h
1.1.2.1
+ aversive projects/example1/time_config.h
1.1.2.1
+ aversive projects/example1/timer_config.h
1.1.2.1
+ aversive projects/example2/error_config.h
1.1.2.1
=================
aversive/Makefile (1.35.4.5 -> 1.35.4.6)
=================
@@ -99,7 +99,7 @@
###
mrproper:
- find . -name "autoconf.h" -o -name ".aversive_conf" -o -name "*.hex"
-o -name "*~" -o -name "*.eep" -o -name "*.obj" -o -name "*.elf" -o -name
"*.map" -o -name "*.obj" -o -name "*.a90" -o -name "*.sym" -o -name "*.lnk" -o
-name "*.lss" -o -name "*.a" -o -name "*.d" -o -name "*.o" -o -name "*.d" -o
-name "*.lst" | xargs rm -f
+ find . -name "autoconf.h" -o -name ".aversive_conf" -o -name "*.hex"
-o -name "*~" -o -name "*.eep" -o -name "*.obj" -o -name "*.elf" -o -name
"*.map" -o -name "*.obj" -o -name "*.a90" -o -name "*.sym" -o -name "*.lnk" -o
-name "*.lss" -o -name "*.a" -o -name "*.{avr,host}.d" -o -name "*.o" -o -name
"*.avr.d.*" -o -name "*.host.d.*" -o -name "*.lst" | xargs rm -f
.PHONY : all clean avrall avrclean hostall hostclean \
=========================
aversive/config/config.in (1.42.4.13 -> 1.42.4.14)
=========================
@@ -129,10 +129,20 @@
dep_bool ' |-- Create Default scheduler config'
CONFIG_MODULE_SCHEDULER_CREATE_CONFIG \
$CONFIG_MODULE_SCHEDULER
+if [ "$CONFIG_MODULE_TIMER" = "y" ]; then
+
choice 'Scheduler config' "use_timer_module CONFIG_MODULE_SCHEDULER_USE_TIMERS\
use_timer0 CONFIG_MODULE_SCHEDULER_TIMER0\
manual CONFIG_MODULE_SCHEDULER_MANUAL" use_timer_module
+else
+
+choice 'Scheduler config' "use_timer_module CONFIG_MODULE_SCHEDULER_USE_TIMERS\
+ use_timer0 CONFIG_MODULE_SCHEDULER_TIMER0\
+ manual CONFIG_MODULE_SCHEDULER_MANUAL" use_timer0
+
+endif
+
#### TIME
dep_bool 'Time' CONFIG_MODULE_TIME \
$CONFIG_MODULE_SCHEDULER
============================================
aversive/modules/base/scheduler/test/.config (1.5.4.11 -> 1.5.4.12)
============================================
@@ -77,6 +77,8 @@
CONFIG_MODULE_SCHEDULER=y
CONFIG_MODULE_SCHEDULER_CREATE_CONFIG=y
# CONFIG_MODULE_SCHEDULER_USE_TIMERS is not set
+CONFIG_MODULE_SCHEDULER_TIMER0=y
+# CONFIG_MODULE_SCHEDULER_MANUAL is not set
# CONFIG_MODULE_TIME is not set
# CONFIG_MODULE_TIME_CREATE_CONFIG is not set
@@ -152,6 +154,7 @@
#
# CONFIG_MODULE_CONTROL_SYSTEM_MANAGER is not set
# CONFIG_MODULE_PID is not set
+# CONFIG_MODULE_PID_CREATE_CONFIG is not set
# CONFIG_MODULE_RAMP is not set
# CONFIG_MODULE_QUADRAMP is not set
# CONFIG_MODULE_QUADRAMP_DERIVATE is not set
===================================================
aversive/modules/base/scheduler/test/timer_config.h (1.1.2.1)
===================================================
@@ -0,0 +1,39 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2006)
+ *
+ * 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
+ *
+ * Revision : $Id: timer_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#define TIMER0_ENABLED
+
+/* #define TIMER1_ENABLED */
+/* #define TIMER1A_ENABLED */
+/* #define TIMER1B_ENABLED */
+/* #define TIMER1C_ENABLED */
+
+/* #define TIMER2_ENABLED */
+
+/* #define TIMER3_ENABLED */
+/* #define TIMER3A_ENABLED */
+/* #define TIMER3B_ENABLED */
+/* #define TIMER3C_ENABLED */
+
+#define TIMER0_PRESCALER_DIV 8
+/* #define TIMER1_PRESCALER_DIV 1 */
+/* #define TIMER2_PRESCALER_DIV 1 */
+/* #define TIMER3_PRESCALER_DIV 1 */
================================================================================
aversive/modules/devices/control_system/control_system_manager/test/pid_config.h
(1.1.2.1)
================================================================================
@@ -0,0 +1,30 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ *
+ *
+ */
+
+#ifndef PID_CONFIG_H
+#define PID_CONFIG_H
+
+/** the derivate term can be filtered to remove the noise. This value
+ * is the maxium sample count to keep in memory to do this
+ * filtering. For an instance of pid, this count is defined o*/
+#define PID_DERIVATE_FILTER_MAX_SIZE 4
+
+#endif
=========================================================
aversive/modules/devices/control_system/filters/pid/pid.c (1.5.4.4 -> 1.5.4.5)
=========================================================
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Revision : $Id: pid.c,v 1.5.4.4 2007-12-05 18:08:39 zer0 Exp $
+ * Revision : $Id: pid.c,v 1.5.4.5 2007-12-06 08:58:00 zer0 Exp $
*
*/
@@ -198,9 +198,9 @@
S_MAX(p->integral, p->max_I) ;
/* so, command = P.coef_P + I.coef_I + D.coef_D */
- command = in * p->gain_P +
+ command = in * p->gain_P +
p->integral * p->gain_I +
- derivate * p->gain_D ;
+ (derivate * p->gain_D) / p->derivate_nb_samples ;
if ( command < 0 )
command = -( -command >> p->out_shift );
=========================================================
aversive/modules/devices/control_system/filters/pid/pid.h (1.4.4.5 -> 1.4.4.6)
=========================================================
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Revision : $Id: pid.h,v 1.4.4.5 2007-12-05 18:08:39 zer0 Exp $
+ * Revision : $Id: pid.h,v 1.4.4.6 2007-12-06 08:58:00 zer0 Exp $
*
*/
@@ -35,7 +35,7 @@
int16_t gain_I; /**< Gain of Integral module */
int16_t gain_D; /**< Gain of Derivate module */
- uint8_t out_shift;
+ uint8_t out_shift; /**< big common divisor for output */
uint8_t derivate_nb_samples; /**< sample count for derivate filter */
uint8_t index; /**< index in circular buffer below */
@@ -70,9 +70,16 @@
uint8_t pid_get_out_shift(struct pid_filter *p);
uint8_t pid_get_derivate_filter(struct pid_filter *p);
+/** get the sum of all nput samples since the filter initialisation */
int32_t pid_get_value_I(struct pid_filter *p);
+
+/** get previous input value */
int32_t pid_get_value_in(struct pid_filter *p);
+
+/** get previous derivate value (without gain) */
int32_t pid_get_value_D(struct pid_filter *p);
+
+/** get previous output value */
int32_t pid_get_value_out(struct pid_filter *p);
/** PID process */
==================================================
aversive/modules/ihm/rdline/config/rdline_config.h (1.1.2.1)
==================================================
=========================================
aversive/modules/ihm/rdline/test/Makefile (1.1.2.1)
=========================================
@@ -0,0 +1,20 @@
+TARGET = main
+
+AVERSIVE_DIR = ../../../..
+
+# List C source files here. (C dependencies are automatically generated.)
+SRC = $(TARGET).c
+
+# List Assembler source files here.
+# Make them always end in a capital .S. Files ending in a lowercase .s
+# will not be considered source files but generated files (assembler
+# output from the compiler), and will be deleted upon "make clean"!
+# Even though the DOS/Win* filesystem matches both .s and .S the same,
+# it will preserve the spelling of the filenames, and gcc itself does
+# care about how the name is spelled on its command-line.
+ASRC =
+
+########################################
+
+-include .aversive_conf
+include $(AVERSIVE_DIR)/mk/aversive_project.mk
===============================================
aversive/modules/ihm/rdline/test/error_config.h (1.1.2.1)
===============================================
@@ -0,0 +1,31 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ * Revision : $Id: error_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#ifndef _ERROR_CONFIG_
+#define _ERROR_CONFIG_
+
+/** enable the dump of the comment */
+#define ERROR_DUMP_TEXTLOG
+
+/** enable the dump of filename and line number */
+#define ERROR_DUMP_FILE_LINE
+
+#endif
================================================
aversive/modules/ihm/rdline/test/rdline_config.h (1.1.2.1)
================================================
==================================
aversive/projects/example1/.config (1.5.4.5 -> 1.5.4.6)
==================================
@@ -76,7 +76,9 @@
CONFIG_MODULE_VECT2=y
CONFIG_MODULE_SCHEDULER=y
CONFIG_MODULE_SCHEDULER_CREATE_CONFIG=y
-# CONFIG_MODULE_SCHEDULER_USE_TIMERS is not set
+CONFIG_MODULE_SCHEDULER_USE_TIMERS=y
+# CONFIG_MODULE_SCHEDULER_TIMER0 is not set
+# CONFIG_MODULE_SCHEDULER_MANUAL is not set
CONFIG_MODULE_TIME=y
CONFIG_MODULE_TIME_CREATE_CONFIG=y
@@ -98,8 +100,8 @@
#
# Hardware modules
#
-# CONFIG_MODULE_TIMER is not set
-# CONFIG_MODULE_TIMER_CREATE_CONFIG is not set
+CONFIG_MODULE_TIMER=y
+CONFIG_MODULE_TIMER_CREATE_CONFIG=y
# CONFIG_MODULE_TIMER_DYNAMIC is not set
# CONFIG_MODULE_PWM is not set
# CONFIG_MODULE_PWM_CREATE_CONFIG is not set
@@ -152,6 +154,7 @@
#
CONFIG_MODULE_CONTROL_SYSTEM_MANAGER=y
# CONFIG_MODULE_PID is not set
+# CONFIG_MODULE_PID_CREATE_CONFIG is not set
# CONFIG_MODULE_RAMP is not set
# CONFIG_MODULE_QUADRAMP is not set
CONFIG_MODULE_QUADRAMP_DERIVATE=y
=========================================
aversive/projects/example1/error_config.h (1.3.4.2)
=========================================
@@ -0,0 +1,31 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ * Revision : $Id: error_config.h,v 1.3.4.2 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#ifndef _ERROR_CONFIG_
+#define _ERROR_CONFIG_
+
+/** enable the dump of the comment */
+#define ERROR_DUMP_TEXTLOG
+
+/** enable the dump of filename and line number */
+#define ERROR_DUMP_FILE_LINE
+
+#endif
=============================================
aversive/projects/example1/scheduler_config.h (1.1.2.1)
=============================================
@@ -0,0 +1,77 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ * Revision : $Id: scheduler_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#ifndef _SCHEDULER_CONFIG_H_
+#define _SCHEDULER_CONFIG_H_
+
+#define _SCHEDULER_CONFIG_VERSION_ 4
+
+/** maximum number of allocated events */
+#define SCHEDULER_NB_MAX_EVENT 5
+
+
+/* define it only if CONFIG_MODULE_SCHEDULER_USE_TIMERS is enabled. In
+ this case, precaler is defined in timers_config.h in your project
+ directory. */
+#ifdef CONFIG_MODULE_SCHEDULER_USE_TIMERS
+/** the num of the timer to use for the scheduler */
+#define SCHEDULER_TIMER_NUM 0
+
+/* or set the prescaler manually (in this case, you use must TIMER0,
+ and the prescaler must be a correct value regarding the AVR device
+ you are using (look in include/aversive/parts.h). Obviously, the
+ values of SCHEDULER_CK and SCHEDULER_CLOCK_PRESCALER must also be
+ coherent (TIMER0_PRESCALER_DIV_VALUE and VALUE) */
+#endif /* CONFIG_MODULE_SCHEDULER_USE_TIMERS */
+
+
+#ifdef CONFIG_MODULE_SCHEDULER_TIMER0
+/* The 2 values below MUST be coherent:
+ * if SCHEDULER_CK = TIMER0_PRESCALER_DIV_x, then
+ * you must have SCHEDULER_CLOCK_PRESCALER = x too !!! */
+#define SCHEDULER_CK TIMER0_PRESCALER_DIV_8
+#define SCHEDULER_CLOCK_PRESCALER 8
+
+#endif /* CONFIG_MODULE_SCHEDULER_TIMER0 */
+
+/* last case, the scheduler is called manually. The user has to
+ define the period here */
+#ifdef CONFIG_MODULE_SCHEDULER_MANUAL
+
+#define SCHEDULER_UNIT_FLOAT 1000.0
+#define SCHEDULER_UNIT 1000UL
+
+#endif /* CONFIG_MODULE_SCHEDULER_MANUAL */
+
+/** number of allowed imbricated scheduler interrupts. The maximum
+ * should be SCHEDULER_NB_MAX_EVENT since we never need to imbricate
+ * more than once per event. If it is less, it can avoid to browse the
+ * event table, events are delayed (we loose precision) but it takes
+ * less CPU */
+#define SCHEDULER_NB_STACKING_MAX SCHEDULER_NB_MAX_EVENT
+
+/** define it for debug infos (not recommended, because very slow on
+ * an AVR, it uses printf in an interrupt). It can be useful if
+ * prescaler is very high, making the timer interrupt period very
+ * long in comparison to printf() */
+/* #define SCHEDULER_DEBUG */
+
+#endif // _SCHEDULER_CONFIG_H_
========================================
aversive/projects/example1/time_config.h (1.1.2.1)
========================================
@@ -0,0 +1,23 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ * Revision : $Id: time_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+/** precision of the time processor, in us */
+#define TIME_PRECISION 10000l
=========================================
aversive/projects/example1/timer_config.h (1.1.2.1)
=========================================
@@ -0,0 +1,39 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2006)
+ *
+ * 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
+ *
+ * Revision : $Id: timer_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#define TIMER0_ENABLED
+
+#define TIMER1_ENABLED
+#define TIMER1A_ENABLED
+#define TIMER1B_ENABLED
+#define TIMER1C_ENABLED
+
+#define TIMER2_ENABLED
+
+#define TIMER3_ENABLED
+#define TIMER3A_ENABLED
+#define TIMER3B_ENABLED
+#define TIMER3C_ENABLED
+
+#define TIMER0_PRESCALER_DIV 1
+#define TIMER1_PRESCALER_DIV 1
+#define TIMER2_PRESCALER_DIV 1
+#define TIMER3_PRESCALER_DIV 1
=========================================
aversive/projects/example2/error_config.h (1.1.2.1)
=========================================
@@ -0,0 +1,31 @@
+/*
+ * Copyright Droids Corporation, Microb Technology, Eirbot (2005)
+ *
+ * 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
+ *
+ * Revision : $Id: error_config.h,v 1.1.2.1 2007-12-06 08:58:00 zer0 Exp $
+ *
+ */
+
+#ifndef _ERROR_CONFIG_
+#define _ERROR_CONFIG_
+
+/** enable the dump of the comment */
+#define ERROR_DUMP_TEXTLOG
+
+/** enable the dump of filename and line number */
+#define ERROR_DUMP_FILE_LINE
+
+#endif
Commit from zer0 (2007-12-06 09:58 CET)
================
Add missing files, update pid : modifying derivate filter does
not impact the gain.
+ aversive_projects microb2008/main/rdline_config.h 1.1
=================================================
aversive_projects/microb2008/main/rdline_config.h (1.1)
=================================================
_______________________________________________
Avr-list mailing list
[email protected]
CVSWEB : http://cvsweb.droids-corp.org/cgi-bin/viewcvs.cgi/aversive
WIKI : http://wiki.droids-corp.org/index.php/Aversive
DOXYGEN : http://zer0.droids-corp.org/doxygen_aversive/html/
BUGZILLA : http://bugzilla.droids-corp.org
COMMIT LOGS : http://zer0.droids-corp.org/aversive_commitlog