Modular, Multi-Platform, 300A ESC

Hello, I think I built the latest version v0.6 and I have a problem with the configuration file. The voltage measurement resistor values have changed to 360k and ~7900k. The mosfets I used were mdp10n027. Capacitors 4x 2000uF 100V nichicon. Everything works on small drone engines, but unfortunately not on larger ones. I set the dead time to 250ns. Is there an updated description of the PCB pins somewhere? Unfortunately, I don't currently have an oscilloscope to check the gates.
What firmware?

250ns is almost certainly about 1/3 of what you need. Normally i run 800ns on the MP2

You'll need to set different parameters for motors. Resistance, inductance and flux linkage. It can be run with all sorts of motors, i haven't found a motor it won't run yet.

You'll need to update the resistor divider in whatever firmware to stand a chance.

I recommend IPA and an old toothbrush to clean the board, it's caked in flux and debris in your pic. This will not help.
 
What firmware?

250ns is almost certainly about 1/3 of what you need. Normally i run 800ns on the MP2

You'll need to set different parameters for motors. Resistance, inductance and flux linkage. It can be run with all sorts of motors, i haven't found a motor it won't run yet.

You'll need to update the resistor divider in whatever firmware to stand a chance.

I recommend IPA and an old toothbrush to clean the board, it's caked in flux and debris in your pic. This will not help.

I use F405 pill. Both versions 6.02 and 6.05 work. I did the times according to Badginner's docs. Less than 300. Unless I misunderstood and that's not what I was supposed to enter in the MP2.h file. In the meantime, I managed to assemble the second board, which worked magically without any unnecessary problems. Could I have damaged any tracks while soldering the bussbars? The connectors in the attached photo are described somewhere, should I check them myself?
 

Attachments

  • Screenshot_2024-03-28-07-22-37-239_com.github.android-edit.jpg
    Screenshot_2024-03-28-07-22-37-239_com.github.android-edit.jpg
    91.5 KB · Views: 11
I use F405 pill. Both versions 6.02 and 6.05 work. I did the times according to Badginner's docs. Less than 300. Unless I misunderstood and that's not what I was supposed to enter in the MP2.h file. In the meantime, I managed to assemble the second board, which worked magically without any unnecessary problems. Could I have damaged any tracks while soldering the bussbars? The connectors in the attached photo are described somewhere, should I check them myself?
There's a pre made header file for this board for VESC, you don't need to make your own. You are using VESC right? Iirc the dead time is 800ns
 
There's a pre made header file for this board for VESC, you don't need to make your own. You are using VESC right? Iirc the dead time is 800ns
The header is for version 0.3, just like the pinout from the image. Version 0.6 has different resistor values and a different pinout connector J1. The new board is available on github with fabrication files.
 
Hey Ebike mates!

Firstly i want to thank you for sharing and working on this project, great job! In February of 2024 i started to build this ESC, with the last fabrication files (The TO220 Version) and the F405 Pill. The JLCPCB made the panel without hesitation, most of the components are preassembled. 9 days later, the PCB's arrived. I ordered the other parts from Aliexpress and TME ( CRST030N10N Fets, 48-12 DCDC, 470uF 100V Lowesr, etc )
The mosfets looks awful, but its new and works great.

The first measures were successful, so the next step was to upload the VESC firmware. It was a little tricky, have not found a correct tutorial for this. The most useful infos come from Andrewwinter's answer #68. Finally the code has built and uploaded to pill successfully with an ST-Link V2. I used the "hw_MP2_v0.3.h" header files, but the voltage divider resistors values has to be modified, because the last schematics says it has R14(360k), R15(8.2K), R38(220k).

The MP2 and pill got alive, no driver needed on Win10, it recognize it as a com port. So lets start the VESC tool. I used the Firmware and VESC tool version 6.02, the newest 6.05 was just a test version, worked limited.

With 6.02 and a lot of hours testing, measuring, setting up, youtube videos, Vesc tutorials, forums later turned out it works with every BLDC motors i have. I tested with small drone motors, bigger drone motors, very big 2kW DJI Agras drone motors, and the final purpose 4kW Ebike motors with hall sensors (Emax 110S with 14S 60Ah lipo battery).

