PX4 micro-quad using computer vision for autnomous flight


I have been looking into the PX4 flight stack for a few months now and have decided to utilise it for my university final year project (honours year). I’m developing a micro-quad X (10cm x 10cm, 100g or less) research platform which will try and fly autonomously in GPS denied environments by use of computer vision.

I’ve developed the frame and picked my hardware so it is compatible with PX4. I am just finishing up my first prototype and it’s looking ‘groovy’. I have run through the developers guide and have successfully flashed my board with the PX4 flight stack. I have also been able to run through the ‘px4_example_app’ guide with no worries.

As my quad is very small in size, I have opted to use brushed DC motors due to their weight and simplicity. This means that the ‘Motor Output’ signals need to be in the order of 20KHz rather than 50-490Hz, due to their connection to the gate of a power MOSFET (one for each motor).

I am currently trying to write my own air-frame config file and mixer file. I’m hoping I can overwrite the PWM frequency for motor outputs 1-4 in the air-frame file but I am still new to the stack. Any help with editing my config files would be appreciated!! I will attach or link them below.

The computer vision guided navigation looks to be quite a daunting task but I’m keen on a challenge. My university has provided me use of their Omi-Vision OV7670 (with fifo) camera modules. I had been keen on adapting a PX4FLOW module, however they are far too heavy for such a build. Does anybody know if this, or similar, camera modules have been integrated into the stack?

Any advice or assistance would be appreciated. I’m very keen on getting into the meat of this project!

Chris Evans.


# @name Micro-Quad UoN "Noisy Miner"
# @type Quadrotor x
# @maintainer Chris Evans <c3166705@uon.edu.au>

sh /etc/init.d/1337_quad_x_UoN

if [ $AUTOCNF == yes ]
    param set MC_ROLL_P 7.0
    param set MC_ROLLRATE_P 0.16
    param set MC_ROLLRATE_I 0.05
    param set MC_ROLLRATE_D 0.003
    param set MC_PITCH_P 7.0
    param set MC_PITCHRATE_P 0.16
    param set MC_PITCHRATE_I 0.05
    param set MC_PITCHRATE_D 0.003
    param set MC_YAW_P 2.8
    param set MC_YAWRATE_P 0.3
    param set MC_YAWRATE_I 0.1
    param set MC_YAWRATE_D 0.0


Multirotor mixer for PX4FMU

This file defines a single mixer for a quadrotor in the X configuration.  All controls
are mixed 100%.

R: 4x 10000 10000 10000 0

Gimbal / payload mixer for last four channels

M: 1
O:      10000  10000      0 -10000  10000
S: 0 4  10000  10000      0 -10000  10000

M: 1
O:      10000  10000      0 -10000  10000
S: 0 5  10000  10000      0 -10000  10000

M: 1
O:      10000  10000      0 -10000  10000
S: 0 6  10000  10000      0 -10000  10000

M: 1
O:      10000  10000      0 -10000  10000
S: 0 7  10000  10000      0 -10000  10000

What kind of processor do you plan to run your CV tasks on?

For the proof of concept, I’ll be using the STM32F4 which runs my PX4 stack.

All I need is to do is take photos at 1 Hz and pipe them to either memory through DMA or the SDcard.

If somebody could point me in the direction of some bench marking tools so I could analyses idle times of the processor and memory usage it would be helpful.

If somebody could point me to a guide to writing both the mixer and init scripts it would be appreciated.


Thanks Mark.

I have already gone through that guide and it has allowed me to get started on my airframe config files above.

Maybe the real questions to ask are…

“Which header files define and explain the parameters?”

“Is there an API on the px4 middle-ware (ArduPilot I believe) floating around?”

Best regards,

Besides the devguide and the source code there is some older material here: https://pixhawk.org/dev/start

I’ve just finished my schematics for my first (1/2 or 1/3, depending on circumstances) PCB. It’s a combined PDB, brushed ESC, and BEC. I’ve tried to stick as close to the standard PX4 hardware as possible.

The ESC portion includes a STM32F10XCXT6 in LQFP48 package which connects to the UAVCAN bus via a CAN Transceiver (MAX3051), takes the regular 500Hz PWM, converts it to a 20KHz PWM to drive the N-Channel power MOSFETs which in turn, drive the motors.

The PDB and BEC portion include a 3.7v -> 5v lipo booster converter (TPS61200) which is powered by the battery. This 5v rail will be the primary rail for all 5v required applications (IO, FMU, IMU). There is also a 3.3v LDO, dual output regulator (MIC5332) which will power IO with one rail and IC with the other.

Programming of the STM32 will be done with the use of pogo-pins, as the pads on the PCB are low profile and light (two essential qualities of micro-quad avionics).

I will upload everything to this git repository - https://github.com/ChrisE-UoN/PX4-Micro-Quad

I am still working on these designs and any feedback (or the pointing out of obvious flaws) is greatly appreciated.

P.S. The data sheet says that programming to System Memory is done through USART1 however it also suggests that JTAG/SWD programming is possible. Ideally, as I’m familiar with JTAG, I’d like to opt for the pogo-pins programming method.

The UAVCAN bus doesn’t carry PWM signals, but perhaps you didn’t mean to imply that. But in such a small form-factor, perhaps I2C or SPI would be a better choice for controlling the ESCs.
I think a JTAG programming port is a good idea.

You’re absolutely right about the UAVCAN and PWM. The plan was to transmit the data over UAVCAN in a similar fashion to the PX4 ESC, which I cannot find any schematics for.

I was going to have a single, cross-PCB UAVCAN bus which would allow ad-hoc, additional PCBs (such as CV, comms, sensors etc) to be included into the quad. I am going to design my frame so the PCBs are stacked on top of each other, keeping the weight as close as possible to the 3 axis. It would look similar to a cube. The frame itself would have clips so new boards could be added at the developer’s leisure.

I would also like to study micro air vehicles, but I’m a beginner, look forward to your progres.

1 Like

Did you successfully implement this?