• Howdy! we're looking for donations to finish custom knowledgebase software for this forum. Please see our Funding drive thread

Lebowski's motor controller IC, schematic & setup, new v2.A1

Very busy coding again... I figured out how to re-capture a running motor, you can even cold-start the controller with a motor that is already running.

Main 'problem' is that I cannot test it other than with my small RC motor. The RC motor I can spin with a drill, and without feeling any type of jolt or
other force on the drill it captures. The big scooter motor, I cannot spin this to high rpm as the motor is not built into a vehicle. I can rotate it slowly
by hand while the thing is held in a vice. The controller captures this good, but the low rpm doesn't make it a valid test. Both AF motors I have
are built into bicycles and have freewheels, so after locking the wheel, when you release the brake the motor will stay still because of the freewheel.
So this is not representative of Zombiess case with a direct drive hub.

So, what I'm doing is putting all the things I think are necessary to make it work under all conditions in the controller IC, and then zombiess will have
to test and tell me whether it needs more...
 
nice work Lebowski, hope it works!
 
Lebowski said:
For low ripple you want lots of cap on the 5V, and low ESR (I use bog standard 47uF, 0.2 Ohm ESR types, about 10 or so, plus a bunch of 100nF 's)
I have gone a bit more into the selection process since this is important for the switching regulator. The Linear Tech rep mentioned that I should look out for the DC bias voltage for the high dielectric ceramic capacitors (e.g. X7R). What I have concluded from my research, is that if you apply a DC voltage of say 5V to a 10V rated capacitor, the capacitance will be higher than if you apply 8V to the 10V rated capacitor. So the closer you get the to capacitor voltage rating, the lower will the effective capacitance be. More reading here, see page 10, figure 13: http://www.kemet.com/Lists/TechnicalArticles/Attachments/4/Why%2047%20uF%20capacitor%20drops%20to%2037%20uF-%2030%20uF-%20or%20lower.pdf

So I'm wondering, what is the voltage rating on the capacitors you used?
 
I am working on a layout for a very small brain board which is challenging with a 40pin DIP. I currently have the format of 1.5 x 3.0", 2 boards stacked so around 0.75" tall. Current sensors are external.
 
zombiess, would you like a 12x12mm (0.5"x0.5" 44-pin TQFP) SMD brain chip? I'm going to send one to Lebowski, soldered to a board he can plug into his programmer since he can't program the SMD chips otherwise. I don't have room for the 40pin DIP device so I'll be using the SMD version. I can make 2 boards and send those to Lebowski, with chips attached, and he could send one of them to you. You'll just have to desolder the chip (I'm not going to solder all the pins, only those 5 needed for programming) and put it on your own board.
It's pretty easy to "drag solder" the SMD chip, even easier if you have solder resist layer on your board (I don't have solder resist on my boards since I'm making them at home so it's more difficult for me, but still I think it is pretty easy).
Drag soldering: https://www.youtube.com/watch?v=5uiroWBkdFY#t=116
 
OK, i've been busy with v2.20, the version that will have what I call recovery. What this means is that after an error current event, instead of
releasing the motor and waiting for it to stop, what it will do is seamlessly 'recover' and continue powering the motor. What I also put in is that
the two checks in drive_0 (throttle closed and motor at standstill) can be disabled individually. The really cool thing about this is that you, with
a spinning motor, can turn on the controller from cold or do a full reset and it will just power the motor straight away. I also covered Zombiess case
where the motor is standing still (he is sliding over gravel with the wheel locked by means of the brake) and suddenly spun to high rpms (at the end
of the slide , the bike is still moving but the brake is released so motor spins up due to external forces). The time it takes to recover depends
on motor erpm, motor kv and controller settings, but is in the order of 0.1 seconds...

Are there any other cases or circumstances I should check ? maybe a video of a case you guys want to see ? At the moment I'm checking with
my small RC motor. I've run checks where I reset the controller with the motor spinning, where it will continue powering the motor after the
reset. I've also tried where the motor is standing still, but suddenly spun to over 20000erpm by means of a power drill. Anything else I should maybe
try ?

P.S. v2.20 has 3 modes: hf tone start, sensorless start without tone, sensorless start without tone with recovery...

hf tone with recovery is just too dangerous to be honest. In Zombiess case, during the slide with the motor locked, the controller will think
it lost control and will go through the HF startup (so starting fro drive_0), which means it will go through drive_1. The hf tone mode will lock
the wheel in drive_1, to determine the relation between electrical and magnetic phase. Normally this is only done at controller startup, but also
after an error event. An error event should normally not occur, but when horsing around and locking the wheel suddenly the controller will interpret
this as an error and will go through the startup routine... Without hf tone the controller does the wiggle start, no need to lock the wheel for this, so
startup will be seamless...
 
If an error occurred and the controller recovers control, is there any indication of this? I mean, if it is so seamless that you won't notice it, and it maybe happens really often due to some misconfiguration or the like, it would be nice to have some kind of indication of this so the problem can be solved.