I have some minor issues that i want to investigate, but it would be great to use the Android VESC tool with a bluetooth module. Is anybody try to use the MP2 and 405Pill with a common serial bluetooth module connected to J2 Uart1 RX-TX?

Safe riding!

Tamas,
Greetings from Hungary
 

Attachments

  • MP2_Tom.jpg
    MP2_Tom.jpg
    1.1 MB · Views: 107
  • kép_2024-04-10_133930772.png
    kép_2024-04-10_133930772.png
    333.9 KB · Views: 99
Hey Ebike mates!

Firstly i want to thank you for sharing and working on this project, great job! In February of 2024 i started to build this ESC, with the last fabrication files (The TO220 Version) and the F405 Pill. The JLCPCB made the panel without hesitation, most of the components are preassembled. 9 days later, the PCB's arrived. I ordered the other parts from Aliexpress and TME ( CRST030N10N Fets, 48-12 DCDC, 470uF 100V Lowesr, etc )
The mosfets looks awful, but its new and works great.

The first measures were successful, so the next step was to upload the VESC firmware. It was a little tricky, have not found a correct tutorial for this. The most useful infos come from Andrewwinter's answer #68. Finally the code has built and uploaded to pill successfully with an ST-Link V2. I used the "hw_MP2_v0.3.h" header files, but the voltage divider resistors values has to be modified, because the last schematics says it has R14(360k), R15(8.2K), R38(220k).

The MP2 and pill got alive, no driver needed on Win10, it recognize it as a com port. So lets start the VESC tool. I used the Firmware and VESC tool version 6.02, the newest 6.05 was just a test version, worked limited.

With 6.02 and a lot of hours testing, measuring, setting up, youtube videos, Vesc tutorials, forums later turned out it works with every BLDC motors i have. I tested with small drone motors, bigger drone motors, very big 2kW DJI Agras drone motors, and the final purpose 4kW Ebike motors with hall sensors (Emax 110S with 14S 60Ah lipo battery).

I have some minor issues that i want to investigate, but it would be great to use the Android VESC tool with a bluetooth module. Is anybody try to use the MP2 and 405Pill with a common serial bluetooth module connected to J2 Uart1 RX-TX?

Safe riding!

Tamas,
Greetings from Hungary
Hi Tamas!

I'm really happy to see another working board! Great!

I think you're the only person I know of to have tested the v0.6 (its not versioned yet in github, but should be v0.6 right? does it say v0.6 on your PCB?)
So ***Thank You*** for testing it, and thank you for reporting back! it's always a joy to see somebody build it.

If you do find bugs / problems / etc, please report them to us, we'll fix.

And yes, unfortunately the hw header files are for v0.3, which has a different set of voltage divider values. If you care to share your working header files, I'll upload them to the repo. Am busy as hell nowadays, didn't get to update them myself.

Br,
 
Hi Tamas!

I'm really happy to see another working board! Great!

I think you're the only person I know of to have tested the v0.6 (its not versioned yet in github, but should be v0.6 right? does it say v0.6 on your PCB?)
So ***Thank You*** for testing it, and thank you for reporting back! it's always a joy to see somebody build it.

If you do find bugs / problems / etc, please report them to us, we'll fix.

And yes, unfortunately the hw header files are for v0.3, which has a different set of voltage divider values. If you care to share your working header files, I'll upload them to the repo. Am busy as hell nowadays, didn't get to update them myself.

Br,
Yes, it is the version 0.6. I did not recognize any serious problem with the PCB, it works well. I only modified the "SW" switch pads, if i turn on the scooters key switch, it turns on the 48-12V DCDC to the pill, and starts to charge the 6x470uF capacitors through a ~100 Ohm resistor, and then a few seconds later i turn on the 150A battery kill switch. I didnt want to keep the voltage always on the capacitors or making big sparks on the kill switch.

