sim- / tgy

tgy -- Open Source Firmware for ATmega-based Brushless ESCs
http://0x.ca/tgy/
688 stars 387 forks source link

Tgy Multistar 422-390KV / Afro esc HV / 15x5.5 CF prop / 6S 5800mA/ 2Kg tricopter #56

Open bighans opened 10 years ago

bighans commented 10 years ago

Some background; I have had some problems getting the above to fly reliably. I have narrowed the problem down to the parameters in the firmware. I am using the latest master through the kkMulticopter Flash Tool. Took me some time to get the boot loader enabled on the Afro Esc, have left a friendly note to HK to this effect.

Overall, it flies beautifully. Using 8A on hover. Gives me 30 minutes+, except that one cell is getting poor at the moment. This must be my fifth generation tricopter. The focus is to get long flight times and not exceeding 2.5Kg.

There were issues with the wiring to the motors, HK had just extended the coil wiring (?) and they failed at the connector side (cost me $$).

The problem is that the motors just stutters on large throttle changes, hence I am pitting this up here. and searching the web shows little in terms on how to fix this. The best advice I initially found was to change POWER_RANGE, but this causes a ramp up issue (and a hard landing). However, I am at 1300 now. From stand still, if I give full power, it just flips over. However, from a hover start, it takes off like a rocket. Lots of ooh and aaah from the audience. Note that auto tune from the the laters APM causes me to crash.

The strategy now is to change the TIMING_OFFSET, I have found some references to setting it to between 5-12 from a German website.

The big question is, am I completely out for lunch on this approach? I have no with to re-engineer anyones code, but would be good to have a tool like ecalc for simonk firmware where we could put in some overall parameters and it could advice on the some brackets of parameters to put in.

Any suggestion(s) is greatly appreciated.

Thx, bighans

owenduffy commented 10 years ago

I guess you really mean a 4822-390kv.

I did some work with timing tweaks (and had Simon add the offset parameter) some while back. I have written some notes and a calculator you might find helpful at http://owenduffy.net/rc/tools/bldca.htm .

That said, newer releases of SimonK seemed to address most of the problems that timing tweaks circumvented.

High pole count on high voltage is high risk!

FWIW.

Owen

bighans commented 10 years ago

Thanks for the update. I have moved from various designs using 2S up to 6S, and the higher voltages gives many benefits. Hence no way back on that. I have tried ESC which supports 6S, but they are not as snappy as Simon's. I did find your calculator, but did not read the notes at first. I did not quite do the advance right last time.

Would like to be able to get some feedback from the controller through i2c or uart where possible.

Kudos to Simon for doing this work. One bug though, and Hobby King turnovers jumps.

bighans commented 10 years ago

I tried the software, I got 11(MA) and 21(TO). I will try these parameters. My mistake in the first email; the motor is 4225-390kv. Should possible have picked 4822-390kv.

sim- commented 10 years ago

Hello! Sorry about the boot-loader.. Let me just say that there was some severe confusion at the factory... It makes me want to add some fuse-checking code that might annoy Owen.. ;)

How fast does the flip occur if you accelerate from stopped very quickly? The response time can't really be predicted since the motors can stop at different points and might oscillate a little more or less, and there is a power ramp from there that will stretch out the exact point at which every motor will provide full power. Normally they are close enough that the flight controller will easily correct unless the outputs are severely clipped or something else is going on.

These motors (4225-390KV) did prove a little tricky in that the un-driven phase can actually start conducting through the FET body diodes and throw off the ZC detection. That's what this trace was about: http://0x.ca/sim/esc/timing_loss_fix/zc_debug_loaded_390kv_flat_spot.png

I was able to solve the porblem by limiting the filter length, but I did my testing at 4S since I have a bench supply that ends there. I suppose I should try again at 6S.

owenduffy commented 10 years ago

Someone mention me?

Looking at your graphic Simon, and having applied my mind recently to FSK demodulation using a comparator... the same problem arises of trying to detect the zero crossing of an underlying wave with noise superimposed.

I wonder what might happen if you shift each comparator sample into a 8 bit shit register, and find XOR of the current sample and say the 8th oldest sample. That result will jump around a bit, but it should have after filtering high frequency noise (by averageing) it should have a clear DC component one side or other of 50%.

Did you save the sample set for that trace, or only the screen dump?

Owen

bighans commented 10 years ago

Gents,

Your comments and efforts is greatly appreciated. I needed to focus on my daytime job for a couple of days, not much time to follow up, sorry.

I am not sure what the trace represents. I used to work in the combined analog digital world, but that was a while ago.

I am building a test rig which includes a current sensor, and 80A mosfet for cutoff and an arduino for the control. I can set min PWM, max PWM and go from one to the other by pushing a button. I am also doing a ramp up version of the code which can increases pam the up at an adjustable rate. Could be interesting. I am also looking at an RPM detector for the above.