Another question. Without the HF tone start, you say the controller will do the wiggle start. How fast is this when the vehicle is at standstill? I'm thinking, how long from giving full throttle till the motor starts to run? In my RC car application, I would like the motor to speed up really fast after applying throttle because some of the races I attend use "standing start", where all the cars are placed on the track and when the flag is raised, all cars go at once. Just like in Formula 1.
 
When an error occures and the controller recovers, during recovery there is no power to the motor. So what you notice is a loss of power for about 0.1 sec, or
how long it takes to recover. What I mean with seamless is that during recovery there is no big jolt or anything like that to the motor. There is a slight drag, but recovery
is very fast and on my low-inertia RC motor I don't see any strong slowing down or anything, I see the power loss but no jolts. If recovery happens often (i mean, with
settings really wrong it will recover for 0.1 sec and conk out back to recovery after maybe 0.1 sec) you get pulsed power with the associated noise, a bit like a sportsbike
where the motor hits the rpm limiter repeatedly

To start with wiggle, how fast this works depends on settings, motor, how far the phase current is above I0 etc etc. I have only a few windings on my RC motor,
and not that many phase amps above I0, it takes about 0.5 to 1 sec to start (and another 1 sec to spin to 50k-erpm)
 
just some commentary:
when you catch a rotating machine be mindful of when you catch at the moment of synch (delay between measurement and acctual power flow) because if you lag the motor's sine-wave then reactive power will flow to your iverter while active power flows to motor (quadrant 2). reactive power can be hard on the DC link caps if you do not have too much uF value. be sure you are in quadrant 1 (advance your controller's generated sine wave as needed to compensate for the delay). the faster the rotating machine the tighter this tolerance.

i think the situation would be different if you were talking about induction motor because when you stop sending power the motor is totally off with no field. but a BLDC motor has magnets internal so it always generates a field when it is spinning.
 
When capturing the rotating motor it looks for 0 current flow... 0 current flow only occurs when you exactly match the motor speed and voltages. When this
is reached it jumps to the normal FOC part.

Anyways, upgraded my bike to v2.20 yesterday, v2.20 being the version with recovery. I'll do about 100km on it this week to see
if anything is amiss, but I think it'll be OK as putting in the recovery was actually not that big of a deal (it pays to read through the 30F's
PWM modules decription :D , it is more powerfull than I thought). I hope you guys excuse me for not reading through all 772 pages of the
datasheet...
 
Hi Lebowski :)
I read an old thread where you said you would like to make the control chip to be able to do self study on BEMF so that it can drive the motor with its own "perfect" wave form.
Have you made this possible yet buddy?
 
Well, in the v1.xx version I put in that you can choose to feed the motor back it's own waveform. Since then I have progressed in my knowledge and understanding of running a motor, and I've come to the conclusion that this is not what you want. What you actually want is that the power to the motor is constant and that it is not fluctuating at a high rate as this makes the motor noisy. To get a constant power flow the waveform to feed the motor is totally different from the back-emf waveform.

I have some ideas on how to achieve this constant power flow, but so far I've not had the time to try them out. Zombiess requested me to look into recovering a running motor after a short error event (so it can continue to deliver power, instead of having to wait for the motor to stop). Also I've been busy looking for a new job as I don't like my current one, so, you know, I'm busy with other things a the moment...
 
I will play the Lottery and then share with you when I win :D
Its best to concentrate on a new job then! Wish I could help with the ideas you have!
But can't wait for yet another Lebowski technological breakthrough :D
Can't you get a online job in your field? :p
 
I'M going to use the CAN bus :lol:
No one uses the CAN bus right now because it is untested :wink:

Ok, so basically the answer to my question is "No". I'll have to wait a bit longer then, before sending you a chip for programming. It would be real silly if I had to take a digital throttle value and convert it to analog for the controller IC to convert it to digital again :roll:
 
Alan B, I would love to test it myself, but Lebowski didn't answer my question whether that was a possibility. I don't know what is going on inside his controller, maybe it is very complex to use the CAN bus, and he did just say it was a lot of work to test it, so I guess it's not just to hook it up and see if it works.

But I have thought about it, and I really want to help Lebowski, so I'll be getting a chip and I will test it however I can, and report back. At least until the CAN bus is tested, I can develop my own controller using the analog throttle input, hopefully the CAN bus will be tested OK sometime later when I'm all ready to use it instead of analog throttle.
 
that's a nice feature. i think CAN bus also has error correction built in too no?
 
HighHopes said:
that's a nice feature. i think CAN bus also has error correction built in too no?
Yep, i wouldn't trust the throttle signal to something without error correction / detection... plus it makes it very easy to have have multiple masters and slaves on a single bus.
 
Lebowski said:
HighHopes said:
that's a nice feature. i think CAN bus also has error correction built in too no?
Yep, i wouldn't trust the throttle signal to something without error correction / detection... plus it makes it very easy to have have multiple masters and slaves on a single bus.

Do you think we could do 6 phase operation on john in CR's hubmonster using CAN bus?
 
Back
Top