Rickys High Power Flexable motor controller

Ricky_nz said:
Yep, I removed the centre+insulator, its actually quite easy :)
1) first I remove the outer jacket with the aid of a knife
2) bunch up the braid slightly by compressing it lengthways
3) slide out centre and insulator (no force required)
4) pull removed braid back lengthwise until its the size you want then flatten it.
The above took less than 1 minute to get about a meter of braid :) so really simple.
The centre insulator on all RG58 I've seen is quite slippery so slides easily.
You can do the same to RG213 (1/2" coax) if you want bigger braid.
Yeah, I did this to a bunch of old 75-ohm RF cables (like old VCR/TV/etc stuff) to get the flexible braid for making the cell interconnects on my TS cells. ;)
 
amberwolf said:
Yeah, I did this to a bunch of old 75-ohm RF cables (like old VCR/TV/etc stuff) to get the flexible braid for making the cell interconnects on my TS cells. ;)
The TV stuff is often a bit thicker than the RG58 I used so probably more braid if you can get the stuff that doesn't rely on foil.

before drilling, drill guide taped on
drill-guide.JPG

I have got the heat sink drilled and taped :D :D :D
I made quite a mess with wd40 and aluminum chips, That mess sticks well to your hands etc :lol:. Those with with mills and cnc's must have fun :lol:. sharp sticky chips of aluminum.
All but one hole remained blind as intended. The one that accidentally went through was because the nut on the depth limit on my drill press vibrated round giving me slightly too much depth.
I really should get a second nut to put on there to lock it when doing critical things.
oops.JPG
All holes were started done first with an intermediate tap and then finished with a bottoming tap. I wouldn't have a patience to do them all with the taper tap first. It didn't seem to be needed anyway.

taped hjeatsink.JPG

it-lines-up.JPG
This photo is at a bit of an angle so its hard to see but it lines up pretty well. a few minor errors in the MOSFET mounting holes but there is a bit of tolerance there.

I now have to trim the 3mm threaded part of the PCB standoffs back as the ones I have have too much thread.
Its going to be tedious but I will do it properly and thread on a nut first to make sure the threads are preserved.
All I have to do this is a hack saw and file. I think they are a bit too small for power tools or at least the ones I have.
 
Ricky_nz said:
amberwolf said:
I have got the heat sink drilled and taped :D :D :D
I made quite a mess with wd40 and aluminum chips, That mess sticks well to your hands etc :lol:. Those with with mills and cnc's must have fun :lol:. sharp sticky chips of aluminum.
Try kerosene..it's a really great drilling lubricant and no sticking! Gotta' be careful not to smoke though. :)
Amazingly, for drilling/tapping aluminum, soapy water works wonderfully too. No sticking with this either.
 
CamLight said:
Try kerosene..it's a really great drilling lubricant and no sticking! Gotta' be careful not to smoke though. :)
Amazingly, for drilling/tapping aluminum, soapy water works wonderfully too. No sticking with this either.
Thanks CamLight.
Good tip I'll try that next time :D.

I've now got the board lined up on the standoffs. one is a little bit off so I'll have to manually drill out the hole on the PCB.
Next time I do a board I will put a hole that allows a bit more error in the standoff position rather than one that has very little tolerance. Luckily the pad for the mounting hole has nothing near it on any layer and is not connected to anything so should be easy to drill out to a mm larger size to allow the bolt through the PCB to line up with the standoff.

helpful tip: don't over tighten PCB standoffs. I did and it sheared off really easy, way below the force I would expect a bolt of that size to fail at :oops:. Luckily its one in the middle of one end of the board that I added just in case but everything seems rigid enough without it. I don't imagine there is a way to remove a bit of 3mm thread in a way that doesn't harm the thread in the aluminum so It can go without the standoff.
I guess I could always superglue the sheared off bit back as it would mainly be in compression anyway. :twisted:

Looks like the MOSFETS will clear the beefed up tracks with sufficient clearance that the tracks could have been beefed up more but I believe will be sufficient for the first prototype as they are.

Now back to adding parts.
I'll add enough to get the gate drive and MOSFETS for just 'A' phase first and do some tests.

Things should go quicker now I'm done with mechanical things for a while and are back to electronics and software :lol:


