paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Difference between paparazzi tiny and booz boards


From: Christophe De Wagter
Subject: Re: [Paparazzi-devel] Difference between paparazzi tiny and booz boards
Date: Tue, 3 Jul 2012 10:51:34 +0200

Servo pulses are created by hardware counters with output compare logic in the microcontroller. A timer automatically counts and below a certain (compare) value a pin is set high and above it is set low. The easiest way to do that is to have 1 PWM generator per servo. Then the software only needs to configure things once: namely: enable the counting and set the compare value. Then all is ready and pulses will continue to come automatically forever. This idea is found in the classix autopilot (ppm_direct driver) and all Lisa autopilots. But you need a lot of PWM generators in the microcontroller and you need  a lot of pins.

The LPC21 has not so many PWM counters (4/5 left after using serial/i2c/...), needed to create servo pulses. Therefore the creators of the tiny board added a "decade counter"... a chip that basically counts to 10. This is the same chip you find in analog receivers to split a combined pulse-train of several pulses into separate pulses per servo. Now the tiny/yapa autopilots can drive 10 servo's using only 1 PWM counter. The drawback is first of all much more difficult code (interrupt needs to configure the next pulse in time after the first was done). And another drawback is less pulses per second. 

Servo pulses are 1 to 2 millisecond. That means you can fit at least 400 of those in a second. For instance the ppm-encoder sends 8channel * 50Hz. Or you have a dedicated line per servo then you can send 400 to each servo/motor controller. 

Now for the booz board: I do not have one but it looks to me it does not have any servo connection output labelled as such. So it does not eliminate your problem at all. Booz seems to be designed for I2C motor controllers only. If you want to use PPM you are stuck with the same problem as the tiny. (except booz has cleaner power for the imu, and has a baro onboard etc...)

Now if you want PWM pulses: All LPC21 autopilots (booz,tiny,twog,yapa,umarin) can create PWM pulses. The default driver (https://github.com/paparazzi/paparazzi/blob/v3.9/sw/airborne/arch/lpc21/servos_direct_hw.h) however, needs the pins of both serial ports and the battery voltage pin etc. So most people do not find that very handy. 

PWM1 PWM5 AD1_6 CAP1_3 P0.21
PWM2 PWM3 RXD0 EINT0 P0.1
PWM3 PWM1 TXD0 P0.0
PWM4 PWM6 RXD1 EINT3 P0.9
PWM5 PWM4 TXD1 AD1_1 P0.8
PWM6 PWM2 SSEL0 EINT2 P0.7

However, it should also be possible to make PWM pulses also on the SPI/ADC port pins using the MAT0/1.X registers. It just hasn't been done because here again you loose another set of pins (SPI/ADC). This lack of resources was one of the reasons to switch to a much more powerful microcontroller on the Lisa boards. (STM: 8 PWM counters  + 2 SPI + 2 I2C + 3 UARTS simultaneously).

Conclusion:

you do not need uarts? -> tiny/yapa with https://github.com/paparazzi/paparazzi/blob/v3.9/sw/airborne/arch/lpc21/servos_direct_hw.c driver! (just modify line 7 to 2500 for 400Hz)
you do not need the SPI or only need 4 servo's? -> tiny/yapa/booz with new driver using MAT0.1,0.1,0.2,0.3,1.1,1.2,1.3 Match registers
you need several uarts and SPI and ADC's -> 
  a) find some I2C motor controllers 
  b) use an external I2C->PWM converter (which adds delay)
  c) switch to Lisa board

One last note: certainly not all servo's can handle 400Hz pulses and most motor controller do not use 400Hz pulses. So you need special motor controllers and servo's for this. Search for SimonK in other posts for links. 



-Christophe 



On Tue, Jul 3, 2012 at 6:07 AM, Sahul Venkat <address@hidden> wrote:
Hi,

Can somebody please explain me the difference between paparazzi booz and tiny autopilot and how is the issue of low speed PWM output as in paparazzi tiny being eliminated in case of booz autopilot.

Thanks in advance,
sahul venkat.

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]