Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArduPilot SITL quadrotor not work #1

Open
GChasing opened this issue Jul 13, 2022 · 9 comments
Open

ArduPilot SITL quadrotor not work #1

GChasing opened this issue Jul 13, 2022 · 9 comments

Comments

@GChasing
Copy link

I have clone the repository via "git clone --recursive -b EuroGNC_2022_flight_test https://github.com/ybeyer/ardupilot.git"
but when the flight mode is switch mode 29, the quadrotor in sitl seems to overturns without any controller works.
Other modes, such as stabilize works fun.
By the way, i add some print message in the "void ModeCustom::run()", but it also doesn't works. I'm starting to wonder if it runs.
Thus, please enlighten the right steps how to implement the ftc code for the quadrotor.

@ybeyer
Copy link
Contributor

ybeyer commented Jul 13, 2022

Hi, I just tried to reproduce the problem, but for me already cloning the ArduPilot fork (git clone --recursive -b EuroGNC_2022_flight_test https://github.com/ybeyer/ardupilot.git) does not work properly.
Could you send me the console output of git status in the ArduPilot fork? Maybe you have the same problem.

@GChasing
Copy link
Author

Thank you for your replay so quickly. Here are the git log and git status below:
Screenshot from 2022-07-13 19-23-48
Screenshot from 2022-07-13 19-23-35
Remark: The modified files are mainly for adjusting the difference between your code version and the submodule version.
And, can the sitl works without communicating with Matlab/Simulink? As for the practical flight you have done very well.
Hope for your replay!

@ybeyer
Copy link
Contributor

ybeyer commented Jul 13, 2022

I had a problem with my git config but now it works again.

I have an idea what your problem might be.
The motors can be switched off with RC 7 and RC 8. In my case RC 7 and RC 8 are initialized with 1500 in the SITL, which is a problem. This means that some motors are saturated at 1500 PWM and causes the quadrotor to rotate moderately fast around the vertical axis.
All motors are fully active when RC 7 and RC 8 are set to 1000. You can do this for example via the console:
rc 7 1000
rc 8 1000
Complete motor faults can then be injected by setting RC 7 and/or RC 8 to 2000:
rc 7 2000
More info can be found in the simulink file ArduCopter_MinnieLoiterFtc in the ardupilot_implementation subfolder.

If that was not the problem, could you share a (private) YouTube video?

The SITL generally also works without Matlab/Simulink. Matlab/Simulink is used here only as a physical model of the quadrotor. However, if you want to use a different simulator you have to make sure that the physical model is very similar.
If you want to design a similar controller for a different quadrotor, a look into the Readme of LADAC-Examples may help.

@GChasing
Copy link
Author

Thanks for your kindly help.

The record video can be accessed via FTC_ArduPilot_For_Issue.
Moreover, I have upload the whole soure code(including the submodule) at github. FTC_ArduPilot_Tmp. Could you please checkout what is wrong?
The simplest way is

git clone https://github.com/GChasing/FTC_ArduPilot_Tmp.git
./waf configure  --board=sitl
./waf copter
cd Tool/autotest
./sim_vehicle -v ArduCopter --add-param-file=Minnie.parm --console --map

Thanks agains, and hope keeping in touch!

@ybeyer
Copy link
Contributor

ybeyer commented Jul 14, 2022

Hi, thanks for the video! If I see it correctly, you are using the standard ArduCopter SITL quadrotor instead of the quadrotor Minnie (Simulink). This quadrotor is probably too different from the quadrotor Minnie, which leads to unstable flight behavior.

Have you already tried the SITL with the Simulink model or do you not have a Matlab license?

I have never done this, but you can certainly configure the quadrotor of the ArduCopter SITL. If you configure the copter like Minnie, it should work.
You can find the parameters of Minnie (weight, inertia etc.) in libraries/ladac-examples-data/LADAC_params/Minnie/copter_params_Minnie.m

I hope this helps and you get it working with it.

@GChasing
Copy link
Author

I guess you are right about the mismatch quadrotor model I have used. But where is the model(gazebo), I mean, --model=gazebo, located?

I'm trying to use the simulink model in the matlab, but the Matlab(Version 2019a) is installed on another computer, whoes
operating system is Windows, and the ArduPilot SITL is running under Ubuntu. The two computer is connected via
local wireless network.
Remark: QuadcopterSimModel_ArduPilot_SITL/From ArduPilot SITL the receive port has been replaced with 14550/ send port
14551

Or maybe, can you share the video about how to implement the whole SITL system on youtube?

Best wishes and many thanks to you!

@ybeyer
Copy link
Contributor

ybeyer commented Jul 21, 2022

Sorry for the late reply. Have you made any progress in the meantime?

We don't use Gazebo, we just use the interface for Gazebo (more info here).

I've never done this, but I would assume that you can run SITL on two computers (one computer with ArduPilot and the other computer with the physical simulation model). I did some quick research and found this, for example.

I hope this helps and look forward to your reply!

@GChasing
Copy link
Author

GChasing commented Jul 21, 2022

I am glad to here your replay. I'm very interested in your work, and want to reproduce your work.

But since the parameters in the standard ArduCopter SITL quadrotor do not work properly, I'm going to learn how to use the Matlab/Simulink module in this repository. Up to now, I can only run the "Customize simulation" section, which is all in Matlab/Simulink module, and it's difficult to understand this so many submodule. However, I'm curious about how to realize that running the code in the Pixhawk, just like the video. Video for this repository.

Can you share some videos about how to implement the whole SITL system on youtube?

@aogrcs
Copy link

aogrcs commented Mar 20, 2024

I have clone the repository via "git clone --recursive -b EuroGNC_2022_flight_test https://github.com/ybeyer/ardupilot.git" but when the flight mode is switch mode 29, the quadrotor in sitl seems to overturns without any controller works. Other modes, such as stabilize works fun. By the way, i add some print message in the "void ModeCustom::run()", but it also doesn't works. I'm starting to wonder if it runs. Thus, please enlighten the right steps how to implement the ftc code for the quadrotor.

Hi, when I run the scripts init_Minie_Loiter_FTC, it says that it could not recognize the variable "copter", have you ever seen this? Thanks
My matlab version is 2022b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants