Cheerson CX-OF low cost optical flow sensor testing

@umgram1, thanks for that. So for other’s here is a link to the CrazyFlie 2.0v2 flow sensor. I suspect we could get it working as well if we can figure out the pin outs.

By the way, I’ve ordered the banggood CJMCU-3901 sensor which uses the spi interface.

2 Likes

@rmackay9 I’ve gotten my crazyflie in last week and have been using the bitcraze FW with the flow deck, and MAN does it just work well. So used to the very picky (in lower light conditions) px4flow. If I could use the crazyflie flow deck on a large quad and the TFmini lidar I’m already using for ALT, I think it would just put the old, sad, px4flow out for good. P.s. px4flow works great. In perfect lighting conditions.

1 Like

@rmackay9 also, bitcraze now makes a simple breakout version of the flow deck v2, pinout is straightforward for SPI seems like, with I2C for the onboard lidar. Here’s the link: Bitcraze Flow Deck V2 “breakout”

2 Likes

Graham,

Txs for that. Yes, the simple breakout version looks better. It’s a little more expensive than the banggood one but they’re all very reasonably priced.

1 Like

Hi Randy,I see you now have a article on the wiki so is it all up and running please,ive got a lidar fitted allready and cheerson will be here any day,and thank you for hard work

1 Like

@rmackay9 calibration complete, next step …flying :wink:

these are my gains

FLOW_ENABLE 1 0:Disabled 1:Enabled
FLOW_FXSCALER -20
FLOW_FYSCALER -30
2 Likes

@ppoirier,

Great! We could potentially update the scaling gains (at the risk of upsetting users who have already done the scaling). All the sensors are probably very close to the same and I can’t say that I spent a huge amount of time coming up with the default calibration.

1 Like

@rmackay9
The opticalflow wiki is pretty self explanatory, we just have to insist on the fact that signal must be adjusted to equivalent level

1 Like

@ppoirier thanks for your answer on gitter.
The calibration procedure is on the PX4FLOW wiki but not on the CX-OF one, maybe is better to replicate it or to put a link.
Anyway I will do the calibration and I will report my results.

Other questions:

Are you able to see OF values in Mavlink Inspector on MP?

Do you know if it is possible to fly in FlowHold without lidar indoor?

Sorry for so much questions.

1 Like

I dont see OF on Mavlink Inspector, I know it has been change quite recently and it has a double star “**”" , so I guess it is note readeable by Ground Station atm , maybe someone could be using dronekit python to intercept message …if really necessary (and if generated by FC)

As for different flight modes and rangefinder I still have to complete components integration before tests

2 Likes

@anbello,

I think flowhold should work indoors without a lidar.

I actually think it should be possible to fly the cheerson without calibrating it… It may not be perfect but I think it will work.

2 Likes

@rmackay9 calibration deserves 3 purposes:
1- It confirm that you have consistent OF signal
2- It shows if sensor is correctly aligned with IMU
3- It is part of a good system check and tuning

Do you think we will get some form of realtime signal reading on Mission Planner like we used to with the PX4Flow?
As for the MavLink OPTICAL_FLOW message, did you tested it? And if yes; How?

1 Like

I tried with FlowHold indoor and I saw an enough stable horizontal pos but an unstable vertical pos and, as I already said on the other thread, I see recurrent messages:
[MAV 001:1] EKF2 IMU0 has stopped aiding
[MAV 001:1] EKF2 IMU0 is using optical flow
both with EK2_GPS_TYPE = 3 and with EK2_GPS_TYPE = 0

Whereas in an outdoor test flight with EK2_GPS_TYPE = 0 when I switch to FlowHold fro Loiter I see a strange behaviour described here:

I saw this link mentioned above:
https://www.bitcraze.io/flow-breakout/
Will it be possible to connect the CX-OF with I2C?
Adding more and more sensors and the UART are an “expensive” resource.

OK , I finally had some time to run test on my Q33O Powered by PIXRACER

  • Upddated to chibios 3.6.4
  • Installed the sensor , add a 3.5 volt regulator, connected to serial
  • Calibrated sensor (as described above)
  • Used EKF3 (the existing PX4FLOW was using this and I wanted to compare)
  • Connected to Mission Planned - set the EKF Home and di the ''walk test"
  • Confirmed that vehicle was moving on screen as on real
  • Switched to loiter and did the flight test

here is a picture of the setup:

Left Cheerson
Right PX4FLOW
TOP Benewake TF2 running as Lightware I2C emulation on I2C

Here is the flight test
(look at the end the drift between the initial walk and the actual flight test on the map)

3 Likes

@ppoirier, txs for the test. So it looks like it’s working which is great. It’s hard to see the scale of the drift is from the video… perhaps a few meters?

1 Like

@rmackay9 Lol …You made me realize that the video does not really demonstrate OpticalFlow :slight_smile: !!

Here is a more convincing sequence, basically stability in centimetric , 10-30cm depends on the perturbing airflow moving around the enclosed garage:

1 Like

@ppoirier, OK so that was the vehicle trying to hold position with no pilot input? Not bad… it gives us an indication of what level of performance people should expect.

1 Like

@sevet, re the crazyflie flow sensor, I suspect it will work but it hasn’t been tested yet. One thing to note though is that as far asI know it doesn’t use I2C but rather SPI. Only the original Pixhawk1 board has the SPI port exposed I think.

1 Like

@rmackay9 to my knowledge other board with SPI port exposed are: Pixracer (needs change in hwdef.dat to use esp8266 port as SPI), RevoMini (needs change in hwdef.dat to use OPLink port as SPI) and Omnibus F4 (this has SPI port but I don’t see relevant config in hwdef.dat for it)

2 Likes