super_star

Dual FOC controller based on Simple FOC and ESP32

 
Overview

-------------------------------------------------- -------------------------------------------------- -------

2021.07.14 Update:

       My matching driver board is also open source! If you are interested, come quickly!

<Dual-channel brushless FOC driver_ESP32 expansion board>

https://oshwhub.com/zdldcyy/l6234-shuang-lu-wu-shua-qu-dong_esp32-kuo-zhan-ban

-------------------------------------------------- -------------------------------------------------- -------

BeKtCYCkBFHmg9WwCgHTtyvJlVFbQr9IegJLNILD.jpeg

Xvp6bZrh6rQiIrhPNO0csvpuXyDMFiFNoKnv8Qww.jpeg

l6tKMiqEkFk8JY0QnoynvlRcf1eGn5MWnRXdfRmQ.jpeg

        Dual-channel FOC controller based on ESP32, the code uses the open source SimpleFOC to realize vector control of dual-channel brushless motors. Supports two IIC encoders and two SPI encoders. At the same time, the two IICs can also be reused as two ABZ encoders!

 

        Prepare to use it on your own brushless quadruped robot. The controller and driver are designed separately, and the boards are plugged into each other, making it easier to replace the driver board with a larger current later. The matching driver board will be released later~

        Welcome to follow my site B. The usage of the board and some codes will also be updated on site B. You can directly scan the QR code on the rendering above to go directly to my homepage~

       

My Bilibili: https://space.bilibili.com/423507600

SimpleFOC official website: https://simplefoc.com/

 

------------------------------------Gorgeous segmentation~---------- ----------------------------

 

        Let me briefly introduce the board design, double-layer PCB, and the main control is esp32-wroom. It is very cheap at 12 yuan each on Taobao (yes, I am targeting you for stm32). Equipped with Type-c usb to serial port communication and automatic download circuit, no need to manually press two buttons! On both sides are standard 2.54 10pin pin headers, which are very cheap and easy to buy. Moreover, the signals above are symmetrically distributed. You can insert it from the front or from the back. Hey, it can be done in any position!

 

        Let me tell you secretly, if you feel that the overall height is too high, you can also choose to insert them back to back (forget about the old face!)

 

        The four connectors at the bottom of the board are encoder interfaces. From left to right, they are I2C1, SPI1, SPI0, and I2C0. These two I2C channels are independent of each other and do not interfere with each other. In other words, it is possible to connect two as5600 at the same time. No problem (as we all know, the single I2C address of as5600 is tricky). Note that I have not added external pull-ups for these two I2Cs, because my magnetic encoder boards are all equipped with pull-ups, so I do not add them on the motherboard, and esp32 itself can set up pull-ups, so there is no need.

 

       The remaining two middle interfaces are spi interfaces. These two share one spi port, and two cs are enabled. In this way, two spi interface encoders can be used at the same time, such as the TLE5012B that will be open sourced later, and the MA730 that will be open sourced later, and they can be used directly.

 

       What? You said you only have an encoder with ABZ output? this. . . This is no problem at all. Thanks to the fully customizable IO function of esp32, the two I2C interfaces can be directly changed to ABZ input in the software, so that the ABZ encoder can be directly connected. I wonder if you are considerate!

       Also, the default pin of Arduino is used by both I2C0 and SPI. There is no need to specify the pin used by I2C/SPI in the code. Just call the function directly. It is more considerate than your mother!

 

        By the way, I would like to share my open source magnetic encoders here, which are all placed in Lichuang Kaiyuan Plaza:

1. AS5600 magnetic encoder I2C interface and PWM interface

2. TLE5012B magnetic encoder, SPI & ABZ/UVW output

3. MA730 high-speed magnetic encoder supports SPI & ABZ & SSI & PWM interfaces

        There is also a small 3-pin connector (changed to 2-pin in the new version) next to the female header. It is a CAN communication interface and is reserved for later use. It has not been tested yet, and the UART interface has been used. Students who are capable can test it. I have not used CAN yet. .

 

----------------------------------Cut again---------------- -----------------------

        

