Home made controller for a MARS BLDC

patallen

1 W
Joined
Feb 24, 2013
Messages
57
Location
In my home basement
Hi, i am new member here. Iooked at several threads here and i am very surprised at the level of knowledge and experience found here, its a bit intimidating.

I am electronic designer in the remote start industry for over 20 years, now a consultant for the known usa makers. Been doing pcb artwork and software for a while. RF communication, hardware and software, encryption methods, key bypass, bla bla bla.

My curiosity brought me a Mars motor and a sevcon, both dead ,from e-bay. My initial intentions was to look at how they are made, and ultimately make the motor work some day. It happened that i went much further that i wished, and here i am. I fixed the motor and ditched away the sevcon (that i opened and partialy reversed).

I am on my 4th prototype, meant for experimentation and to satisfy my curiosity.

1st proto was made with a tba6575, it worked, but had a lot weird issues and it toasted too much fets. When it worked first, its there i realised the capacity and potential of such kind of motor.

Here are some video of my work.
2nd proto, with a Pic, but lower board was meant still for the tba chip
https://www.youtube.com/watch?v=YC4JSf8uchg&list=UUC673uaNkUUZovyc5ZeYhDw&index=8
3rd video, with newer board and more features, keep going better
https://www.youtube.com/watch?v=x87YHZbrfvU&list=UUC673uaNkUUZovyc5ZeYhDw&index=6
And last, i changed fets and builded them around solid copper bus bars. It may be overkill, but i dont want the controller to be the weak link.
Its not completely done yet. Will switch the pic16f916 to a 18f4431 soon,and ultimately a nice compact pcb artwork.
There is 48x 100A/100v fets, 2x ACS200A sensors (potentialy 3). So it can "control" 400amp max (very tentatively).
I know, it is excessively big and not very sexy, but again i am experimenting. The heatsink is an old portawatt inverter i am using as the enclosure.

It is all meant to go soon into my son's toy 1:2 willys i made him few years ago. it was powered by a 2stroke honda motor. stink and noisey to say the least, and just no torque at all to get off. i ditched this all out of there recently and thrown it in the garbage. I already tested proto #3 in it and made a nice brake burn in my home basement, and ran straigt into the wall, it stoped once it ran out of the booster cables. Stupid test, by i was laughing realy loud, and moaning at the same time holding one of my knee that hurted because of the impact into the concrete wall that acted as the shock absorber....it did hit the 200A software limit real quick, but man dit it went off !! (1:2 chain reduction and 10.5inch tires, at 24v at that moment, 100% duty cycle on 110amp/h car batteries, it went off like a scalded cat).

Once i will get enough confidence and experience with this, i realy plan to make a trike for my personnal use and some similar motor and more compact driver.
Comments are much appreciated.
Thanks !
 

Attachments

  • IMG_8129.JPG
    IMG_8129.JPG
    390.9 KB · Views: 2,189
Thats a pretty epic intro.
Welcome and keep up the great work. DIY controller stuff is on the top of my list of cool things. There is a few builds going on and I find them all different enough that is very hard to understand everything they builder is doing.
 
circuit said:
I don't really like the sound from this motor. You should look into SVPWM.

would like to know what you dont like exactly in the sound, and what is svpwm, i know those motors prefer sine wave rather than plain pwm. its been just few months that i am working on that so i learned from the start at 0, its already good that i am able to make it run i think.

fwiw, my native language is french so sometimes i dont catch all the expressions, sorry.
 
patallen said:
circuit said:
I don't really like the sound from this motor. You should look into SVPWM.

would like to know what you dont like exactly in the sound, and what is svpwm, i know those motors prefer sine wave rather than plain pwm. its been just few months that i am working on that so i learned from the start at 0, its already good that i am able to make it run i think.

fwiw, my native language is french so sometimes i dont catch all the expressions, sorry.
To my taste, I don't like any sound that is not a silent humm coming from bearings. In this case a very loud cogging noise is audible, possibly, from trapezoidal commutation and bad timing, or even random MCU resetting.

SVPWM stands for space vector pulse width modulation. It is similar to 'standard' PWM, but is 'better'. There is a lot of info on the web, numerous application notes from MCU manufacturers, such as microchip, atmel, ST, TI, etc.
 
thanks for the detail, for now i am far away from that, altough i know a bit more than i knew, i made a lot of class D amps in the past and to some extent, its similar, ie, digital signal to generate analogue signal.

i searched a bit and it may be possible to make that on a DSpic, for now i am on a pic16 :cry: because i like to test/emulate my code with my ICE2000, i will move soon to a pic 18 but still realy doubt it could be done (svpwm) with my actual hardware, and i code only in assembler. Yes i know, i am mind limited. But i made this motor work !!! lol...

