How to add thrust to swarmSequence.py and script flight in firmware

Post here to get support
Post Reply
purvisb
Beginner
Posts: 13
Joined: Sat Apr 10, 2021 12:59 am

How to add thrust to swarmSequence.py and script flight in firmware

Post by purvisb »

I'm trying to get the crazyflie to support 12.4g of weight. I'm using this script as an example on how to get it to fly and hover. If I don't change anything here, the drone does not have enough thrust to lift off. What can I change to change thrust?

I tried changing `cf.commander.send_velocity_world_setpoint(0, 0, vz, 0)` to `cf.commander.send_velocity_world_setpoint(0, 0, 5, 0)` in the take_off function. But the drone just crashes into a wall when I do this. I'm not sure if the way I'm attaching the payload is messing with the flight, or if I'm going about the programming wrong.

Also If I want to avoid using the crazyradio PA, can I script flight patterns in firmware?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to add thrust to swarmSequence.py and script flight in firmware

Post by arnaud »

I have a couple of question about what you are trying to achieve and how:

1. Do you have any kind of positioning system in place? At least a flow deck, or any of the supported positioning system, is required for velocity control to work.

2. Does the Crazyflie fly with this payload in manual flight? The best is to fly using the client and look (or have someone else look, or log) the thrust applied to the motors. It is important that, when hovering, there is enough margin for the Crazyflie to control its attitude. If the thrust of one or many motors hits the top of the bars in the client while hovering, you just do not have the lift capability to carry this payload.

If the Crazyflie can carry the payload, you should not have to modify the setpoint in order to fly, the Crazyflie should be able to control its velocity to reach the requested setpoint. Your modification did request 5 meters per seconds in Z which is likely not possible to achieve even with a stock Crazyflie, so definitely not with that payload, and would have hit the ceiling in less than a second.

One thing that might help is to tune the position controller for the higher hover thrust. While flying manually you can estimate the hover thrust by hovering with the Crazyflie and looking at the client to see the current thrust (might be easier to log the thrust, hover for a while and then look at the plot). Then you can set the parameter "posCtrlPid.thrustBase" to the new thrust (the current default value is 36000, the value should be between 0 and 65535).
purvisb
Beginner
Posts: 13
Joined: Sat Apr 10, 2021 12:59 am

Re: How to add thrust to swarmSequence.py and script flight in firmware

Post by purvisb »

1. I'm using a flow deck

2. I tried flying the drone with the phone app, So I wasn't using cfclient. I'm waiting to borrow a controller so I can use cfclient.

I'll update this ticket when I have a controller and I can follow your recommendations. Thank you.
Post Reply