My package of parts from Digikey is now showing rescheduled for Tuesday :evil: I could really use those parts.
I'm sure UPS in aussie are just delaying the package to annoy me. :lol:
Oh well I've got enough parts to get started on testing anyway.

Ricky
 
Gate drive operating for phase 'A' :D.

I have found I have managed to break my PWM initialisation code along the way so I need to get that working before i can optimise the gate drive etc.
When it came up it was running at 100KHz :lol:.
I'm running 30V into the DC bus at the moment as yes it does spit out 100KHz at about 15% duty cycle @ 30V!
I promise I'm not trying to build a VLF radio transmitter :lol:
I don't intend to run it this high, its just the first value I got when I manually activated the PWM using the debugger.

Time for coffee before I start debugging the code to figure what I broke since I last had PWM running and fix it.
Its almost the right time for me to be debugging as its 11:30pm and I seem to do well debugging at this time of the night although I should probably stay away from the power electronics :lol:.

The board is starting to look nice from the bottom now that I have the 4 FETs for phase 'A' soldered on.
Once I get the PWM code stable I'll fit the other FETS and upload a picture.

Edit 00:10 Sunday NZ Time
Found it!
Don't comment out code and then not look at it for about a month :roll:.
I was skipping half of the initialisation sequence.

Now thats solved I have played around with PWM frequency with a test ramp but I found one MOSFET getting warm and the PSU tripping on over current intermittantly. I found I had forgotten to solder one side of the gate resistor for that FET :roll: :oops: damn phone calls interrupting me at critical moments!

Oh well with that solved it was working well but all the FETS were warming up a little at 20KHz and the current from the PSU was about 250ma on the DC Bus. Not bolted to heat sink yet.

Looking at the scope showed I had a default value for my dead time that was a bit short 50ns!
I bumped it up to 1us and the DC bus current dropped to unmeasurable on the meter (<10mA) on the PSU :D.

I think ill get some sleep and then in the morning I'll add the other 2 channels to the board and look at getting some current flowing.

I currently have one limitation due to my parts being held up in Aussie for 2 days :roll: (ups probably playing rugby with them :lol: )
I have had to use temporarily 10V tantalums for the gate drive so I've only had the gate drive voltage up to 9.5V. I'll swap those out when I get the correct 20V parts. Also I don't have the leaded caps for the DC bus yet so not too keen to push the power to far.

At least I have proven the PCB is good on the 'A' channel :D .

Ricky
 
You're doing better than me, Ricky. I started testing my controller this morning and was getting really odd results, little jerks from the motor then the thing latching on with the bench supply current limiting. Seems I made an idiotic error - the hi side outputs on the chip I'm using are active low, the low side are active high, something I failed to spot in the small print on the datasheet. Slight re-work's needed to invert the high side drive before the next round of testing.

Your power board looks neater than mine, I've just quickly slapped on a mess of 2mm diameter copper wire soldered to all the power tracks. The weight of solder has upped the weight of the board a fair bit.............

Jeremy
 
Ricky_nz said:
I think ill get some sleep and then in the morning I'll add the other 2 channels to the board and look at getting some current flowing.

What's this "sleep" that you, Jeremy, and Amberwolf keep talking about? Seems like a complete waste of time. I do seem to remember that it involves sheep, so it could be fun.
 
lol pyro. :)



