Stand-alone Crazyflie remote using STM32-103STK published

Firmware/software/electronics/mechanics
MidLifeCrisis
Beginner
Posts: 3
Joined: Fri Aug 09, 2013 1:38 pm

Stand-alone Crazyflie remote using STM32-103STK published

Post by MidLifeCrisis »

Hi All,

I have had my Crazyflie for a while now, but what irks me the most is that I just want to have a quick fly with it. Indoors or out. Setting everything up is a bit of a pain, so I used an off-the-shelf STM32 evaluation board from Olimex, a MOD-WII, and a standard Nintendo Wii Classic Controller to make my remote. That's it, no PC, no Crazy Remote, no phone, just the Olimex board which has an LCD and is battery powered. Just right for flying!

My write up with a picture is here, along with the code that works with CrossWorks:

http://goo.gl/LNDuv9

I had intended to grab some footage of it all in action at the weekend, but it was pretty rainy in the UK and not outside flying weather! Oh well. :-(

Regards,

-- Paul.
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by marcus »

Hi Paul,

Nice work, it looks great :D

/Marcus
williamlweaver
Beginner
Posts: 2
Joined: Tue Apr 08, 2014 6:52 pm
Location: Philadelphia, PA USA
Contact:

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by williamlweaver »

Great example @Paul!

My undergraduate students and I have been flying our two (2) CrazyFlies since September 2013 and we are now starting a project that requires us to deep dive into the code.

We propose to create a Crazyflie Interface Driver in National Instruments LabVIEW so we can use LabVIEW on Windows as our main development environment for an integrated project that incorporates some AI and optimization algorithms we have developed in LabVIEW. We would ultimately like to control multiple CrazyFlies as an autonomous nanocopter SWARM.

Would it be OK if we used your posted code as a starting template for developing our LabVIEW interface?

Any suggestions on how best to proceed by the community is greatly welcomed and appreciated.

-Bill =]
MidLifeCrisis
Beginner
Posts: 3
Joined: Fri Aug 09, 2013 1:38 pm

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by MidLifeCrisis »

williamlweaver wrote:Great example @Paul!
We propose to create a Crazyflie Interface Driver in National Instruments LabVIEW so we can use LabVIEW on Windows as our main development environment for an integrated project that incorporates some AI and optimization algorithms we have developed in LabVIEW. We would ultimately like to control multiple CrazyFlies as an autonomous nanocopter SWARM.
Surely the flies would need to know their position accurately? I don't think the standard flie would be able to know that -- you can clearly estimate, but experience with this stuff tells me dead reckoning is not brilliant. I was thinking of fusing GPS and the sensors as a better indication of where you are. The firmware would still run the orientation estimation (and I have already written my own one of those).
williamlweaver wrote:Would it be OK if we used your posted code as a starting template for developing our LabVIEW interface?
Go for it. :-) I'm not sure it's going to get you very far, but hey, you never know!
williamlweaver wrote:Any suggestions on how best to proceed by the community is greatly welcomed and appreciated.
I find diving into code and experimenting is very good. Lots of theory doesn't is great, but there is simply nothing like experimentation!

-- Paul.
williamlweaver
Beginner
Posts: 2
Joined: Tue Apr 08, 2014 6:52 pm
Location: Philadelphia, PA USA
Contact:

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by williamlweaver »

Hi Paul!

Thanks for your kind reply. We are still near the launch of our project and are happy to look at all examples of code and control approaches.

We are planning to explore RFID for position information. The GRASP Lab at the University of Pennsylvania famously outfits its development laboratory with digital cameras that provide position information to the drones.

We are a much smaller (read nearly infinitely smaller) school and we are looking into placing small, active RFID chips on the Crazyflie and using multiple RFID radios to triangulate 2D position based on signal strength. Looking at product specifications, I've seen position accuracy approaching 10 cm with a dual-antenna, single receiver. We plan to position three (3), dual-antenna receivers at known locations and calculate the geometry for the RFID tag location.

We initially plan to keep all control intelligence (the swarming algorithms) on the controlling computers and send flight command information to the Crazyflie. If we have success, we plan to sensor fuse 2D position information with altitude information from the Crazyflie to create a very poor-man's "GPS" triangulation system.

We are just one faculty member and some undergraduate students playing with code, wires, radios, and nanocopters... Difficult to imagine college getting any better than that...

-Bill =]
ivandevel
Beginner
Posts: 8
Joined: Mon Apr 14, 2014 9:51 pm

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by ivandevel »

Hello all! I'm developing my own standalone controlleron STM32 with analogue joystick parts (ALPS) from PS3 controller.Now I'm sending a commander packet, and everything is working good (Roll, Pich, Yaw, Thrust) Now the (uint16_t) Thrust value is changing from 10000 to 65000 and motors are responding good. I want to know, what should I write in Thrust value, to achieve the AltHold mode? Can anyone give an example on C?
http://youtu.be/b6k0apB5JjM
omwdunkley
Expert
Posts: 162
Joined: Thu Jun 06, 2013 9:56 pm
Location: Munich

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by omwdunkley »

For alt hold mode, you will need to set a parameter using the parameter frame work.
For the thrust values check this code. Basically while hover mode is active, half of thrust = stay at same height, less thrust means decrease target altitude and more thrust = raise target altitude.
Good luck :)
ivandevel wrote:Hello all! I'm developing my own standalone controlleron STM32 with analogue joystick parts (ALPS) from PS3 controller.Now I'm sending a commander packet, and everything is working good (Roll, Pich, Yaw, Thrust) Now the (uint16_t) Thrust value is changing from 10000 to 65000 and motors are responding good. I want to know, what should I write in Thrust value, to achieve the AltHold mode? Can anyone give an example on C?
http://youtu.be/b6k0apB5JjM
ivandevel
Beginner
Posts: 8
Joined: Mon Apr 14, 2014 9:51 pm

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by ivandevel »

Okay, so what kind of packet should i transmit to copter to activate the AltHold mode? Is this a commander packet only, or something else? Can you provide an example packet for setting up an altHold parameter? Now i'm sending only a crtp commander packet with this structure:

Code: Select all

__packed typedef struct {
  unsigned char c; //the commander slot
  float roll;
  float pitch;
  float yaw;
  unsigned short thrust; //(0...65535)
} CRAZYFLIE_COMMANDER_SETPOINT_t;
omwdunkley
Expert
Posts: 162
Joined: Thu Jun 06, 2013 9:56 pm
Location: Munich

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by omwdunkley »

It is something else.
See here for an example on how to list, read and change a parameter.

This is the parameter you will need to change.

Hope this helps!
ivandevel
Beginner
Posts: 8
Joined: Mon Apr 14, 2014 9:51 pm

Re: Stand-alone Crazyflie remote using STM32-103STK publishe

Post by ivandevel »

Sorry, i'm not familar with Python. I need a simple example on C, how to read paremeters and set it. :oops:
Post Reply