Fun, Learning, Friendship and Mutual Respect START  HERE


Unregistered
Go Back   HeliFreak > R/C Helicopter Support > Blade Helicopters (eFlite) > mCP X Brushless Mods


mCP X Brushless Mods Blade Micro CPx Brushless Mods and Conversions


Reply
 
LinkBack Thread Tools Display Modes
Old 11-16-2011, 05:34 AM   #1 (permalink)
Registered Users
 

Join Date: Jan 2008
Default BLHeli - Double brushless for mCP X - with governor coming

I am starting this thread now to share the results of programming brushless ESCs for the mCP X.

Since getting the mCP X earlier this year, I have had a lot of joy and learning from this bird.
However a brushless main was IMO required in order to have sufficient power. In my setup I have used the WOW-07 together with a YGE 4A ESC. This motor has a lot of power, and the ESC has a good governor mode. However, the ESC is a bit underdimensoned and when running the motor hard it gets so hot that the motor wire solder joints melt! Thus starting the quest for a good 1S ESC with governor mode...

For the tail I have been using the SR120 tail motor with very good results. However, the heli gets really tail heavy. This is not really an issue for non pitching manouvers, since the FBL largely cancels out the imbalance. But for manouvers like sideways tic-tocs the imbalance gets annoying. Thus starting the quest for a lighter tail motor...

Bernard Konze's work on BLMC http://home.versanet.de/~b-konze/index.htm, Simon Kirby's work https://github.com/sim-/tgy as well as Roffey's good intro to the Feigao/Turnigy 6A programming http://www.rcgroups.com/forums/showp...postcount=1096 have been my starting points.

The code has been totally rewritten, partly as getting to know the code in detail and also to optimize it for this specific task. A lot of comments have been added that hopefully makes it easier for others to read (as well as for myself).

Currently the code is supported on three different ESCs:
- Feigao 6A. This ESC uses an Atmega8. However the ESC needs to be modified for 1S operation by removing the voltage regulator and shorting its input and output. And also the FETs are AP4503GM that are not specified for operation below 4.5V and should be replaced.
- HobbyCity 5A 1S. This ESC also uses an Atmega8. The FETs are AO4610 that are not specified for operation below 4.5V and should be replaced.
- Walkera WK-WST-10A-LT. This ESC uses an Atmega88 that is locked (can not be reprogrammed) and therefore the MPU chip needs to be replaced. This ESC has very good FETs (FDW2501/2508).

The Walkera FETs have a very low on resistance in the order of 10 milliohms.
For replacement FETs for the other ESCs I have tried IRF7317 (30/80 milliohms) and DMC2020 (20/30 milliohms). I have also added a second set of FETs on the main ESC (by piggybacking).

The 8kHz PWM outputs from the mCP X 3in1 are tapped from the resistor points that are shown in Roffey's post above. The software works directly off this, without any additional converter boards.

The current version of the software is now at a stage where it flies well. Tail performance is good, there is no wag and it holds really well in pitch pumps as well as backward flight. A feature in the SW is that the tail motor keeps running at a very low RPM for a while even at zero input, in order to avoid the delays inherent with BL motor startup.

The main motor SW does a very smooth startup and run of my WOW-07. Other motors may need adjustments to the SW parameters. The governor function is currently a crude first attempt and should not yet be used. I will continue working on it.

When compiling the SW, one line of "BLHeli.asm" needs to be modified in order to select target ESC, and one line to select main or tail mode.

In order to program the ESCs, an AVRISP mkII http://www.atmel.com/dyn/products/to...p?tool_id=3808 (about 40$) or equivalent is required. In addition to the PC based software "AVR Studio 4" that can be downloaded for free from Atmel.

The joy of the helicopter hobby for me is the mix of building and tuning and flying.
Hopefully some of you will also pick up this particular challenge of building and tuning.

Click image for larger version

Name:	Workplace.jpg
Views:	3146
Size:	235.4 KB
ID:	267249

Click image for larger version

Name:	BLHeli mCP X.jpg
Views:	2891
Size:	256.7 KB
ID:	267250

Click image for larger version

Name:	Feigao ESCs.jpg
Views:	2904
Size:	234.8 KB
ID:	267251

Click image for larger version

Name:	3gr tail motor.jpg
Views:	2872
Size:	216.4 KB
ID:	267252

Click image for larger version

Name:	Feigao 6A ESC.jpg
Views:	3446
Size:	199.1 KB
ID:	267253

Click image for larger version

