Page 1 of 21

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 06, 2012 10:50 am
by fiendie
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

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 06, 2012 11:18 am
by Hamburger
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.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 06, 2012 11:21 am
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Fri Sep 07, 2012 9:00 am
by nicog
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).

Re: Baseflight aka multiwii port to stm32

Posted: Fri Sep 07, 2012 7:23 pm
by msev
Nico could one do an aeroplane or flying wing mixer with that custom mixer?

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 6:34 am
by nicog
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 6:42 am
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 8:32 am
by msev
Very cool :D... Baro and magneto will also have influence on aero/wing flying mode right?

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 1:50 pm
by copterrichie
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:

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 1:55 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:01 pm
by copterrichie
Well, an I2C-Servo or an I2C-GPS seems to be in other but that will never meet the TC's standard. Hmmm.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:05 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:14 pm
by copterrichie
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?

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:17 pm
by timecop
last I checked, that was the max number available on your beloved tarduino pro mini without hacks.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:21 pm
by copterrichie
I'm asking about the Naze32, how would one go about connecting eight servos to it?

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:23 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 2:26 pm
by copterrichie
Thank you for the information and Yes I do care. Just don't like the BaShing at times.

R: Baseflight aka multiwii port to stm32

Posted: Sat Sep 08, 2012 3:56 pm
by multimee
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

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 09, 2012 12:15 pm
by frog32
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 09, 2012 12:18 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 09, 2012 2:26 pm
by frog32
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

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 12, 2012 11:34 am
by Gimbal
Any chance airplane mode will be implemented ?

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 12, 2012 11:43 am
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 12, 2012 6:11 pm
by Gimbal
Thnx

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 12, 2012 6:24 pm
by copterrichie
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 16, 2012 9:40 am
by kolaa0
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.

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 16, 2012 9:50 am
by timecop
Cool, so the MTK guy was right.
Maybe someone can figure out what's wrong.

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 19, 2012 9:36 pm
by frog32
@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?

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 19, 2012 11:42 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 20, 2012 2:49 am
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 20, 2012 8:53 pm
by frog32
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.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 20, 2012 9:03 pm
by nicog
maybe the gimbal feature is on, wich gives output 1/2 as tilt and roll of gimbal, wich are servos.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 20, 2012 10:34 pm
by frog32
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.

Re: Baseflight aka multiwii port to stm32

Posted: Fri Sep 21, 2012 1:04 am
by timecop
ok haha I will take another look and scope things out and see what's going on.

Re: Baseflight aka multiwii port to stm32

Posted: Fri Sep 21, 2012 5:14 am
by timecop
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

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 23, 2012 8:30 pm
by frog32
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

Re: Baseflight aka multiwii port to stm32

Posted: Mon Sep 24, 2012 9:22 pm
by eirikso
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?

Re: Baseflight aka multiwii port to stm32

Posted: Mon Sep 24, 2012 11:38 pm
by timecop
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.

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 8:32 am
by eirikso
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?

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 8:36 am
by timecop
Did you put foam over baro and make sure there's no wind from props/etc over it?

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 9:54 am
by eirikso
Yes, the baro is well protected with foam that is letting air through. I did not loose power when turning on the baro in the previous version. But unfortunately I changed a lot of settings as well compared to what I had with the previous version, so I don't know if the loss of power is due to the new version or my current settings.

The baro is on a separate board that I soldered on to the FF with wires. The way it is mounted now is that it is inside a blob of foam on top of the board. The baro itself pointing down towards the board. Would that disturb anything? My idea is that it is measuring air pressure, so letting the hole point down shouldn't be a problem as long as it is properly covered from prop wash and sunlight. But still letting air in?

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 10:29 am
by timecop
Yea, thats a good way to insulate it.
When I was testing with bmp, I was experiencing the opposite of what you're seeing... stuff would shoot UP in the air, but once a few meters up it would be decent. Anyway, Freeflight is a pretty bad combo for accZ based alt-hold - adxl345 on there (and rev1 nazes) is really noisy wihtout proper power filtering, plus vibrations will affect it more. This is why you have to use high acc_lpf in level mode. try runing up acc_vel_lpf even more and see if that helps, also you do know you can go to default settings by doing 'defaults' in console right

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 11:16 am
by eirikso
OK. Thank you. I'll do some more tests later today. The tri is very stable and well balanced. The T-motors are smooth out of the box and I've balanced them to perfection as well. The FF is mounted on rubber dampeners and I have no jello on my GoPro on this rig. In my quick test earlier today I had 8" props on. I'll try again with 10" props to give it some more basic power. Will report back here when I've done some more testing.

