PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.51k stars 13.51k forks source link

In the Qualcomm_Snapdragon_Flight, ESC can't working #6525

Closed sunshine-yan closed 6 years ago

sunshine-yan commented 7 years ago

Hi, First of all, i have used this code in the Qualcomm_Snapdragon_Flight. Now, i have tried to use two sets of code. One of them is this PX4/Firmware. However, the ESC can't working when i use this code. I find all of the code, I think 'snapdragm_pwm_out' may be related to ESC.Therefore I have tried to replace the "snapdragm_pwm_out start -d /dev/tty-2" with "uart_esc start -D /dev/tty-2". However,ESC still can't start. The situation is as follows: image This is the ESC i used: image

Stifael commented 7 years ago

To what ports of the snapdragon did you attach the esc board?

sunshine-yan commented 7 years ago

@Stifael It's this port.As shown in the yellow box. esc

Stifael commented 7 years ago

This is correct. Does it work now? Or why did u close the issue?

sunshine-yan commented 7 years ago

@Stifael I'm sorry, I just accidentally closed the issue.It still can't work.

Stifael commented 7 years ago

So if you want to use snappy to send out pwm signals directly, then you should use snapdragon_pwm_out. I need to retest it my own to see if actually nothing broke, but I suggest to look at the pin outputs to see if there is any signal.

sunshine-yan commented 7 years ago

@Stifael I I have tried to use snapdragon_pwm_out.However,the ESC did not respond.LEDs in the ESC don't flash green. One LED flash red.So i don't know how to judge there is no signal.

Stifael commented 7 years ago

@sunshine-yan: I actually meant to look at the signal at the snapdragon port. that is independent of the esc. If the snapdragon does not send any pwm singals, then obviously the esc is not responding either.

Before I test, I want to be sure that you have tested with the newest master. Is that correct?

sunshine-yan commented 7 years ago

@Stifael How do I detect if snapdragon send any pwm singals? Is there any place to print?

Stifael commented 7 years ago

I mean you could do PX4_INFO in snapdragon_pwm_out (https://github.com/PX4/Firmware/blob/master/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp#L317) and see what it prints. But before you do that, did you look at the mini-dm what the output is? does it say that the snapdragon_pwm_out is initialized correctly, or is there any error message?

sunshine-yan commented 7 years ago

@Stifael Now it is error. Such as the following picture: default

Stifael commented 7 years ago

I just tested. so the default is set to pwm_out_rc_in. change that to snapdragon_pwm_out as you did, but just write start without defining the port: snapdragon_pwm_out start

sunshine-yan commented 7 years ago

@Stifael Thanks for your help. I try to write: snapdragon_pwm_out start px4 config Add output to the code: default The situation is as follows: qq 20170208104821

Seanmatthews commented 7 years ago

Bump. Any progress?

I've talked to a handful of people with this issue. Specifically, they're all having trouble getting the ESCs to arm on Snadragon Flight using PX4/Firmware as opposed to ATLFlight/Firmware. Are there some settings that need to change? Or do the fc_addon drivers provided by Intrinsyc still need to be loaded on top of those provided by this repo?

julianoes commented 7 years ago

Guys you are talking about two different types of ESCs.

  1. PWM support that was recently added (@Stifael I think that's what you're refering to). needs snapdragm_pwm_out start -d /dev/tty-2
  2. Snapdragon ESCs connected over UART. needs uart_esc start -D /dev/tty-2

@sunshine-yan what is the output in mini-dm when you try to start the uart_esc like this:

qshell uart_esc start -D /dev/tty-2
mhkabir commented 7 years ago

Closing in favour of #6962

alexandrelheinen commented 7 years ago

I am having a similar issue:

I am trying to implement a PX4-based autopilot for a fixed-wing UAV. It turns out that the easiest alternative is to use the 4 PWMs output on port J13 which uses snapdragon_pwm_out module (https://github.com/PX4/Firmware/tree/master/src/drivers/snapdragon_pwm_out).

As we can observe in the source code, it tries to parse the mixer file into a MultirotorMixer object. In practice, I am having the following error from the mini-dm

[08500/00]  01:50.030  HAP:34:Trying to initialize mixer from config file /dev/fs/myfixedwing.main.mix  0166  snapdragon_pwm_out.cpp
[08500/03]  01:50.032  HAP:34:Unable to parse from mixer config file  0181  snapdragon_pwm_out.cpp
[08500/03]  01:50.032  HAP:34:Mixer initialization failed.  0337  snapdragon_pwm_out.cpp

even if I use the example mixer file given in the DevGuide (https://dev.px4.io/airframes-adding-a-new-frame.html).

Does it have any link with the class MultirotorMixer? Could I initialize the fixed-wing mixer without using a .mix file, setting up the MultirotorMixer directly?

LorenzMeier commented 7 years ago

Yeah that's clearly wrong try replacing this here: https://github.com/PX4/Firmware/blob/master/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp#L174

With the more generic call Mixer::from text or something along these lines: https://github.com/PX4/Firmware/blob/master/src/drivers/navio_sysfs_pwm_out/navio_sysfs_pwm_out.cpp#L135-L164

alexandrelheinen commented 7 years ago

UPDATE: the reason why I am getting this error is because the MultirotorMixer::from_text function (https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/mixer/mixer_multirotor.cpp) requires a mixer file which defines the Multirotor Geometry in the first line. However how could I do this for a fixed-wing uav, if only multirotors geometries are accepted?

PX4BuildBot commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 30 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

julianoes commented 6 years ago

Snapdragon Flight is end-of-lifed, anyway, not sure if that's worth the effort, so keeping it closed.