MikroKopter - Forum » BL-Ctrl » DragonSky 60A auf I2C umbauen?

DragonSky 60A auf I2C umbauen?

Seite: < 1 2

Autor Neuer Beitrag
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

I have now programmed one DragonSky 60A controller (got it from rc-brushless.de) with the motor #1 hex file from the zip file at http://www.rcgroups.com/forums/showthread.php?t=1039478, and modified the board (freeing the I2C inputs from other uses) using "aggresiva"s image at the same link. Programming was just a matter of taking my AVRISPMkII and connecting the avr pins described in the first image of this thread (here) to the AVRISP as described here.

Programming went without trouble. I left all fuse bits as-is.

First test: Connect controller (SDA to D, SCL to C) to an FC. Used motor test in MK-Tool. It actually works!

But: The speed range was only from 8 to about 120. Below 8 the motor remained stopped, and above 120 it did not go any faster. Not a big problem really - I can just scale the output values accordingly. But is that normal?

Could it have to do with the fuses that I forgot to set (and I am too lazy to solder the wires back on now)? I would expect the I2C to not work at all if there is, for example, a 1:2 difference in clock speeds at both ends of the wire. Not even the controller address should get through correctly?

OOOO kay I will try set the fuses and check... Does anybody know what the changes from original DragonSky fuse values are, and why?

UPDATE: Damn, I selected the wrong values for the oscillator fuse bits, and now I can't communicate with the avr :( - Will go sleep and then wire up an external 8MHz oscillator.

Regards
Soren
« Bearbeitet von Kuula/dongfang am 18.02.2011 00:12. »
Mitglied
Registriert seit: Jun 2010
Beiträge: 184
Ort: Seligenstadt / Hessen
for me it is so. From 8 to 120 I'm still not flown with the controls. No idea whether it is ok.
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

