Mini FOC based on VESC6

I see you’re a gambling man

11 Likes

Yeah, Im sure there are decent caps at a good price somewhere on ali, but it is indeed abit of a gamble.

The ones im about to use are taiyo yuden (which is japanese I think?). High values, high voltage in around 0805 package tend to cost alot on most reliable suppliers Ive looked at so far

2 Likes

Some progress pics for anyone intrested.

Cap at low voltage (without electrolyte)

Alive and well at 50V

20 Likes

This looks great! I’ve been looking for small VESC6 variants – does anyone know what the safe eRPM limit is for the super mini? (or @YUTW123 can you please confirm?) VESC4.xx I know is 60K and I’ve seen 150K mentioned in the VESC6 limit in the documentation but nothing really definitive.

Thank you!

1 Like

Hey Jeff-

I bumped your account so you can post and message freely.

Welcome!

While an actual hard limit hasn’t been shown (unless @Trampa has done testing) I think its accepted to stay below 100k erpm. I’m sure you’ll find it hard to reach this limit

1 Like

Did you up the voltage rating on those caps yet? :grimacing:

1 Like

No. 1 thing keeping me (and probably others) away from these is needing to source and solder on proper capacitors. I just want something that works right from the start.

3 Likes

In thier defence, I did not change the caps on the unit that didn’t die on the bench, just added one electrolyte.
Thinking I run them side by side and see if they hold up.

Been busy with other shit tho so they havn’t been abused properly yet. Planning on running em on 11S, cause I’m a hipster

7 Likes

I am trying to work out what value of cap to add to the Mini FOC and I have read all of the posts in this thread relating to adding electrolytics to the input leads but there are a lot of suggestions for different values that seem to vary quite wildly.

@linsus says “63V 500uF+ should suffice”
@Fatglottis says the designer of the ESC says “for peace of mind” add “680uF extra”
@YUTW123 says “A very small electrolytic capacitor will do. Although it is 33uf”
@linsus the says that he fitted a 2200uF and it still failed.

I have looked for 100v 2200uF electrolytics and the ones I have been able to find are huge (25x50mm) and much larger than the cap that @linsus has attached to the power leads. Was this a 63V used instead of 100V?

What would be a good value to go for please to add reliability but not excessive size?

Additionally is 13S usage regarded as possible if regen braking is not used? e.g. ebike applications?

Many thanks,
Oli.

you can calculate a more accurate value by meassuering the transient voltage delta and putting it into a nifty calculation.

Think I ended up with around 800uF when I did that many years ago.

63V rating is fine, 100V is better; https://www.mouser.se/Search/Refine?Keyword=100V+680uF

Dont run at 13S, unless you trying real hard for the darwin award.

3 Likes

Hi,

Thank you for the recommendation!!

I presume that if I try and measure the transient spike when I plug it in and the capacitance is too low and the spike goes >60v then by the time I have the measurement the ESC may well be toast! :joy:

I will start with 800uf and see how I go!

So no 13S even on a bike not using regen braking. That’s a shame.

Many thanks,
Oli.

Hello! I have one of the FOC Mini’s and am having some difficulty with it.

The motor is a relatively large e-bike motor (48V/1800W rated, 4400RPM, powered by a 1500W 48V PSU rather than a battery). I cannot get BLDC detection to work at all, and FOC detection seems to be all over the place. I have done a 4-wire resistance measurement on the motor, and the actual resistance of each phase is ~21mOhm. FOC detection will occasionally measure 16mOhm, 0uH and 10-20mWb. Other times it will measure 100-300mOhm, 50-80uH and 3-10mWb. I do not know what to make of this. The motor will only run when I manually enter ~16mOhm, with even 21mOhm being too much for it to run at all. Inductance and flux linkage values seem to matter a lot less. I’ve manually put in a FOC Kp=0.075 and Ki=0 which at least runs. Also, I am running sensorless since using the Hall sensors on the motor seems to make it run with extra vibration.

My desire is to run this with a 10kOhm potentiometer with the 3.3V line across it and the wiper going to ADC1, which will then be used in PID Speed mode. This does work, but not reliably. Sometimes the motor will not start as the potentiometer is turned, other times the motor will slow but not stop when the potentiometer is turned down to zero. Occasionally the motor will be locked and making cogging noises, or start to run backwards as well. All electrical connections are good and secure, so I am confident it is not related to that.

Is the ADC1 input just a straight trace to the MCU’s ADC input? If so, do you recommend that I build a small active filter/buffer to low-pass filter the analog signal and provide a controlled, low-impedance signal to the ADC input? I see a lot of noise on the 3.3V and 5V outputs, which (not surprisingly) is for the most part spikes occurring at 20kHz since that is the FOC switching frequency.

I have added 2 x 1000uF 63V capacitors onto the unit, with the leads soldered directly to the same pads on the board as the power wires. The wires between the Mini FOC and PSU are ~7cm long. From the Mini FOC to the motor, the wires are ~40cm.

