Successor to the Lepton (apologies if premature)

Point taken regarding the wide variety of specs and possible applications for a motor driver.

I would do what I have previously done when designing a CNC machine: take a survey of candidate uses and go backwards from there. As you note, the possibilities are too extensive to cover, the idea of engineering tolerance is needed.

If we look at this forum, which I have browsed a lot, I do think the specs of the lepton with 2 layers and areas of copper you can flood with solder are in a very good place. We are usually talking about smaller motors and less than 50 volts. You definitely need a sensor with SimpleFOC so if it can be added to the back of the board that would make sense. Current sensing does not seem to be commonly used, but the real estate for the chips is cheap, as physical size does not seem to be a primary concern.

I think the cooling fan can be left for others to power, if you got a motor and need a fan you can do that part without difficulty. An adjustable buck regulator board can be wired to any fan easily. It’s the combo of mcu+sensor+power stage +possibly current sense that’s prone to wacky phenomena, needs to be compatible with a code base, and takes many iterations to squash bugs and refine.

Nancy, looking forward to checking out your board, perhaps a good approach is to post the general concept in detail? That way we don’t have to wait for the actual board. As previously mentioned I am not a big fan of the HAT approach, the MCU is going to be dedicated to the motor stuff anyway and the PCB assembly guys do a pretty bang up job with the integration. However it does simplify the design process because you can just roll with the mcu section and focus on other stuff. It’s too bad the community didn’t adopt the chip Valentine mentioned instead of the blue pill. There is a faster one called the black pill but it’s kind of expensive.

I agree with runger. I think I was trying to get at this in my first comment. I am still not really understanding what about currently available boards is not meeting your needs. The application range of these boards is incredibly broad and so there has to be one that meets your needs, and if there is not, then it is easy to identify what features to include in a design.

I think you should try to pick up KiCad and make a simple board, with any mcu of your choice. The design process is pretty straightforward, the documentation is provided by manufacturer via datasheets for all the chips, and there are many designs to reference. It will help you understand some of the physical and cost constraints as well as give you a better understanding about how the configuration should be set up. If you are using platformIO you can directly build for separate boards easily so you might even be able to use your existing local codebase without changing anything.

That may be your perception from a distance, but my point is that that is not so. There is not a single combo, board, shield or hat that is ready to actually use. I hoped the Lepton was enough, but it is not. The I2C port does not work, the encoders I got for it do not work, the serial port does not work. I’m not complaining or ragging on the people that have already done stuff, I am saying that more is needed, and it is not as easy as people to think to make good quality stuff. You can’t just “pick up kicad” and roll your own, get some boards made and expect everything to work great the first time around. Even when you know what you are doing, it takes multiple prototypes and refinement.

It would be foolish and extremely time consuming and expensive for me to try to undertake the development of a board superior to the lepton in a lone-wolf type way when someone who is steeped in the project and already put a lot of time in still takes a long time to do it and many iterations. I could pick up where the Lepton is and keep going, and that is exactly what I am doing: and not in a foolish, nonsensical, unrealistic lone-wolf way, but by consulting with, collaborating with and discussing and moving forward together with the community.

Edit: just want to say thanks to those have gone before, just in case it wasn’t clear I am grateful. Although I am frequently frustrated within the open source community because it seems like it’s never enough, I am lucky to be arriving at this stage, at least. It is certainly fortunate for me that this project, forum, code base, community already exists. Like many engineers I am merely working at the margin, however I believe that is respectable enough and if one works at the margin with a far sighted view, the stepping stones laid down will add up to more in the future, for oneself and others. It’s building the commons. It takes a long time but it really adds up, like gravity is weak at a small scale but rules the cosmos because it always adds up. I am working on other aspects of my project unit I hear if Runger is able to get anywhere with the lepton, and will proceed from there, but I have been working since October on my ventilator and am only nearing beta now, which is a real problem for me. I do have to tie things up. I got some good motors and bearings now, I just am stuck on a driver, but I don’t like to rush and hack things togethr, I like to make sure I’m making general purpose, useful stuff, collaborating, being efficient.