When I tested full throttle, it may have went to 1/3 speed before it started to stutter. I have since realised that it can also recover in the air, as I saw this behaviour before, but did not pay attention as it did not fall out of the sky.

I am using the latest arducopter firmware. Does it make any sense to reduce the refresh rate? Logically perhaps not.

If I throw i the towel, would the 4822/390 kv motors be a better choice? One day I would like to try the auto tune, which has brought down all my tricopters in the past (RIP).

Hans

owenduffy commented 10 years ago

See http://owenduffy.net/blog/?p=92 for some ideas / code.

Owen

bighans commented 10 years ago

Owen,

Thanks for that. I have had a look at some of your previous work as well, very interesting. Noted that it may be worthwhile setting COMP_PWM for sensorless operation. I will finalise the hardware in the weekend for some initial testing.

Thx, Hans

sim- commented 10 years ago

Hi Owen,

I'm trying to work out what the point of the XORIng through the shift register might be. Currently, I filter the output by seeding a counter with the filter length desired, then enter a loop that decrements it if the comparator level is as desired for a ZC; else, it increments it (if not already at the initial value). The loop exits when the counter reaches 0.

There is actually one other bit in the comparator register that I tried to play with before -- the ACI flag, which is typically used to signal an interrupt, will always be set when an edge occurs, until cleared. So, it can be used as a "noise" flag even if the output value seems the same as last time. However, I wasn't able to come up with anything that actually worked any better with that considered.

That trace was just saved as a screen capture, but I can set it up again fairly easily if you'd like. :)

owenduffy commented 10 years ago

Hi Simon,

Let my just try a simulation of a ramp with noise superimposed, and I can configure the S/N ratio. I can try some algorithms on the delayed detector and see what turns up.

Owen

bighans commented 10 years ago

I have finished my SimonK test box. I had to use the teensy 3.0, as I went overboard on the functionality. It allows me to set PWM rates / Frequency, and I added a MOSFET for programmable power cutoff. Uploading firmware from a afro usb stick works well through a bypass switch.

With the above, I have tested all previous version of simony firmware, and the best so far is the 15-May-2013 version. Next best is the 20-SEP-2103 version. All other has problems when starting from zero rpm.

The 15-May version has problems starting up, seems not sure if either CW or CCW.

Would love to have this fixed. I have a demo next month for aspiring modellers, would like to share more about the upside, if you see what I mean.

20140908_182933

sim- commented 10 years ago

Fancy! :) Hmm, the version you said is best is before I basically did anything special to try to make the 390KV and other motors work better. D'oh...

The starting and running are certainly separate pieces, so the ZC detection is shared for both of them.

Are you able to reproduce the stutter to the extent that it looks and sounds the same as in flight? Could you perhaps capture a video where you show the issue?

bighans commented 10 years ago

Just an update on the above. I updated the firmware on all three ESC and calibrated the throttle. Dissapointingly, it turned out that not all of the motors had the same problem starting up, hence it flipped over repeatedly. No damage, though.

I can see from the thread above that the problem is to detect the zero crossing by monitoring the feedback from the spare wire (at that point). I have not set myself into this technology very much, but would it make sense to look at the current sensor which some of the boards has, and / or do a bespoke timing, perhaps based on probabilities rather than expect a detection of the crossover every time.

I presume that we would need to enter the # of poles in the firmware somewhere.

Lastly, is it possible to feed back some info through the i2c interface? I would like to install a parachute system at some point.

Oh, I have on delivery another four Afro HV ESC for installation in another tricopter with 490KV motors. These motors are bought directly from China, whish me luck.

Thx, Hans E.

bighans commented 10 years ago

Yes, I can set up the ESC / motors in a bench and record a video, no problem. Sadly, I will be in Hong Kong for over a week starting Wednesday, I will need pick this up when I get back.

Just to clarify, on the 15 May 2013 version, as long as it started, a ramp up was not a problem. It was the only one that could do 1100uS to 1810uS, the others could to 1100uS to 1500uS (from one period to another) with some initial stuttering..

My observation is that for the most recent version, it can start, but not ramp up, it gets stuck (well stuttering). The most recent mast can start, but not accelerate.

This is getting more interesting by the minute ….

On 8 Sep 2014, at 19:35, Simon Kirby notifications@github.com wrote:

Fancy! :) Hmm, the version you said is best is before I basically did anything special to try to make the 390KV and other motors work better. D'oh...

The starting and running are certainly separate pieces, so the ZC detection is shared for both of them.

Are you able to reproduce the stutter to the extent that it looks and sounds the same as in flight? Could you perhaps capture a video where you show the issue?

— Reply to this email directly or view it on GitHub.

edekzkrainykredek commented 10 years ago

Hello there

I have to join in to share my experiences with Multistars 4822 390Kv motors, 4s LiPos and 17 5.5 carbon props. My quadcopter does seem to work and fly very well but only when battery is slightly discharged (around 16.2V). If the battery is fully charged i get red light on esc's. Esc's are all calibrated and updateded with latest SimonK firmware dated 18.06.2014.