I set up the VESC settings. i calibrating the current sensors (offsets), then measuring the motor, finally it read out the correct values for the hall sensors and the FOC works good after a few tries. I set up the throttle as well to the ADC1 and the brake switch output to the ADC2 making it regenerate constant 30A if i pull the brake lightly. I will start the long term tests with this setup, but i think there wont be issues. I attached a zip file with the current bin-hex files i built, and the header files i used for v0.6 PCB. I am using 14S 60Ah battery, so the voltage limits are min 38V max 73V. HW voltage limits 20-75V.

I will report back with the test results, maybe at the end of the summer :)
 

Attachments

  • MP2_Build_Files_VESCv6_02.zip
    4.2 MB · Views: 38
Hello People. Just a minor update from the post the MP2-DFN, the version of the MP2 which does not use TO-220s.

V0.3 is a slightly improved version. There are no circuit changes, but some components have been updated.

However, the main improvement was a safety issue. Note this picture:

Screen Shot 2024-06-27 at 4.44.30 PM.png

most terminals made for 8AWG wire are large enough to contact the caps located next to the terminals. I've added 3mm safer radius around the previous design.

Files for V0.3 are on github [LINK].
 
well I also built 0.6v mp2
currently only has 6 mosfets and all shunts
tested with ninebot es2 motor on sensorless(it spins!)
so far figured out the pinout of the connectors
```
J3
1 GND
2 HALL A
3 HALL B
4 HALL C
5 TEMP
6 5V

J2
1 5v/3v3
2 GND
3 CAN_TX
4 CAN_RX
5 TIM4/USART1_RX
6 TIM4/CAN2_TX/USART1_TX

J4
1 5V/3V3
2 GND
3 TIM3/MOSI/CAN2_RX
4 TIM3/MISO
5 SCK/TIM2
6 TIM2

J1
1 5V/3V3
2 GND
3 A_THROTTLE (PA0..??)
4 A_BRAKE (PB2)
5 UART3_RX/I²C_2_SDA
6 UART3_TX/I²C_2_SCL
7 ADC12-5(PB10..?)
```
so far tried comm with usb only
bt doesn't want to work connected on usart-1 rx tx
uart looks like enabled but says it can't read version data
tried with exact setup like this GitHub - A-Emile/VescBLEBridge: Add Bluetooth to your Vesc Controller for under 3€ (same board same code)
can anyone confirm if the pinout is correct and why bt isn't working?
 
well I also built 0.6v mp2
currently only has 6 mosfets and all shunts
tested with ninebot es2 motor on sensorless(it spins!)
so far figured out the pinout of the connectors
```
J3
1 GND
2 HALL A
3 HALL B
4 HALL C
5 TEMP
6 5V

J2
1 5v/3v3
2 GND
3 CAN_TX
4 CAN_RX
5 TIM4/USART1_RX
6 TIM4/CAN2_TX/USART1_TX

J4
1 5V/3V3
2 GND
3 TIM3/MOSI/CAN2_RX
4 TIM3/MISO
5 SCK/TIM2
6 TIM2

J1
1 5V/3V3
2 GND
3 A_THROTTLE (PA0..??)
4 A_BRAKE (PB2)
5 UART3_RX/I²C_2_SDA
6 UART3_TX/I²C_2_SCL
7 ADC12-5(PB10..?)
```
so far tried comm with usb only
bt doesn't want to work connected on usart-1 rx tx
uart looks like enabled but says it can't read version data
tried with exact setup like this GitHub - A-Emile/VescBLEBridge: Add Bluetooth to your Vesc Controller for under 3€ (same board same code)
can anyone confirm if the pinout is correct and why bt isn't working?
I have very little experience with Vesc but dont you need to activate the UART in vesc-tool?
 
What is the maximum eRPM the MP2-ESC can handle? (F405 pill with VESC)
It can handle any erpm that any other low side shunt VESC firmware running board can. It's not really a function of the board, it's the firmware.

