Sunday, November 28, 2010

New IR Thermometer

After doing more testing with the old IR thermometer (MLX90614) and re-reading the data sheet Ive realized that it isn't appropriate because the field of view (FOV) is too wide. Since our target is very small we need a thermometer with a smaller FOV in order to get a more accurate reading. This seems like a very good option. Let's buy it ASAP.

http://www.futureelectronics.com/en/technologies/semiconductors/analog/sensors/temperature/Pages/4099248-MLX90614ESF-ACF-TU.aspx


MLX90614ESF-ACF-TU

Francisco

Friday, November 5, 2010

Conexion de los arduinos a traves de I2C

Probamos hoy conectar dos arduinos y comunicarlos a traves de I2C. Resulto ser bastante sencillo. Creo que podemos considerar esto como una posibilidad para el proyecto.

Gabriel

Wednesday, November 3, 2010

Tutorial para conectar Arduinos a través de I2C

http://www.instructables.com/id/I2C-between-Arduinos/

Con esto podríamos hacer lo que dice el Profe de usar un Arduino controlado por APM para conectar los sensores.

Gabriel

Setting up Timers in AVR

Aqui hay un tutorial de como utilizar timers en AVR usando assembly. Esta muy bueno.

Gabriel

http://www.avrbeginners.net/


Setting up a Timer

Setting up a timer is pretty simple - once you know how it basically works. Once you've set up a timer successfully you can also use the other modes without much learning as all timer modes are based on the same principles.

Right now, we just want to let an LED light up for 1 second after reset. What do we need for that? The best way is to set up a timer (Timer1, the 16 bit timer), switch the LED on and wait. As the timer overflow has an own interrupt, we can write an ISR that switches the LED off again.

First, some stuff that has to be prepared/kept in mind. The following is assumed:

- The program is running on a AT90S2313, the LED is connected to PortB.4 (this pin doesn't have any special functions), cathode connected to PortB.4 via a current limiting resistor and the anode connected to Vcc. That means that the LED is ON when the port pin is LOW.

- The micro is running at 4MHz

- How do we get the timer to overflow after 1 second? 1 second means 4 Million cycles, so we need a big prescaler: 1024 seems to be good. 4,000,000 / 1024 = 3906,25; so after 3906 timer clock cycles the timer has to overflow. As the timers count UP and then overflow from $FFFF to 0 (that's when the ISR is called), we have to load TCNT1 with -3906 (=0xF0BE)

- The interrupt vector for Timer1 overflow is at address 0x0005

Here's the code: (don't forget to include 2313def.inc!!!)

.org 0x0000
rjmp reset
.org 0x0005
rjmp led_off

reset:
ldi r16, low(RAMEND)
out SPL, r16

ldi r16, high(0xF0BE)
out TCNT1H, r16
ldi r16, low(0xF0BE)
out TCNT1L, r16

ldi r16, 0b00000101
out TCCR1B, r16

ldi r16, 0b10000000
out TIMSK, r16
sei

sbi DDRB, 4
cbi PortB, 4

loop:
rjmp loop

led_off:
push r16
in r16, SREG
push r16

ldi r16, 0
out TCCR1B, r16
sbi PortB, 4

pop r16
out SREG, r16
pop r16
reti
; reset vector address
; when reset occurs, jump to label "reset"
; Timer 1 overflow interrupt vector address
; jump to "led_off"
;
; reset handler:
; setup stack pointer
;
;
; load timer 1 register (TCNT1) with 0xF0BE
;
;
;
;
; set CS10 and CS12 for 1024 cycle prescaler
;
;
; set bit 7 in TIMSK to enable Timer 1 overflow interrupt
;
;and enable global interrupts
;
; set PortB.4 to output
; switch LED on
;
; loop forever (we're waiting for the interrupt)
;
;
; This is the ISR:
; preserve r16
; save MCU status register
;
;
; stop Timer 1 (clear CS10 and CS12)
;
; Turn off LED
;
; restore SREG
;
; restore r16
; return from interrupt

Simulating this code in AVR Studio showed that the LED is turned off after 3999759 cycles. When changing the timer value to 0xF0BD the simulator turns the LED off after 4000783 cycles (3999759 + 1024).

This is not the fastest code you can write for this specific problem. As the micro isn't doing anything during the loop, the ISR doesn't need to preserve any register or the SREG, but I included this anyway to remind you of that important step.

No it's up to you to alter this code to use a prescaler of 256 or turn the LED off after some other time interval. Then the TCCR1B and TCNT1 values change. You can also connect the LED to PortB.3 (Output Capture Pin) and use the Output Compare mode of Timer 1 to make the LED flash! It's now just a matter of reading the datasheet or the AVR Architecture -> Timers page (see "modes").



ArduPilot Telemetry Protocol

http://diydrones.com/profiles/blogs/ardupilot-telemetry-protocol

El autor dice al final:

"I know the protocol sucks but is very flexible and i can add and remove new strings when ever i want without damaging the parsing of every groundstation. In ArduPilot Mega i will use ONLY binary protocol with Message ID's, Payload Bytes and CheckSums, better/faster/efficient/flexible..
"

Hay que explorar si vamos a usar esto como una base para la comunicacion con el ArduRC.

Monday, November 1, 2010

Frames, frame, frames

El frame de Rusty no se si llego a enviar por que PayPal cancelo el pago. Yo recibi un email que traía un tracking number pero lo verifique y no parece que lo haya llegado a enviar. Así que lo mas probable no salio nunca. El esta de vacaciones hasta el 15 así que si no lo envió ya pues no podemos contar con ese frame.

Francisco había conseguido un frame de una compania de Polonia que se ve bastante nice y esta bastante barato. Pero no hab contestado asi que no sabemos si de verdad no los va a vender o no.

La otra opción es una tienda alemana que se llama MikroKopter. Ellos venden un frame que se ve bastante nice aunque es medio caro pero eso no importa. También esta nítido que venden hasta el power distribution board. Otra ventaja es que un tipo en los foros de DIYDrones esta usando este mismo frame así que le podemos preguntar a el si nos pasa algo malo o si no nos funciona. http://www.mikrokopter.de/ucwiki/en/MikroKopter Algo que me preocupa es que dicen que quedan pocos de todos los frames.

Los motores y los props están disponibles en store.aeroquad.com. Ambos están en stock. Lo único que me preocupa un poco son los motores que quedan como 30.

Para pagar en estas tiendas se necesita PayPal. Vamos a tener que crear una.

Gabriel