also, this motor is realy used, one bearing needs to get replaced.
 
Well yes, pic16 is for sure not upto the job. I am not intimately familiar with pics, however some low power mcus (for example at90pwm3b, atmega64M1) have integrated Power Stage Controller (atmel calls it this way), which does a lot of time-consuming tasks in hardware. This allows relatively slow MCU to do advanced high speed motor control. Until you add features requiring lots of math that is... Take a look at pic18, there should be some among them.
 
I also use PIC processors and like you, program them in assembly.

My tip, forget about the 16F adn 18F, go straight to the 30F/33F . The 30F/33F are much easier to program because of the
large amount of registers (w0 - w15 instead of only wreg) and because they don't use bank switching. Other things which are
really nice w.r.t. the 16F/18F are the multiply / divide instructions and the large amount of conditional stuff (like > , >= , <, etc).
For motor stuff, they have 3 center alligned PWM blocks with programmable deadtime, and are capable of sampling 4 analog
signals at the same time (by means of 4 S&H units feeding a single ADC).
 
Hi, i am moving soon to 18f4431, which has the "power control module" specific to motor control and ultra fast 2x a/d sampling, and a motion feedback module. My actual design already works very great imho, so i cannot see how better it will with the "better" pic.

18f4431 features:
14-Bit Power Control PWM Module:
• Up to 4 Channels with Complementary Outputs
• Edge or Center-Aligned Operation
• Flexible Dead-Band Generator
• Hardware Fault Protection Inputs
• Simultaneous Update of Duty Cycle and Period:
- Flexible Special Event Trigger output
Motion Feedback Module:
• Three Independent Input Capture Channels:
- Flexible operating modes for period and
pulse-width measurement
- Special Hall sensor interface module
- Special Event Trigger output to other modules
• Quadrature Encoder Interface:
- 2-phase inputs and one index input from
encoder
- High and low position tracking with direction
status and change of direction interrupt
- Velocity measurement
High-Speed, 200 ksps 10-Bit A/D Converter:
• Up to 9 Channels
• Simultaneous, Two-Channel Sampling
• Sequential Sampling: 1, 2 or 4 Selected Channels
• Auto-Conversion Capability
• 4-Word FIFO with Selectable Interrupt Frequency
• Selectable External Conversion Triggers
• Programmable Acquisition Time
 
Hi, so here i am. I made first laps on my son's jeep tonigh. Man did it fly.
But thats all. I made some further harder test, discovered an issue with the a/d sampling crosstalk in between the channels, and excessive noise present on the hall signal, then chazam !!! it made a nice fondue inside.

I do this to learn, and to have fun so lets take it that way.

Pics: last known pic before it died and proof that it worked, you can see 2 black stripes on the floor just in front of the jeep.
 

Attachments

  • IMG_8157.JPG
    IMG_8157.JPG
    412.5 KB · Views: 1,965
Hi, as i am moving forward considerably on my BLDC controller and made some very good progress, i am searching for academic method to choose and place low esr caps on my power supply, my mars motor generates a hell lot of emf and noise enough to disturb the processor. Is it the type of method "more is better" ? Yes i searched on this forum and resourses.
I have collected over the years several huge "computer grade" caps, Sangamo 34800uf 50vdc and some 33000uf 50vdc Mallory/Sprague powerlytic. Not sure about them and theirs ripple capabilities but will try and see if it changes anything at all.
For now there is 2x 2200uf/50v caps in front of each of the "arms" of my controller. so a total of 13200uf, spreaded on the copper power buss bars.

There is about 3' of #6awg wires from my controller before it reaches the battery (2x 90AH car batteries).

fwiw, i managed to make real runs in the scalled down jeep with a handicaped controller with wrong fets, and made very good acceleration, up to 40kmh, 24v with 10 inch rear wheels and 2:1 reduction. I saw several times 300amp and more on a clamp ammeter. It is very funny. Once i will fix the noise issue it will cure some hesitation problem at lower speed, which then will make some very funny litle toy for my son. :roll:

Thanks for any inputs on low ESR caps solutions/details.
 
Jeremy Harris, Fechter, and Bigmoose have posted about it (search their posts for "capacitor" and it might turn up) in various motor controller and other threads, but basically what I recall of the system is that you want to use small solid (ceramic? mylar? tantalum? I forget which one) low-value caps right at the FETs and as decouplers right at the VCC/VSS/GND of your MCU and other chips, then something like ten times their value as another of the solid types near those, then use the really big ones as ten times that value in electrolytics, and maybe another set ten times that size.

IIRC part of the reasoning is frequencies--different inductances and capacitances will create different LC filtration and resonance, so that ringing and other RF/EMF noise in the circuit would be more reduced than just using really big caps.