Name:	HC5A1S ESC.jpg
Views:	3015
Size:	197.4 KB
ID:	267254

Click image for larger version

Name:	Walkera ESC.jpg
Views:	2947
Size:	193.6 KB
ID:	267255

Click image for larger version

Name:	AVRISP mkII.jpg
Views:	2330
Size:	252.9 KB
ID:	267256

BLHeli Rev0.0.zip
sskaug is offline        Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 11-16-2011, 06:51 AM   #2 (permalink)
Registered Users
 
Posts: 261
 

Join Date: Feb 2011
Default

Very VERY cool!
__________________
Gaui 200v2FES BeastX (built by nexgen) zPower5150, HS-5065MG cyclic, Hyperion DS09GMD tail, Castle Creations Phoenix 25.
3 Brushless Blade MCPX's - 1 Hp05s, 1 C05m and 1 Hp06v2-Hp03t DB
Walkera v120d02 HP08S, v120d03 HP07v2, and m120d01 9G
_Opiate_ is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 08:42 AM   #3 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

Ha! Brings a smile Great work..... a few hours of work gone into that (and the rest!). Good to see more BL tail work at last. I was lucky with my tail wag at first, which is all down to vibration and harmonics.
That's sorted for me again, and good for you at the start point, which helps.

Looks like we came to the same conclusion as far as the tail not shutting down.

Thanks for sharing the files. Makes me wonder if I should get back into that side again, particularly as I want to have a more dynamic bl esc. The only thing for me is that I like to have control of the main/tail mix and curve etc for dealing with the higher power motors, which means taking the gyro out of the mix, so I'm using a separate micro.

It's great to have a fresh bl tail that looks like it works! More fun to come!
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 09:08 AM   #4 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

Indeed - been quite a few hours. Of good fun

Let's see how the wag works out, I'll have to do a great deal more flying and testing. But generally when thinks work at first it gives me a good feeling for it.
Well - at first is not entirely correct. The very first attempt had too much delay from input to output (caused by a slow ramp of the output pwm) and there was a significant wag.

Of course main/tail mix can not be modified in this setup. And probably there are some mixes in the 3in1 that should preferably not be there. But for my flying I think that having the current tail with a governor on the main will be quite enjoyable. This is more or less where I was before starting this, but now hopefully without a melting ESC and a saggingly heavy tail...
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 09:15 AM   #5 (permalink)
Registered Users
 
Posts: 698
 

Join Date: Aug 2011
Default

Good info, I've been looking in to doing just this but I wanted to go a different route, use the digital data (for the main not tail). Probing around the 3-1 I found what looks to be the serial stream on a debug port coming from the ATMEGA chip on the 3-1. I'll post up some screen shots from the logic analyzer when I get home.
fjoe is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 09:21 AM   #6 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

Quote:
Originally Posted by fjoe View Post
Good info, I've been looking in to doing just this but I wanted to go a different route, use the digital data (for the main not tail). Probing around the 3-1 I found what looks to be the serial stream on a debug port coming from the ATMEGA chip on the 3-1. I'll post up some screen shots from the logic analyzer when I get home.
If you want to deal with just the main you can pull the thottle data from the serial stream sent by the reciever. 3 pads around the top of the chip. Clock, data, and I think it was the start edge. Can just use the data and clock though.
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 10:54 AM   #7 (permalink)
Registered Users
 
Posts: 698
 

Join Date: Aug 2011
Default

Yes but the debug port is just a serial stream. There may be other data that is in the stream too. I just think I found the throttle but need to test more to verify my initial findings.

The port I am taking about is here:
https://www.helifreak.com/showthread.php?t=295415



Really I need a another 3-1 board to muck with so my MCPx is not down while I play around
fjoe is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 06:34 PM   #8 (permalink)
Registered Users
 

Join Date: Sep 2010
Default

The coding is were i got stuck,

Are you sharing your code?
fusionsx00 is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 09:11 PM   #9 (permalink)
Registered Users
 
Posts: 698
 

Join Date: Aug 2011
Default

Are you asking me? Once I verify my findings I'll post them up
fjoe is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 10:47 PM   #10 (permalink)
Registered Users
 

Join Date: Sep 2010
Default

Sweet, i have my avr programmer already, a old turnigy, and a few walkeras,

I even have a pre moded fiego i picked up on rcgroups

There all confirmed atmega88 chips

My teacher was supposed to help me figure out the coding, we got his hex copter up and running and then he never got back to mine
fusionsx00 is offline        Reply With Quote Quick reply to this message
Old 11-16-2011, 11:32 PM   #11 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