1 Like

It is most important to remember that all a PCB does is arrange tried and true components in a certain way. Lepton is truly one of the most pure examples of this - it is as bare bones as it gets. Many people have gotten every part of that board to work (including myself) in an excellent fashion. I have the upmost faith that if you ask the right questions, and do your due diligence in terms of understanding the components on the board, you will find success with it equally as much as others who have used it. (Although I have confirmed at least one of my Lepton boards DOA from JLCPCB. Nothing we can do here at SimpleFOC about that)

Going into my second point - a new board wont solve all of the issues you face. The software will most likely not change. You can put the STM32 in a different spot, use different connectors for I2C, route serial a different way, etc, but to what end? You get my point. Of course as you say, PCB design in terms of EMF and signal integrity is important. But again, it has been tested by many folks here with success.

I think this is where some of the confusion lies… No one expects that, and truthfully if that where the case, SimpleFOC community discourse would be frivolous. If you watch one or two videos on youtube about EasyEDA, you will be able to fully understand the Lepton electrical schematic, PCB, and roughly why certain design choices where made. Remember it presents the minimum viable product for a cheap hobby grade motor driver.

I guess the point I am trying to make is that working in an open source community is a push and pull system. You can ask all the questions you like, and I have even witnessed some very nice people on here design PCBs from merely a question on a forum! But at some point, you have to realize that to truly utilize what SFOC offers, you must push yourself to put in the individual, lone-wolf style work for your own understanding and the betterment of the community. (It seems like you already know this)

I hope I did not ramble to much :slight_smile:

PS. Please do not get discouraged from any part of this - in some ways I do hope SFOC become more like what you propose!

1 Like

I completely disagree with this statement. The primary goal, at least in my opinion, of this community, is to first educate, and then make something production ready. I’m currently involved in a couple efforts, especially one involved designing an electric car end-to-end using SimpleFOC and I could tell you the students making it are doing a bang-up job. The driver setup they made is close to production ready.

This is a great thread, I like the opinions shared here. I’m learning a lot.

Cheers,
Valentine

1 Like

I designed the Lepton exactly as that, even the name was inspired by the Widow’s Mite story if anyone is interested. Couldn’t get any cheaper and easier than that. Also I did and opened a 4-layer version if anyone is interested. Then, if you replace with G071 as @dekutree64 suggested, I genuinely do not see any other driver that could compete with that board at this combination of price point, simplicity and functionality. I believe the only cheaper and smaller with similar functionality would be the HotDog or the NanoDog, but the mosfet drivers for that one are end-of-life.

Great discussions here.

Valentine

PS this is the first version of the Lepton, with 2.54mm headers, oscillator, no buck converter (two LDOs in a ladder) and two-phase current sensing. @Anthony_Douglas , as you could see, I have tried everything you already suggested, and this turned out to be a dud. That’s a failed design. I’m sure if I work on it, I can make it a success, but I’m not convinced at that point it’s worth the effort.


What was wrong with it?

Re the students making something worthwhile, where is it? I will be the first to celebrate when they publish something others can use.

They will make it public. It’s a competition so they are keeping it secret until the race.

The driver and the LDOs were a problem. I needed a different driver and proper buck converter – the current Lepton iteration has those. You can add current sense if you want, I used CC6903SO-30A JLC part number C469388, which costs 0.80 per chip, so adding current sense is $1.60 per board. If you add G071 (another $1.50) which is double the memory you will may be solve all your problems.

Who is driving it ?

Very sleek design! How is the gearing done ?

So I picked up some Leptons from the post office today :smiley:

I didn’t realise they came with the sockets already soldered on, but luckily I had some 4 pin 1.25mm plugs with cables in my “pre-made cables” box :smiley:
So after some crimping on the other ends of those I now have a lepton with Serial and SWD broken out to DuPont and ready to go.

Lets see how it goes with basic programming and Serial comms this weekend, and then I’ll try with motor and sensor during the course of next week, after my 6-pin 1.25mm JST MX (?) cables arrive.

I’ll keep you updated @Anthony_Douglas and thanks a lot!

2 Likes

Used to be EG2133 which I replaced with FD6288Q.

Bicycle.

1 Like

They are picoblade connectors, rats, I thought of including some connectors but I thought you had all the stuff over there. Wouldn’t have cost anything. Oh well. I’ll keep the doors open to using simplefoc and work on other aspects of my project in the meantime. You can get little kits of picoblade connectors with precrimped wires, they are much cheaper than buying the plugs with wires already connected. You just insert the precrimped wires into their little plastic housings. I kept trying to put them in upside down at first, they only go one way.

Not to worry, like I said I had some 4-pin connectors in my box. And the kit I ordered is one like you describe, I think. Lets see what arrives from Amazon on Tuesday :smiley:

Anyways, so far so good! Lepton seems like a really nice little board so far. My only gripe so far would be that I would add some LEDs, maybe one for 3.3V power and one attached to the MCU for status indication. I’m very partial to LEDs, and I like it when I can look at a board and just see what’s working (or not working). And since it took me a bit of messing around before I got serial working it would have been nice to use a LED to show a sign of life.

But anyway, as you’ve probably guessed from the above both programming via SWD and Serial IO are working nicely for me in PlatformIO.

Serial output:

This code, if you wanted to try it, is now checked into GitHub. I must stress that it’s work in progress still: GitHub - simplefoc/simplefoc_lepton_platformio: Firmware for the SimpleFOC Lepton Board by Valentine

Hmmm… I think I can maybe make SPI work before tuesday - let me see if the 4-pin plugs fit in the middle of the 6-pin sockets…

1 Like

A quick pic… the lepton, powered via lab PSU at 15V and attached to the ST-Link for SWD and Serial

1 Like

nioce. I’m open to learning to use platformIO. The silkscreen on that blue board appears to be slightly misaligned, it looks like a vcc is connected to a black wire. I do see a thing that might say gnd nearby…

No it says cn6, it looks like you have a black wire going from ground on the lepton to vcc on the board? I guess not if it works.

@runger

Thank you so much for doing this.

I’m open to modifying the board as long as the cost is kept as low as possible.

Perhaps actually create variants:

  1. With LEDs
  2. With an oscillator
  3. With current sensing
  4. With G071 (you can do this today but people would be confused)
  5. Anything else? Different connectors, perhaps a bigger MCU (g431?)

All these would of course raise the price, so I’m not sure it’s going to be a cheap board anymore.

Please let me know. I’m not available until end of March due to extensive travel, but can dedicate time after that.

Cheers,
Valentine

It think the most important thing is usability and compatibility and availability. I would have ordered that b-g431b-esc1 but the documentation page led me to think it costs more and is harder to get than it is. Also I didn’t realize the suitability of it.
edit: actually, after looking closer it’s not clear if it would work, I don’t see access to the SPI or I2C ports, also no leds or access to GPIO pins… not general purpose.

I think it would make sense to gear this board to taking the place of the arduino and shield for helping people learn, and build things. The arduino and shield is not really applicable for learning because most of the learning is in other departments, and you are going to have to use different hardware for your application.

Regarding mcu choice, I think it is advisable to peg the meter and get the G431. You gotta pay for the other components anyway.

