MikroKopter - Forum » MikroKopter - general » Low cost wood mikrokopter from Russia)

Low cost wood mikrokopter from Russia)

Seite: 1 2 >

Autor Neuer Beitrag
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
Guten Tag!

I’d like to expose my current mikrokopter (experimental version). It can fly and has the following configuration

1. Flight-Ctrl v1.3
2. Propellers 12” with propeller savers
3. Wood arms with foam plastic on the ends..
4. Motors: Turborix kv 800 D2830
5. TowerPro W30A Brushless Speed Controllers (without any modification)
6. Turnigy 9X 9Ch radio control
7. 2.4Ghz Module for TGY 9X Transmitter
8. TGY 9X 8ch 2.4Ghz Receiver (FHSS)
9. ATMega8 i2c (twi) to pwm (4 channels) converter for Brushless Speed Controllers
10. ATtiny26 4 channels PWM (Receiver) to PPM (Flight-Ctrl) converter

Sources and firmwire:
63Hz for PWM output version I2C to PWM
200 Hz for PWM output version I2C to PWM 200hz

125 Hz for PWM output version I2C to PWM 125hz
PWM to PPM

Scheme
User image

Mikrokopter pictures

User image


User image


User image


Video
http://vimeo.com/6304210

Unfortunately I powered my receiver wrong recently and it died, so now I’m controlling the mikrokopter by wire (I use trainer PPM output in radio control) and waiting the new hobbyking receiver. Mikrokopter is also powered from ATX. So I have 3 wires going to the mikrokopter: GND, PPM, +12V. I think I have the craziest mikrokopter now:)

You ask me how one ATMega8 converter has four i2c slave addresses? I did one trick: after ATMega8 receives the data for the first i2c slave address, it changes its own slave address to the second one and so on. So it’s ATMega8 with the rotating i2c slave address:)

PWM (Receiver) to PPM (Flight-Ctrl) conversion is based on this article http://jreise.de/PPM/R617FS.html I made a little modification so it worked with my receiver.

Some advices from my practice:

1. You can use USB data cable from your phone with Mikrokopter-Tool to configure mikrokopter. All you need is to find TX,RX and GND pins in it. I use data cable from Samsung C100 and AVRDragon for uploading firmware.
2. You don’t need to adjust precisely Nick and Roll in Mikrokopter Tool. You need to adjust precisely the position of mikrokopter board after you mount it to the frame and see mikrokopter is drifting in the flight. So you should adjust mikrokopter board position to kill drifting.
3. Soldering must be very strong, if you don’t want re-solder after each hard landing.

If someone can compare my i2c to PWM convention with original BL-Ctrls this would be great! Let me know. Yura
« Bearbeitet von l0pan am 10.09.2009 19:36. »
MK-Betatester
Registriert seit: Aug 2008
Beiträge: 4167
Ort: München , Neu-Perlach
ну вы блин даёте :-)

.
Mitglied
Registriert seit: Jan 2009
Beiträge: 907
Ort: Zürich
Hi,

Haha, that's great!!! I love it.

If your PWM brushless controllers are fast responding enough, they will probably be just as good as the "original" ones.

You could maybe modify the PWM-PCM controller and the FC, so they communicate over a data bus. The one used for ISP, maybe? I did not check whether that is available in th FC though. It might be a little more precise than encoding to PCM and decoding it again. But heck, if it works...

Your cable also is an altitude hold system, I presume :) The higher it goes, the more cable it must carry. They used the same system on manned balloons once, with a long rope. With the rope attached to a boom extending sideways from the gondola, it was also a yaw hold system - the other side of the gondola would always face the direction of flight. Some even made use of the braking force of the rope, and used the back-wind it created to maneuver the balloon with sails... Your aircraft is not the first to have a cable dragging behind it. But maybe the first to run off an ATX supply ;)

What do you mean with TX, RX pins in an USB data cable? A converter cable USB<-->asynchronous? Anyway I also upload firmware without the MK-Tool - I have an AVRISPMkII.

Funny, I also use an alternative way of ACC calibration, after my MK just wouldn't stand still in ACC mode: I place it on something so that its attitude is opposite of the error (eg if it tends to dip the right-hand side in flight, I raise that side), and then calibrate. Worked great.

