[resolved] BigQuad Deck: PWM output unreliable

Firmware/software/electronics/mechanics
Post Reply
H0stname
Member
Posts: 43
Joined: Fri Feb 17, 2017 5:44 am

[resolved] BigQuad Deck: PWM output unreliable

Post by H0stname »

Hi all,

I believe I have stumbled across a bug. The PWM output from the BQ deck does not seem to be working reliably. Sometimes it will work just fine, but a good number of times, the duty cycle is stuck at 40% no matter what I do to the throttle, and try disconnecting/reconnecting to the crazyflie. I recently got an oscilloscope to assist with development of electronics projects and here is the signal output on the BQ deck:
Image
Image
This duty cycle does not change with throttle input (CFclient shows that it is reading the input as the throttle bars move) most of the time, thus my ESCs don't move the motors. Sometimes, however, seemingly at random, the duty cycle will change with throttle response and everything works as intended!

I would guess it would have to do with how the motor driver or PWM is configured??? All I know is I have tried this many times, cannot reliably reproduce the issue, but can show with my scope that it is definitely not my ESC hardware, probably a firmware bug of some kind, or maybe in the cfclient? Sometimes I have had issues with the same symptoms without the BQ deck, but disconnecting/reconnecting and/or restarting CFClient fixes the issue. That does not work here, making me think it is firmware related as I don't *think* the CFClient does anything different for the BQ deck.

I have not obtained anything useful in the console window, it seems to be the same.

I will also mention, there were multiple times I did not get any PWM output at all, but eventually I figured out this was due to me having the drone on my knee, not a table, and it appears the crazyflie was not initializing correctly because it needs to be set on a flat/consistent surface when it first turns on. Before I had the frame anchored down, it shaking in the mess of wires also caused it to fail and provide no PWM output for no apparent reason. I'm pretty sure it will still fly when in normal mode though when it fails this initial check, just not properly. With the BQ deck, nothing happens and the system must be restarted on a flat surface. I just lost a good deal of time figuring that out, perhaps you guys can think of a beep code or something to alert the user that the PWM is disabled because the crazyflie's initial calibration failed? Seems like a good feature addition to me.
Last edited by H0stname on Sat Jan 19, 2019 5:28 pm, edited 1 time in total.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: BigQuad Deck: PWM output unreliable

Post by tobias »

Hmmm, I have not seen this behavior before. Could be a newly introduced bug or more likely something with your configuration. Could you share your configuration? Maybe you have a fork on github, that would be the easiest for me to try out, else I will try to replicate it with your config.

As for the initial calibration phase I agree it could be made more clear. It is documented a bit here but maybe not so easy to find. The good thing (when you know it) with the BQ is that the motors do the "ready" beep sequence when the CF has calibrated. But if you don't know this, not much help...
H0stname
Member
Posts: 43
Joined: Fri Feb 17, 2017 5:44 am

Re: BigQuad Deck: PWM output unreliable

Post by H0stname »

Saw this tab in my queue and closing some chrome tabs :D

This was eventually resolved, it had to do with the initialization of the CF2 or my ESCs. The CF2 must be on a level surface and still when it does its init (and during my initial test, it was not even attached to my frame). It helps to have a solid mount to your Big Quad frame of choice, I 3d printed an adapter to convert the 2 screw mounting the crazyflie has (not sure what it's for) to 'standard' ~20 mm square drone accessory mount. Similar one here:

https://www.thingiverse.com/thing:3367071

After using this and leveling on a stable surface, I could usually get it to init properly.
Post Reply