*** empty log message ***

This commit is contained in:
Antoine Drouin
2006-04-15 20:53:26 +00:00
parent fcfe1bf414
commit 86ce6804c9
37 changed files with 452 additions and 207 deletions
+14
View File
@@ -166,3 +166,17 @@ clean:
find . -name '*~' -exec rm -f {} \;
dist_clean : clean
test_all_example_airframes:
make AIRCRAFT=Tux clean_ac hard_ac
make AIRCRAFT=Plaster clean_ac hard_ac
make AIRCRAFT=Twin1 clean_ac hard_ac
make AIRCRAFT=Twin2 clean_ac hard_ac
make AIRCRAFT=MJ1 clean_ac hard_ac
make AIRCRAFT=TS5 clean_ac fbw
make AIRCRAFT=TJ1 clean_ac ap
make AIRCRAFT=MJ4 clean_ac ap
make AIRCRAFT=GRZE3 clean_ac ap
make AIRCRAFT=Twin4 clean_ac hard_ac
+18 -1
View File
@@ -76,7 +76,7 @@
<define name="VOLTAGE_ADC_A" value="0.0178771"/>
<define name="VOLTAGE_ADC_B" value="-0.556983"/>
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/>
<define name="LOW_BATTERY" value="90" unit="1e-1V"/>
<define name="LOW_BATTERY" value="9.0" unit="V"/>
</section>
<section name="SERVOS" channel="6">
<define name="SERVOS_FALLING_EDGE" value="1"/>
@@ -104,11 +104,28 @@
<define name="THETA0" value="45" unit="deg"/>
<define name="PHI0" value="45" unit="deg"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\"
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
ap.CFLAGS += -DINFRARED -DGPS -DUBX
# -DRADIO_CONTROL_CALIB
# ap.EXTRA_SRCS += if_calib.c
</makefile>
</airframe>
+16
View File
@@ -133,9 +133,25 @@
<define name="NOMINAL_AIRSPEED" value="10." unit="m/s"/>
<define name="CARROT" value="5." unit="s"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/disc_board.makefile
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\"servos_esc_hw.h\" -DTIMER3 -DTIMER1_TOP=0x400
ap.srcs += $(SRC_ARCH)/servos_esc_hw.c
ap.CFLAGS += -DRADIO_CONTROL
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
ap.CFLAGS += -DDOWNLINK -DUART0
ap.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
# ap.CFLAGS += -DDEBUG_RC
# LOCAL_CFLAGS += -DIMU_3DMG
+31 -14
View File
@@ -1,13 +1,6 @@
<airframe name="Microjet one">
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="0"/>
<define name="AIRSPEED" value="2"/>
<define name="CURRENT " value="3"/>
<define name="BAT" value="4"/>
</section>
<servos min="1000" neutral="1500" max="2000">
<servos>
<servo name="GAZ" no="3" min="1000" neutral="1000" max="2000"/>
<servo name="AILEVON_LEFT" no="0" min="1800" neutral="1492" max="1179"/>
<servo name="AILEVON_RIGHT" no="2" min="1990" neutral="1662" max="1389"/>
@@ -25,6 +18,11 @@
<set command="PITCH" value="@PITCH"/>
</rc_commands>
<section name="MIXER">
<define name="AILEVON_AILERON_RATE" value="0.55"/>
<define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
</section>
<command_laws>
<set servo="GAZ" value="@THROTTLE"/>
<let var="aileron" value="@ROLL * AILEVON_AILERON_RATE"/>
@@ -33,12 +31,16 @@
<set servo="AILEVON_RIGHT" value="$aileron - $elevator"/>
</command_laws>
<section name="MIXER">
<define name="AILEVON_AILERON_RATE" value="0.55"/>
<define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="0"/>
<define name="AIRSPEED" value="2"/>
<define name="CURRENT " value="3"/>
<define name="BAT" value="4"/>
</section>
<section name="INFRARED" prefix="IR_">
<section name="INFRARED" prefix="IR_">
<define name="ADC_ROLL_NEUTRAL" value="0"/>
<define name="ADC_PITCH_NEUTRAL" value="1040"/>
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
@@ -77,7 +79,7 @@
<define name="VOLTAGE_ADC_A" value="0.016768"/>
<define name="VOLTAGE_ADC_B" value="0.089803"/>
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/>
<define name="LOW_BATTERY" value="90" unit="1e-1V"/>
<define name="LOW_BATTERY" value="9.0" unit="1V"/>
</section>
<section name="MISC">
<define name="NOMINAL_AIRSPEED" value="15."/>
@@ -95,8 +97,23 @@
<define name="DEFAULT_PITCH" value="0.08" unit="rad"/>
<define name="HOME_RADIUS" value="50" unit="m"/>
</section>
<makefile>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\"
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
ap.CFLAGS += -DGPS -DUBX -DINFRARED
+19 -13
View File
@@ -14,6 +14,12 @@
<axis name="PITCH" failsafe_value="0"/>
</commands>
<rc_commands>
<set command="THROTTLE" value="@THROTTLE"/>
<set command="ROLL" value="@ROLL"/>
<set command="PITCH" value="@PITCH"/>
</rc_commands>
<section name="MIXER">
<define name="AILEVON_AILERON_RATE" value="0.55"/>
<define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
@@ -27,17 +33,12 @@
<set servo="AILEVON_RIGHT" value="$elevator - $aileron"/>
</command_laws>
<control>
<mode name="MANUAL">
<input input="rc_values[RADIO_THROTTLE]" output="control_commands[COMMAND_THROTTLE]" range="1"/>
<input input="rc_values[RADIO_ROLL]" output="control_commands[COMMAND_ROLL]" range="1"/>
<input input="rc_values[RADIO_PITCH]" output="control_commands[COMMAND_PITCH]" range="1"/>
</mode>
</control>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/tiny_test.makefile
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
#ap.CFLAGS += -DTRACES=uart0
#ap.EXTRA_SRCS += $(SRC_ARCH)/traces.c $(SRC_ARCH)/uart.c
#ap.CFLAGS += -DRADIO_CONTROL
@@ -55,13 +56,18 @@ include $(PAPARAZZI_SRC)/conf/autopilot/tiny_test.makefile
#ap.EXTRA_SRCS += $(SRC_ARCH)/modem_hw.c
#ap.CFLAGS += -DDOWNLINK
ap.srcs += commands.c inter_mcu.c
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\"
ap.srcs += $(SRC_ARCH)/servos_4017_hw.c
ap.CFLAGS += -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015
ap.srcs += $(SRC_ARCH)/servos_4015_hw.c
ap.CFLAGS += -DRADIO_CONTROL
ap.srcs += $(SRC_ARCH)/ppm_hw.c
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
ap.CFLAGS += -DDOWNLINK -DUSE_UART0
ap.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
ap.srcs += inter_mcu.c $(SRC_ARCH)/adc_hw.c
</makefile>
</airframe>
+20 -1
View File
@@ -106,10 +106,29 @@
<define name="THETA0" value="45" unit="deg"/>
<define name="PHI0" value="-45" unit="deg"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2_1.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\" -DSERVOS_4017
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
ap.CFLAGS += -DGPS -DUBX -DINFRARED
fbw.CFLAGS += -DDEBUG
fbw.CFLAGS += -DDEBUG
</makefile>
</airframe>
+21
View File
@@ -87,15 +87,36 @@
<define name="VoltageOfAdc(adc)" value="4.2"/>
<define name="LOW_BATTERY" value="9" unit="V"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/robostix.makefile
ap.srcs += commands.c
ap.CFLAGS += -DACTUATORS=\"servos_direct_hw.h\"
ap.srcs += $(SRC_ARCH)/servos_direct_hw.c
ap.CFLAGS += -DRADIO_CONTROL
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
ap.CFLAGS += -DDOWNLINK -DUART0
ap.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
#ap.CFLAGS += -DCONTROL -DAUTOPILOT
#ap.EXTRA_SRCS += $(ACINCLUDE)/ap/control.c
#ap.CFLAGS += -DADC
#ap.EXTRA_SRCS += $(SRC_ARCH)/adc_hw.c
#ap.CFLAGS += -DDATALINK
#ap.EXTRA_SRCS += datalink.c nav.c estimator.c
</makefile>
</airframe>
+31 -17
View File
@@ -1,19 +1,11 @@
<airframe name="Twin1">
<section name="control board">
<define name="AVR_ARCH" value="1"/>
</section>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<servos min="1000" neutral="1500" max="2000">
<servo name="GAZ" no="9" min="1000" neutral="1000" max="2000"/>
<servo name="AILERON_LEFT" no="2" min="1100" neutral="1492" max="2000"/>
<servos>
<servo name="GAZ" no="9" min="1000" neutral="1000" max="2000"/>
<servo name="AILERON_LEFT" no="2" min="1100" neutral="1492" max="2000"/>
<servo name="AILERON_RIGHT" no="6" min="1000" neutral="1385" max="1833"/>
<servo name="ELEVATOR" no="7" min="1816" neutral="1586" max="1220"/>
<servo name="RUDDER" no="3" min="1270" neutral="1546" max="1850"/>
<servo name="ELEVATOR" no="7" min="1816" neutral="1586" max="1220"/>
<servo name="RUDDER" no="3" min="1270" neutral="1546" max="1850"/>
</servos>
<commands>
@@ -30,6 +22,11 @@
<set command="YAW" value="@YAW"/>
</rc_commands>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
</section>
<command_laws>
<set servo="GAZ" value="2 * @THROTTLE"/>
<set servo="ELEVATOR" value="@PITCH"/>
@@ -39,10 +36,11 @@
<set servo="RUDDER" value="@YAW + @ROLL*COMBI_SWITCH"/>
</command_laws>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<section name="INFRARED" prefix="IR_">
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
@@ -104,9 +102,25 @@
<define name="THETA0" value="0" unit="deg"/>
<define name="PHI0" value="30" unit="deg"/>
</section>
<makefile>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2_1.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\" -DSERVOS_4017
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
ap.CFLAGS += -DGPS -DUBX -DINFRARED
ap.CFLAGS += -Werror
+30 -8
View File
@@ -1,9 +1,6 @@
<airframe name="Twin2">
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<servos min="1000" neutral="1500" max="2000">
<servos>
<servo name="GAZ" no="9" min="1000" neutral="1000" max="2000"/>
<servo name="AILERON_LEFT" no="2" min="1100" neutral="1492" max="2000"/>
<servo name="AILERON_RIGHT" no="6" min="1000" neutral="1385" max="1833"/>
@@ -29,6 +26,11 @@
<set command="YAW" value="@YAW"/>
</rc_commands>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
</section>
<command_laws>
<set servo="GAZ" value="2 * @THROTTLE"/>
<set servo="ELEVATOR" value="@PITCH"/>
@@ -37,10 +39,12 @@
<set servo="AILERON_RIGHT" value="($roll > 0 ? AILERON_DIFF : 1) * $roll"/>
<set servo="RUDDER" value="@YAW + @ROLL*COMBI_SWITCH"/>
</command_laws>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<section name="INFRARED" prefix="IR_">
<define name="ROLL_NEUTRAL_DEFAULT" value="0" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="0" unit="deg"/>
@@ -102,9 +106,27 @@
<define name="THETA0" value="15" unit="deg"/>
<define name="PHI0" value="-30" unit="deg"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2_1.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\" -DSERVOS_4017
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
fbw.CFLAGS += -Werror
ap.CFLAGS += -DGPS -DUBX -DINFRARED
ap.CFLAGS += -DDATALINK
ap.EXTRA_SRCS += traffic_info.c datalink.c
+38 -10
View File
@@ -1,9 +1,6 @@
<airframe name="Twinstar four">
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<servos min="1000" neutral="1500" max="2000">
<servos>
<servo name="GAZ" no="3" min="1000" neutral="1000" max="2000"/>
<servo name="AILERON_LEFT" no="0" max="1190" neutral="1530" min="1850"/>
<servo name="AILERON_RIGHT" no="2" max="1375" neutral="1580" min="2000"/>
@@ -25,6 +22,17 @@
<axis name="CALIB" failsafe_value="0"/>
</commands>
<rc_commands>
<set command="THROTTLE" value="@THROTTLE"/>
<set command="ROLL" value="@ROLL"/>
<set command="PITCH" value="@PITCH"/>
</rc_commands>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
</section>
<command_laws>
<set servo="GAZ" value="2 * @THROTTLE"/>
<set servo="ELEVATOR" value="@PITCH"/>
@@ -36,10 +44,12 @@
<set servo="CAM_PITCH" value="@CALIB"/>
</command_laws>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
<section name="adc" prefix="ADC_CHANNEL_">
<define name="IR1" value="1"/>
<define name="IR2" value="2"/>
</section>
<section name="INFRARED" prefix="IR_">
<define name="ROLL_NEUTRAL_DEFAULT" value="6" unit="deg"/>
<define name="PITCH_NEUTRAL_DEFAULT" value="5" unit="deg"/>
@@ -81,7 +91,7 @@
<define name="VOLTAGE_ADC_A" value="0.0175"/>
<define name="VOLTAGE_ADC_B" value="0.088"/>
<define name="VoltageOfAdc(adc)" value="(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)"/>
<define name="LOW_BATTERY" value="93" unit="1e-1V"/>
<define name="LOW_BATTERY" value="9.3" unit="V"/>
</section>
<section name="MISC">
<define name="NOMINAL_AIRSPEED" value="10." unit="m/s"/>
@@ -99,9 +109,27 @@
<define name="DEFAULT_PITCH" value="0.08" unit="rad"/>
<define name="HOME_RADIUS" value="50" unit="m"/>
</section>
<makefile>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/v1_2_1.makefile
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017.h\" -DSERVOS_4017
fbw.srcs += $(SRC_ARCH)/servos_4017.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.CFLAGS += -DDOWNLINK -DUART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
fbw.CFLAGS += -DDEBUG
ap.CFLAGS += -DINFRARED -DGPS -DUBX -DRADIO_CONTROL_CALIB
ap.CFLAGS += -DLED -DLED_1_BANK=D -DLED_1_PIN=0 -DLED_2_BANK=D -DLED_2_PIN=1
ap.EXTRA_SRCS += if_calib.c
+15 -6
View File
@@ -26,6 +26,11 @@
<set command="YAW" value="@YAW"/>
</rc_commands>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
</section>
<command_laws>
<set servo="GAZ" value="@THROTTLE"/>
<set servo="ELEVATOR" value="@PITCH"/>
@@ -37,10 +42,6 @@
<set servo="CAM_PITCH" value="@CAM_PITCH"/>
</command_laws>
<section name="MIXER">
<define name="AILERON_DIFF" value="0.66"/>
<define name="COMBI_SWITCH" value="1.0"/>
</section>
<section name="INFRARED" prefix="IR_">
<define name="ROLL_NEUTRAL_DEFAULT" value="6" unit="deg"/>
@@ -109,6 +110,11 @@
<define name="HOME_RADIUS" value="50" unit="m"/>
</section>
<section name="DOWNLINK" prefix="DOWNLINK_">
<define name="FBW_DEVICE" value="uart0"/>
</section>
<makefile>
ap.CFLAGS += -DTIME_LED=2
include $(PAPARAZZI_SRC)/conf/autopilot/classix.makefile
@@ -123,13 +129,16 @@ ap.srcs += $(SRC_ARCH)/modem_hw.c
fbw.srcs += commands.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\"
fbw.CFLAGS += -DDOWNLINK -DUSE_UART0
fbw.srcs += fbw_downlink.c $(SRC_ARCH)/uart_hw.c
fbw.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -DSERVOS_4017_CLOCK_FALLING
fbw.srcs += $(SRC_ARCH)/servos_4017_hw.c
fbw.CFLAGS += -DRADIO_CONTROL
fbw.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
fbw.srcs += inter_mcu.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/adc_hw.c
fbw.srcs += inter_mcu.c $(SRC_ARCH)/adc_hw.c
</makefile>
</airframe>
+3 -3
View File
@@ -8,6 +8,6 @@ ap.LOW_FUSE = a0
ap.HIGH_FUSE = 99
ap.EXT_FUSE = ff
ap.LOCK_FUSE = ff
ap.CFLAGS += -DFBW -DCONFIG=\"config_discboard.h\" -DTIMER3 -DTIMER1_TOP=0x400 -DRADIO_CONTROL -DACTUATORS=\"servos_esc_hw.h\" -DUART0 -DDOWNLINK
ap.srcs = sys_time.c radio_control.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_esc_hw.c commands.c main_fbw.c main.c
# inter_mcu.c pid.c estimator.c if_calib.c nav.c main_ap.c mainloop.c main.c
ap.CFLAGS += -DFBW -DCONFIG=\"config_discboard.h\"
ap.srcs = inter_mcu.c $(SRC_ARCH)/adc_hw.c sys_time.c main_fbw.c main.c
# pid.c estimator.c if_calib.c nav.c main_ap.c mainloop.c main.c
+2 -2
View File
@@ -10,6 +10,6 @@ ap.LOW_FUSE = 0xbf
ap.HIGH_FUSE = 0xc9
ap.EXT_FUSE = ff
ap.LOCK_FUSE = ff
ap.CFLAGS += -DFBW -DCONFIG=\"config_robostix.h\" -DLED -DRADIO_CONTROL -DACTUATORS=\"servos_direct_hw.h\" -DUART0
ap.srcs = sys_time.c radio_control.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_direct_hw.c commands.c main_fbw.c main.c
ap.CFLAGS += -DFBW -DCONFIG=\"config_robostix.h\" -DLED
ap.srcs = sys_time.c $(SRC_ARCH)/adc_hw.c main_fbw.c main.c
# ap.srcs += main_ap.c
+5 -3
View File
@@ -6,6 +6,8 @@ ap.ARCHDIR = $(ARCHI)
ap.ARCH = arm7tdmi
ap.TARGET = autopilot
ap.TARGETDIR = autopilot
ap.CFLAGS += -DAP -DFBW -DCONFIG=\"config_tiny.h\" -DLED -DRADIO_CONTROL -DACTUATORS -DGPS -DUBX
ap.srcs = estimator.c gps_ubx.c gps.c $(SRC_ARCH)/uart.c radio_control.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/servos_hw.c $(SRC_ARCH)/armVIC.c sys_time.c main_fbw_2.c main_ap_2.c main.c
ap.CFLAGS += -DFBW -DCONFIG=\"config_tiny.h\"
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main.c
#ap.CFLAGS += -DAP -DLED -DGPS -DUBX
#ap.srcs = main_ap_2.c
# estimator.c gps_ubx.c gps.c
+2 -2
View File
@@ -19,5 +19,5 @@ fbw.LOW_FUSE = 2e
fbw.HIGH_FUSE = cb
fbw.EXT_FUSE = ff
fbw.LOCK_FUSE = ff
fbw.CFLAGS += -DFBW -DRADIO_CONTROL -DINTER_MCU -DMCU_SPI_LINK -DACTUATORS=\"servos_4017.h\" -DUART0 -DDOWNLINK
fbw.srcs = $(SRC_ARCH)/ppm_hw.c commands.c radio_control.c inter_mcu.c $(SRC_ARCH)/servos_4017.c $(SRC_ARCH)/spi_fbw.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/adc_hw.c sys_time.c main_fbw.c main.c
fbw.CFLAGS += -DFBW -DINTER_MCU -DMCU_SPI_LINK
fbw.srcs = inter_mcu.c $(SRC_ARCH)/spi_fbw.c $(SRC_ARCH)/adc_hw.c sys_time.c main_fbw.c main.c
-2
View File
@@ -275,8 +275,6 @@
</class>
<class name="ground" ID="0x42">
<message name="NEW_AIRCRAFT" ID="1">
<field name="ac_id" type="string"/>
+1 -2
View File
@@ -26,9 +26,8 @@
#if defined ACTUATORS
#include "paparazzi.h"
#include "airframe.h"
/** Defines SetActuatorsFromCommands() macro */
#include "airframe.h"
extern void actuators_init( void );
+37 -12
View File
@@ -1,16 +1,48 @@
#include "servos_4015_hw.h"
#include "command.h"
#include "actuators.h"
#include "armVIC.h"
#include "airframe.h"
#include "sys_time.h"
//#include "led.h"
const pprz_t failsafe_values[COMMANDS_NB] = COMMANDS_FAILSAFE;
#define COMMAND(i) servos_values[i]
#define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s)
void actuators_init ( void ) {
/* PWM selected as IRQ */
VICIntSelect &= ~VIC_BIT(VIC_PWM);
/* PWM interrupt enabled */
VICIntEnable = VIC_BIT(VIC_PWM);
VICVectCntl3 = VIC_ENABLE | VIC_PWM;
/* address of the ISR */
VICVectAddr3 = (uint32_t)PWM_ISR;
/* PW5 pin (P0.21) used for PWM */
IO0DIR |= _BV(SERV0_CLOCK_PIN);
IO1DIR |= _BV(SERV0_DATA_PIN) | _BV(SERV0_RESET_PIN);
SERV0_CLOCK_PINSEL |= SERV0_CLOCK_PINSEL_VAL << SERV0_CLOCK_PINSEL_BIT;
/* set match5 to go of a long time from now */
PWMMR0 = 0XFFFFFF;
//PWMMR0 = CLOCK_OF_US(1500);
PWMMR5 = 0XFFF;
/* commit above change */
PWMLER = PWMLER_LATCH0 | PWMLER_LATCH5;
/* interrupt on PWMMR5 match */
PWMMCR = PWMMCR_MR0R | PWMMCR_MR5I;
/* enable PWM5 ouptput */
PWMPCR = PWMPCR_ENA5;
/* enable PWM timer counter and PWM mode */
PWMTCR = PWMTCR_COUNTER_ENABLE | PWMTCR_PWM_ENABLE;
/* Load failsafe values */
/* Set all servos at their midpoints */
/* compulsory for unaffected servos */
uint8_t i;
for( i=0 ; i < _4015_NB_CHANNELS ; i++ )
servos_values[i] = SERVOS_TICS_OF_USEC(1500);
}
uint16_t servos_values[_4015_NB_CHANNELS];
#define CLOCK_OF_US(us) ((us)*(PCLK/1000000))
@@ -20,14 +52,7 @@ const pprz_t failsafe_values[COMMANDS_NB] = COMMANDS_FAILSAFE;
#define SERV7_START_POS 1600
#define NB_SERVOS 4
#define SERVO_REFRESH_US 25000
uint32_t servos_values[NB_SERVOS] =
{ CLOCK_OF_US(SERV4_START_POS),
CLOCK_OF_US(SERV5_START_POS),
CLOCK_OF_US(SERV6_START_POS),
CLOCK_OF_US(SERV7_START_POS)
};
uint32_t servos_delay = CLOCK_OF_US(SERVO_REFRESH_US - SERV4_START_POS - SERV5_START_POS - SERV6_START_POS - SERV7_START_POS) / 2;
uint8_t servos_idx = 0;
@@ -44,7 +69,7 @@ void PWM_ISR ( void ) {
PWMLER = PWMLER_LATCH0;
servos_idx++;
}
else if (servos_idx < NB_SERVOS) {
else if (servos_idx < _4015_NB_CHANNELS) {
IO1CLR = _BV(SERV0_DATA_PIN);
PWMMR0 = servos_values[servos_idx];
PWMLER = PWMLER_LATCH0;
+9 -28
View File
@@ -1,41 +1,22 @@
#ifndef SERVOS_4015_HW_H
#define SERVOS_4015_HW_H
#include <inttypes.h>
#include "std.h"
#include "LPC21xx.h"
#include "sys_time.h"
#include CONFIG
#define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s)
#define ChopServo(x,a,b) Chop(x, a, b)
#define _4015_NB_CHANNELS 8
extern uint16_t servos_values[_4015_NB_CHANNELS];
#define Actuator(i) servos_values[i]
void PWM_ISR ( void ) __attribute__((naked));
static inline void command_init ( void ) {
/* PWM selected as IRQ */
VICIntSelect &= ~VIC_BIT(VIC_PWM);
/* PWM interrupt enabled */
VICIntEnable = VIC_BIT(VIC_PWM);
VICVectCntl3 = VIC_ENABLE | VIC_PWM;
/* address of the ISR */
VICVectAddr3 = (uint32_t)PWM_ISR;
/* PW5 pin (P0.21) used for PWM */
IO0DIR |= _BV(SERV0_CLOCK_PIN);
IO1DIR |= _BV(SERV0_DATA_PIN) | _BV(SERV0_RESET_PIN);
SERV0_CLOCK_PINSEL |= SERV0_CLOCK_PINSEL_VAL << SERV0_CLOCK_PINSEL_BIT;
/* set match5 to go of a long time from now */
PWMMR0 = 0XFFFFFF;
//PWMMR0 = CLOCK_OF_US(1500);
PWMMR5 = 0XFFF;
/* commit above change */
PWMLER = PWMLER_LATCH0 | PWMLER_LATCH5;
/* interrupt on PWMMR5 match */
PWMMCR = PWMMCR_MR0R | PWMMCR_MR5I;
/* enable PWM5 ouptput */
PWMPCR = PWMPCR_ENA5;
/* enable PWM timer counter and PWM mode */
PWMTCR = PWMTCR_COUNTER_ENABLE | PWMTCR_PWM_ENABLE;
/* Load failsafe values */
command_set(failsafe_values);
}
#endif /* SERVOS_4015_HW_H */
-6
View File
@@ -1,13 +1,7 @@
#include "actuators.h"
#include "LPC21xx.h"
#include CONFIG
#include "std.h"
#include "paparazzi.h"
#include "airframe.h"
#include "actuators.h"
uint8_t servos_4017_idx;
+3 -2
View File
@@ -2,12 +2,13 @@
#define SERVOS_4017_HW_H
#include <inttypes.h>
#include "std.h"
#include "LPC21xx.h"
#include "sys_time.h"
#include "led.h"
#define SERVOS_4017_CLOCK_FALLING 1
#include CONFIG
#define SERVOS_TICS_OF_USEC(s) SYS_TICS_OF_USEC(s)
+6 -1
View File
@@ -7,19 +7,24 @@
#warning "FIXMEEE - i fear that if two T0IR flags are up together I might discard an IT"
#warning "And I've seen crashes: don't fly with that"
#define TIMER0_IT_MASK (TIR_CR2I | TIR_MR1I)
void TIMER0_ISR ( void ) {
ISR_ENTRY();
if (T0IR&TIR_CR2I) {
PPM_ISR();
/* clear interrupt */
T0IR = TIR_CR2I;
}
#ifdef SERVOS_4017
else if (T0IR&TIR_MR1I) {
SERVOS_4017_ISR();
/* clear interrupt */
T0IR = TIR_MR1I;
}
#endif
VICVectAddr = 0x00000000;
ISR_EXIT();
}
+7
View File
@@ -35,6 +35,13 @@ void uart0_init_rx( void ) {
}
bool_t uart0_check_free_space( uint8_t len) {
int16_t space;
if ((space = (uart0_tx_extract_idx - uart0_tx_insert_idx)) <= 0)
space += UART0_TX_BUFFER_SIZE;
return (uint16_t)(space - 1) >= len;
}
void uart0_transmit( unsigned char data ) {
#ifdef UART0_TX_INT_MODE
-1
View File
@@ -26,7 +26,6 @@
//// ADC6 MVSERVO
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <avr/io.h>
#include "adc.h"
+1 -2
View File
@@ -23,9 +23,8 @@
*/
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <avr/crc16.h>
#include <util/crc16.h>
#include "inter_mcu.h"
#include "link_mcu_ap.h"
-1
View File
@@ -28,7 +28,6 @@
#include <inttypes.h>
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <stdlib.h>
#include "modem.h"
+1 -3
View File
@@ -23,7 +23,7 @@
*
*/
#include <avr/signal.h>
#include <avr/interrupt.h>
#include "ppm.h"
#include "sys_time.h"
@@ -67,8 +67,6 @@ SIGNAL( SIG_INPUT_CAPTURE1 )
static uint8_t state = 0;
static uint8_t sync_start;
#include "led.h"
this = ICR1;
#ifdef TIMER1_TOP
this += tmr1_ov_cnt;
+1 -1
View File
@@ -25,7 +25,7 @@
/** Implementation of actuators.h */
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include "servos_4017.h"
#include "actuators.h"
#include "sys_time.h"
-1
View File
@@ -24,7 +24,6 @@
#include <inttypes.h>
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
+1 -2
View File
@@ -26,9 +26,8 @@
#include <inttypes.h>
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <avr/crc16.h>
#include <util/crc16.h>
#include "inter_mcu.h"
#include "spi_fbw.h"
+67 -52
View File
@@ -22,7 +22,6 @@
*
*/
#include <avr/signal.h>
#include <avr/interrupt.h>
#include <avr/io.h>
@@ -62,6 +61,14 @@ void uart0_init_rx( void ) {
sbi( UCSRB, RXCIE );
}
bool_t uart0_check_free_space( uint8_t len) {
int8_t space;
if ((space = (tx_tail - tx_head)) <= 0)
space += TX_BUF_SIZE;
return (uint8_t)(space - 1) >= len;
}
void uart0_transmit( unsigned char data ) {
if (UCSRB & _BV(TXCIE)) {
/* we are waiting for the last char to be sent : buffering */
@@ -101,57 +108,6 @@ static uint8_t tx_head1; /* next free in buf */
static volatile uint8_t tx_tail1; /* next char to send */
static uint8_t tx_buf1[ TX_BUF_SIZE ];
void uart0_transmit( unsigned char data ) {
if (UCSR0B & _BV(TXCIE)) {
/* we are waiting for the last char to be sent : buffering */
if (tx_tail0 == tx_head0 + 1) { /* BUF_SIZE = 256 */
/* Buffer is full (almost, but tx_head = tx_tail means "empty" */
return;
}
tx_buf0[tx_head0] = data;
tx_head0++; /* BUF_SIZE = 256 */
} else { /* Channel is free: just send */
UDR0 = data;
sbi(UCSR0B, TXCIE);
}
}
void uart1_transmit( unsigned char data ) {
if (UCSR1B & _BV(TXCIE)) {
/* we are waiting for the last char to be sent : buffering */
if (tx_tail1 == tx_head1 + 1) { /* BUF_SIZE = 256 */
/* Buffer is full (almost, but tx_head = tx_tail means "empty" */
return;
}
tx_buf1[tx_head1] = data;
tx_head1++; /* BUF_SIZE = 256 */
} else { /* Channel is free: just send */
UDR1 = data;
sbi(UCSR1B, TXCIE);
}
}
SIGNAL(SIG_UART0_TRANS) {
if (tx_head0 == tx_tail0) {
/* Nothing more to send */
cbi(UCSR0B, TXCIE); /* disable interrupt */
} else {
UDR0 = tx_buf0[tx_tail0];
tx_tail0++; /* warning tx_buf_len is 256 */
}
}
SIGNAL(SIG_UART1_TRANS) {
if (tx_head1 == tx_tail1) {
/* Nothing more to send */
cbi(UCSR1B, TXCIE); /* disable interrupt */
} else {
UDR1 = tx_buf1[tx_tail1];
tx_tail1++; /* warning tx_buf_len is 256 */
}
}
void uart0_init_tx( void ) {
/* Baudrate is 38.4k */
UBRR0H = 0;
@@ -177,6 +133,40 @@ void uart0_init_rx( void ) {
sbi(UCSR0B, RXCIE );
}
bool_t uart0_check_free_space( uint8_t len) {
int8_t space;
if ((space = (tx_tail0 - tx_head0)) <= 0)
space += TX_BUF_SIZE;
return (uint16_t)(space - 1) >= len;
}
void uart0_transmit( unsigned char data ) {
if (UCSR0B & _BV(TXCIE)) {
/* we are waiting for the last char to be sent : buffering */
if (tx_tail0 == tx_head0 + 1) { /* BUF_SIZE = 256 */
/* Buffer is full (almost, but tx_head = tx_tail means "empty" */
return;
}
tx_buf0[tx_head0] = data;
tx_head0++; /* BUF_SIZE = 256 */
} else { /* Channel is free: just send */
UDR0 = data;
sbi(UCSR0B, TXCIE);
}
}
SIGNAL(SIG_UART0_TRANS) {
if (tx_head0 == tx_tail0) {
/* Nothing more to send */
cbi(UCSR0B, TXCIE); /* disable interrupt */
} else {
UDR0 = tx_buf0[tx_tail0];
tx_tail0++; /* warning tx_buf_len is 256 */
}
}
void uart1_init_tx( void ) {
/* Baudrate is 38.4k */
UBRR1H = 0;
@@ -197,6 +187,31 @@ void uart1_init_rx( void ) {
sbi(UCSR1B, RXCIE );
}
void uart1_transmit( unsigned char data ) {
if (UCSR1B & _BV(TXCIE)) {
/* we are waiting for the last char to be sent : buffering */
if (tx_tail1 == tx_head1 + 1) { /* BUF_SIZE = 256 */
/* Buffer is full (almost, but tx_head = tx_tail means "empty" */
return;
}
tx_buf1[tx_head1] = data;
tx_head1++; /* BUF_SIZE = 256 */
} else { /* Channel is free: just send */
UDR1 = data;
sbi(UCSR1B, TXCIE);
}
}
SIGNAL(SIG_UART1_TRANS) {
if (tx_head1 == tx_tail1) {
/* Nothing more to send */
cbi(UCSR1B, TXCIE); /* disable interrupt */
} else {
UDR1 = tx_buf1[tx_tail1];
tx_tail1++; /* warning tx_buf_len is 256 */
}
}
uint8_t uart1_char;
bool_t uart1_char_available;
-1
View File
@@ -31,7 +31,6 @@
#define UART_HW_H
#include <avr/io.h>
#include <avr/signal.h>
#include <avr/interrupt.h>
#include "std.h"
+45 -3
View File
@@ -25,15 +25,57 @@
#ifndef FBW_DOWNLINK_H
#define FBW_DOWNLINK_H
#include "inttypes.h"
#include "messages_fbw.h"
#include "airframe.h"
#define PERIODIC_SEND_PPM() { Uart0PrintString("SEND_PPM\n"); }
#include "uart.h"
#include "main_fbw.h"
#include "radio_control.h"
extern uint8_t ck_a, ck_b;
extern uint8_t downlink_nb_ovrn;
#define STX 0x05
#define __DownlinkCheckFreeSpace(dev, _x) dev ##_check_free_space(_x)
#define _DownlinkCheckFreeSpace(dev, _x) __DownlinkCheckFreeSpace(dev, _x)
#define DownlinkCheckFreeSpace(_x) _DownlinkCheckFreeSpace(DOWNLINK_FBW_DEVICE, _x)
#define __DownlinkPut1Byte(dev, _x) dev ##_transmit(_x)
#define _DownlinkPut1Byte(dev, _x) __DownlinkPut1Byte(dev, _x)
#define DownlinkPut1Byte(_x) _DownlinkPut1Byte(DOWNLINK_FBW_DEVICE, _x)
#define PERIODIC_SEND_PPM() {}
//#define PERIODIC_SEND_SERVOS() { Uart0PrintString("SERVOS\n");}
#define PERIODIC_SEND_SERVOS() {}
#define PERIODIC_SEND_FBW_STATUS() {}
#define PERIODIC_SEND_FBW_STATUS() {DOWNLINK_SEND_FBW_STATUS(&fbw_mode, &rc_status, &fbw_mode)}
#define PERIODIC_SEND_RC() {}
/** 5 = STX + ac_id + msg_id + ck_a + ck_b */
#define DownlinkSizeOf(_payload) (_payload+5)
#define DownlinkPut1ByteUpdateCs(_byte) { \
ck_a += _byte; \
ck_b += ck_a; \
DownlinkPut1Byte(_byte); \
}
#define DownlinkPut1ByteByAddr(_byte) { \
uint8_t _x = *(_byte); \
DownlinkPut1ByteUpdateCs(_x); \
}
#define DownlinkStartMessage(id) \
{ DownlinkPut1Byte(STX); DownlinkPut1Byte(id); ck_a = id; ck_b = id; DownlinkPut1ByteUpdateCs(AC_ID);}
#define DownlinkEndMessage() \
{ DownlinkPut1Byte(ck_a); DownlinkPut1Byte(ck_b); }
static inline void fbw_downlink_periodic_task(void) {
PeriodicSend()
}
}
#endif /* FBW_DOWNLINK_H */
+2 -2
View File
@@ -1,7 +1,7 @@
#include "main_ap.h"
#include "low_level_hw.h"
#include "sys_time.h"
#include "init_hw.h"
#include "int.h"
#include "sys_time.h"
#include "led.h"
#include "modem.h"
#include "gps.h"
+2 -2
View File
@@ -87,8 +87,9 @@ void init_fbw( void ) {
#endif
sys_time_init();
#ifdef ACTUATORS
actuators_init();
#endif
/* Load the failsafe defaults */
SetCommands(commands_failsafe);
@@ -134,7 +135,6 @@ void event_task_fbw( void) {
if (ap_ok && fbw_mode == FBW_MODE_AUTO) {
SetCommands(from_ap.from_ap.channels);
}
#endif
#ifdef IMU_3DMG
+2 -1
View File
@@ -26,7 +26,7 @@
#define UART_H
#include <inttypes.h>
#include "std.h"
#include "uart_hw.h"
void uart0_init_tx( void );
@@ -35,6 +35,7 @@ void uart0_init_rx( void );
/** uart0_init_tx() must be called BEFORE */
void uart0_transmit( unsigned char data );
bool_t uart0_check_free_space( uint8_t len);
/** Not necessarily defined */
void uart1_init_tx( void );
+2 -2
View File
@@ -25,7 +25,7 @@
open Latlong
open Printf
module W = Wavecard
module Tm_Pprz = Pprz.Protocol(struct let name = "telemetry_ap" end)
module Tm_Pprz = Pprz.Protocol(struct let name = "telemetry_fbw" end)
module Ground_Pprz = Pprz.Protocol(struct let name = "ground" end)
module Dl_Pprz = Pprz.Protocol(struct let name = "datalink" end)
module PprzTransport = Serial.Transport(Tm_Pprz)
@@ -182,7 +182,7 @@ let _ =
Ivy.start !ivy_bus;
try
let fd = Serial.opendev !port Serial.B9600 in
let fd = Serial.opendev !port Serial.B38400 in
let ac = { fd=fd; } in
(* Listening on wavecard *)
let cb = fun _ ->