Now get some bigger woods, 3 variable pitch counter-rotating turboprops from an old TU-95, and put it together with a seat on top of it. Then you don't have to wait for your new receiver.

Kind regards
Soren
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
Thanks.
dongfang meinte
If your PWM brushless controllers are fast responding enough, they will probably be just as good as the "original" ones.

Actually I don't know how fast they can be, but as i understand i can vary their rate by changing PWM frequency. It's 16 ms or 62.5hz now. What is motor's update rate for BLCtrls?
dongfang meinte
What do you mean with TX, RX pins in an USB data cable? A converter cable USB<-->asynchronous? Anyway I also upload firmware without the MK-Tool - I have an AVRISPMkII.

Yes, usb <-> uart for tweaking MK parameters
dongfang meinte
Now get some bigger woods, 3 variable pitch counter-rotating turboprops from an old TU-95, and put it together with a seat on top of it. Then you don't have to wait for your new receiver.

:)
Mitglied
Registriert seit: Sep 2009
Beiträge: 1
Привет!
Наконец то сделали выход с FlCtrl на обычные регуляторы!
Как летает? Хватает ли быстродействия?
Насколько видно из схемы- Вы в процессорах используете внутренний генератор...
Нельзя ли скинуть Фузи- биты для них?
С уважением, rubik (Сергей)

Hi!
As I can see from the schematic, you used internal RC oscillator in ATmega8...
By the way - can you list the fuse-bits settings for Atmega8?

WBR,
rubic (Sergey)
« Bearbeitet von rubik am 04.09.2009 16:51. »
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
Привет!
У меня случилось поломка: сломалась из-за сучка одна нога:( Я сделал новый карбоновый фрейм с новыми моторами, но почему МК стал какой-то дерганный : я держу его в руках, увеличиваю обороты, а он внезапно начинает дергаться. Пока не нашел причину… Теперь хорошие новости:

I made new version of firmware: it’s 200 Hz for PWM output now. There are 4,8 and 12 motors versions. 12 motors version uses also PortB of the mega.
Yes, it uses internal RC oscillator at 8 Mhz frequency and with any other fuse settings I guess.

http://sites.google.com/site/l0pan321/i2c2pwm-200hz.rar
« Bearbeitet von l0pan am 04.09.2009 22:26. »
Mitglied
Registriert seit: Jun 2008
Beiträge: 1
Привет всем)) нужна ваша помощь,
очень сложно поддержать стабильный полет, коптер постоянно заваливается на один бок..
сначала это было следствием перегоревшего гироскопа, я его заменил, теперь с этим вроде все ок.
Когда подключаю коптер к mk-toolsб при управлении с передатчика видно, что левый мотор работает на более низких оборотах чем остальные.. в чем может быть дело? (Когда контролю моторы с мануал режима mkTools все ок, все моторы работают синхронно и исправно)
И если не сложно скиньте параметры для "Beginner", а то я случайно все потер))

