Timing Adjustment Tool

Get all your technical information about electric bikes here.
Post Reply
User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Timing Adjustment Tool

Post by Burtie » Jun 10 2010 11:27am

Edit: I will use the beginning of this thread to publish the most up to date reference info on the Timing Adjuster, so it is easy to find.

Introduction:
The Timing Adjuster (TA) is a microcontroller based gadget that can be used with any sensored controller.
It sits between the hall sensors in the motor, and the sensor inputs to the controller, and allows the motor timing to be adjusted electronically.

An interface program running on a PC is used to configure the many settings of the TA, and can also display data about the motor as it is running.

In addition to static timing adjustments, motor timing can be modified dynamicaly in response to RPM, Throttle position and Phase Current.
The aim of continually adjusting the timing is to help keep the motor operating at its maximum efficiency, or maximum performance :)

TA2 Connection Diagram.jpg
TA2 Connection Diagram.jpg (69.75 KiB) Viewed 9724 times
SDC12202.JPG
Current version of the board
SDC12202.JPG (73.94 KiB) Viewed 9724 times
ScrGeneralTab201.jpg
One of the screens from the configuration tool
ScrGeneralTab201.jpg (42.2 KiB) Viewed 9724 times



Lots more words in this TA2Userguide :shock: . I will try to keep this userguide updated as it progresses.
TA2-Userguide.doc
Updated Dec 17 2011
(491 KiB) Downloaded 323 times

Installer for PC interface program v2.02 (this works with current TA2, updated March 2012)
TA interface prog v2.02.zip
(209.8 KiB) Downloaded 150 times

Installer for PC interface program v1.02 (this works with the original TA prototypes)
TimingAdjuster v1.02.zip
(209.11 KiB) Downloaded 147 times

Driver for HL-340 usb serial adapter
HL-340.zip
(145.58 KiB) Downloaded 157 times
HL-340 win7 x64.zip
(134.39 KiB) Downloaded 104 times
Burtie
Last edited by Burtie on Mar 05 2012 8:53am, edited 46 times in total.

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jun 10 2010 11:50am

multiplecurrent1.jpg
Phase current (load) sensor modules
multiplecurrent1.jpg (39.18 KiB) Viewed 9739 times

With one of these modules attached, you can vary the timing depending on the phase current drawn by the motor :)


Link to the sale thread :
http://endless-sphere.com/forums/viewto ... 31&t=26068
Last edited by Burtie on Oct 22 2013 5:12am, edited 5 times in total.

markobetti   10 kW

10 kW
Posts: 620
Joined: Jul 17 2009 1:28am

Re: Timing Adjustment Tool using a microcontroller

Post by markobetti » Jun 12 2010 4:07am

go burtie ,go ! :)

John in CR   100 GW

100 GW
Posts: 13579
Joined: May 20 2008 12:58am
Location: Paradise

Re: Timing Adjustment Tool using a microcontroller

Post by John in CR » Jun 12 2010 10:10am

I'm having some difficulty understanding how a variable timing helps with an electric motor. With an electric motor things happen at electronic speed so there would seem to be only one optimum "timing", because there is only 1 exact position where the coil polarity should change from attracting the approaching magnet to pushing it away as it's leaving. Varying the duration of the ON status of a winding for that segment of the commutation would seem to make more sense. If the "ON period" is variable then I can see the timing of it coming into play as something beneficial to vary, but moving the start of the ON status without varying its duration doesn't make sense to me.

rolf_w   100 W

100 W
Posts: 139
Joined: Aug 04 2009 12:04pm

Re: Timing Adjustment Tool using a microcontroller

Post by rolf_w » Jun 12 2010 10:41am

John in CR wrote:I'm having some difficulty understanding how a variable timing helps with an electric motor...
same with me - it would be nice to get some lessons in BLDC basics (or get some links... )

I give it a try with something I remember from brushed dc motors:
For brushed dc motors advancing or retarding the brushes allows to avoid brush sparking. The brushes commutate (reverse) the current through the windings which should be done when the back emf is exactly zero thus at an exact position of the rotor (windings) related to the stator (magnets). This 'zero back emf' position, however, is also dependent of the current through the winding, since they produce also part of the emf inducing magnetic field. Brushes would thus have to be moved according to the load.
This might be translated to BLDC too?