I wouldn't fly with them without adjustments! Reason: If you give the copter some throttle - for example 200 - it will set all motors to 200 +/- adjustments for control and stabilization. For example, motors 1-4 could get: 170, 230, 195, 205. But because these numbers are all the same (power) to the BLCs there is no stability. In other words, you will lose control if giving too much throttle. You might also have a motor stopping completely if its throttle value becomes too low. Fortunately these BLCs are faster at restarting than the H&I ones.
One has to adjust the minGas and maxGas parameters: minGas = 8 and maxGas = 120 or there about. That will fix the worst, but it will still mean that the copter is at full throttle at just half throttle stick (it doesn't get scaled).
I will mod my home made firmware a little to have adjustable motor range scaling. Ideally, somebody should write firmware for these BLCs with the correct range, and maybe even the BLC1.x and 2.x protocols.

It does however appear that they have a FAST throttle response over I2C. No unnecessary damping.

Regards
Soren
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Well some more results. I managed to bring the avr back on line now (I had shut myself out by selecting an invalid oscillator fuse bit set...).

The fuse settings from "aggresiva"s posting in the rcgroups thread are claimed to be "Fuse configuration for SuperSimple 50amp with atmega8 8mhz (internal oscilator)".

I can't get that to tally up: In JUERGENs image, the SUT bits are 10 and the CKSEL bits are 0000. As far as I can see in the ATMEGA8 datasheet, this is "Ceramic resonator, BOD enabled" and "external clock". External clock can't be right - there is no external oscillator on the board.
In the image in the rcgroups thread itself, the fuses are different! SUT=01 and CKSEL=1011. That is "Crystal Oscillator, BOD
enabled" and "External Crystal/Ceramic Resonator".

I think the rcgroups is wrong because it is not a crystal on the board, and Juergen is wrong in setting an external clock source? And nether sets an internal 8MHz internal oscillator.

Anyway, after having tried w different fuse values: Using a correct setting for the 16MHz ceramic resonator and another for 8MHz internal RC osc did not really make much difference in pitch or speed of the startup tune. Shouldn't 16 be twice as fast as 8? Using 4MHz internal RC also worked, and the pitch fell by one octave and the tune took longer to play. In all cases the speed range of the motor was still about 8-121 and I2C comms worked ok. There seems, in other words, not to be any issues with osc speed and strange I2C bit shifting or whatever.

So I hope we can all reach some kind of agreement on what the fuse values should be - and that there will be a way to solve that with the speed curve, which is flat at full speed from 121 to 255...

Does anybody know what the code is: Is it a development from scratch, or is it a disassembled and reverse engineered version of the DragonSky code?

Regards
Soren
« Bearbeitet von Kuula/dongfang am 18.02.2011 22:04. »
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Well now I have disassembled and reverse engineered the i2c mod firmware for the DragonSky's.

It seems the original code has been retained, and some code added for the I2C interface, and for scaling down the range from I2C to that used internally in the original code.

The original range is:
0-7: Stop
8-98: Linear range
99- : Full speed

The ("aggressiva"?) modification does this scaling:
throttle = throttle_from_i2c - (throttle_from_i2c>>>3) - (throttle_from_i2c>>>4)

- a range from 0 to 209. The 98 to 99 interval limit can be felt as a larger than normal increase in speed when going from 120 to 121 in the motor test in MK Tool.

This scaling is wrong! Is will not fit within the linear range of 8-121. It would be better just to take half that throttle value and use that.

I think the loss of 1 bit of resolution makes no difference. When looking at the scope, the throttle values are much noisier than deserving 10 bits of resolution (BL 2.0 protocol) anyway. One could however try to preserve the resolution by alternating between n/2 and (n+1)/2...

I will try see if the 8-98 interval can be broadened a little to get a wider linear range (especially a lower minimum speed would be nice to have for descending fast but stably). Then I will mod the mod to scale the interval better.

Apart from that, they are nice BLCs. No PMOS's, they seem to be able to handle plenty of power, they are inexpensive and they have a very smooth and reliable start-up. There is no current measurement but well, I don't miss that.

Regards
Soren
« Bearbeitet von Kuula/dongfang am 21.02.2011 22:30. »
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

I have now hacked around with the 17 Euro DragonSky 60A BLCs.

I have modded the Aggressiva I2C code to make them start at throttle level 1, and increase speed almost linearly till throttle level 253. The last way to 255 there is a little jolt in the curve, because the controllers have software PWM and they switch from doing PWM to doing always-ON there. So:

0: Stop
1-253: Linear range (the thrust will lift the weight of motor, prop and half a 25 cm outrigger at 25)
254-255 : Full speed

The startup is very nice and smooth, much better than the H&I BLCs. Full speed performance with an AXI2217/20 and 12x4.5 EPP is waaaay better too (I almost burned out the motor on a 3S battery!). Restart after stall is good, too.

The internal resolution is really only 120 steps. That is less than for example the H&I BLCs but I suspect that there will be no noticeable difference. The FC's throttle commands to the BLCs bounce up and down by many steps 100s of times a second anyway. Better resolution could be made, however, with a few tricks, but let me see first if it really makes a difference or not.

If somebody wants to try it out, PM me. I still have to finalize it a little, such as making solder blob configurable I2C address (there are some unused ports perfect for that).

Kind regards
Soren
« Bearbeitet von Kuula/dongfang am 09.03.2011 21:52. »
Mitglied
Registriert seit: Jun 2010
Beiträge: 184
Ort: Seligenstadt / Hessen
Wow, sounds so great. Good work!
Would you share the file?
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Sure, but let me finish it first. Remove my diagnosis code etc.

Can I ask if you have time to help test it for me?

Regards
Soren
Mitglied
Registriert seit: Jun 2010
Beiträge: 184
Ort: Seligenstadt / Hessen
Yes, I can test it for you. But I must first build the copter ready. Did after I read your problems do not continue to be built. Can I do on the weekend.
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

HaTe, you have PM.

Regards
Soren
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Have you tested HaTe?

I have quickly thrown together a PentaKopter; that is a quad with Roxxy motors from the shop, BLC 1.2, all counterclockwise 10 x 4.5 EPP propellers, and a larger motor in the center with a 15 x 8 propeller and a DragonSky 60 A controller. The mixer matrix is set to 64 in yaw/Gier for all the small props and -64 for the center one. Throttle/Gas is 64 for all 5.

The controller works great! The copter stays stable over the whole throttle range (it does not lose yaw stability) - except when I used an old battery with too much voltage loss for the center motor.

I think I can say the software is completed...

Regards
Soren
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Tested the firmware now, working great!

So here's how to get a dirt cheap, perfectly good 60A BLC with real driver ICs and 100% NMOS, with smoooooooth and reliable startup:

1) Buy some DragonSky 60A controllers at rc-brushless-shop.de.

