Motor Controller with Customizable Electronics, easy DIY and repair OpenSource

badgineer said:
Oh and I changed all 0603 to 0805 :D.
So a smaller form factor is achievable even with 0805. How small should it be? :)
Would be good change in board size to go with all 0603 instead??

Do you want to join the telegram channel for developers?

I am busy, opamp LMV324IDT had missing voltage divider for 3.3V/2 reference, hall sensors works, but IRS2003 are not working, the PWM signals are at his inputs but the outputs are always 0 volts.
 
Hi

casainho said:
Would be good change in board size to go with all 0603 instead??

That's my point - i don't think that would help that much reducing the board size at least at this stage. The limit horizontally now is the total width of mosfets + big power components. The limit vertically is again power stage + bluepill + custom electronics board. (or big Capacitor + the 2 DC-DC modules in my design).
BUT if I manage to reorganize these big parts a bit so i can cram everything in a smaller board, it will be of help eventually!

I have some additional ideas of improving design (putting the Vbat trace at the edge and the GND below the mosfets towards the middle, the inverse of the current design, which has some layout benefits which might further make things smaller. (both easier and cleaner to trace, and a new placement - maybe more compact - for the shunts)
However progress is slow, and this is my first PCB as an adult so it might end up being a disaster... (I do have some understanding of electronics though, I'm not a 100% noob)

casainho said:
I am busy, opamp LMV324IDT had missing voltage divider for 3.3V/2 reference,...
Not sure what you mean. Also the schematic is missing this? I'd like to add this to my little PCB design "branch"...

casainho said:
Do you want to join the telegram channel for developers?
If I am welcome, yes! How do I do that?

Br,
 
casainho said:
badgineer said:
Oh and I changed all 0603 to 0805 :D.
So a smaller form factor is achievable even with 0805. How small should it be? :)
Would be good change in board size to go with all 0603 instead??

Do you want to join the telegram channel for developers?

I am busy, opamp LMV324IDT had missing voltage divider for 3.3V/2 reference, hall sensors works, but IRS2003 are not working, the PWM signals are at his inputs but the outputs are always 0 volts.

I see the v3 firmware applies to Xiaomi 360 original hardware, the mosfet driver is MT8006A, while your device is IRS2003, the L input polarity is different. you need to modify the firmware, or change to MT8006A. see the difference below:
2003.JPG
8006.JPG
 
usertogo said:
I can still see some 0603 pads - Diodes?
Yes, i did not change the diodes - yet :)

Also, I changed some 1206 components to 0805 - but not all, only some that i felt confident about making smaller.

usertogo said:
Is it correct that you are not using KiCAD for the PCB design? The Design program you are using is also open source?
The original design was made by somebody else (check it in github) in easyeda. So that's what I am using also, to make it easy to collaborate with the original designer, in case my design ends up being of any value. Also, I did not know if I can import the easyeda schematic to kicad, and had very very little time, so I just opened it in easyeda and that was it. :)

Br,
 
badgineer said:
usertogo said:
Is it correct that you are not using KiCAD for the PCB design? The Design program you are using is also open source?
The original design was made by somebody else (check it in github) in easyeda. So that's what I am using also, to make it easy to collaborate with the original designer, in case my design ends up being of any value. Also, I did not know if I can import the easyeda schematic to kicad, and had very very little time, so I just opened it in easyeda and that was it. :)
I would prefer in KiCAD but I think EasyEda is ok the the developers prefer it.

flute2k3@hotmail.com said:
I see the v3 firmware applies to Xiaomi 360 original hardware, the mosfet driver is MT8006A, while your device is IRS2003, the L input polarity is different. you need to modify the firmware, or change to MT8006A.
That was the solution - THANKS!!
Since the PWM is fixed at 50% on the testing firmware, I feel resistant when trying to rotate the motor to any direction, as expected. The PWM signals seems ok looking with oscilloscope.

I even changed the IRS2003 for the one on the M365 clone as seen on the picture, and lucky enough, it works as the IRS2003 so I will leave it:

 
badgineer said:
casainho said:
Do you want to join the telegram channel for developers?
If I am welcome, yes! How do I do that?
For the ones that want to help the development of this controller, join us here on this telegram channel: https://t.me/+3UprGRQeYTI2ZmE0
 
Motor works!!
[youtube]NelnB91Vqgw[/youtube]

And here is my custom electronics board, quickly made with a perforated board. Added a button to execute the motor autodetection and two 0805 resistors to adapt the throttle 5V signal to the 3.3V scale:


I assembled the board and I was also adapting and cleaning the motor firmware, and while using the oscilloscope for debugging, I did a short circuit on the PWM pins at the mosfet driver and the STM32F103 did burn - it was quick to repair, just removed the Bluepill with the burned STM32F103 and used a new one :)




 
congratulations !! very impressive, it runs so quiet I thought my Bluetooth speaker was not connected.