This works out that below 60kerpm everything is fine. Up to about 120k things are usually fine but you start to lose some performance and above that... Things get inefficient and a bit tricky to tune.
200kerpm+ is possible (I've done it) but that's a bad idea in general, motors don't like this speed.

Bear in mine 60kerpm is 1khz sin wave frequency. Iron (or silicon steel) gets huge Eddie current loss and hysteresis loss at that speed.
 
yo Hi guys, I'm going to start building version 0.6. I hope it goes well for me like the other colleagues, although they know more than me on the subject. I hope to get this working, which is the best project I've seen. I hope you can help me with everything you can.
 
Hello. This is my first time joining a forum and post messages so excuse me in advance if I miss something with regards to forum etiquette.

I got interested in MP2 ESC while googling for an open source BLDC controller. I am pretty good with electronics and soldering but is new to FOC and would like to learn it a bit more. My eventual goal is to control drone motors used for agricultural spraying applications.

I just have 5 x MP2 ESC v0.6 and 5x 405 pill 1.11 fabricated by JLPCB and is starting to test it. I used the attached header files. I also set the following

#define DEFAULT_STARTUP_SENSOR STARTUP_SENSOR_OPENLOOP


For my test, i have only connected 6 Mosfets MDP10N027 and using a 4S small outrunner motor used in tiny drones for my initial test and a 4s LiPo battery. I have connected a potentiometer for my throttle input. I have done all the recommended assembly tests before powering up the boards and starting my tests. Vbus reads about 15.6 volts, so the resistor settings are correct.

I have not measured the inductance of the motor since I am waiting for an LC meter that I ordered to arrive, so I am using these values:
define DEFAULT_FLUX_LINKAGE 0.0128f//Set this to the motor linkage in wB
#define DEFAULT_MOTOR_Ld 0.000087f //Henries
#define DEFAULT_MOTOR_Lq 0.000099f//Henries
#define DEFAULT_MOTOR_R 0.0080f //Ohms
#define DEFAULT_MOTOR_PP 7 //Pole Pai


I tried to spin the motor via the potentiometer connected to ADC1 but after the ADC value exceeds ADC1MIN set to 1200, I always get ERROR_ADC_OUT_OF_RANGE_IA 16 ( MESC_errors = 16 as seen in CubeIDE Live Expressions) view. I am thinking this is due to incorrect R L and flux linkage values. I tried another board/405 pill combination with the same settings and I got similar results ( motor won't spin) so I don't think it's a hardware issue.

How close should the R,L and flux measurements be to the real values in order to spin the motor? or I have not configured my test correctly?

Any help would be greatly appreciated.
 

Attachments

  • MESC_F405.h
    4.4 KB · Views: 1
  • MP2_V0_1.h
    3.7 KB · Views: 1
Hi,

Your flux linkage is definitely wrong...a small RC outrunner will be nearer 0.001. the value you have is correct for something like a surron motor.

Make Ld and Lq nearer to 10 micro and R nearer to 30mohm if you didn't actually measure it.

Your should be setting these through the terminal and using "save".

Error adc out of range is not a normal one to get... That means that the current has gone up sufficiently high that it's saturated the ADC - more than 4096 counts (or 4094?) so I think what you're actually getting is under voltage... The error 16 is 0b00010000.



Hello. This is my first time joining a forum and post messages so excuse me in advance if I miss something with regards to forum etiquette.

I got interested in MP2 ESC while googling for an open source BLDC controller. I am pretty good with electronics and soldering but is new to FOC and would like to learn it a bit more. My eventual goal is to control drone motors used for agricultural spraying applications.

I just have 5 x MP2 ESC v0.6 and 5x 405 pill 1.11 fabricated by JLPCB and is starting to test it. I used the attached header files. I also set the following

#define DEFAULT_STARTUP_SENSOR STARTUP_SENSOR_OPENLOOP


For my test, i have only connected 6 Mosfets MDP10N027 and using a 4S small outrunner motor used in tiny drones for my initial test and a 4s LiPo battery. I have connected a potentiometer for my throttle input. I have done all the recommended assembly tests before powering up the boards and starting my tests. Vbus reads about 15.6 volts, so the resistor settings are correct.

I have not measured the inductance of the motor since I am waiting for an LC meter that I ordered to arrive, so I am using these values:
define DEFAULT_FLUX_LINKAGE 0.0128f//Set this to the motor linkage in wB
#define DEFAULT_MOTOR_Ld 0.000087f //Henries
#define DEFAULT_MOTOR_Lq 0.000099f//Henries
#define DEFAULT_MOTOR_R 0.0080f //Ohms
#define DEFAULT_MOTOR_PP 7 //Pole Pai


I tried to spin the motor via the potentiometer connected to ADC1 but after the ADC value exceeds ADC1MIN set to 1200, I always get ERROR_ADC_OUT_OF_RANGE_IA 16 ( MESC_errors = 16 as seen in CubeIDE Live Expressions) view. I am thinking this is due to incorrect R L and flux linkage values. I tried another board/405 pill combination with the same settings and I got similar results ( motor won't spin) so I don't think it's a hardware issue.

How close should the R,L and flux measurements be to the real values in order to spin the motor? or I have not configured my test correctly?

Any help would be greatly appreciated.
 
Thanks for the information mxlemming.

With such low values for inductances, I doubt that the LC meter that I ordered would be able to measure them accurately. Giving me ballpark figures is a big help.

Anyway, after changing the parameters using the terminal, saving it and resetting the device. I get 2 errors as shown in the snapshot.1740788267643.png

Is there something wrong with my hardware? I have setup CubeIDE and knows how to step through the code. with St Link. I actually tried to follow the code flow by setting breakpoints at several points. But I am at a loss at this stage. There;' the App_Type APP_NONE and APP_VEHICLE. I tried stepping through the code, but I could not get past the tracking stage, and when I change the throttle input via the IDE, I immediately get MOTOR ERROR.
Can you suggest what's the next step to figure out why I am getting these errors? At this point, I am not sure if it's the configuration or the hardware itself.

I hope that with the things I can learn from here, I can create a document that I can share sort of a how to to help those starting out in this hobby/interest.
 
I finally got a motor to spin fine. Since I have spare boards, I just used a new one and then the ADC error was gone. I'll try to figure this out later on. Anyway, I got myself another outrunner and this time, I took the effort to measure the resistance, inductance and flux linkage as best as I could and used those new values. Afterwards, I could spin the motor smoothly.

As a side note, I got myself a brushless kit from ST electronics while I was having problems in trying to spin the motor with MESC/MP2. This is the B-g431-ESC kit which I thought would be easy to use My intention was to use their software tools to profile the motor ,i.e determine the R.L,flux,inertia etc and just be able to spin it.. Then I could use those values to enter in my MP2/ESC board. But.... I encountered so many issues, I thought that would be a walk in the park. And I realized. that it is important to get these parameters right... otherwise you get weird results. I did not realize this before. Lessons learned.

To the guys who created and contributed to the MESC/MP2 projects., many thanks
 
I finally got a motor to spin fine. Since I have spare boards, I just used a new one and then the ADC error was gone. I'll try to figure this out later on. Anyway, I got myself another outrunner and this time, I took the effort to measure the resistance, inductance and flux linkage as best as I could and used those new values. Afterwards, I could spin the motor smoothly.

As a side note, I got myself a brushless kit from ST electronics while I was having problems in trying to spin the motor with MESC/MP2. This is the B-g431-ESC kit which I thought would be easy to use My intention was to use their software tools to profile the motor ,i.e determine the R.L,flux,inertia etc and just be able to spin it.. Then I could use those values to enter in my MP2/ESC board. But.... I encountered so many issues, I thought that would be a walk in the park. And I realized. that it is important to get these parameters right... otherwise you get weird results. I did not realize this before. Lessons learned.

To the guys who created and contributed to the MESC/MP2 projects., many thanks
Congrats on getting it running. Unfortunately it's virtually impossible to debug bad solder joints and broken ICs over the web so starting afresh with a new board was probably the best idea.

Most issues with all types of board and firmware unfortunately come down to build quality and configuration, that's true for VESC, MESC, st...

The parameters are very important as you've observed and they're infuriatingly nuanced to measure.

Good luck going forward.
 
Hello mxlemming, I use VESC6MK5 to run MESC, and now I can run the motor with the command set uart_req 3, but opt_cont_type default is Torque, I change it to Speed and send set uart_req 3 The motor is not running, how should I test the Speed mode?
 
Back
Top