2) Do the mod at http://www.rcgroups.com/forums/showpost.php?p=12103374&postcount=4. Schematics are in the containing thread. Convince yourself that this is the same as JUERGENs mod on the 1st page of this thread. Secure wires with epoxy.
Also make some connections for I2C. I have removed the resistor to the PWM pad and connected the PWM (where the yellow receiver cable lands) and center (unused, red wire) pad to the I2C pins with little copper wires (optional: 27 Ohm wired resistors). Again secure wires with epoxy.

3) Connect ISP and flash this hex file: url=http://dongfang.ch/DragonSky60A.hex. It has a full dynamic range from 1-255 which is better for the MK than than the 8-121 range of the Quax code. It has a smoother throttle curve, too.

4) Setup address:
No. 1: Leave as is
No. 2: Connect PB0 (pin 12) and PB1 (pin13)
No. 3: Connect PB1 (pin 13) and PB2 (pin14)
No. 4: Connect PB0 (pin 12) and PB1 (pin 13) and PB2 (pin14)
No. 5: Connect PB2 (pin 14) and PB3 (pin15)
No. 6: Connect PB0 (pin 12) and PB1 (pin13), and separately also PB2 (pin 14) and PB3 (pin15)
No. 7: Connect PB1 (pin13) and PB2 (pin 14) and PB3 (pin15)
No. 8: Connect PB0 (pin 12) and PB1 (pin 13) and PB2 (pin14) and PB2 (pin15)
At power-up the BLC will play 2 tones and then beep its number in a high pitch.

5) If you can't find pin 12, or you don't know where the SDA connection is, then this is probably not for you.

It simulates BL1.x. Current and maxPWM values returned are dummy.

Now will this also work for the 80A and 100A controllers? I'm eager to know but rc-brushless-shop.de no longer deliver to Switzerland :(

Regards
Soren
« Bearbeitet von Kuula/dongfang am 02.08.2011 14:16. »
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

The DragonSky 60A and 100A are now both with MLF packed ATMega8's. The pinout remains the same. These things are tiny! The conversion is still possible but it requires very good soldering skills!

Regards
Soren
Mitglied
Registriert seit: Jan 2011
Beiträge: 1104
Ort: Berlin
Nice Work, i like it! :D

Respect
Mitglied
Registriert seit: Jan 2009
Beiträge: 956
Ort: Zürich
Hi,

Here is the controller with the MLF chip, and suggested hardware mod:

User image

One can do it any way one wants, as long as:

- The sense signal that originally went to Pin 27 goes to Pin 24 instead.
- Pin 27 no longer gets the sense signal.
- SDA goes to Pin 27
- SCL goes to Pin 28

When flashing the firmware (which remains the same, either Quax's or my mod), RESET needs to be cut loose from +5V and then reconnected afterwards. Fortunately, the +5V gets fed from the through plating outside the chip and not from underneath it. I connected the ISP programmer with more little copper wires....

The PCB is now multi layer (4?) with large GND areas in the middle.

Please note, this is on my part only a demonstration that this controller can be made to work with I2C control. If you decide to fly with it, your responsibility. Better check (using a magnifier/microscope) that all connections are good and solid.

Regards
Soren
« Bearbeitet von Kuula/dongfang am 18.12.2011 01:21. »

Seite: < 1 2

MikroKopter - Forum » BL-Ctrl » DragonSky 60A auf I2C umbauen?