Any help will be appreciated. The Mini FOC is a nice, compact device and I am really hoping that I can get it to work as desired! Just in case it helps, my application is actually a variable speed conversion for an old drill press, so I am mainly looking to get consistent RPM vs potentiometer position, and reliable starts when I want to turn the motor on and off (AC power to the PSU is constant, and I have a small switch that applies/cuts 3.3V to the potentiometer so that when it is “off” the ADC1 line just gets pulled to ground). That reminds me…when I cut the connection to 3.3V and if the potentiometer is set to a high value (>4kOhm), the motor will start spinning. It seems like there is some voltage build-up on the ADC1 line when impedance to ground is high. Again, maybe I need to have an active filter on there?

If ADCx inputs are not likely to be reliable, I can see about coding an Arduino sketch that can just send commands to the UART input, but I am hoping to keep the controls as simple as possible since this is just a drill press!

Thanks!

1 Like

I have run the mini foc+ with larger hub hub motor. No issue.

What Firmware are you using?

Only 5.1 seems to measure my large hub motors reliable. Earlier firmware gave me values all over the place like you describe and I could not run with those.

I updated it to 5.1 before trying to run it, so I am on a recent FW.

One other thing I have noticed…when using the Hall sensors, I can’t get the motor to start on its own. I need to start it “by hand”. In sensorless, it will usually start (sometimes it cogs and I have to try a few times, or rotate it a little by hand to get the phases aligned differently).

I don’t get the large phase resistance you have.
Could it be a FET that is not properly soldered?

I once had a bad current amplifier on a mini, could also be a cause for inacuracy. The current measurement in vesctool jumped up and down when i pressed on the IC. Swapped it and problem went away.

With any of the above I doubt the motor would run at all.

Regarding the hall sensors, I had hell to get a somewhat smooth transition from sensored to sensorless with my motor.
No start up issue though.
The Hallsensor detection run ok?

A have an early makerx and had many issues with newer fw I though it was the poor shunt design (not a issue on newer designs) . I was close, one of the phases had a damaged sense resistor. It now running 5.1 with a few mods and working well on 10S. I am impressed with this cheap little unit.

1 Like

Thanks folks, I will open it up and re-flow the solder joints for the FETs and sense resistors. I bought the FOC Mini back in January, so I suppose that things have improved since then? I’ll try to get some pics of my drill press conversion in here, too…it’s not a skateboard, bit it’s still a fun use of the hardware!

Movation, was the issue that you saw with the sense resistor due to a cracked solder joint, or something with the resistor itself? They are basically pieces of stamped copper (assuming you are referring to the 3 large ones that jump the FETs to the output pads), so other than it getting crushed down onto a trace under it I can’t imagine what else might go wrong with it!

Yes, Hall detection runs fine. I get a little variance in the values each time I run it, maybe plus/minus 10 counts. I’m not sure what is normal.

OK, I reflowed every single solder joint on the thing this evening. A couple of the bigger solder joints looked a little “dry” on a FET or two. This made no difference to detection success, but I spent another hour playing with PID settings and stuff and I have it all working well enough now. It still fails to start 25% of the time, but flipping it on/off a few times usually gets it going. I am running 100% sensorless since Hall mode seems to run with more vibration than sensorless. It’s good enough for now, and maybe I can improve more with additional time in VESC-Tool. My usage is so different than what these things are intended for that maybe I am expecting too much…with the drill press, I want to go from 0 to (up to) 12000ERPM (4000 mech RPM) as fast as possible, with rapid steps to any RPM in between when I change spindle speeds. There is pretty minimal mass on the system, maybe 2kg of rotating mass total with most of the losses coming from the V-belt when it is not actively drilling anything.

The biggest improvement through all of this came from installing the electrolytic caps on the power inputs. Operation became a lot smoother and more consistent with those in place. I just need to tape them up or something so that they don’t fatigue their leads. Anyway, this is why I love forums since other enthusiasts learn and share tips like this.

I get much better consistency controlling this via VESC-Tool than with the ADC1 input, so I think I am going to program an Arduino to communicate over UART and build a little control box with RPM readouts and stuff.

Is there a previous version of the FW that people have had better results with on these Mini FOC units? I am up for trying an older version.

As promised, here are a couple of photos of what I am using the Mini FOC for. This was a craigslist special that was totally rusted over in some guy’s basement up in the mountains. I spent a month totally de-rusting everything, replacing all of the bearings in the quill assembly and machining new handles since it was missing those. While I have access to a full machine shop during normal business hours, it is nice to have the basics in the garage at home! The motor mount plate, motor clamps, shaft-to-pulley adapter and some custom machining of the motor’s rotor were things I had to fab to get this to all fit together well. Now I just need to clean up the wiring a bit more.

12 Likes