It has an STM32F103CB onboard, with a pair of A4950 full bridge motor drivers which looks like it is pretty well supported. However, the rotation sensor is a TLE5012B, which looks like it has a currently unsupported communication protocol:
Data communications are accomplished with a bi-directional Synchronous Serial Communication (SSC) that is SPI-compatible. The sensor configuration is stored in registers, which are accessible by the SSC interface. Additionally four other interfaces are available with the TLE5012B: Pulse-Width-Modulation (PWM) Protocol, Short-PWM-Code (SPC) Protocol, Hall Switch Mode (HSM) and Incremental Interface (IIF). These interfaces can be used in parallel with SSC or alone.
Has anyone used one of these before? Any idea if it will end up working well with SimpleFOC?
Welcome @wjbuys. I can’t find a schematic for this board but bigtreetech have released source code. Looks like code is st/cmsis so would need to be translated to Arduino framework.
The spi code for sensor looks fairly standard but I’m no expert:
The pin used for motors, etc can be worked out from here
The code mentions stm32f0, so it’s possible this code isn’t for your board as you mention stm32f1. Perhaps there are two variants?
I looked into it in a recent round-up of sensors I did. I think VESC now supports it. I concluded that the extra effort involved in dealing with the half-duplex SPI-compatible SSC wasn’t worth it compared to the other available chips. The PWM and IIF interfaces would be supported.
The firmware isn’t written for Arduino framework as far as I can tell, but the sensor code gives a fairly clear blueprint for reading an angle. I think the chances are pretty good to get SimpleFOC working on this board.
Nice find! If you have the time, please do let us know how it goes.
Hi, do you have any progress now? recently I am looking into TLE5012B, because it’s really cheap and high resolution~ but i only tested the UVW/ABZ port is ok, I didn’t test the SSC because my broken control board…
That library looks useful. Particularly it looks as if you can ask it what the angular velocity is. Most other sensors only offer positional readings and then the simplefoc library has to do it’s best to work out the velocity (angle/time) which tends to be a bit noisy and thus needs velocity smoothing. If this sensor provides smooth/accurate velocity then it would be appealing to a lot of us!
Creating a new sensor class has become easier to do since SimpleFOC 2.0+ all you need to do is extend Sensor.cpp and implement getAngle(). But in this case I’d also try to implement getVelocity() as the hardware seems to offer a decent implementation.
It provides 3.5A current for each phase to drive the NEMA17 motor to run like a BLDC motor that reach 5000RPM. I don’t knw how to upload the pdf SCH file, it seems only support picture upload.
I spent some time today and got SimpleFOC running on the 2.0 board. I don’t really know much about what I’m doing, BUT it lives! I used bits and pieces of drivers on github and finagled together working angle and velocity output from the TLE5012B. Seems like a pretty nice chip.
I have two of those sitting on my desk that I got in the mail today! They use a slower samd21, but are probably more plug and play with SimpleFOC since they use an out of the box encoder. Those also run the a4954 driver instead of dual a4950’s BUT I suspect making the a4950 run well is probably going to be something useful to both boards.