I see two green wire jumpers, what's the issue? and you changed IRS2003 to IRS2001? or re-complied the firmware? I particularly interested in the regen break function, are you able to connect a hall break to control the realtime break force? it will be very usefull for ebike.

I'm going to design a fit-in-box version of PCB based on your great work, will keep posted for my progress here.
 
Hi

flute2k3@hotmail.com said:
the up and down mosfet turn on and off at the same time, hope all your mosfets are lucky to survive.

The driver has protection against both mosfets on at the same time - so all should be OK (I assume - were they?).
Also that's why the output was 0 all the time.

flute2k3@hotmail.com said:
I'm going to design a fit-in-box version of PCB based on your great work, will keep posted for my progress here.

We made / are making some changes to the schematic too. maybe you want to wait for the new schematic before starting your PCB design. There are some fixed issues and some improvements.
This is also doubly true for the PCB where the schematic changes need to be implemented, and there need to be some layout changes, especially in the power stage.
-> the big CAP (C24 in the image) was far away from the battery wires, gnd was routed to it via long thin traces. It should be as close as possible to the battery wires, or else it can't perform its function. In the part placement I posted earlier this is already fixed
-> the smaller caps (C5 C7 in the image for example) are also connected to the shunt, when they should be connected to the ground! (schematic change).


casainho said:
I did a short circuit on the PWM pins at the mosfet driver and the STM32F103 did burn - it was quick to repair, just removed the Bluepill with the burned STM32F103 and used a new one

Oh, the beauty of modularity! :)

Br,
 
Badgenier, note that the 3 capacitors TH are to be bent and placed on horizontal, the same for the big capacitor, so they take less space on the board than the original footprint.

And I wounder if there is enough space for a M3 between the mosfets so we can hold the mosfets with a piece of metal, against another big piece of metal for cooling the mosfets.

I think I would prefer to use a flat metal aluminum sheet to hold the mosfets against. But I really do not know what will be the best way... -- we really need to work on this.
 
badgineer said:
Hi

flute2k3@hotmail.com said:
the up and down mosfet turn on and off at the same time, hope all your mosfets are lucky to survive.

The driver has protection against both mosfets on at the same time - so all should be OK (I assume - were they?).
Also that's why the output was 0 all the time.

flute2k3@hotmail.com said:
I'm going to design a fit-in-box version of PCB based on your great work, will keep posted for my progress here.

We made / are making some changes to the schematic too. maybe you want to wait for the new schematic before starting your PCB design. There are some fixed issues and some improvements.
This is also doubly true for the PCB where the schematic changes need to be implemented, and there need to be some layout changes, especially in the power stage.
-> the big CAP (C24 in the image) was far away from the battery wires, gnd was routed to it via long thin traces. It should be as close as possible to the battery wires, or else it can't perform its function. In the part placement I posted earlier this is already fixed
-> the smaller caps (C5 C7 in the image for example) are also connected to the shunt, when they should be connected to the ground! (schematic change).


casainho said:
I did a short circuit on the PWM pins at the mosfet driver and the STM32F103 did burn - it was quick to repair, just removed the Bluepill with the burned STM32F103 and used a new one

Oh, the beauty of modularity! :)

Br,

yes and thank you, the verified workable schematic is ok enough. I anyway have to redesign all detail to insert into a smaller size box approx. 87 x 50 mm.
 
I just figured out the purpose of two jumper wires... there is an issue for LMV324 OP4, the original design of Xiaomi is used as a buffer
sch.jpg
by this way you get a low impedance virtual ground instead of two 47K voltage divider :wink:
short +,- inputs & output at any time is not a good idea.
 
Hi,

Last night I cleaned and rearranged a bit the schematic around the Opamp, and yes, it now looks like what you suggested (plus another cap on the output of the opamp).
We're still working on the next version. Slowly but surely.

Opamp_half_schematic.png

We will probably also increase the gain.

Feedback is welcome.

Br,
 
TSDZ2 motor controller on bottom and M365 motor controller at middle:


We were discussing this aggressive design (at right) where even one DC-DC is placed on top of the header (using headers):


And yes, one DC-Dc can be on top of the other:
 
badgineer said:
Hi,

Last night I cleaned and rearranged a bit the schematic around the Opamp, and yes, it now looks like what you suggested (plus another cap on the output of the opamp).
We're still working on the next version. Slowly but surely.

Opamp_half_schematic.png

We will probably also increase the gain.

Feedback is welcome.

Br,

You should add a resistor between the output of U1 and C7, a 100 Ohms or something smaller.
 
agphil said:
badgineer said:
Hi,

Last night I cleaned and rearranged a bit the schematic around the Opamp, and yes, it now looks like what you suggested (plus another cap on the output of the opamp).
We're still working on the next version. Slowly but surely.

Opamp_half_schematic.png

We will probably also increase the gain.

Feedback is welcome.

Br,

You should add a resistor between the output of U1 and C7, a 100 Ohms or something smaller.