Quote:
Originally Posted by sskaug View Post
Indeed - been quite a few hours. Of good fun

Let's see how the wag works out, I'll have to do a great deal more flying and testing. But generally when thinks work at first it gives me a good feeling for it.
Well - at first is not entirely correct. The very first attempt had too much delay from input to output (caused by a slow ramp of the output pwm) and there was a significant wag.

Of course main/tail mix can not be modified in this setup. And probably there are some mixes in the 3in1 that should preferably not be there. But for my flying I think that having the current tail with a governor on the main will be quite enjoyable. This is more or less where I was before starting this, but now hopefully without a melting ESC and a saggingly heavy tail...
Well, I wouldn't have thought the 07 lacks power
What headspeed and pinion are you using? I'd be interested in what you are seeing with a scope at the gyro chip output.

You are right about getting a good feeling when things work first time. In general, that bodes well. Here, for me, there are little mysteries lurking about that I needed to put to rest, and probably a few more to come!

I had originally thought that they had stopped using the atmega chip, since it seemed most of the 6A versions came ultimately from the same manufacturer. (apart from the Walkera of course). That's partly why I came away from a dedicated esc.

I see the clock speed has been increased, are you doing the same? ( I haven't had time to go thoroughly through the code, (not my favorite, as you know), but you've done a lot of work there).
I had issues with the int's taking up too much time, so I guess that's helped.

Have you increased the rate of change capability much? (ramping)

Have you tried lowering the gyro gain at all, or are you trying to stay stock? Piro rate will increase, but stopping can then become an issue.

If I find that braking will help with reaction times, hopefully you may be able to shed some light on that aspect.

All these questions and more?

Great dedication and staying power.
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-17-2011, 02:25 AM   #12 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

The 07 has quite a lot of power, it is generally the LiPo that gives up in high load situations. I have ordered some Hyperion 550s, possibly the added weight will be worth it.

I am using an 8T pinion. Used to use a 9T before KKPMO came out with the 8T and 7T for a 1.5mm shaft. Haven't tried the 7T yet, the design kind of looks marginal. The 8T produced better motor efficiency than the 9T.

I my YGE 4A setup I had idle up 1 set to about 4900rpm and idle up 2 at about 5600rpm. The higher headspeed gives more "pop" and is better for tic-tocs, but also consumes more power.

The Turnigy Plush 6A ESCs do no longer use the Atmega chip. But the Feigao 6A does (at least when I bought them a few weeks ago).

As you very accurately notice I have spent quite alot of time with the code.
And used a scope to debug interrupts and timing in general. The Atmegas still run at 8MHz, that is close to their max spec for operation down to 2.7V.

The code measures the 8kHz pwm input at a rate of about one sample per millisecond (for the tail. Parameter "RCP_SKIP_RATE" in the code). And then directly applies this to the motor output. No filtering and no rate limitations.'

I have held the gain (from pwm input to pwm output) at unity. With this setup the performance should be very similar to what it is with the SR120 tail, since the SR120 motor and the 3g tail motor both produce about the same thrust (about 25-30g).

The code piece below can be modified for altering the gyro gain:
; Limit the maximum value to avoid wrap when scaled to PWM_RANGE
cpi I_Temp1, 255 ; 255 = (255/1) Needs to be updated according to multiplication factor below
brlo t0ovfl_rcp_update_mult

ldi I_Temp1, PWM_RANGE ; Set requested pwm to max
rjmp t0ovfl_pwm_min_run

t0ovfl_rcp_update_mult:
; Multiply by 1
mov I_Temp2, I_Temp1 ; Included here for the option to adjust gyro gain

t0ovfl_pwm_min_run:

Increasing the gain should be OK (I started with a gain of 1.125 and that worked well, only a little "overshoot" in pitch pumps). Decreasing the gain can also be done, but the main issue with that is that max power will also be limited.
I guess the piro rate control is limited by what you can do with TX settings.
Do you control piro rate by adjusting the gain at the output from the gyro chip?

I'm not sure how breaking is generally done in ESCs (I could study Bernards code some more). But what I have tried is what I called "damped" operation, which I have found to be very useful during startup. When running "damped" I turn on all the pFETs in the pwm off state. That way all three windings are shorted and power is dissipated from BEMF.
I tried using the tail permanently in this mode, but there was not really a difference. The tail works equally well in normal (non-"damped") mode.

