Cheap FOCer 2 (Open-source, Low-cost, VESC 6 based ESC) (v0.9 Release. Beta testing ongoing)

In my experience, I’ve had to change code for different firmware versions. I’ve now got code that works for several versions that I use to update my dashboard. I don’t claim it’s necessarily pretty, but happy to share it.

1 Like

It was just the motors own inertia as load. I was spinning it up and down with the keyboard every 0,5s too see if the focer could run the motor properly. The motor is 7kg. It has some inertia to spin up.

I can clamp the disk brake if I want a higher load but i never got to this stage in the roll out test :cry:

I see now that I lost one low side fet also… need to get some extra of those.

edit. the fet was ok. It was the drv shorting across Vds.
Sadly I realized this just after I had cut off the legs from the fet. :face_with_symbols_over_mouth:

3 Likes

Still having trouble connecting to the uart. It would help alot if I could see some working code so I can double check what I am doing. Also if you have details of the arduino (wondering if 3.3v or 5v ttl on the serial is making a difference.). Good to know it should work if I get things right though.

Which version of firmware are you using?

My recollection is that the VESC is using 3.3V TTL, so in a perfect world you’d either use a 3.3V arduino or logic level shifters. But I think I recall that it’s actually relatively robust. I’m not talking directly to the arduino currently. I’m talking to a Bluetooth module on the board, and the paired Bluetooth module in my dashboard talks to the arduino.

I’m using slightly altered code from the davega OS and it’s working.


This is the code for it.
I’m using an arduino every so the rx/tx pins are 5V but the vesc has 5V tolerant pins on RX/TX.

5 Likes

spinning up an unloaded motor at high startup current like that is actually a really stressful test doesn’t exactly match reality. My 75A max current claim comes testing a motor under load both on the bench and in the field. An unloaded motor can go from 0 to max speed in an instant with that amount of current…impossible to achieve when that motor is actually on a scooter scooting you around.

5 Likes

I agree, this use case is pretty nasty. Also I believe that using the keyboard will set the current request instantly (no gentle ramp as with the throttle).

I did try using the disc brake as a load… I thought is was about to catch fire. Turns out 1kw of heat is quite a lot :man_facepalming:

2 Likes

I played a little with the OC protection. Seems like a value of 20 is the limit to be able to run 50A. I don’t get the math to add up for this but a higher value simply increases the current limit.

I think having this protection active should be a good thing. Trying to prevent burnt DRVs or mosfets as much as possible

1 Like

The v1.0 will likely do better in your stress testing. I’ve added PNP transistors to the gates of the MOSFETSs to provide a Miller clamp. Helps keeps the MOSFET off when it’s supposed to be off and prevent MOSFET shoot through (can easily kill MOSFETs)

I’ve also added a shottky diode to prevent large negative voltage stress on the DRV and also dialed in the gate resistors and capacitor values to be more effective as well.

These improvements have made a significant impact when putting the CFOC2 through high stress situations.

10 Likes

Mostly with 5.01, but have tried 3.62 and 4.02. Having seen that other people are able to get it working is encouraging, going to revisit my wiring and see if anything is off there. I also tried to use usb-serial converter to connnect to vesc-tool it didn’t work which is odd, but I need to double check the baud rates etc.

image
image we need to get this number
image to be more like this number.

I would donate more but I want to have money ready to order v1 CFOCers and Serious FOCers

5 Likes

Are you using the 5.X firmware on the FOCer? I thought I had read that the davega didn’t support it.

Edit: turns out I was misrecalling the davegaX not working with 5.1:

New question: the OG davega supports 5.xx FW? Or is that’s what your code alterations add support for? (I didn’t see anything that popped out immediately)

1 Like

Thanks! Every bit helps. Now I need to stop procrastinating on v1.0!

3 Likes

No. Up to v3.60 is supported by the OS DAVEGA. The DAVEGA X supports VESC FW 5.1 since v2.0.4. Let’s not derail this thread though. If you have any more DAVEGA questions please ask in one of these threads:

6 Likes

Does this FOCer support firmware v3.60? I would be interested in using a Davega with it but I can’t afford a Davega X right now.

3 Likes

image

I’ve got 3.62 in the repository. Does that work?

3 Likes

Uhh, thats not going to work. Only 3.42/3.48-3.60 is going to work

1 Like

So I was stress testing the Little FOCer in a similar fashion to what you were doing. Unloaded motor. 5uH (killer) at 72V. Was going full throttle with keyboard at 60A and switching directions at max rpm. Got some interesting results.

Nothing died. Most of the time the Little FOCer was fine with it. As I went up in max motor current, I would start to get over-voltage faults. The bus was exceeding 95V. Seems like the back EMF at from the motor at high rpm was coming into play and dumping a bunch of energy into the bus when I suddenly switched directions. My gate drive solution is robust enough to handle it and the MCU alerts on it like it should.

The same thing is probably happening to you with the CFOC2 but the DRV isn’t surviving when it gets the >60V from the back EMF of the motor. I wonder if you lower the battery to 10s if you would stop blowing DRVs.

2 Likes

Ok. You’ll have to snag the firmware(s) from those versions, add the CFOC2 relevant files, make sure the CFOC2 is the enabled hardware, and compile.

1 Like