In general I am extremely satisfied with this multiwii setup. Have been flying KK, KK2, OPCC, Rabbit and Naza. But this baseflight-upgraded FF is now giving me a very reliable and stable platform for both AP, FPV and acro. Would be very nice to get the baro working a bit better for my FPV-flights.

Re: Baseflight aka multiwii port to stm32

Posted: Wed Sep 26, 2012 7:25 pm
by eirikso
Did some more testing and now it is working much better. Didn't change any settings, but got rid of the 8" slowflyers and installed some GWS 3 blade 9" props. And now it keeps the height very well. The only thing I can compare it to is my Naza and rabbits with the old and new baro. The naza is still a step better, but my FF with baseflight is now actually close to the Naza. Both my rabbits are a joke in comparison. When they're not falling out of the sky due to bugs they keep the height with an accuracy of 20 meters or so. Even the one with the new baro.

So, with the settings I mentioned in an earlier post and the 9x5x3 props the FF holds height within 30 cm or so.

But: it is doing some strange pulsating when giving full throttle with the baro turned on.

Too high P, I or... D for altitude?

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 27, 2012 12:01 am
by timecop
acc noise I would suspect.
I wonder if programmatically reducing acc influence (modifying cf factors) or increasing acc lpf based on throttle would help.

Re: Baseflight aka multiwii port to stm32

Posted: Thu Sep 27, 2012 7:58 am
by eirikso
If I understand you correct the FF is disturbed by both physical vibrations and electrical noise. I've ordered one of these: http://www.readymaderc.com/store/index. ... cts_id=533

And will put it between the battery and the power input on the FF to reduce electrical noise. I'll also experiment a bit more with the settings. But I can't seem to find any good descriptions of exactly how the different baro-adjustments work. This is my idea so far:

lpf = low pass filter. So:

acc_lpf_for_velocity
Increasing it will filter out high frequent input from the acc. So, a low value will let the acc influence throttle (height) even for small vibrations. A high value will only let the acc influence throttle for bigger movements of the copter.

baro_noise_lpf
Increasing it will filter out any small changes in pressure and only let the baro kick in for bigger changes in pressure. I already have this pretty high (0.900).

But for these I'm completely blank:
baro_tab_size = 21
baro_cf = 0.985

And for altitude PIDS the D will adjust how fast the main loop will react on altitude? And P+I will adjust how fast the copter should react on baro input?

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 29, 2012 8:53 pm
by dr.tom
at least 1 mag axis is reversed on this 32bit board due to pcb layout :(
http://www.goodluckbuy.com/kcopter-stm32f103cbt6-flight-control-board-with-itg3200-bma180-hmc5883l-ms5611.html

copter is pointing north, but in gui arrow shows south (180 degrees shift).
pitch axis is reversed, roll and Z is ok as it seems for now.

here is a picture of the board, showing a flying direction with red arrow and zoomed MAG chip letters orientation.

Image

not a big thing in acro flying as you can see below,
board flies great with mag off
http://youtu.be/jpGn16prTj4



but I'm planning to hook up an GPS, there it will render it useless.
because it uses mag to turn to an coordinate(home or pos hold) and keep the heading,


please, is there a way to reverse the readings, via some command in ''putty serial''?
if not, can someone compile baseflight.hex with a fix?

in mwii it's just a matter of ''-'' in front of that axis in 'defines' tab, but this 32bit is too new for me at the moment to deal with it.


thanks a lot :)

Re: Baseflight aka multiwii port to stm32

Posted: Sat Sep 29, 2012 10:45 pm
by timecop
yes someone needs to code a way to dynamically swap and invert sensor axes without too much performance hit.
A solution very close to good has been posted before, but still not optimal. compiling stuff by non developers is out of the question. When implemented, it would be a CLI option.

@eirikso - I'm not sure, might be better off asking in the original thread for mahowik alt hold, but I think the consensus there is that adxl sucks for this purpose.

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 30, 2012 12:08 am
by dr.tom
so, for now :(
the only way to fly that IMU(and GY86 I have, same mag orientation) is on good old 8bit atmel?
ordered this shield:
http://www.goodluckbuy.com/kcopter-mult ... opter.html

hope developers will come upon a solution,
performance is not everything, keep that in mind. ;)

Re: Baseflight aka multiwii port to stm32

Posted: Sun Sep 30, 2012 12:27 am
by timecop
you're welcome to submit patches for the features you want added.
This is not supported because apparently no one cares enough to code a solution.
seems you want to make use of different oriented sensors, start coding.