Notes on usage/testing:

       1. I only designed one side of the Type-c usb to serial port to be useful (because the layout is inconvenient), so if the computer doesn’t recognize the serial port when you plug it in, just turn it the other way and plug it in again. There is also a UART interface reserved for direct connection. On the back of the USB port, you can communicate and supply power with other boards through this port. Update 2021.07.09: The new board connects both sides, so you don’t have to worry about plugging it in wrong. Oh yeah~

       2. The power input of the board has two sources. One is the power supply of the driver board (12V~24V) to the motherboard through the pin header, and then converted to 5V & 3.3V through DCDC & LDO; the other is to supply power to the board through the 5v of USB. Two can be connected at the same time, and there is a diode to protect the USB from reverse current.

       3. When using the 12V/24V of the driver board as the power supply, pay attention to the TVS diode D2. The current design uses a 12V TVS. If you want to use a 24V power supply, you need to replace it with a 24V TVS tube.

If there is a problem with the test code, you can use the code on my site b to try it first.

 

#Poor first version, it died after just a few power-ups. 0.1s of silence~

Poor first version, it died after just one power-up.

-------------------------------------------------- -------------------------------------------------- -----------------------

2021.06.01——The current verified functions of the board:

       1. Two-way AS5600 I2C interface encoder communication.

       2. Two UVW encoder inputs.

       3. Open-loop speed, position, and voltage control of two 4010 brushless motors; closed-loop speed, voltage, and position control of two motors.

       4. For the current loop control of the single-channel brushless motor, there may be some problems with the driver board of the other channel and it has not been fixed yet.

-------------------------------------------------- -------------------------------------------------- ---------------

2021.06.28 - Filters and matching resistor designs have been added to the I2C and spi interfaces of the board. In order to solve the problem of data errors caused by interference when the encoder cable is too long (my encoder cable is 30cm long...)

    The board is already on the way. I will upload it after verification. The attachment is still the old gerber, so don’t download it yet.

siysosRNs6nm6j7bkfYhkMowR2InM6bTXoIKkf5m.png

-------------------------------------------------- -------------------------------------------------- -----------------------

2021.07.09 update:

        1. The filter circuit designed above works well after testing, and the ABZ input signal no longer fluctuates randomly. If it is used as an I2C interface, you need to pay attention to the two capacitors C4 and C8 in the picture below. If your encoder's wire is very long, you may need to remove these two. This is related to the protocol rules of I2C. I2C stipulates that the parasitic capacitance value of the bus should not exceed 400pf. If the parasitic capacitance is high, it will affect the rising edge time of the signal, leading to a decrease in speed or errors. In addition, reducing the resistance of the pull-up resistor can also increase the rise/fall time of I2C, which should be considered according to your own speed requirements (low speed 100KHz, high speed 400kHz).

hNQnGedV3rzghdVwixFgcITkb2gOvSgAboUUUDSZ.png

    

        2. The Spi interface has not been tested yet, and the encoder may be picked up by the cat at home. . .

-------------------------------------------------- -------------------------------------------------- ----------------

2021.07.14 Update:

        Small update, I tested the SPI encoder MA730 and it works.

        In addition, my matching driver board is also open source! If you are interested, come quickly!

<Dual-channel brushless FOC driver_ESP32 expansion board>

https://oshwhub.com/zdldcyy/l6234-shuang-lu-wu-shua-qu-dong_esp32-kuo-zhan-ban

-------------------------------------------------- -------------------------------------------------- -------------------

2021.09.05 Update:

IBOM has been added to facilitate my smt classmates. Just open the html file with your browser

 

-------------------------------------------------- -------------------------------------------------- -------------------

 

Test videos will be uploaded later and will be updated if there are any changes.

 

        #In the future, I will test it with my dog ​​legs. If you are interested, come to station b to discuss.

 

Disclaimer: This circuit board was developed for personal interest only. I am not responsible for any bugs, fried boards, or burned capacitors. If you have any questions, please give feedback. After all, I am not a scumbag.

Sincerely

Disband!

document

1652×1170

PCB

1122×793

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-22 08:58:13
  • 28027 I2C Application Sharing
  • [National Technology N32G430] 4GPIO inversion
  • Protel shortcut keys
  • Embedded systems and "spygate" were hot topics in July, and renewable energy will be a focus in August
  • How to display the generated waveform on 12864?
  • Health Assistant

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号