Beginning of a proposal for Lepton 3.0

Ok, Valentine has done a great job on the Lepton 2.0, but it has become clear it’s not quite fast enough for me to get smooth, low noise motion (interruptions in the waveform make noise and some other stuff just needs to happen.) Thus, as much as I want to avoid doing work, I can’t avoid changing things for the next order of boards.

I will have to order more boards because it’s clear at this point that I’m using this approach of SimpleFOC, or at least some of it’s components plus a bunch of glue code. I’ve been able to experiment with a B-G431b-ESC1 board, and it works for what I need I think, but they are not boards you can buy a bunch of, ST sells them at a loss as dev boards and I’m sure they won’t let me buy and use a whole bunch of them, or I would just halt there, because the extra cost per part is worth the reduced workload, given that I am in thoroughly unfamiliar territory and thus everything takes me forever and tends to cost way more than you’d think.

Secondly, I think there needs to be some changes to give more wiggle room and make things more amenable for widespread adoption by the community as a successor to the SimpleFOC shield + uno+as5600 combo.

If things become adopted, there are more users, more support, more dev, the ball rolls, can gain inertia, snowball. But it needs a spark.

I propose that things be developed as a combo MCU + driver stage + magnetic sensor, however the AS5600 appears to be good enough for me. But it’s slow speed is clearly a major issue. There are considerable time delays apparently in reading it, and the read rate is only 1 kHz or so. SPI is apparently much faster. There are very similar chips that have SPI, but apparently they are expensive. The SC60228DC is reported by others in this community to be fast, cheap, and appears to be thoroughly available, however the driver is not quite working yet (it wraps around instead of continuing to count upwards).

I propose that I make and submit a design for the Lepton 3.0, if we may call it that, with board files.

I would be modifying the Lepton 2.0. I am really not the best person to do this but can probably muddle through it.

I propose this as a collaborative effort because even if I can, with much effort and gross inefficiency (probably have to order the boards at least 3 times), do something that works for me, I am dead sure I would end up doing a crap job and the results would not be a useful contribution to the commons/be useful to anyone else anyway. If we collaborate, we can roll this ball forward in a meaningful way that will help others. I believe that if we make even a small improvement over the Lepton 2.0 it will be a clear winner for many applications that people encounter in this community, probably - total guess - 80 percent of the things people post about on the forum.

Let not perfection be the enemy of progress… I don’t believe in the idea of making a “configurable design” as desirable - a handful of complete, down to every detail, board/code base/encoder or sensor combos (the magnetic sensors seem to be a lot easier to use than the other options), ideally for sale in small quantities, is going to be more useful to more people, I think, for the same workload, starting from this point. Some starts with one.

I would:
-Add an LED. This is important for many reasons during setup, debugging and to communicate with whatever user in the field. Very basic, human readable output.

-Make the connectors 2.54 mm pitch, both sides, except for power in/out, which has to be arranged to accommodate the higher current. I will be puting on screw terminal connectors, probably.

  • Ideally in a way that, with these particular MOSFETS, the pads can be flooded with solder to increase current capacity cheaply. IDK if I can swing that last one, but looking at the Lepton 2.0, I think maybe. Perhaps we can use some large gauge copper wire that you can solder on in the right places in addition, or as the approach to this, with some suitably sized through holes. That seems doable. Quick way to get your full 40 amps out of the MOSFETs without increasing the cost of the 10 amp config.

-Break out more pins. The right ones for CAN, PWM input, the ADC pins (good for analog input sensors, potentiometers etc), and the op amp pins ideally. Wiggle room.

-Getting more current out of the 5 volt regulator would be useful, I have a standard size RC servo in my machine that takes about 5 volts, an amp or so peak. Doesn’t work very hard, just has to move once in a blue moon, but it draws some. Basically the same thing a BEC is for on hobby ESC, basically, then, funnily enough.

I have no use for current sense apparently, so I cannot put the effort into trying to implement that. It won’t work as a sensorless ESC without that but there are already Bl_heli ones for that. It certainly has it’s uses to measure motor characteristics, sensorless commutation which is cheap and has it’s perks, but I just have to trim back what I bite off wherever possible and people keep saying this is expensive, too.

Integrating the sensor is too much work, and I would have to shrink the board which might be a problem, to fit inside my fan, so I decided not to undertake that.