Am I right that a timing adjustment tool would need to allow for a) advancing / retarding the commutation pattern b) correcting the mechanical positioning errors and c) switching Y/D motor connection ?

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jun 12 2010 5:02pm

John in CR wrote:
I'm having some difficulty understanding how a variable timing helps with an electric motor
Hi John,
My (perhaps overly simplistic :) ) understanding is that: When the controller applies a voltage to a stator winding, due to the inductance of the stator, the current takes a finite time to build. So we need to energise the winding some time before the point where we want the maximum current to be flowing.

When the motor is spinning, the time can be translated into degrees of rotation, the time for the current to build remains constant, but as the motor speed increases, this translates to a larger number of degrees of advance. Therefore RPM dependent phase advance is desireable.


rolf_w wrote:
Am I right that a timing adjustment tool would need to allow for a) advancing / retarding the commutation pattern b) correcting the mechanical positioning errors and c) switching Y/D motor connection ?
Hi rolf
Yes to all points :D ( more specific for point (c), will allow required timing correction for Y/D config change)


Burtie
Last edited by Burtie on Sep 06 2011 4:57pm, edited 3 times in total.

John in CR   100 GW

100 GW
Posts: 13579
Joined: May 20 2008 12:58am
Location: Paradise

Re: Timing Adjustment Tool using a microcontroller

Post by John in CR » Jun 12 2010 8:23pm

Thanks Burtie,
That makes sense, but I'm surprised that the controllers don't already consider the fixed coil delay, though I guess the delay due to inductance varies by motor due to different windings. I wonder if the lower delay of my motors with very low turn counts is a factor in all controllers running hot with them, and not just the current limiting.

User avatar
dozentrio   1 kW

1 kW
Posts: 497
Joined: May 26 2009 5:51pm
Location: Canada

Re: Timing Adjustment Tool using a microcontroller

Post by dozentrio » Jun 12 2010 9:58pm

Yes, go Burtie go! I want this finished before my bike is, because now that I'm aware of the issue, it just doesn't seem right to have a motor controller which DOESN'T do this :D

User avatar
liveforphysics   100 GW

100 GW
Posts: 14045
Joined: Oct 29 2008 1:48am
Location: Santa Cruz, CA, USA

Re: Timing Adjustment Tool using a microcontroller

Post by liveforphysics » Jun 12 2010 10:20pm

John, you ask a great question. Why isn't zero advance or retard always ideal?

To answer it, I think looking to the experience gained from RC car motors with adjustable sensors, or even brushed motors with adjustable brush ring positions. You can use advanced timing to compensate for coil field rise time at higher RPMs, which prevents premature torque decreases as rpms increase. This can make a 50kv motor into a 60+kv motor when you need it (going for max power).

Or, even more useful, it can be retarded to lower kv, and greatly decrease no-load waste currents on a motor for the times you just want to cruise along with minimal controller heating, motor heating, and trying to maximize range.
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.

User avatar
liveforphysics   100 GW

100 GW
Posts: 14045
Joined: Oct 29 2008 1:48am
Location: Santa Cruz, CA, USA

Re: Timing Adjustment Tool using a microcontroller

Post by liveforphysics » Jun 12 2010 10:24pm

And with a neat little device like this, its got throttle input, then the same little box can give you max economy retarded settings when you're just cruising along at mid throttle, then give you peak power when you need it by advancing timing when you need a burst of speed to jet around a car or whatever. :)
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jun 13 2010 2:15am

From the 'Adding hall sensors to outrunners' thread:
dozentrio wrote:
I wonder if it's possible to adjust the timing of EACH hall signal individually, though. At very small intervals too? Say, tenths of a degree? That way, even if you haven't mounted them exactly perfectly, the software could adjust the signal so that it runs perfectly smooth. I could potentially contribute on the code for that.
I was thinking that once the motor is running fast enough, we have a fairly predictable hall signal sequence. We would only need to use the timing reference from one sensor to allow us to generate the signals for all three sensors. This way we would ensure that the signals were generated exactly 120 E degrees from each other.