С уважнием
Илья
Mitglied
Registriert seit: Jun 2009
Beiträge: 100
Ort: Bremen
Dear Yura,
this sounds very interesting to me! I developed a tricopter ( http://shrediquette.blogspot.com ), and I would like to make it work with standard ESCs. I am using modified towerPro n18A ESCs, but other people might have problems modifying the ESCs. You are using PD0-PD3 for the motors? Do I have to change any fuse settings of the Mega8? Will your software cause problems if it receives 3 motor values only (I would like to use it for a tricopter)? If so, would there be a way to modify the source code? Any other things that I have to take care of when using your software?

Thanks for your reply,
all the best,
William
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
@Ilya
Угол Roll в МКTool в нуле или нет? Наклоните МК чуть вправо и откалибруйте акселерометры.

@Willa
Yes, exactly.
it works with internal RC oscillator at 8 Mhz frequency and with any other fuse settings.
No, 4motors version won’t work with 3 copter (mega8 will get i2c address for the 4th ESC and wait command for the 4th motor forever), but I added 3 motors version here http://sites.google.com/site/l0pan321/i2c2pwm-125hz.rar
Mitglied
Registriert seit: Jun 2009
Beiträge: 100
Ort: Bremen
Thank you very much Yura! I'll try that. Do you still have jitter in the PWM signals? I am thinking about making a converter with three mega8 µC's (TQFP packages). That is some sort of overkill, but it would enable a jitter-free I2C -> PWM conversion with update rates of about 300 Hz... But first, I will try your version.
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
No jitter, I found the way to kill it with the following code

SIGNAL( SIG_OVERFLOW1 )
{
while(TCNT1<700) asm("nop");
SERVO_PORT = 1 << current_servo;
TCNT1=65535 - 8000 - 8*4*motors[current_servo];
current_servo = (current_servo + 1) % MotorCount;
}
Mitglied
Registriert seit: Jun 2009
Beiträge: 100
Ort: Bremen
Would it be possible to increase the frequency? 125Hz might work, but it might also be a bit too slow.... Thank you,
William
Mitglied
Registriert seit: Aug 2009
Beiträge: 6
Ort: Moscow
Actually, 3 motors version is not 125Hz but 1/(0.002*3)=167Hz . The algorithm for the higher frequencies is much more complicated. I did it even for 500Hz and TowerPro ESC works on 500Hz. The problem is that I didn’t found it stable, but may be my frame is the reason of bugs. It’s still under research:)
The other problem is that TowerPro ESC doesn’t change RPM smoothly. It has 7-bit resolution and the minimum change in RPM is 50 RPM for the TowerPro ESC I tested.
Mitglied
Registriert seit: Jun 2009
Beiträge: 100
Ort: Bremen
Hi L0pan,
I managed to make some I²C to PWM converters myself. I tried to make them as universal as possibly:
http://shrediquette.blogspot.com/2010/01/finished-ic-to-pwm-converter-and.html

All the best,
William
Mitglied
Registriert seit: Jun 2008
Beiträge: 100
Can it serve more than 4 motors?
Mitglied
Registriert seit: Jun 2009
Beiträge: 100
Ort: Bremen
Which one? Mine? If I update the firmware it can handle any i²c adress available.
Mitglied
Registriert seit: Mar 2009
Beiträge: 2
@I0pan : can you detail the fuse settings you are using ?

I understood that I have to check OSCILLATOR OPTION and set Internal OSCILLATOR at 8MHz but is there any other fuse/setting to set ?

I just received my ATMega 8 today and finished the build. I am looking forward to receiving my 4 BL controllers now for further testing ...
Mitglied
Registriert seit: Jan 2009
Beiträge: 33
Ort: Wasserburg / Inn
Hi IOpan,

you have done a great job. With this converter (i2c->pwm) we are able to build copter’s for a less price. :P
But now to my whish:

I’m more or less a beginner in programming "C".
I’m interesting to learn more about programming. I saw that the file “i2c2pwm-8-motors.hex” is for 8 motors and 200Hz.

Can you give us the source code for this very interesting file? :roll: (I hope you will do it and say thanks) :)

By
Mitglied
Registriert seit: Feb 2010
Beiträge: 368
krake meinte
Can you give us the source code for this very interesting file? :roll: (I hope you will do it and say thanks) :)


A little hint: take a close look at the folder "i2c2pwm in the downloads IOPan gave links to at the top of this thread: There you can find the .c an .h you are looking for. (Except for some kyrilic comments).

But as the forum is getting multiligual it is a good exercise. :mrgreen: Wonder if chinese comes next 8)

OT: I found an online Russian to German translator here:


It is a good proof of concept. *** applause **** And the indoor fly by wire video is a "must see"!
Mitglied
Registriert seit: Jan 2009
Beiträge: 33
Ort: Wasserburg / Inn
Hi WalMo,

I have done it time ago. I found out that there are two types of code in all the linked files: one for 125Hz and one for 200Hz.
Also the code in the zip-file for 3 motors 125Hz is the same as for 4 motors 125 Hz. I can’t believe that this is the same code. :roll:
For this reason I ask for the code: 8 Motors 200 Hz.
I hope IOpan give us THIS (better: all the source files) :lol:
And once more again. I very good job from IOpan.

Thanks for the link o the online tanslator ;)

By
krake
Mitglied
Registriert seit: Feb 2010
Beiträge: 368
krake meinte
Hi WalMo,