well, work as a buffer, C or RC is not needed at all, it only reduces the performance actually.
 
Hi

agphil said:
You should add a resistor between the output of U1 and C7, a 100 Ohms or something smaller.
flute2k3@hotmail.com said:
well, work as a buffer, C or RC is not needed at all, it only reduces the performance actually.

Hi.

Thanks for the feedback!
But as the old saying goes - https://en.wiktionary.org/wiki/give...a_man_to_fish_and_you_feed_him_for_a_lifetime

In other words: why?

For *this* situation, I think an R is not needed, but a C does help. My rationale for this layout was:
1) no R - here we just want a stable 1.65V bias voltage for the non-inverting inputs of the opamps. This is fed to the inputs though a 24k Resistor, so what could another 100 Ohms accomplish? For the opams that do signal amplificaiton we do have 120Ohm resistors on the outputs though. (R45 in the image)
2) I would argue the Capactitor there is useful. We have one on the input of the opamp, but i expect the opamp to still have some noise. So i thought some extra filtering of the output is useful, as we are feeding that to the input of the signal amplifying opams as bias voltage! We want that voltage to be as clean as possible.

Thanks again for input.

Br,
 
Reason for this is that opamps do not like driving a capacitive load. Rather than stabilising, with a certain value of capacitance that changes with opamp, it can become unstable and start to oscillate.

Putting a resistor in series before the capacitor stops this. Can crudely think of it as a damper but what it's actually doing is improving the phase margin.

If you have a decent opamp that's unity gain stable you might be best off putting the capacitor at the +input (as you already have). It's only driving 24kohm resistors so it's not going to get vicious pulls on it's output.
 
mxlemming said:
Training for this is that opamps do not like driving a capacitive load. Rather than stabilising, with a certain value of capacitance that changes with opamp, it can become unstable and start to oscillate.

Putting a resistor in series before the capacitor stops this. Can crudely think of it as a damper but what it's actually doing is improving the phase margin.

If you have a decent opamp that's unity gain stable you might be best off putting the capacitor at the +input (as you already have). It's only driving 24kohm resistors so it's not going to get vicious pulls on it's output.

Guru mxlemming explains very well. if you have ever worked or seen any instrument opamp application (mostly for low noise DC inputs), you would never see RC system at an opamp output. if you do want to do frequency compensation, the normal way is to add RC network at feedback (-inputs and output) rather than output.

as melemming pointed out, any filter efforts shall be done at +input side, and let the decent opamp (BW of 7Mhz of yours) follows this filtered voltage, this is why the voltage follower comes from.

It looks to me that Xiaomi original design is reasonable at all aspects, being a big company guess they have pretty mature R&D workflow to do design, calculate and choose the BOM. for a 3-shunt current sensing, SR>0.8V/us is normally considered ok @20Hz PWM frequency, the LMV324 has 1v/us, which fits in a cost effective way. anyway the bigger the better if you just DIY not a mess production.
 
Guru mxlemming explains very well.

I reached guru status? I still feel like a naughty child playing with spanners.
 
Hi

Thanks for the explanation. This was unexpected! I thought I did a decent homework on this :D
I took the topology from here:
https://ocw.mit.edu/courses/media-arts-and-sciences/mas-836-sensor-technologies-for-interactive-environments-spring-2011/readings/MITMAS_836S11_read02_bias.pdf
(first schematic on page 4) and did not give it much thought.

mxlemming said:
I reached guru status? I still feel like a naughty child playing with spanners.

It depends on the frame of reference. From my subjective point of view you definitely are :).
Oh, and you just sort of contradicted, quite confidently and well-explained, information I got from an MIT course. So I guess you now also have an objective claim to the title :D

As for me, I learned something today. And gained some much needed space on the board :D

Br,
 
What is the goal: Max Amps and Volts? If possible include it for battery and phase.
 
Hi

Max Volts:
At this time the Max Volts is 72 (at which the 12V DC-DC module dies) This is the main bottleneck - we could not find a good solution for a small 12V DC module that takes a bigger input. If anybody knows of any small 100 to 12 V DC-DC module, please tell! This is the main barrier i think to making it a 100V max (~20s) controller.

This makes it a maximum ~15s lipo battery controller. We expect it to be used mainly in 48v nominal batteries.

Other then that there are a few 75v / 80v components, but those are easy to find 100v alternatives (diodes, capacitors, mosfets etc)

For Amps, we are targeting about max 80A phase current.

Here the bottlenecks will be the fets and shunts (phase amps). You can buy good fets and lower value shunts and get more phase amps, probably. But a To220 FET will will usually top out at a max of ~110-120, and that is pretty much stress for a single FET.
Also we will leave about 5mm wide exposed copper on the battery " traces " so you can solder some bus bars / wires for better current handling.

And of course, max power depends on cooling - the better cooling you have, the more power you can get from it.

But we are focusing more on making it small + DIY friendly than powerful, at least this version.

BR,
 
Back
Top