Another part was distributing the largest capacitance closest to where the power drains and spikes occur, but with smaller ones interpersed among them.

But to get the precise story on this, you'll want to locate those older posts. I wish I had a link for you. If anyone finds the link, it'd be great to stick taht in the ES Wiki in one of the electronics tutorial articles. ;)
 
I would 1st try to identify more specifically what, when, why, where the interferences on the processor are being generated. More/different caps may not be the solution or the easiest/cheaper one.
 
Thanks very much for thoses threads, it is very interesting.

I havent measured anything yet, i have 2 digital scope on the task soon.

Problem seems to be commutation related since it occurs and low speed and high throtle demand. The rails on my controller are relatively far away from each others to placing mlcc caps in there seems a bit useless imho.

So, i try to be a bit methodic there

1-i will do some runs and measure the batt ripple, at the batt and at the input of the controller
2-will measure the ripple at the entry of the controller board
3-will measure +15v and +5v inside the board

will report the findings and will shoot out snap shots of the measurements if you want to comments.

Thanks !!
 
1st thing I'd check is if the batteries are being able to handle the current without sagging badly, which could be the only reason for the controller resets. Measuring (oscilloscope) supply voltage directly at the controller's brain power input.
 
Njay said:
1st thing I'd check is if the batteries are being able to handle the current without sagging badly, which could be the only reason for the controller resets. Measuring (oscilloscope) supply voltage directly at the controller's brain power input.


maybe. but the mcu doesnt reset. brown out and low voltage detect are all active, plus i have a lcd screen with entry text at reset so i would see if it would reset, but thanks for the suggestions, will check again.
 
Njay said:
Ah, ok, when you mentioned "disturb the processor" I presumed you're seeing resets.


actualy the most disturbance is seen on the lcd display, its the type that works with 8 i/o so i use a shift register and a data/clock/enable. the display gets totaly f*cked up so i have a sub routine that every 1s the lcd is re-initiated....temporary fix :x
 
i don't follow the logic of how the rf noise from the brushes will somehow cause the processor to not work. if you are trying to eliminate the noise then the caps would have to be right on top of the brushes imo. if you know how to protect the polarity then electrolytics would work. needing low ESR is a function of the frequency and how much noise the cap has to eat.
 
dnmun said:
i don't follow the logic of how the rf noise from the brushes will somehow cause the processor to not work. if you are trying to eliminate the noise then the caps would have to be right on top of the brushes imo. if you know how to protect the polarity then electrolytics would work. needing low ESR is a function of the frequency and how much noise the cap has to eat.

its a brushless motor.
Actualy i just finished several tests.
I have a huge amount of random parts and some boxes of various caps. I did try several combinations and placements.
The ones that made a real HUGE difference is some film mkp 3.3uf caps, called "emi suppresion"
http://www.digikey.ca/product-search/en?lang=en&site=ca&KeyWords=bc1614

still new in the pac, 10 of them actualy. Theses are not cheap, dont even remember how i had them (date code on the pack is 2003).
I placed some on the rail and some right at the input of the controller right after the battery wires.
The noise seen on my scope reduced by as much as 75% i would say with some light load. It gets better and better !!!
 
patallen said:
The noise seen on my scope reduced by as much as 75% i would say with some light load. It gets better and better !!!
So in that regard, what improvements have you seen? Does it jump off the line better? Is it less audible/less ringing? Or is it all in the scope?

I have toyed with big mombo low ESR caps before, but this last round of new controllers I left them out and can't say I notice a difference.

Kurious the Kat, KF
 
Kingfish said:
patallen said:
The noise seen on my scope reduced by as much as 75% i would say with some light load. It gets better and better !!!
So in that regard, what improvements have you seen? Does it jump off the line better? Is it less audible/less ringing? Or is it all in the scope?

I have toyed with big mombo low ESR caps before, but this last round of new controllers I left them out and can't say I notice a difference.

Kurious the Kat, KF

for now its just noticed on the scope. havent had a chance yet to "try" the thing on acceleration and real feeling. maybe the hesitation it has and/or surge has nothing to do with this, maybe my software is pure crap. but i am happy to see improvements every day.
thanks.
 
Ok, today test was not very conclusive. As soon as i throtled it down, it literaly exploded. One arm completely went on fire. Spark, fire, fumes, everything, the whole enchilada.
2nd time.

Could there be now that since the esr is much lower than before, now its up to the fets to handle higher current peaks ?
its strange, ive been able to make several runs on the street, fully loaded with my 160lbs.
Now with the caps, standing in the air no load, one shot of throtle and PATOW !! lol....that will be it for this week.

I will draw my schematic and post it here so any comments and improvements will be more than welcome....thanks.
 
Back
Top