Outstanding work Ricky! Glad to hear you've got a channel up and running!
If you manage to get a DIY flux-vector sensorless controller working (and you've got the parts on board to do it), it's going to be soooo amazing! Every RC bike build is going to be beating your door down for them, including myself.
 
Jeremy Harris said:
You're doing better than me, Ricky. I started testing my controller this morning and was getting really odd results, little jerks from the motor then the thing latching on with the bench supply current limiting. Seems I made an idiotic error - the hi side outputs on the chip I'm using are active low, the low side are active high, something I failed to spot in the small print on the datasheet. Slight re-work's needed to invert the high side drive before the next round of testing.
Jeremy
Thats a nuisance but glad to read you have a plan to fix it. Some datasheets can be really bad or hard to follow.
Youre are closer to having a motor running though I think.
I still need to write the simple motor controller software to test the power board ( won't take too much) and then I will start on the vector control which will take more time work..

texaspyro said:
What's this "sleep" that you, Jeremy, and Amberwolf keep talking about? Seems like a complete waste of time. I do seem to remember that it involves sheep, so it could be fun.
No sheep round here :lol:
I agree that sleep is wasted time but unfortunatly its necessary to avoid plasma events on prototype controllers.
When I was at university I did a few 48hour stints without sleep to get things in on time and not miss important lectures, never again :lol:



liveforphysics said:
Outstanding work Ricky! Glad to hear you've got a channel up and running!
If you manage to get a DIY flux-vector sensorless controller working (and you've got the parts on board to do it), it's going to be soooo amazing! Every RC bike build is going to be beating your door down for them, including myself.
Two phases to go, I'll build them up (only take 1/2 hour) then ill tweak the test software a little and try to get some current through an air cored inductor/motor simulator).
It looks like about 20 turns of wire 100mm in diameter is enough to simulate the motor. All I need is an inductor somewhere between 13uH and 27uH that can handle runs of up to 200A for now.
I will bypass some current around the CT's once I have a second external one setup so I can calibrate them, This will allow even higher currents :lol:.
I will go over the calcs again and see if I can find a diameter a bit smaller so I can actually have a form to wrap the wire round though.
Once I have some current flowing I can really begin to optimise the gate drive although depending how it goes with the SMD caps.
I may need to wait for the leaded ones to arrive.

I want to get onto the vector control as soon as possible but I would like to get a simple hall effect driven trapesium controller going quickly so I can give the power electronics a bit of time on my hub so I can separate power electronics issues from controller bugs etc.

Ricky
 
Pro job Ricky, is this your first controller build?
Thanks for the detailed write- up too, it will probably serve well for kit builds if you go that route. I'm also glad you decided to add the sensorless option as well. I wouldn't worry too much about the start from zero, if Castle Creations hasn't been able to perfect this yet.... well, on the other hand, if you solve this problem you can quit your day job. :lol:

What motors do you have to test it on?
 
etard said:
Pro job Ricky, is this your first controller build?
Thanks for the detailed write- up too, it will probably serve well for kit builds if you go that route. I'm also glad you decided to add the sensorless option as well. I wouldn't worry too much about the start from zero, if Castle Creations hasn't been able to perfect this yet.... well, on the other hand, if you solve this problem you can quit your day job. :lol:

What motors do you have to test it on?
Yes its my first motor controller build.
I have built small 500W level switch-mode converters before but this is my first motor control.
All the principles are similar for the electronics, just everything scales up a lot :lol: .
This is the first home project where I have had PCB's made and I like the result :) .

I have a Turnigy 80-100 180Kv, 2 actually so maybe I can run one in regen and one in motor mode when I get that far with the shafts ties together. Can't do that until I make enough progress on the vector control though.
I still don't have the reduction drive made to attach one to the bike yet so load testing could be difficult.
Unfortunately I can only do one thing at a time :lol:.

I also have a golden motor 1000W hub rear on a bike that I can use.
That is what I will use to test the hall effect mode. I don't really want to drill holes in it etc so it will only get short runs at power.

I think sensorless start from zero is possible if the software is written with it in mind.
I imagine in the modelling world there is no need to produce as much power at start as we need/want.
I guess my real goal is no sync loss etc which I believe shouldn't be a problem with vector control and then as smooth a startup as I can manage but that part of the code should be able to be tweeked independent of the main sensor less control.
I have been looking at a few algorithms that allow sensing the rotor position from a dead stop up to a point where the normal back emf methods can be used.
 
etard said:
I wouldn't worry too much about the start from zero, if Castle Creations hasn't been able to perfect this yet.... well, on the other hand, if you solve this problem you can quit your day job. :lol:

It's entirely possible, and well documented. It's called flux vector rotor position sensing. He has the A/D's needed on that board to make it happen, it just requires the right 1's and 0's inside the controller and it can become a sensor-less controller with full torque at 0rpm, and excellent low-speed AND high speed control.

The reason castle creations would never do a proper sensorless drive is because just the A/D's would blow the whole controlling component cost for an RC controller. lol
 
Here is a short video I did last night now that its completed uploading to youtube while I slept.
It just shows the phase output voltage while being driven by the control board with a test pattern.
excuse the mess, Its time for a tidyup on the workbench again.
[youtube]f2qIZDVKiRY[/youtube]



Edit: add photo of all 12 MOSFETs fitted.
All_FETS_Fitted_100_2972_small.jpeg
Yes everything lines up and they all sit flat against the heatsink. I bolted them to the heatsink before soldering.
Long threaded standoffs work great for temporarily holding the FETS to the heatsink while soldering, less fiddly than dropping bolts through the holes in the PCB and hoping they land in the FET mounting hole.
I will add a bit more solder on the bottom side MOSFETS soon. I got good flow through the plate through hole but I want a bigger fillet on the bottom side which with all the copper planes acting as heat sinks is kind of hard to do from the top side :lol:

Ricky
 
All three Channels are working :D :D :D
Now I need to fit some of the missing DC Bus capacitors and then wind an air cored inductor to simulate the motor for current tests.
I'm thinking once I get it to output some current with the DC bus at the 29V I can get with my 2.5A PSU I will then probably move up to my stack of 150W Meanwells I use for charging my 14S Lipo pack. It is made of one 15V and 2 * 24V meanwells and is set up for 57.4V and it current limits around 6A so hopefully still relatively safe for the MOSFETS,

[youtube]mmvgKNSZETM[/youtube]


Edit:
I haven't found a former for my inductor yet but I did one other test.
I can set the PWM frequency and duty cycle from the command line so I played around a bit.

I shorted :twisted: the A phase output to ground with a thin clip lead about 200mm long.
I set the frequency for 12KHz and dead time of 1us for now and a very narrow pulse width.
I brought up the DC Bus to 29.2V and it was drawing about 1.7A. Thats a really good way to heat up a clip lead :lol:.
I didn't have any proper instrumentation on the current pulses although since nothing else heated up much (FETS just warm) it must have all been going into the wire :lol:.
No explosions. I need to check of overshoot and ringing around the MOSFETS now but I needed a fun test :lol:
This was all without the heatsink attached.

I stopped the test when the wire started emitting smoke signals after a few seconds :lol:

Ricky
 
The reason why the wire tries to melt :lol: .
The following scope trace is on the phase A CT output (unfiltered as I haven fitted the small RC filter yet). It is centred on 2.5V
10mV/A therefore 1 division = 100A. The CT is backwards for current leaving the phase wire but it made the board easier and dosen't matter in software anyway. I should hurry up ad add the RMS measurment functions for the CT's.
Ie for every 10mV below 2.5V there is an amp flowing out of the A phase.

I'm currently getting 5V peak of ringing on the DC bus (only caps for A channel fitted so far) it lasts for a us or so.
I might have to wait to get the leaded caps and try them to see if they are less vicious compared to the SMD caps due to their damping.
View attachment ADS00014.BMP


Edit:
I have just wound a air cored inductor 24 Turns around a empty mountain dew 1.5L bottle with the top cut off.
I don't have an L meter at home but with fixed duty cycle the current waveform is now close to DC at 12KHz now.
If I got the calculations right it should be around 27uH so similar to the maximum inductance on the 80-100.
I figure I can take turns off to get the minimum inductance of the motor.
The most current I have managed to get through the inductor is about 60A. Enough to warm up the Turnigy 8 gage wire I wound it with.
any more and I need more current than my bench supply can provide.
Its only the coil part that warms up so maybe too much edycurrents in the big wire. I didn't have a stash of winding wire so this will do for now.

View attachment 1
motor_sim_2_100_2979.JPG
 
hah! That's an excellent load! Hahaha. I feel like some dude on a surfboard will pop out with enough current like some kind of geanie in a mtn dew bottle... :shock:
 
texaspyro said:
So how many RPM does the Dew do? :roll:
:lol:

grindz145 said:
hah! That's an excellent load! Hahaha. I feel like some dude on a surfboard will pop out with enough current like some kind of geanie in a mtn dew bottle... :shock:
You do feed waves into it so I guess a surfer is a possibility :lol:
I guess he would prefer sinewave to square wave though.

=============

I was expecting my package of parts from digikey today.
It hasn't shown up :(
UPS tracking says it was delivered and the proof has a number in it.
No sign of the package round here Grrrrr.
I hope it wasn't left and has been stolen.
There is a possibility the courier recognised my name and delivered it to work when I wasn't home so I will check tomorrow (I've had that happen before).
I'm not sure which local courier company UPS uses in NZ. They have offices in some of the major cities but not the one I am in.

==============

On the plus side I managed to sort out the software to get the hardware abort handled correctly for the PWM output.
Its not 100% complete yet but I had to play around a little to understand how the hardware on the CPU operates.
The one paragraph in the datasheet had to be read carefully and a few assumptions made and tried.
Its interesting that they don't have an app note of using the /MCABORT input (I suspect because there is not a real clean way of using it).
It is quite messy how you have to handle it. You must enable the interrupt to have it work (Not explicitly stated in the datasheet but implied. The PWM turns off when it /MCABORT goes low and then in the interrupt you must either disable the abort interrupt or clear the flag but doing either turns the PWM back on! The software solution is to switch the pins back to GPIO all low to turn off all transistors and for the next cycle switch them back to PWM mode.
I'm still refining the solution but its some protection I really need to avoid risking the MOSFETS. The signal from the CT reaches the comparator and the comparator output is connected to the pin. I forced the pin low to test but I really need to alter the comparator thresholds so I can do a few tests of it with real current. Currently the trip is set for about 160A/phase.
Too high for initial tests.

Ricky
 
Alan B said:
On the AVR motor controller I've been studying they provided a DAC to wire to the comparator threshold. That way it can be adjusted in software but it causes a real hardware trip. Makes testing easier as well.
I have worked with a board that software programmed hardware trips.
It kind of worried me as any software issue might be able to change the threshold accidentally but for for most cases its probably fine.

The LPC I used doesn't have any on chip comparators but does have one DAC unfortunately I needed the only pin that comes out on for a different function. The other issue is that for current measurement I have 2 thresholds as it is a bipolar sensor. ie 0V = -200A and 5 = 200A and 2.5V = 0A, the thresolds are just within that range so I needed two thresholds on 2 inputs. The hardware trip is just the final thing so in most cases one value is suitable as no matter what size power stage the CT should be in the same range of output otherwise it doesn't use the entire range of the ADC. The tricky part is for very early development very high trip levels are a bit too high to risk but once the design/software is stable it won't matter as the software limits will be able to control things to allow production testing etc.
 
Hi All,
I've made some more progress tonight
I just figured out why I commented out the end of the PWM initialisation sequence. :lol:
Is was related to trying to test some experimental code I was playing with to use the match registers to trigger ADC conversions etc.
I noticed that the external ADC was returning 0 and on probing the PCB there was no activity on the pins and that jogged my memory and sure enough I had swapped the mode of a few pins around but not completed the required code :oops: its been a while since I really looked at the software.
It shouldn't take too much to get the ADC sampling at the right time now.
Once the high speed ADC is converting and being read at the required rate and location I will write some RMS measurement code and then add some software protection for the hardware.
Before I push the current up I want to be 100% certain that the major protections are in place and are working otherwise it could be come expensive.

So far I have been relying on the very power limited bench supply to provide some protection but I want to be able to move up to my 57V 6A supply which should allow me to push the controller a lot harder than the 60A phase current I can hit now before my 30V 2.5A bench supply goes into current limit.

I did some more tests with the hardware over current detection.
I have confirmed if I bring the CT output near zero (full scale -ve) the comparator trips and I have improved the code so that following the immediate abort from hardware a software off if forced for all FETS for the rest of the cycle.

Dispute concern about noise getting into the CT outputs due to the long traces back to the ADC a quick check with the scope at the control board end shows a nice clean current waveform, just the same as when the CT was disconnected from the long traces in the board and scoped directly. The ground plane next to them must be doing its job :D.
This was checked driving into a short with approx 100A peak currents 50A average and also with 60A into my test inductor.
Admittedly this is with only one phase loaded but I believe this is still representative.

Ricky
 
Ricky_nz said:
texaspyro said:
grindz145 said:
hah! That's an excellent load! Hahaha. I feel like some dude on a surfboard will pop out with enough current like some kind of geanie in a mtn dew bottle... :shock:
You do feed waves into it so I guess a surfer is a possibility :lol:
I guess he would prefer sinewave to square wave though.

Haha I meant like the mtn dew commercials from the 90s. They were totally radical dude.

I wrote that while half asleep and didn't explain it well... :roll:

Anyway, good to hear PWM is on it's way.
 
grindz145 said:
Haha I meant like the mtn dew commercials from the 90s. They were totally radical dude.

I wrote that while half asleep and didn't explain it well... :roll:

Anyway, good to hear PWM is on it's way.
Yes I remeber the ads too and did think of them. Just when replyiing (after a few beers) I stumbled on the other connection to waves :lol:
 
On many of the high power/inductive circuits I have done I have had to implement a 2 level current limit. The hard limit would be like your hardware/instant shutdown. This was set near the FET max/pulse current limits (say 1000 amps). The current transucer signal was also filtered and monitored in software at a fairly fast (say 1KHz rate) and tripped at below the FET continuous current rating. Setting the hardware current limit at the FET continuous current rating causes a lot of shutdowns due to noise and the vagaries of spinning motors out in the wild world.
 
texaspyro said:
On many of the high power/inductive circuits I have done I have had to implement a 2 level current limit. The hard limit would be like your hardware/instant shutdown. This was set near the FET max/pulse current limits (say 1000 amps). The current transucer signal was also filtered and monitored in software at a fairly fast (say 1KHz rate) and tripped at below the FET continuous current rating. Setting the hardware current limit at the FET continuous current rating causes a lot of shutdowns due to noise and the vagaries of spinning motors out in the wild world.

Yes noise can be a problem, I'm planning on adding a copper shorting link around the CT's that will rescale them upwards once I have a current source to recalibrate them. That will allow a higher hardware current limit but then again I also don't want to lose too much ADC resolution.

The hardware limit will probably be just over twice nominal operating current. I have still to decide as its a resolution thing but I think it should be ok. The hardware limit will be allowed to continue for several cycles to allow operating with noise but if it continues to activate every cycle then something is wrong.
It should be able to ride through spikes with the cycle by cycle limiting and if I get really fast spikes I can add a small hardware filter.
Operation above nominal current will be permitted based on some thermal models etc.

It is a balancing act between CT size / ADC resolution and hardware trip level as like you say noise spikes can be a problem. Unfortunate losing resolution or CT range is also an issue.

My software current monitoring / limiting will most likely be at the PWM rate providing I have sufficient processor performance.
I'm intending the vector control current loop to run at the PWM rate or a close fraction of it so maybe 12KHz hence the fast 12 bit ADC.


Parts are here
Finally my parts arrived :D. Wednesday morning. They were re-scheduled for Tuesday (initially Monday) and the local courier signed them as delivered on Tuesday but they arrived Wednesday :?. left without obtaining a signature. The dodgy courier had signed my name when I checked online (nothing like my signature :lol: ). Unfortunately I have to get things delivered to home now as inwards goods at work are now too busy to accept personal packages :(.
The courier company used by UPS around here is PBT peter baker(breaker) transport. I have been informed at work that they have well earned the breaker nick name dropping large items :lol:.

I should be able to fit a few more caps and really start having some fun. I will not let the current go above 60A ( limited input to 30V 2.5A) until I have some more protections in place. I need to fit the voltage divider for the gate drive voltage monitoring and the write some code for the software protections. I will start on that tonight and try and get the ADC sampling in the right place. I am targeting increasing the output current up significantly by sometime on Saturday as long as all the critical protections are in place.
I have double checked the ACS758 CT specs and its internal slug used to measure current is 100uR oxygen free copper so I should be able to solder another piece of copper wire in parallel with them to increase the current handling without creating any unwanted temperature effects as p[er their app note.

I also have some insulating thermal sheet coming to put between the FETS and the heatsink. I just need to figure out how to put nice holes in it for the FET mounting holes. I will use one strip for the high side FETS and one for the low side ones.

Still got to drill and tap a hole for the heatsink temperature monitoring NTC once I decide the best place for it. Ideally it would right in the middle of the heatsink but that isn't going to happen unless instead of the threaded one I have I use a small glass bead one like I embedded in my headline motor. If I use one of them I can glue in right in the middle of the heatsink where it should be hottest. I'm still undecided on this.

Ricky
 
Back
Top