...I found out that there are two types of code in all the linked files: one for 125Hz and one for 200Hz.
Also the code in the zip-file for 3 motors 125Hz is the same as for 4 motors 125 Hz. I can’t believe that this is the same code. :roll:


Well it certainly is not the same code and is IMHO the interupt routine is a bit overloaded.

I don't see why to use dynamic structures with dynamic fields (memalloc) and then address them by pointers.

I would just assign an array of 8 structures, set the motor count (3,4,6 or 8) as a maximum index value and address the structures with an index. This also leads to indirect addressing but with constant offsets added to the structures base address when access a structure field.

I do fear his algorithm has plenty of jitter which could "irritate" the native ESC PWM decoder.

Keep in mind that one speed step (0 to 255) between 1ms and 2ms is approx. 4 µ secs which @ 8MHz represents only 32 program steps in the AVR. Another reason why I would not use so many pointers.

To gain more reserve I would spend 50 cents on a 16MHz quartz and run the AVR at the doubled speed or as in Willa's approach spend an individual AVR for one or two motors. A Mega8 only costs approx. €1.50.


BTW. Did you all notice the plastic dome = bottom part of a soda / cola bottle? 8) 8) Ingenious 8) 8)
« Bearbeitet von WalMo am 17.03.2010 11:43. »
Mitglied
Registriert seit: Jan 2009
Beiträge: 33
Ort: Wasserburg / Inn
Hi WalMo,

wow !!!!
As I write before I’m more or less a beginner in C programming.

The idea was (because the hex file exists) if I compare the source files I can learn more about C and for me this converter is very interesting. But now I think I must study or comments.

About our remark to the jitter there was a comment form IOpan :


No jitter, I found the way to kill it with the following code

SIGNAL( SIG_OVERFLOW1 )
{
while(TCNT1<700) asm("nop");
SERVO_PORT = 1 << current_servo;
TCNT1=65535 - 8000 - 8*4*motors[current_servo];
current_servo = (current_servo + 1) % MotorCount;
}

Also Willa’s solution is interesting. But no source file is available. So to change the address for motor 5 to 8 is not able for me. To get a 16MHz is no problem if this solves the remarks.

by
krake
Mitglied
Registriert seit: Jan 2009
Beiträge: 33
Ort: Wasserburg / Inn
Hi WalMo,

wow !!!! :shock:
As I write before I’m more or less a beginner in C programming.

The idea was (because the hex file exists // in the 200Hz zip: i2c2pwm-8-motors.hex) if I compare the source files I can learn more about C and for me this converter is very interesting. But now I think I must study our comments. ;)

About our remark to the jitter there was a comment form IOpan :

--------------------- IOpan -------------------------------------------
No jitter, I found the way to kill it with the following code

SIGNAL( SIG_OVERFLOW1 )
{
while(TCNT1<700) asm("nop");
SERVO_PORT = 1 << current_servo;
TCNT1=65535 - 8000 - 8*4*motors[current_servo];
current_servo = (current_servo + 1) % MotorCount;
}
--------------------------------------------------------------------------

Also Willa’s solution is interesting. But no source file is available. So to change the address for motor 5 to 8 is not able for me.

To get a 16MHz is no problem if this solves the remarks.

by
krake
Mitglied
Registriert seit: Feb 2010
Beiträge: 368
I did not find the cited code in the sources! :?
Mitglied
Registriert seit: Jan 2009
Beiträge: 33
Ort: Wasserburg / Inn
Hi,

it's part of 125Hz version in twi.c.

-----------------------------------------------------------------------
twi.c:
SIGNAL( SIG_OVERFLOW1 )
{

//asm("ag:");
//asm("in R24,0x2C");
//asm("cpi R24,0xF0");
//asm("BRCS ag");
//TWCR = 0;
//TCNT1 += rand()/1000;
//while(TCNT1>64535) asm("nop");
// if(TCNT1>1000) while(1) asm("nop");
while(TCNT1<700) asm("nop");
SERVO_PORT = 1 << current_servo;
TCNT1=65535 - 8000 - 8*4*motors[current_servo];
current_servo = (current_servo + 1) % MotorCount;
}
-------------------------------------------------------------------------

;)

Seite: 1 2 >

MikroKopter - Forum » MikroKopter - general » Low cost wood mikrokopter from Russia)