What are the issues that you see with main and tail mixing in the 3in1?
Have you investigated exactly what mixing it does?

Good questions and more
Going off to work on the governor - still have a few days to spend on heli fun before having to go back to money making daily efforts...
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-17-2011, 07:40 AM   #13 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

[QUOTE=sskaug;3403638]The 07 has quite a lot of power, it is generally the LiPo that gives up in high load situations. I have ordered some Hyperion 550s, possibly the added weight will be worth it.

I guess the piro rate control is limited by what you can do with TX settings.
Do you control piro rate by adjusting the gain at the output from the gyro chip?

What are the issues that you see with main and tail mixing in the 3in1?
Have you investigated exactly what mixing it does?

QUOTE]

That's the trouble for me with 1S high power, too much current. I prefer 2S or 3S as I am using now.

The piro rate will increase as the actual gyro signal is reduced, and I am adjusting it at the actual chip output. I did control it in software, but this actually reduces the piro rate, so I prefer to do it at the chip. Not so friendly, but better.

Also with the gain on the gyro chip, it can be zeroed so that the correct head/tail mix can be adjusted for.

Since I used both tail and main into my chip, I can subtract the tail percentage derived from the main and get just the rudder/gyro data (I did this for my vari pitch tail).
Then I can play with any percentage of the main to send to the tail, plus curving it, after which I add the rudder/gyro back.
When I did a rotary table test (with no gyro) I found I needed to curve quite heavily to get the best non rotation over the throttle/pitch setup. I was trying to minimise the gyro correction required so that the gain could be turned down, which reduces sensitivity to vibration and allows increases piro rate.
Also for really rapid + and - pitch changes, the hold increases.

The negative side is the need for rapid motor response, which is why I have experimented with the mechanical brake, and why I want to try braking in the esc. I might have to use different magnetic braking though. (The variable pitch tail showed what could really be done!) With the rewound 5gm tail I have the power required, although a 2S 3gm might well do it.

Thanks for highlighting the variables in the software. I have just got the losi car type esc which has braking, so I will see if that actually helps or not. Only one way to find out!

All the best with your work, it looks like all is going in the right direction for you! Keep having fun (if you can)
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 03:57 AM   #14 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

Saw in another thread that you had 240g thrust with the Medusa motor. That is really insane

Get your point about piro rate when reducing gyro gain at the sensor output versus in the ESC. Makes sense.

Also what you do to subtract the 3in1 main into tail mix, and then adding your own gives you a lot of freedom.
Would be interesting to see if you have data on the main to tail mix that is done in the 3in1?
Also, is the mix done form throttle or from pitch?
If it is done from throttle, then a governed main would remove the mix...

I can take a closer look into Bernards code and see how he implemented his brake function on the BLMC.

Governor for the BLHeli is coming along well. Yesterday the functionality was implemented, today I will look at tuning it.

All good fun
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 04:14 AM   #15 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

The brake functionality in the BLMC code is similar to what I called "damped" operation.

In the BLMC code, all nFETs are turned on (and all pFETs off of course):
.equ BRAKE_PB = (1<<AnFET)+(1<<BnFET)+(1<<CnFET)

This functionality is however not used during normal motor running. It appears to be used only to stop the motor before starting it (braking is applied for 2.6 seconds).

Not sure how you would implement braking versus input though. You could brake when input signal is decreasing - but how much and for how long?

From what I saw with "damped" versus "non-damped" tail, braking appears not to be required. Probably the inertial energy is not dominant over the energy dissipated by generating the airflow. At least not for moderate to higher rpms.

Anyway, will be interesting to see the car ESC results...
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 04:27 AM   #16 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

Quote:
Originally Posted by sskaug View Post
Also, is the mix done form throttle or from pitch?

I can take a closer look into Bernards code and see how he implemented his brake function on the BLMC.

Governor for the BLHeli is coming along well. Yesterday the functionality was implemented, today I will look at tuning it.

All good fun
The Hyperion 12 by 30, which I am using now, at 3S, is about the same, but not a slotted design, so it is really smooth and gives very little vibration combined with a 9 tooth pinion. I like it a lot.

Yes, the mix main to tail is from the throttle, pretty much a linear percentage. Once the gyro/rudder is subracted, monitoring the tail with no gyro, allows a match to be made.

The brake thing is interesting to me, but I'm not sure about it yet until I have a look at the Losi, which I'm hoping to do later today. (looks like an atmega on it) I also have the LTC version of the walkera, which is 'supposed' to be more responsive. I shall find out

