lis-epfl / mavric Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
The qgroundcontrol version currently pointed to by MAVRIC is quite old (version 2.3.0).
I do have several issues with this version:
Should we update to a newer version and/or assure compatibility with this version?
I think it is good to have an official version which is 100% supported
If we update, to which version should we go?
Still refer to maveric instead of mavric
@jlecoeur, @mdouglas90 and I decided to rewrite the controller structure and replace stabilization copter with a flexible cascade controller structure.
Last idea, we provide a templated 'cascade_controller' structure containing a controller for each level and 'mode_' member variable indicating the highest active controller level:
Cascade_controller<Nav, Pos, Vel, Att, rate>
{
public:
enum mode_t {POS_MODE, VEL_MODE, ... }
void update()
{
switch(mode_)
{
case POS_MODE:
// do position control
}
}
private:
Nav_ctrl nav_ctrl_;
Pos_ctrl pos_ctrl_;
Vel_ctrl vel_ctrl_;
Rate_ctrl rate_ctrl_;
Att_ctrl att_ctrl_;
mode_t mode_;
};
However, I find there are some limitations to this approach:
Keeping in mind safety and flexibility, I propose a new approach, where each controller inherits from is underlaying controller level, hence exposing its set function. The challenge of this approach is that the update function has to execute the correct levels. You can find my suggestion here:
https://gist.github.com/basil-huber/4f9f4ff579948129c729f5b5e2fc95c3
So, what do you think?
The file Utilities/Atmel_headers/avr32-gnu-toolchain-3.4.2.435-linux.any.x86.tar.gz seems to be quite old and it no longer works with the existing version on Mavric autopilot. Hence it should be upgraded to a later version.
Here is the connection of PWMs on Mavrimini:
(copy pasted from lis-epfl/MAVRIC_Library#304)
PWM | PIN | TIMER | CHANNEL | SERVO_CONNECTOR | DC_CONNECTOR |
---|---|---|---|---|---|
0 | PB3 | TIM2 | CH2 | 0 | P10 |
1 | PB4 | TIM3 | CH1 | 1 | P11 |
2 | PB5 | TIM3 | CH2 | 2 | - |
3 | PB6 | TIM4 | CH1 | 3 | P12 |
4 | PB7 | TIM4 | CH2 | 4 | - |
5 | PB8 | TIM4 | CH3 | 5 | P13 |
It is not possible to configure 0, 1, 3, and 5 as DC motor controller (2000Hz PWM), and 2 and 4 as servo controller (50 or 200Hz PWM).
This is because PWM 1 and 2 share timer 3, and PWM 3 and 4 share timer 4, so they cannot be configured with different periods.
@GregoireH for next revision of mavrimini, is it possible to do like this ?
PWM | PIN | TIMER | CHANNEL | SERVO_CONNECTOR | DC_CONNECTOR |
---|---|---|---|---|---|
0 | PB6 | TIM4 | CH1 | 0 | P10 |
1 | PB7 | TIM4 | CH2 | 1 | P11 |
2 | PB8 | TIM4 | CH3 | 2 | P12 |
3 | PB9 | TIM4 | CH4 | 3 | P13 |
4 | PB4 | TIM3 | CH1 | 4 | - |
5 | PB5 | TIM3 | CH2 | 5 | - |
This way all DC controllers will have the same period, and the 2 other PWMs can have a period different from the 4 DC ones.
I think these lines should be in the code.
In cc34c4a I added the lines but commented them.
A more automatic solution would be to switch them on by a symbol than we could set in the Makefile.
This would allow to build the code with the lines by e.g. make config
. The downside is a slightly more complicated Makefile and code. What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.