Baseflight aka multiwii port to stm32

Re: Baseflight aka multiwii port to stm32

Postby timecop » Tue Sep 04, 2012 12:04 am

OK, here's what I got to say

Hamburger:

yes, that is part of what I call a problem in the long run. It _needs_ doing, because it is separate forks.

There is no way to "just use" mwc-8bit code directly because:
1) everything is a forest of #ifdef (here it's all compiled and and configurable at runtime)
2) drivers/control code is all mixed and there's no attempt to have any sort of abstraction layer - particularly bad examples: mag and baro stuff
3) 8bit shortcuts are done all over the place - 16 vs 32 bit multiplies if expected value < 65000 etc.

So not all features from arduino-mwii make it into stm32-mwii. Last I looked the entire LCD & telemetry stuff was not there.


LCD is unnecessary because of serial console. It would be basically duplicating all the same functionality of serial console and STILL wouldn't be able to be used as-is because there are a LOT more parameters to configure. For example I'd have to hack in way to change motor mixer or any of the other settings that are only exposed by serial console.

Besides, there is no 'backchannel'. New features from the stm32 fork have no designated mechanism to become part of the arduino-mwii in an orderly fashion.

It's a rewrite for proper hardware only reusing basically bits of control code. Any improvements, if any, would be made with assumption that the hardware is capable so adding an extra sinf() in the main loop doesn't take a week of deliberations and confirmation that it won't affect loop time on atmega168 running at 8MHz. As others said, the code is open and you're welcome to take back ideas or features - I'm sure mega2560 users would like to have a working serial console and all the settings configurable instead of having to recompile stuff. Or heck, forget console and just add them all to LCD if you're into that.

.. and yeah, MS5611 is now officially supported and autodetected even if it's on the same address as BMP085.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby Hamburger » Tue Sep 04, 2012 9:55 pm

Hi timecop,
you respnded to my post from June 29th - more than 2 months old.
You really do some catching up :)

timecop wrote:
Hamburger wrote:yes, that is part of what I call a problem in the long run. It _needs_ doing, because it is separate forks.

There is no way to "just use" mwc-8bit code directly because:
1) everything is a forest of #ifdef (here it's all compiled and and configurable at runtime)
2) drivers/control code is all mixed and there's no attempt to have any sort of abstraction layer - particularly bad examples: mag and baro stuff
3) 8bit shortcuts are done all over the place - 16 vs 32 bit multiplies if expected value < 65000 etc.

yes, I understand the different capabilities of the hardwares and the non-portable structure of current mwii code.
Still, two separate forks will either require continuous work on both sides for porting back and forth or will drift apart over time.
So not all features from arduino-mwii make it into stm32-mwii. Last I looked the entire LCD & telemetry stuff was not there.


LCD is unnecessary because of serial console. It would be basically duplicating all the same functionality of serial console and STILL wouldn't be able to be used as-is because there are a LOT more parameters to configure. For example I'd have to hack in way to change motor mixer or any of the other settings that are only exposed by serial console.

from what I understand your console is the equivalent of the lcd config menu in MWii. Of course you provide more/other options since you converted compile time switches into cli-selectable items; I like that runtime-select over compiletime.define; MWii on 328p cannot do that for all supported hardware and features due to limited resources.

In MWii, the lcd also serves the purpose of telemetry - via serial over wireless (BT or other) or to i2c displays. Dunno if/how baseflight does telemetry.

Anyway, LCD was only meant as an example to drive the point - baseflight and MWii are already apart; supported sensors might be another example?
Besides, there is no 'backchannel'. New features from the stm32 fork have no designated mechanism to become part of the arduino-mwii in an orderly fashion.

It's a rewrite for proper hardware only reusing basically bits of control code. Any improvements, if any, would be made with assumption that the hardware is capable so adding an extra sinf() in the main loop doesn't take a week of deliberations and confirmation that it won't affect loop time on atmega168 running at 8MHz. As others said, the code is open and you're welcome to take back ideas or features - I'm sure mega2560 users would like to have a working serial console and all the settings configurable instead of having to recompile stuff. Or heck, forget console and just add them all to LCD if you're into that.