The accuracy of placement and relative spacing of the 3 hall sensors would only really be important when the motor was starting.

rolf_w   100 W

100 W
Posts: 139
Joined: Aug 04 2009 12:04pm

Re: Timing Adjustment Tool using a microcontroller

Post by rolf_w » Jun 13 2010 7:45am

A short video showing the effect of adjusting the brush ring whilst driving on a brushed motor in a http://www.quantya.com

User avatar
dozentrio   1 kW

1 kW
Posts: 497
Joined: May 26 2009 5:51pm
Location: Canada

Re: Timing Adjustment Tool using a microcontroller

Post by dozentrio » Jun 13 2010 10:05am

We would only need to use the timing reference from one sensor to allow us to generate the signals for all three sensors. This way we would ensure that the signals were generated exactly 120 E degrees from each other.

The accuracy of placement and relative spacing of the 3 hall sensors would only really be important when the motor was starting.
True! I'm still working on learning exactly how it all works. I don't really understand why 3 hall sensors are needed even for starting. Anywhere I can figure this stuff out in detail? :)

deVries   1 MW

1 MW
Posts: 1545
Joined: Jul 10 2008 11:29pm
Location: Solar Powered 3000w Texas

Re: Timing Adjustment Tool using a microcontroller

Post by deVries » Jun 13 2010 3:42pm

I was reading in another thread about this...
mwkeefer wrote:I've played with it extensively...

The purpose in the eyes of eBike designers is quite simple... Although some hub motors are really torquey, most just arent... to that end, you need the most torque when launching from a dead stop and so...

An engineer decides what wattage and determines the motor's torque output based on 1355 / No Load KV * Amps... Then depending on the requirements, for instance a max load weight of 300 lbs the engineer needs to find a way to get that mass (the 300lbs of you bike batteries and motor) moving along quickly... though accelleration takes more power, it only needs that power for a short time... hence Block time is supposed to be the delay in seconds before the limiting kicks in and brings you back to the programmed primary current.

Another bit you may or may not have realized is the purpose of Phase Current and why it is different than Primary or Battery Current...

At lower speeds the controller can multiply the current at the cost of voltage which is only needed (the higher voltage) once the motor is trying to gain speed.... That's why people with 9C usually recommend 2.5 X the Primary Current for this setting and it's the current your phase windings are slammed with on startup... the block time allows for a momentary surge of Primary Current to enable the output which is current amplified (the FETs do this) which in a 26" DD 9x7 Rear (Loaded kV of 10.10 @ 48v - load rating 100KG / 220lbs) - these motors don't have enough torque at 45A to get you moving and thus reduce duty cycle and power handling of the FETs, phases and every other component... then when you approach speed... you will see your current taper down because "An object in motion stays in motion unless acted upon by an outside force".

By comparison - I have found that using Phase Current of lower multipliers of Primary Current like 1.5 X will result in higher top end speeds because the voltage sag is less in the current amplification process.

If your using geared hubs... these are the most fun, here I begin at 1:1 with block time at about 5 (I do run 69A limit on a 9FET shunt soldered and reprogrammed infineon with stock fets and caps) - I can't keep the nose down and my top speed reaches 30+ mph where as when I had the Phase Current at 2.5 the max speed was 27mph... Next I increased the multiplier until my top speed on a flat without wind dropped measurably... This gives me the absolute best combo of slamming accelleration, higher top speeds and better efficiency since the motor spends less time at low inefficient speeds.
And, I see all the work you brilliant ES contributors are doing to install hall sensors with RC motors and adjust the timing to affect torque/speed and efficiencies, etc.

And, since I know nothing about the technical aspects about all this, I wonder why some type of ESC can't be programmed too? There are ESC for hot-rod wheel driven models and boats (besides the aero/heli flight) that might have some programmable features to at least help with stop to start-up conditions???

I obviously don't know, since I'm new to building eBikes and know nothing about the RC world. I did read on some thread that one can overcome some of these issues with start-up from stops if you get a 150amp+ ESC... I guess to handle the power and not burn-up ?... but why not have the ESC programmed to do something like Mike refers to at the top in this post?