Other people are already selling simplefoc boards of various kinds on aliexpress, and soon enough people will start selling them if this turns out ok, I believe. Those guys are always looking for stuff to sell, I think they will be all over it. Their costs of production are way lower than what JLCB charges, I am sure, and so is the cost of labor etc, so they can do a better job on that part. I don’t wish to discuss selling them personally, I don’t think that is a fruitful avenue of discussion (although people seem to tend to do that so go nuts if you want I guess).

For me, I am already roped into an “open core” business model, and want to be using standard, open source parts that have a community behind them because that’s more reliable for me as I try to produce my ventilators. I’m less likely to end up without the parts I need.

Secondly, it’s part of the product proposition that you can maintain the unit into the very distant future because you have the source code and it uses standard parts that you can source relatively easily and not from the original company (this removes the incentive for planned obsolescence and thus is expected to improve the financial return on investment greatly when compared to other industry-leading options. Thus it is an important selling point).

Anyone game to contribute with board design/review before production/have other modifications? I know I am getting a bit ahead of myself but I gotta plan ahead. I may make the board design within 4 weeks hopefully. I can buy ESC boards and kick the can down the road for a while, but need to do this eventually. Also I need to let the dust settle a bit on my list of modifications, be sure what I need.

I can buy the initial order of boards and then mail out boards to others who wish to test them/use them to develop the code base.

Let’s face it, there is likely to be at least one revision immediately after this, too. I’m hoping I can at least use the boards I purchase/avoid serious design issues with the first batch, but I think I will try to keep the order size small all the same, just in case.

1 Like

Go for it! I think many people here would be happy to offer advise on any WIP or design you finish.

The latest state of the art in my project is to make an independent waveform generator module, which could be a G431 based board but I am not too keen on trying to do that and will probably try to use the Lepton to do that. It appears to be able to do open loop at 250 rads/s, I tested it last night. And that’s all I need. I just need to communicate with it efficiently, the program on the lepton can be nearly elementary (with the simplefoc library). I hypothesize this will obviate the need for a blazing fast processor and learning enough C to do a good job on a complex good quality driver that runs on only one MCU.

You will need far more C skills if you distribute the work across multiple CPUs rather than using just one. I don‘t know, what other things you need to process, but unless you are aiming at really high rpm, a G431 should have a lot of extra power besides running the motor control. If you add a second MCU, you may easily waste more CPU cycles for communication than you gain. Don‘t forget, that you need to properly synchronize everything and that you cannot have your driver MCU just sit and sleep for more than very few microseconds.

I’m not using C on the other one, I’m using micropython.

Wait so are you doing distributed computing across two different mcu type? STM32 and RP2040?

Yeah basically. But I’m treating the module with the STM32 as a peripheral. It is like a TMC2209 stepper motor driver, basically, but for three phase ac instead of two phase. That’s basically it. The STM32 doesn’t even reply any more, it just accepts voltage and speed commands, I had it so that it would print the electrical angle when I raised a pin high to request it, but I am hoping I don’t even need that any more. I am hoping to regulate motor timing by using a current sensor located at the input of the waveform generator. The motor timing is optimal when the current is minimal. The pico will adjust the voltage till it gets to that point. It has to search around, a problem I have encountered before, to find the local minima of a curve. The plan is to use a pid controller but detect the slope of the curve and reverse the direction of the controller accordingly. So it will wander on either side of the optimal point, but it sort of has to do that to keep track of the slope, I think. The giant capacitor on the lepton may hinder or help, IDK. Some smoothing is good, too much bad.

I can already do this manually just by twiddling the knob on the power supply and get a margin of about 0.4 volts before the timing gets too far off and the motor stalls, so I am hoping the pico can do it ok.

There are other manifestations. It occurred to me, idk if I mentioned this, that you could make the wave generator such that it accepts angles, not speeds. Then ramp the angle from the old value to the new value at a rate that is such that the new angle will be achieved after x time has passed, with x being the time since the last update. Thus, if you update the angle regularly, you get smooth motion. With upper and lower limits on the ramping speed. But it also works with lower speed and precise angles. Trinamic does this with their silent stepper motor drivers, I think the feature is called MicroPlyer.

If the angle updates are erratic it would still leave some clonkyness, but it would certainly still help a lot. The downside is very slightly increased time to achieve the commanded angle in some cases, where it probably does not matter anyway.