so indeed there is no backchannel.

I have 2 stm32 boards plus ulink2 in the drawer. I am waiting to see telemetry in baseflight with options for i2c displays and serial (over wireless, BT) gadgets (like smartphones with terminal programs).

You have done a load of work on baseflight and still do, I applaud you for that.
For the sake of MWii, I still think it could benefit from a common source base instead of drifting forks. Alas, when I asked for input on a multi-platform MWii code there was little response. I understand it would not be easy. So it seems the pain is not yet strong enough, the benefits not sweet enough.

We shall keep watching out, right?
User avatar
Hamburger
 
Posts: 2317
Joined: Tue Mar 01, 2011 2:14 pm

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Tue Sep 04, 2012 9:59 pm

Hamburger wrote:For the sake of MWii, I still think it could benefit from a common source base instead of drifting forks. Alas, when I asked for input on a multi-platform MWii code there was little response. I understand it would not be easy. So it seems the pain is not yet strong enough, the benefits not sweet enough.

We shall keep watching out, right?



The only way I see this happening is, upgrading to an ATMEGA2560 and nothing less. Truth is sometime hard to accept. :(
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Wed Sep 05, 2012 2:02 am

The only supported telemetry currently is output of FrSky binary protocol for either FrSky LCD or er9x+mods receivers. This dumps flight time/gps data/accel values (fairly useless)/battery voltage.

Normal flight telemetry (via bt/xbee/whatever) and going to multiwiiconf works too.
I know there's some stuff like minmax counters for various sensors, but that didn't make it in since the only way to view it was by lcd , i could put same stats in serial console .. but dunno if its any useful there. though I suppose things like max height/etc might be interesting.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby nicog » Wed Sep 05, 2012 6:49 am

TC, I can update my configurator to use that telemetry max min stuff and all telemetry data, can't be that dificult.
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Thu Sep 06, 2012 2:15 am

Right, I might consider readding it in some form at some point.

However what I did commit with r205 is redone mixer code. Moved all hardcoded stuff into tables, in preparing for custom mixer.
RIght now, any of the predefined tables are copied into the custom mix and used that way. if cfg.customMixer[] is filled with data and MULTITYPE_CUSTOM is chosen, this is used instead. The custom stuff is still work in progress as there's no UI to configure it.

I did triple-check all mixers and hopefully didn't break anything BUT I only hovered quadX mix - people using QuadP or hexa/octo please check CAREFULLY motor responses.

r207 now has custom mixer loading stuff.
http://code.google.com/p/afrodevices/so ... tail?r=207
example of using it in cli:
http://bcas.tv/paste/results/xToE9w26.html
setting throttle of any motor to 0 will disable that motor. all 5 parameters are required, and space between params can only be one space, not several, or else stuff will break.

Mixer will do a sanity check (sum of powers) to see if mix is valid or not. You can still fly with wrong mixer, but don't expect it to work.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby Hamburger » Thu Sep 06, 2012 9:28 am

timecop wrote:Normal flight telemetry (via bt/xbee/whatever) and going to multiwiiconf works too..

I find using an old BT enabled smartphone/gadget with a terminal program is much more versatile. And I can live without fancy graphics for tradeoff.

Currently available info via telemetry includes
- rx signal input values
- motor+servo output values
- gyro&acc sensors readings
- battery voltage, amps
- battery remaining capacity
- armed time, uptime
- alittude, max. altitude
- active options (level, angle, althold...)
- diagnostics (failsafe, i2c errorcount, cycletime min/max, debug[])

it is quite useful info at times.
User avatar
Hamburger
 
Posts: 2317
Joined: Tue Mar 01, 2011 2:14 pm

Re: Baseflight aka multiwii port to stm32

Postby nicog » Thu Sep 06, 2012 9:45 am

I'm sorry hamburguer,

but:

- rx signal input values this is done with numbers and line bar to be much faster reading (a green line that move is better than a small number that changes)
- motor+servo output values same as above
- gyro&acc sensors readings graph does that in visual way, but if you want to see the numbers I have them just next to the graph
- battery voltage, amps yes my batery alarm show voltage and vibrates if the alarm is set!
- battery remaining capacity powermeter stuff?? If you ask me nicely I can add it.
- armed time, uptime also ask me nicely I'll do it for you
- alittude, max. altitude I will add it, that is in the todolist
- active options (level, angle, althold...) the switch tab show the active options in green. Please tell me that is easier to get them on a terminal
- diagnostics (failsafe, i2c errorcount, cycletime min/max, debug[]) I also can add a tab for you if you ask nicely

and finally:

I find using an old BT enabled smartphone/gadget Naze32 configurator is android 2.1 compatible, wich seems to be an old one.
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby Hamburger » Thu Sep 06, 2012 10:25 am

nicog wrote:I'm sorry hamburguer,

but:

... If you ask me nicely I can add it.
...
I find using an old BT enabled smartphone/gadget Naze32 configurator is android 2.1 compatible, wich seems to be an old one.


NicoG,
I am not competing with you.
Yes, a text based (terminal) interface has its shortcomings and advantages when compared to a real GUI.

With the current implementation of telemetry integrated in MWii, it is all open source, so I need not 'ask nicely' and wait but do it myself if I want to. When developing new features this has proven to be a huge benefit.

An android app will not work with anything but android. That leaves old palmos, symbian, win* and everything else useless.

Please understand not everyone likes using a closed source app in the context of open sourced MWii or basefilght. I certainly do not but that is for everyone to decide for oneself.
User avatar
Hamburger
 
Posts: 2317
Joined: Tue Mar 01, 2011 2:14 pm

Re: Baseflight aka multiwii port to stm32

Postby nicog » Thu Sep 06, 2012 10:43 am

I'm not competing with you either.
But my code is free to everyone. it's not closed source. Maybe closed mind. But hey, everyone do what he wants right? free world?

So yes, asking nicely is a way to do the things right. And you know something? It works really great.

Please understand that the telemetry implementation maybe is not needed in the 32bits port. And if you want to use it, as you said, code it and commit to svn.
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby fiendie » Thu Sep 06, 2012 10:50 am

nicog wrote:And if you want to use it, as you said, code it and commit to svn.

Or better yet, open a pull request on GitHub! https://github.com/fiendie/baseflight
I am maintaining an up to date clone of the SVN repo just there to piss dongs off ;P
fiendie
 
Posts: 138
Joined: Fri Apr 20, 2012 4:22 pm

Re: Baseflight aka multiwii port to stm32

Postby Hamburger » Thu Sep 06, 2012 11:18 am

nicog wrote:I'm not competing with you either.
But my code is free to everyone. it's not closed source.

ok, so your app is GPLed open source and I mixed that with another android app which is closed source. When I followed the link in the initial post here, all I found was a binary download. So it was my fault, good.
Please understand that the telemetry implementation maybe is not needed in the 32bits port.

so long as everyone is happpy to own and use an android device.

My post was meant as an answer to timecop's statement and not to critizise your app. As I am not intending to use baseflight in the imminent future, I feel it not appropriate to comment on baseflight more than I already have.

In earnest, have fun. It's a hobby.
User avatar
Hamburger
 
Posts: 2317
Joined: Tue Mar 01, 2011 2:14 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Thu Sep 06, 2012 11:21 am

the 'serial console' / cli stuff already works from regular vt100 terminal and every setting thats available in GUI can also be changed there via the 'set' command. I'll see about doing printing out raw rc/motor numbers + some telemetry. not anything i'd ever use but could be fun.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby nicog » Fri Sep 07, 2012 9:00 am

I added the custom mix feature into the windows based GUI. You can download it here:
http://tinyurl.com/8evhl7n

You should read the manual about motor order. I will simplify the use of this (for now it's the user who calculate the values).
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby msev » Fri Sep 07, 2012 7:23 pm

Nico could one do an aeroplane or flying wing mixer with that custom mixer?
msev
 
Posts: 181
Joined: Thu Apr 14, 2011 11:49 am

Re: Baseflight aka multiwii port to stm32

Postby nicog » Sat Sep 08, 2012 6:34 am

Msev, I don't think so because custom mixer is for motor position only. No servo can be mixed for now, board side.

I need to rewrite the equations to try to simplify the method of calculation.
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sat Sep 08, 2012 6:42 am

Yeah airplane mix stuff will be done separately, to allow servos/direction/etc.
Still planning a good way to do that.

Will probably merge flying wing and aeroplane mixers together, and just allow enough customization so it can be configured either way.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby msev » Sat Sep 08, 2012 8:32 am

Very cool :D... Baro and magneto will also have influence on aero/wing flying mode right?
msev
 
Posts: 181
Joined: Thu Apr 14, 2011 11:49 am

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Sat Sep 08, 2012 1:50 pm

timecop wrote:Yeah airplane mix stuff will be done separately, to allow servos/direction/etc.
Still planning a good way to do that.

Will probably merge flying wing and aeroplane mixers together, and just allow enough customization so it can be configured either way.


LOL, you don't have a solution but yet you BASH others for their work in progress? :lol: :lol: :lol:
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sat Sep 08, 2012 1:55 pm

I have a solution that looks like a turd, I can commit it today.
Or I can spend some time on it and make it nice - something most 8bit devs dont seem to care about.

p.s. enabled GPS in PWM mode as well - reduces number of channels to 4RC+2 AUX.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Sat Sep 08, 2012 2:01 pm

Well, an I2C-Servo or an I2C-GPS seems to be in other but that will never meet the TC's standard. Hmmm.
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sat Sep 08, 2012 2:05 pm

With 8 servos available in airplane mix mode, I doubt there's going to be any need for a HACK.
And with serial GPS working in both PPM and PWM input modes, what's the point for I2C GPS again? Remind me. Another point of failure? OK, thanks.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Sat Sep 08, 2012 2:14 pm

timecop wrote:With 8 servos available in airplane mix mode, I doubt there's going to be any need for a HACK.
And with serial GPS working in both PPM and PWM input modes, what's the point for I2C GPS again? Remind me. Another point of failure? OK, thanks.


Your Words: "p.s. enabled GPS in PWM mode as well - reduces number of channels to 4RC+2 AUX."

P.S. I count six motor pins, where do the other two servo pins come from?
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sat Sep 08, 2012 2:17 pm

last I checked, that was the max number available on your beloved tarduino pro mini without hacks.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Sat Sep 08, 2012 2:21 pm

I'm asking about the Naze32, how would one go about connecting eight servos to it?
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sat Sep 08, 2012 2:23 pm

There are total 14 PWM channels that can be configured as inputs or outputs in various groups.
If you truly care, have a look around http://code.google.com/p/afrodevices/so ... /drv_pwm.c

There are 6+8 header pins where things can be connected. Infact if one so wishes, the 6 motor pins can be used as RC inputs and the 8 pins on the side can be outputs etc.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Sat Sep 08, 2012 2:26 pm

Thank you for the information and Yes I do care. Just don't like the BaShing at times.
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

R: Baseflight aka multiwii port to stm32

Postby multimee » Sat Sep 08, 2012 3:56 pm

timecop wrote:p.s. enabled GPS in PWM mode as well - reduces number of channels to 4RC+2 AUX.


Great, TC! I'm sincerely grateful :D
multimee
 
Posts: 1
Joined: Tue Mar 13, 2012 1:25 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Sun Sep 09, 2012 12:15 pm

timecop wrote:I have a solution that looks like a turd, I can commit it today.
Or I can spend some time on it and make it nice - something most 8bit devs dont seem to care about.


but it would be good for all who are also coding on the same project. i am waiting for your solution i nearly went back to the last commit having flying wing support. you could push those things to a feature-mixer branch and let others participate in searching for ideas.

i don't knew ho expensive merging or rebasing is with svn but i am doing this up to 20 times a day at work using git where branching and merging is low cost.
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sun Sep 09, 2012 12:18 pm

Basically the problem with current solution is lack of flexibility. Too much stuff needs to be configurable, even previous builds needed recompile. I'll bring that back in a bit w/some more options as a temporary solution (flyingwing only) but for future, proper mixer needs to be reimplemented.

edit: k, flyingwing mixer is back. airplane mixer will happen later.

as far as ideas/discussion, go ahead.
basically: it has to be configurable, nothing hardcoded, fairly flexible (i.e. completed airplane mixer would be able to do flyingwing just by configuring it as such), and be able to mix in X number required servos in whatever orientation.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Sun Sep 09, 2012 2:26 pm

thanks for bringing flying wing back. i'll test it as soon as i can leave the city.

regarding your mixer thing: what about having a set of configurable mixes like in er9x (http://www.youtube.com/watch?v=uc3TdQhNc_g). it would be enough to have those sources: rcchannels, pid loops, fixed value and a weight for each of them.

it's not that easy to implement it so it's usable in the console but it would be possible

edit: i tried it on my wing right now. mixes in gui seem ok but they aren't written to the servos. tried to add
Code: Select all
            pwmWriteServo(0, servo[0]);
            pwmWriteServo(1, servo[1]);

in writeServos in mixer.c line 200 but it didn't do the job
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby Gimbal » Wed Sep 12, 2012 11:34 am

Any chance airplane mode will be implemented ?
Gimbal
 
Posts: 141
Joined: Tue Jul 24, 2012 7:14 pm
Location: Sweden

Re: Baseflight aka multiwii port to stm32

Postby timecop » Wed Sep 12, 2012 11:43 am

frog32 wrote:thanks for bringing flying wing back. i'll test it as soon as i can leave the city.

regarding your mixer thing: what about having a set of configurable mixes like in er9x (http://www.youtube.com/watch?v=uc3TdQhNc_g). it would be enough to have those sources: rcchannels, pid loops, fixed value and a weight for each of them.

it's not that easy to implement it so it's usable in the console but it would be possible

edit: i tried it on my wing right now. mixes in gui seem ok but they aren't written to the servos. tried to add
Code: Select all
            pwmWriteServo(0, servo[0]);
            pwmWriteServo(1, servo[1]);

in writeServos in mixer.c line 200 but it didn't do the job

that was the problem, it should work, no?

Remember for airplane-like stuff I rewrote PWM driver, so now M1 pin is gonna be throttle, and then servos 4+ are on M3, M4.. etc (motor pins).
Did you check there? I just commited the fix for writing servos though. This is not in the manual yet but I'll stick it there on next revision.

Gimbal wrote:Any chance airplane mode will be implemented ?


Sure, you can start on it :) See discussion above.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby Gimbal » Wed Sep 12, 2012 6:11 pm

Thnx
Gimbal
 
Posts: 141
Joined: Tue Jul 24, 2012 7:14 pm
Location: Sweden

Re: Baseflight aka multiwii port to stm32

Postby copterrichie » Wed Sep 12, 2012 6:24 pm

FYI TC, I am busy building a new airplane for testing. I first need to make sure it flies well before installing a flight controller.
copterrichie
 
Posts: 2213
Joined: Sat Feb 19, 2011 8:30 pm

Re: Baseflight aka multiwii port to stm32

Postby kolaa0 » Sun Sep 16, 2012 9:40 am

Yesterday I tried the latest build-218

Past 10 seconds after turn on GPSHOLD mode, system is out of control, it not response to commands and dives to the ground. After that, on the earth, i cant turn off the motors. It looks like board hangs.
kolaa0
 
Posts: 1
Joined: Sun Sep 16, 2012 9:28 am

Re: Baseflight aka multiwii port to stm32

Postby timecop » Sun Sep 16, 2012 9:50 am

Cool, so the MTK guy was right.
Maybe someone can figure out what's wrong.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Wed Sep 19, 2012 9:36 pm

@timecop: tried flying wing again. mixer seems ok. i couldn't start the motor and tried to reduce motorpwm to 50hz. i even tried probing with a servo. which pin should be motor out on flying wing? is it possible that pwm initialisation doesn't work with flying wing?
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Wed Sep 19, 2012 11:42 pm

check the source - in servo/wing modes, pwm1/2 are motors, the rest are servo.
so first servo will be pwm3, etc.

so you should have the motor plugged into pwm1.
I'm pretty sure it should be working.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Thu Sep 20, 2012 2:49 am

I enabled the new mahowik althold in baseflight since r220.
Those with freeflight/afro32 hardware can try it out by grabbing latest build. All the parameters are tunable:
acc_lpf_for_velocity = 10
baro_tab_size = 21
baro_noise_lpf = 0.600
baro_cf = 0.985
Probably start with some fixed looptime as well, 3000 seems to be a good choice.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Thu Sep 20, 2012 8:53 pm

on pwm1/2 i have valid servo outputs but they seem to be the wing servo mixes. maybe the servo mapping is wrong and it overrides motor out.

Your pwm init procedure is too crazy for me without some more comments. But the Problem seems to be in there.
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby nicog » Thu Sep 20, 2012 9:03 pm

maybe the gimbal feature is on, wich gives output 1/2 as tilt and roll of gimbal, wich are servos.
nicog
 
Posts: 88
Joined: Tue Aug 21, 2012 2:21 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Thu Sep 20, 2012 10:34 pm

not it's not on and it's realy wing output i have gyro correction, and also the radio input in it and it reacts to changes in pitch_direction_r etc.
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Fri Sep 21, 2012 1:04 am

ok haha I will take another look and scope things out and see what's going on.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Fri Sep 21, 2012 5:14 am

frog32 wrote:on pwm1/2 i have valid servo outputs but they seem to be the wing servo mixes. maybe the servo mapping is wrong and it overrides motor out.

Your pwm init procedure is too crazy for me without some more comments. But the Problem seems to be in there.


ok you were right.
in the leftover hack of remapping motors as servos when useServo was on, i also did same for airplane mix, essentially killing the motor outputs and replacing with servos.

Now it works correctly and flyingwing layout is:

PWM1 = throttle
PWM2 = unused
PWM3, 4 = servos

Only tested in PPM mode but it should be fine in PWM as well
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby frog32 » Sun Sep 23, 2012 8:30 pm

i 've tested it today and it seems to work. i wasn't able to test fly it but the corrections are being made in the right direction, and motor is working again.

tanks
frog32
 
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Baseflight aka multiwii port to stm32

Postby eirikso » Mon Sep 24, 2012 9:22 pm

acc_lpf_for_velocity = 10
baro_tab_size = 21
baro_noise_lpf = 0.600
baro_cf = 0.985


I just soldered a baro on my FreeFLight 1.2. It showed up and I can activate it. Works fairly well but it would be interesting to tune it. The problem is that I can't seem to find a description of the parameters.

Anyone with a link or a quick description?
eirikso
 
Posts: 11
Joined: Wed Apr 04, 2012 10:54 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Mon Sep 24, 2012 11:38 pm

check the altitude hold improvement thread in software section.
There are different params needed for bmp85, both lpf and cf.
since default adxl on free flight is pretty noisy, you might want to increase lpf for velocity as well.
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Re: Baseflight aka multiwii port to stm32

Postby eirikso » Wed Sep 26, 2012 8:32 am

Thank you. I read through the thread and found this post very useful: viewtopic.php?p=22429#p22429

Grabbed the latest build from SVN and tried the following ALT-PIDS: 5 - 0.030 - 30

When looking at the data in the GUI it seemed like there was a lot of noise from the baro, so I increased the baro_noise_lpf to 0.900 and increased acc_lpf_for_velocity to 15.

My quick test today was not very good. I simply lost a lot of power when turning on the baro. The tricopter tried its best to hold the height, but with modest success. Probably because of the low power. When turning off the baro again the tri got its power back and thrusted upwards.

Any hints on what settings to adjust?
eirikso
 
Posts: 11
Joined: Wed Apr 04, 2012 10:54 pm

Re: Baseflight aka multiwii port to stm32

Postby timecop » Wed Sep 26, 2012 8:36 am

Did you put foam over baro and make sure there's no wind from props/etc over it?
timecop
 
Posts: 1726
Joined: Fri Sep 02, 2011 4:48 pm

Next

Return to Software

Who is online

Users browsing this forum: No registered users and 1 guest