This may be a stupid question for those in the know, but I'm sure newbies with little electrical knowledge just starting out might wonder about this too.

TIA for any help and explanations...

User avatar
amberwolf   100 GW

100 GW
Posts: 25962
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Timing Adjustment Tool using a microcontroller

Post by amberwolf » Jun 14 2010 1:44am

There's no *technical* reason the ESC couldn't be reprogrammed to do this work by itself, as part of normal operation as a controller. But it is highly unlikely that you'd be able to get the source code for the ESC from the manufacturer so you could rewrite it to do so. That would require writing totally new ESC code from scratch, debugging it (probably blowing up a lot of controllers in the process), and then verifying that it works the same way the original code did (or better) plus the modifications.

It's also unlikely the ESC manufacturers would even consider putting anything like this directly into their code unless someone first proves it is a very useful feature that the majority of their customer base will want, or that they can at least use as a marketing point to sell more controllers to justify the expense of rewriting and debugging. If you can prove the idea useful and saleable, I'm sure they'd be more than happy to steal the idea and any code created, then adapt it for their MCUs in the ESCs, and market away. ;)

deVries   1 MW

1 MW
Posts: 1545
Joined: Jul 10 2008 11:29pm
Location: Solar Powered 3000w Texas

Re: Timing Adjustment Tool using a microcontroller

Post by deVries » Jun 14 2010 2:30am

amberwolf wrote:There's no *technical* reason the ESC couldn't be reprogrammed to do this work by itself, as part of normal operation as a controller.
Thanks for your explanation noting the major limitation of obtaining the source code to do it. :P

Some RC ESC do come with some limited user programmable feature sets, so I'm wondering if there is one of these that might help with ramp-up speed or acceleration from stop to start-up conditions?

User avatar
rhitee05   10 kW

10 kW
Posts: 841
Joined: Apr 07 2009 9:08pm
Location: Upstate SC

Re: Timing Adjustment Tool using a microcontroller

Post by rhitee05 » Jun 14 2010 9:02am

dozentrio wrote:I don't really understand why 3 hall sensors are needed even for starting.
There are 6 possible commutation states for the controller. Consider the hall signals as binary bits, you need 3 bits to uniquely identify each of the 6 states.
Eric

Trek FX 7.3 hybrid - Cyclone 650W setup in process! Still...

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jul 01 2010 8:13am

The weather has been kind to us in Southern England lately, so I have been out biking around and not working on this project too hard :)

It is prooving a tougher job than I expected, but I have made some progress. Still a long way to go, but at least the concept seems feasable.
Here is a short nerdy video for those of us who enjoy that sort of thing.


http://www.youtube.com/watch?v=RZDLpqs5Sc0



BTW, NO -I didnt choose those flowery curtains :|

burtie.
Last edited by Burtie on Jul 01 2010 5:53pm, edited 1 time in total.

User avatar
gwhy!   100 kW

100 kW
Posts: 1099
Joined: Jan 13 2009 8:32am
Location: UK, Bristol

Re: Timing Adjustment Tool using a microcontroller

Post by gwhy! » Jul 01 2010 4:31pm

Burtie wrote:The weather has been kind to us in Southern England lately, so I have been out biking around and not working on this project too hard :)

It is prooving a tougher job than I expected, but I have made some progress. Still a long way to go, but at least the concept seems feasable.
Here is a short nerdy video for those of us who enjoy that sort of thing.


http://www.youtube.com/watch?v=RZDLpqs5Sc0


BTW I didnt choose those flowery curtains :|

burtie.
Hi Burtie,
Its looking good :D . The starting issue with the motor can be resolved by programming the 6 fet with 12 or 18 fet settings and adjust shunt to compensate for current, Im sure you are aware of this but just thought will mention it as it may help testing your set up a bit easier ( consistent ).

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jul 01 2010 5:59pm

gwhy,

Thanks, but I welcome the over-current transient protection at the moment, because of the horrible conditions I am subjecting this un-modified controller to during this testing :o

burtie

User avatar
dozentrio   1 kW

1 kW
Posts: 497
Joined: May 26 2009 5:51pm
Location: Canada