When it comes to current sensing, I like the idea of designing them in but leaving the pads empty on a production run if you want to save those bucks. I think that is a good approach. Everyone always thinks this difference or that difference is trivial and likes to make a new board for everything as we do have the power to get boards made surprisingly cheaply, but when the community has to support several boards it’s a real problem no matter how small the differences between boards appear to the designers. Absolute minimal complications is good. Also a lot of people can’t afford to get boards fabricated, I know it was a major barrier and still is for me. So if boards are to be prefabricated, they should keep the doors open for downstream users as much as possible. If you want, you can solder that angle sensor and current sense on yourself.

update: Yeah, after reading and thinking about other possible options, it’s clear that the development of this board is important. To make one board that is a fairly broadly usable (say 80 percent of the use cases we see coming along on this forum) and which the community can rally around and make the flagship, well supported option is a really good idea. I believe it would really catalyze contribution to the code base and also help the users a lot. One leads to the others as the more the community grows the more it grows. The more people use it, the more it grows. Looking at the features people want like sensorless low speed motion and angle sensing, anti cogging, higher rpm smooth quiet motion than a stepper can provide, servo motor stuff at a fraction the price of an odrive, this stuff is on the table and this board would help a lot.

So I hooked up SPI to an AS5048A, and this is working nicely too!
I committed the changes to the GitHub repository already.

Motor isn’t connected yet, that’s next.

Yes, that was the design goal. So far I don’t see any reason to really change anything.

  • I think adding one LED on one of the free MCU pins, just a dim one at 1mA or so, that would add 1 LED and one resistor to the BOM, and make it easier to debug and use (e.g. being able to indicate some kind of status when not connected to Serial).
  • I’m really not sure an oscillator is needed.
  • Current sensing and G431 I would see maybe more in a Lepton pro version? It would significantly change the cost to add these things.
  • G071 probably makes sense, as its less than $1 difference in cost, but makes the board much easier to use with SimpleFOC since the standard examples with Commander will fit.

But let’s see how far I get with a motor powered, and then think about it again.

I’d say that compared to the Lepton it is really hard to use it, using SPI requires hacking the board, etc… I think you won’t be happy with it.

Compared to the G031 it would be a more than $3 difference… but of course it is a far more capable MCU. I think the upcoming ESP32-P4 might also be interesting, let’s see.

1 Like

Thing is, 3 bucks really is just 3 bucks. I mean, to be fair I don’t actually know if I would even use it, but if they use it in that ESC dev board some people must be using that much processor power.

Again, I had to pay like $45 usd for an uno plus shield, and what can it do? 3 bucks is a good deal for the door-opening, I think. There are a lot of features that people are talking about on the forum that could use that processing power, I think, and the internal op amp will reduce the cost of current sensing, so it almost pays for itsself maybe? (idk about that one)

I never understood why people try to shave such small amounts at such great cost. Like, I just had that problem with some bearings. The motors I had didn’t have good bearings, so I go and source some top quality P6 Z4 bearings, and they cost 25 cents each, 18 cents each in quantities of 1000 or more. Somebody thought they were being smart by shaving literally pennies off the cost of some bearings. But if I buy crappy bearings on amazon they are $3 each. And they are the crappy bearings, so they are no good. I did that, they were crap, sent em back. They skimped to save literally pennies, and that spoiled everything downstream.

If we go for the extra 3 bucks then we reduce forking in the community and code base. People can comfortably focus on just one processor thereafter, not two, everything learned, all code developed, is more applicable. The more comfortable people are that they are working on something that matters, the more they do. So effect of effort in goes up as like the square of the applicability of the effort.

I mean there is always too much to do and not enough time, I am a fan of radically slashing back wherever possible. I too am very much prone to doing this thing of proliferating options and complexity, and I always regret it. One more complication, one more… nay, one must cut back.

After your suggestions, I created a Lepton+ 4-layer variant with G071 and two LEDs - power and PC6. This would leave four analog pins free, three for current sensing and one for temperature sensor if anyone is willing to extend the design to a Pro version.

https://oshwlab.com/cost.co/20220903_bldc_se3082g_copy_copy

Cheers,
Valentine

1 Like