# Help with Voxl2 PID Tune problem

Source: https://forum.modalai.com/topic/2593/help-with-voxl2-pid-tune-problem
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-08-24 18:33:35 UTC by bensusana
Replies: 23 · Views: 8225

## bensusana · 2023-08-24 18:33:35 UTC

Hello guys ,
I'm calling for your help after hours of tune flights that we made with voxl2 (actually 3 drones with voxl 2)
and we don't  getting any good results, there is some wobbling that all of the 3  suffering from , no matter any of rate tune we tried / attitude gains that solves our problem .

we build 4th drone with same setup (frame/motors/esc) but with Kakute f7 fc with px4 and even with very bad vibration issues it flying super smoothly .

so lets go through our setups and changes that we already tried.

we are talking about 5" carbon frame ( racer frame) with voxl2 flight-deck+v2 modem , F55 ModalAi esc, voxl2 i/o board with crossfire receiver and tmotor f40 pro iv 2400kv motors with 5" tri prop hq  .

after tune was pretty fine but still we getting this wobble in stabilize mode indoor flight and also outdoor in position hold.
we tried to install only voxl2 without the flight-deck and without dumpers only standoffs with thine O-rings, still nothing change same wobbling .

we tried that also with different frame and different voxl2 board and nothing change .

the third try ,we took all different frame and the vary same problem occurred, wobbling .

the 4th try ,we took same setup but only this time without voxl2 but with kakute fc with px4 and it fly's smooth as i mention above .

we have about 4 drones based on similar frame with voxl1 and the tune was very easy, pretty much nothing was change from the default and it fly's great .

here is some log file from our last try (voxl2 board attached without O-ring only board attached to standoffs ) :
https://review.px4.io/plot_app?log=35849e36-1a8a-4718-abe1-d57c9d66a964

there is some problem in the actuator outputs look like saturation that i didn't managed to solve (tried different rx/tx) can it be some false coming from the i/o board?

here is example from px4 forums: https://discuss.px4.io/t/weird-actuator-output-logs-problems-tuning/32839.

## Reply by bensusana · 2023-08-24 21:40:51 UTC

@bensusana  one more thing , all of the F55 ModalAi esc's on our builds were fully calibrated as explained in your calibrate procedure .

## Reply by Alex Kushleyev (ModalAI staff) · 2023-08-26 01:59:07 UTC (in reply to bensusana)

Hi @bensusana ,

There seems to be an issue somewhere in PX4 that is causing all the commanded ESC outputs to drop to 1500 (min_rpm) for one cycle (but very often). See below the plot of Actuator Outputs (what PX4 sends) and also the RPM feedback. The RPM feedback is logged at much lower frequency, but also the ESC does not respond fast enough to drop the RPM significantly, since the 1500 rpm command is only present for one update cycle and then it goes back to normal (see second plot). Sending such jumpy commands to ESC would definitely cause oscillations since ESC will try to drop to 1500 rpm for all 4 channels and then back to normal flight RPM in a few milliseconds. Since the ESC is running motor control at 10khz, it will definitely have a chance to slow down a bit even in a few milliseconds.

I am not sure if we have seen this issue before, perhaps others can comment @modaltb @Eric-Katzfey . Maybe it is due to something custom that you added, @bensusana ?

Alex

---