Re: Timing Adjustment Tool using a microcontroller

Post by dozentrio » Jul 05 2010 7:12pm

need any help? I am eagerly awaiting developments because i want to use this to optimize my own hall sensor positioning...

markobetti   10 kW

10 kW
Posts: 620
Joined: Jul 17 2009 1:28am

Re: Timing Adjustment Tool using a microcontroller

Post by markobetti » Jul 07 2010 2:36am

Burtie wrote:gwhy,

Thanks, but I welcome the over-current transient protection at the moment, because of the horrible conditions I am subjecting this un-modified controller to during this testing :o

burtie

Dear Burtie , when we were testing Colossus mr. Chubichevic made a similiar device but with less adjustable settings... .. i will ask him to join discussion if he finds time

User avatar
liveforphysics   100 GW

100 GW
Posts: 14045
Joined: Oct 29 2008 1:48am
Location: Santa Cruz, CA, USA

Re: Timing Adjustment Tool using a microcontroller

Post by liveforphysics » Jul 07 2010 2:45am

Burtie wrote:The weather has been kind to us in Southern England lately, so I have been out biking around and not working on this project too hard :)

It is prooving a tougher job than I expected, but I have made some progress. Still a long way to go, but at least the concept seems feasable.
Here is a short nerdy video for those of us who enjoy that sort of thing.


http://www.youtube.com/watch?v=RZDLpqs5Sc0



BTW, NO -I didnt choose those flowery curtains :|

burtie.


Burtie! This is awesome! Great work! It's amazing how sensitive the motors are to a little tiny bit of timing change isn't it? I thought I was going crazy when I was first setting mine up, and moving it a quarter of a mm would cause a few amps +- of no-load current. lol
Each carcinogen vapor exposure includes a dice roll for cancer.

Each mutagen vapor exposure includes a dice roll for reproductive genetic defects in your children.

Each engine start sprays them into a shared atmosphere which includes beings not offered an opportunity to consent accepting these cancer experiences and defective genetics life experiences.

Every post is a free gift to the collective of minds composing the living bleeding edge of LEV development on our spaceship.

User avatar
Tiberius   10 kW

10 kW
Posts: 871
Joined: Jan 14 2008 7:52am
Location: Rural England

Re: Timing Adjustment Tool using a microcontroller

Post by Tiberius » Jul 07 2010 2:00pm

Hi Burtie,

What's your algorithm for adjusting the phase?
At one stage in the video it looked like the shift was different on the rising and falling edges.

Nick

User avatar
Burtie   10 kW

10 kW
Posts: 544
Joined: Mar 27 2009 9:45am
Location: UK

Re: Timing Adjustment Tool using a microcontroller

Post by Burtie » Jul 07 2010 3:41pm

dozentrio wrote:need any help? I am eagerly awaiting developments because i want to use this to optimize my own hall sensor positioning...
Thanks for the offer, I will give you a shout when I get stuck. I should have more time to work on it if/when it starts raining!

markobetti wrote:
Dear Burtie , when we were testing Colossus mr. Chubichevic made a similiar device but with less adjustable settings... .. i will ask him to join discussion if he finds time
Thanks markobetti, that would be great!
Are there any details on the forum about mr. Chubichevics device already??
LFP wrote:
Burtie! This is awesome! Great work! It's amazing how sensitive the motors are to a little tiny bit of timing change isn't it? I thought I was going crazy when I was first setting mine up, and moving it a quarter of a mm would cause a few amps +- of no-load current. lol
LFP,
Thanks for the encouragement :wink:
Yup, these high pole count motors sure are damn fussy about any small error in the sensor positioning.

Tiberius wrote:Hi Burtie,

What's your algorithm for adjusting the phase?
At one stage in the video it looked like the shift was different on the rising and falling edges.

Nick
Well spotted Nick. Yes the algorithm is still a slightly flawed one.
Plenty of work to do / fun to be had to get it right :?


I am beginning to think I will have to cut down the original feature set because the processing capacity of the PIC18 is too limited.
May start looking at the larger/faster families of PIC processors as a better platform for this project.

Burtie

Post Reply