Great that you are getting closer with the governor, you must have a really good and hard earned knowledge about esc algorithms now. Sometimes my brain won't take it all in! (it is a little on the well used side now!.... maybe not so much used as worn out)

Keep going I really want to devote some time to understanding your work and appreciate the time /effort you have put into it, plus the fact that you have posted it here. Always too little time!

Not too sure about these guys supplying complete brushless kits and then asking for help about wagging etc.
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 07:46 AM   #17 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

I also used the Medusa 12 by 30 on a Walkera M120 heli. It sure is a great motor, with very little cogging and good power.

So with main to tail mix being on throttle, I should have "no mix" when using a governor.

Will be interesting to see what you find on braking and ESCs.
Currently I have built the heli with Feigao ESCs, but today I received Walkera LT ESCs that I will rebuild and reflash with BLHeli code. Should give a bit more power.

I measured negative thrust, and with the current setup it is almost 150g. And AUW is 52g with the HP 250 battery. So, almost a 3x ratio which is quite acceptable.

I've had a lot of time to devote to this lately, since I am inbetween jobs. So my head has been spinning almost exclusively on this. However, next week it is back to reality again...
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 07:49 AM   #18 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default BLHeli code with governor

Attached is Rev1.0 of the BLHeli code, that now has a good governor function.

BLHeli Rev1.0.zip
Enjoy!
sskaug is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 08:28 AM   #19 (permalink)
Registered Users
 

Join Date: Jun 2007
Default

Quote:
Originally Posted by sskaug View Post
I also used the Medusa 12 by 30 on a Walkera M120 heli. It sure is a great motor, with very little cogging and good power.

So with main to tail mix being on throttle, I should have "no mix" when using a governor.

Will be interesting to see what you find on braking and ESCs.
Currently I have built the heli with Feigao ESCs, but today I received Walkera LT ESCs that I will rebuild and reflash with BLHeli code. Should give a bit more power.

I measured negative thrust, and with the current setup it is almost 150g. And AUW is 52g with the HP 250 battery. So, almost a 3x ratio which is quite acceptable.

I've had a lot of time to devote to this lately, since I am inbetween jobs. So my head has been spinning almost exclusively on this. However, next week it is back to reality again...
Actually I found the Hyperion 12 by 30 much smoother than the Medusa and thought it wouldn't have so much power, but it is very close and I prefer it. I used the 9 tooth pinion with the thought that the angular motor step would relate to the pinion in such a way as to reduce harmonics in the vibration. It certainly does help. The thrust you have is easily good enough for fun flying.

The LTC seems to be a bit more attacky than the LT but I can't be sure until I make up a fast response monitor that I can check them with. The Losi is a bit strange due to half range for reverse (even though I'm not using it), but the resolution is good enough. Certainly appears to bit quicker on rise and fall times, but that might just be me. The monitor will give the final answer.

As regards the mix and governing, the mix will remain to the tail, since that comes from the tail drive output of the mcpx cpu. The governing is purely in your esc, is it not?

Thanks for the new software update. And yes, don't jobs get in the way! Wish they would just send the money! I'm lucky at the moment, in that I have a couple of days a week, where I can combine work and hobby in that there are similar developments. (new type cpu and brushless for a completely different project).

Hope the new job goes well. Thanks again
Roffey is offline        Reply With Quote Quick reply to this message
Old 11-18-2011, 08:46 AM   #20 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2008
Default

Lucky you, combining work and hobby in that way

The governing is done purely in the ESC, and the throttle curve in the TX (and then also in the 3in1) is completely flat. So then there should be no mix to the tail...?

Thanks
-S
sskaug is offline        Reply With Quote Quick reply to this message
Reply




Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the HeliFreak forums, you must first register.
Please enter your desired user name, your REAL and WORKING email address and other required details in the form below.
User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself. Use a real email address or you will not be granted access to the site. Thank you.
Email Address:
Location
Where do you live? ie: Country, State, City or General Geographic Location please.
Name and Lastname
Enter name and last name here. (This information is not shown to the general public. Optional)
Helicopter #1
Enter Helicopter #1 type and equipment.
Helicopter #2
Enter Helicopter #2 type and equipment.
Helicopter #3
Enter Helicopter #3 type and equipment.
Helicopter #4
Enter Helicopter #4 type and equipment.

Log-in


Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Copyright © Website Acquisitions Inc. All rights reserved.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.

SEO by vBSEO 3.6.1