Actuator outputs and RPM feedback from ESC
![a3fd35f2-b194-4de9-a1f7-df9e77c288fe-image.png](https://forum.modalai.com/assets/uploads/files/1693014962672-a3fd35f2-b194-4de9-a1f7-df9e77c288fe-image.png) 

Zoomed in actuator outputs
![d3bea05f-902d-4090-b0d4-f1422e183411-image.png](https://forum.modalai.com/assets/uploads/files/1693014973757-d3bea05f-902d-4090-b0d4-f1422e183411-image.png)

## Reply by bensusana · 2023-08-26 06:08:11 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev hi alex
i noticed that , as you can see i added link for a similar problem from px4 forum ,
beside the frame motors and the receiver  all of the components are from modalAi nothing custom ,
for fact, we have same builds with voxl1 that's working great, the only differences are modalAi esc and Io board.

i have 3 quads  2  of them with voxl2 flight-deck and have the same actuator outputs...

## Reply by Alex Kushleyev (ModalAI staff) · 2023-08-26 16:40:18 UTC (in reply to bensusana)

@bensusana 

Yes this seems like exactly the same problem. No clear solution, i suspect this was it : “  or because there is another module in PX4 also publishing RC (at 0) when it shouldn’t. The last one might be the most likely actually.”

Can you make sure there is not another RC module publishing rc control message?

## Reply by bensusana · 2023-08-26 17:48:07 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev the only thing comes in mind  its the receiver (frsky/crossfire tried them both) working through voxl IO board ,
 i was thinking to connect it directly to j19  as shown in your description .
any other ideas for testing will be much appreciate , its a major problem causing all  of our developing drone grounded .
![csrf.JPG](https://forum.modalai.com/assets/uploads/files/1693071974159-csrf.jpg)

## Reply by bensusana · 2023-08-26 19:03:03 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev just noticed that the other guy that opend the issue in px4 forum using ModalAi rb5 and same version as we using .
https://discuss.px4.io/t/weird-actuator-output-logs-problems-tuning/32839.

## Reply by Chad Sweet (ModalAI staff) · 2023-08-27 02:19:02 UTC (in reply to bensusana)

@bensusana which version of px4 are you running? PX4 changed the px4io protocol in 1.14 and that board will no longer work correctly. You should connect your csrf receiver directly to VOXL 2 if using PX4 1.14

## Reply by bensusana · 2023-08-28 05:50:10 UTC (in reply to Chad Sweet)

@Chad-Sweet  Hi chad
we using v1.12.31 , but thanks for the heads up , our next step was moving to 1.14  and we need that board  so obviously we cant use it with this version   .

## Reply by bensusana · 2023-08-28 10:03:20 UTC

hi  @Alex-Kushleyev 
OK,  we got a significant  improvement but it comes with a lot of questions and other problems that came up .

first , i took the IO board out and connected the crossfire directly to J19 as shown at picture in the previous massage.

then i configured the receiver to work in mavlink mode and started the voxl px4 service  with  voxl-px4 -r

(as i founded in other topic in the forum) .

as a result we got pretty smooth flight and actuator output  looks great  : 
https://review.px4.io/plot_app?log=dd187870-0fb2-4dc9-a0f6-694c4c3bdea2

now since we need this IO board how can we solve this problem ?

moving to work with mavliink causes  a lot of missing mavlink messages and tabs in  qgc mavlink inspector,  but this problem should be in  a new topic (i will publish later ) . 

looking forward for any help/solution .

## Reply by Alex Kushleyev (ModalAI staff) · 2023-08-28 15:31:46 UTC (in reply to bensusana)

@bensusana 

Please let us test it on our end to see if we can reproduce the issue. I will ask our team to set up a quick test as soon as possible.

Alex

## Reply by Moderator (ModalAI staff) · 2023-08-28 15:47:29 UTC (in reply to Alex Kushleyev)

@bensusana can you please diagram your desired system architecture? Why do you need the IO board?

## Reply by bensusana · 2023-08-28 18:47:06 UTC (in reply to Moderator)

@Moderator hi
first of all we use it to connect RC receiver and we also need the other pwm pins for servo operate .

we tried to connect the crossfire nano directly to j19 and change the mode to mavlink (just to see how the drone perform ),

we succeed to do that only with voxl-px4 -r command that we do every restart (im guessing there is an easy way to do it if you can guide us through )
but that causes a lot of mavlink massages and status tabs like battery status and a bunch of other tabs in qgc mavlink inspector to disappear .

if there is some guidelines that i missed to work properly with crossfire receiver without IO board for now ,
that will give us a lot of space for keeping developing .

## Reply by Eric Katzfey (ModalAI staff) · 2023-08-30 02:27:36 UTC (in reply to bensusana)

@bensusana Can you provide some more information to help us rule out any obvious configuration issues? For example, a px4 log from `journalctl -b -u voxl-px4 --no-pager` on voxl2?

## Reply by bensusana · 2023-08-30 10:12:37 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
hi eric , i uploaded  the log here (too many  characters )
https://we.tl/t-36gYH3HTue
 if you guys  can support us through email it will be much faster .
thanks.

## Reply by Eric Katzfey (ModalAI staff) · 2023-08-30 15:21:33 UTC

@Eric-Katzfey I don't see anything obviously wrong in either the flight log or the startup log. The log of the input_rc topic doesn't show any obvious dropouts or other problems but it is not logged at full rate so it's possible that it didn't capture something bad.

## Reply by bensusana · 2023-08-31 07:27:41 UTC (in reply to Eric Katzfey)

@Eric-Katzfey @Alex-Kushleyev @Chad-Sweet  
hi guys, 
we about to build 4 more drones with same setup ( 8 total)  and we have to be sure about the hardware, how can you help us to work this through?
can one of the dev team can give us  support through emails? its hard to support this with one massage a day ( we have time zone problem :flushed:  )

## Reply by Moderator (ModalAI staff) · 2023-08-31 22:33:42 UTC (in reply to bensusana)

@bensusana Hi Ben, Eric is our head of software so you are getting the best support we can offer at this point. Do you have developers you work with who can help debug PX4?

We are working on a new firmware for that VOXL 2 IO board that we hope to help resolve some of your issues. We are a few weeks away though from the release. 

For the direct CSRF connection, are you using the latest SDK or is it still the older version?

## Reply by bensusana · 2023-09-01 06:46:24 UTC (in reply to Moderator)

@Moderator Sdk 0.9.5 
Crossfire nano rx connected to j19 ,using mavlink mode.
For unknown reasons in this mode I can control the drone but a lot of mavlink massages disappear, no battery status system status almost half of the tabs in mavlink inspector  on qgc are gone .

What I’m doing wrong? 
Can I use csrf raw on that Sdk?or should I move to v1.0?

should I try use spectrum receiver?

## Reply by Eric Katzfey (ModalAI staff) · 2023-09-01 15:42:35 UTC (in reply to bensusana)

@bensusana Using the TBS Crossfire receiver in mavlink mode shouldn't have any affect on the mavlink messages you get at QGC. The TBS Crossfire driver runs on the DSP and communicates to the receiver using UART. It uses the Mavlink protocol over that UART. The Mavlink module is a completely separate thing that runs on the applications processor and communicates to QGC via the network. So it is unclear to me how one would influence the other in any way. You can certainly try it in CRSF mode. You can also switch to Spektrum. For full M0065 support of both RC and PWM we would recommend waiting for the upcoming 1.0.x release that supports that combination.

## Reply by bensusana · 2023-09-01 17:32:46 UTC (in reply to Eric Katzfey)

@Eric-Katzfey  how to start the system with crsf raw mode?
i didnt found it on the modalAi portal .
 for mavlink mode i tracked open topic that says use voxl-px4 -r for mavlink...
this link : https://docs.modalai.com/voxl2-rc-configs/#crsf     leading to "page not found"

thanks for the support !

## Reply by Eric Katzfey (ModalAI staff) · 2023-09-01 17:51:59 UTC (in reply to bensusana)

@bensusana Use `-c` instead of `-r`. Baudrate will be 250000 for CRSF (It's 115200 for Mavlink mode).

## Reply by bensusana · 2023-09-21 05:25:31 UTC

hi guys ,
quick update , after a  lot of testing and after we take out the IO board and still got some wobbling from the drone , we re-calibrate the f55 esc we got diffrent results from the last calibration , after updated the last resullts we did a flight test and the drone fly smoothly .

thanks for the support ,
i hope that this topic will help others :)
@Eric-Katzfey  @Moderator @Alex-Kushleyev

## Reply by bensusana · 2023-09-26 06:25:54 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

only 420000 work for me for CRSF RAW
