FeeTech SC Servo notes

Also are you using your original HC126 cct with enable/disable TxD/RxD, or your new version with Rpi 3V3/5V0 level shift up? My cct does not sue any GPIO to pull up HC03 and CD4050. So it is unlikely that I can test your code with my Rpi. Anyway, perhaps you can confirm your modified HC126 cct first, before I try the code. There are other difficulties I might need to tackle before trying your code. More details later. Keep up with your nice work! Cheers. Adrian Maire13.4kThu 17:26“But I could not any checksum code to steal or borrow. Have you written any check sum function?”
This file just access the library (you will find nothing interesting inside). Look at src/HiwonderBusServo.hpp, there is all the “real” code.
You will find a “checksum” function around line 272“But is the 200 something 200us, the command and reply gap?”
The delays are in ms, and is to wait the servo finish to move before to release UART (this is for the command line only, not for the library)“Also are you using your original HC126 cct with enable/disable TxD/RxD”
Currently, the library was tested just with the Hiwonder Board. I made the 3.3V to 5V conversion with two HC126, but I do not enable/disable Tx / RX, as the board does the half-duplex to full-duplex conversion. Basically it is just the circuit that I hand-drawed few messages ago“I am going very slow”
Please, don’t feel any pressure: few week ago you advanced a lot while I was doing nearly nothing. As you say: “nothing urgent in our exploratory/feasibility project. As we are newbies in bus servo, we don’t need to setup any goal, not to mention any spec or schedule. I used to think we are using an Agile style, with frequent short meetings/chats and change our direction and goal time after time.”  4 hours later… tlfong014137Thu 21:27@AdrianMaire Ah, so you mean you are not writing your own library but just assessing the open source library, no wonder I could not find any checksum functions in your GitHub files. Actually I got stuck in a small part of the checksum algorithm (about the bitwise negation, which I wrong thought was about two’s complement). Now I think I found what my function went wrong and the bug should be fixed easily.@AdrianMaire I see. So you confirm the delay is for the servo to do its job. I have not gone that far yet, and will check out later.@AdrianMaire I see, I missed the critical part that you are using the HiWonder board to do testing. So you will be using the 555 timer to do the enable/disable Tx/Rx thing. Good luck. tlfong014137Thu 21:44@AdrianMaire Ah yes, no problem and no pressure at all. The reason that I told you that I am going very slowly, is to let you know don’t expect me catching up fast. I remember last time I told you that I found you reach a milestone and I must catch up, that was a joke, because I already caught up and so told you the joke.I see our project a fun game. My ex favorite sport was squash. My regular partners almost always beat me up badly, but I never gave up and still enjoyed the game, because I enjoyed discovering how to improve my techniques, and most importantly I, in other times would find some weaker players who wrongly thought could beat me up, but later found I surprisingly beat them up badly.It is just like program debugging or playing chess, not with a dead line or schedule. Ah, almost bed time! Happy learning together. See you later. Cheers.Last time I mentioned the following: “I googled further and found the following very interesting: alibaba.com/product-detail/….” It is about another serial bus servo by FeeTech which seems to be more advanced than HiWonder LewanSoul, but weaker and cheaper than the strong Korean guy Dynamixel. Not thing urgent. Will tell you more about it later. Cheers. Adrian Maire13.4kThu 22:22“so you mean you are not writing your own library but just assessing the open source library”
All code is mine, but you were looking the wrong file.The checksum is the following:

user image

The negation is with the “~”, I think it’s the same in pythonAbout Feetech, I have seen them yes, but to have decent torque (e.g. >15kg servo), they are pretty expensive (over 50$), so to me is very similar to Dynamixel. You are right that for small (<10kg) some are cheap. tlfong014137Thu 23:06@AdrianMaire Ah, sorry, I misunderstood. So you are writing your own library. Me too, I am also writing my own library in python.@AdrianMaire Thanks a lot for your checksum function. Yes, “~” in python is also bitwise not (1 to 0, and 0 to one). I see that you are using buf which is the same of that of the open source library. Python seems to prefer their “bytes” data structure, which causes me much trouble.Anyway, I got stuck in converting “bytes” to “byte list”, then to string etc, but I think I am walking the last mile, and should full debug in another 2 hours or so. I used your very first command of read ServoId and found your comment clear. Many thanks.@AdrianMaire The FeeTech servo I already ordered is the following:item.taobao.com/…FEETECH 飞特双轴 19KG 磁编码360度TTL信号电平机器人串行总线舵机 单价:99元Translation: FeeTech, double axis, 19kg, magnetic encoding (Note 1), 360 degrees, TTL level signal, serial bus servo. Note 1 – The magnetic encoding is high resolution, I forgot if 11 bit resolution or higher, anyway not using analog pot is superior than HiWonder. Other good things including the following, (1) can read current (ie. loading) , read stall status,(2) They have higher, more expensive models using RS485, CAN (I have zero experience) so the upgrade path to industrial grade project is smooth. I feel inferior always doing RS232, I hope to upgrade to RS485, of course it is a long term thing, perhaps 1 to 2 years. Good night. PS – The model I ordered is CNY99, or 99/6.28 = US$16. Adrian MaireFri 0:02@tlfong01 Buffer is just an std::array<uint8_t,10>, that is, an array of 10 char.Woo, nice servo!  22 hours later… tlfong014137Fri 22:28@AdrianMaire Ah yes, I did use “Buffer” when I played with Arduino C++ UART, some 7 or 8 years ago. So when I saw your “std::array…” I surprisingly found that I have already forgotten the meaning of the symbol “::”. I vaguely remember this “::” symbol is related to the “class inheritance” thing in OO programming. But for now I will only play with python and forget C++ altogether, at least for 2 or 3 years, I hope.My toys arrived yesterday and I collected them an hour ago.

user image

It seems that (1) the servo sends DTR signal (so are you jealous?), (2) UART speed range is 38.4kbd ~ 1000kbd, (I hope to use low speed of 38k4bs to see if the reading error drops. (3) 12 bit (4,096 resolution) magnetic position encoding (as I say, this is truly digital servo, while LX-224HY using analog potentiometer is fake digital. tlfong014137Fri 22:59

user image

It appears that we don’t need that many servos to make a cat or a dog.Cats and Dogs
(1) kickstarter.com/projects/…
(2) interestingengineering.com/…
(3) youtube.com/…. Ah bed time. See you tomorrow. Adrian Maire13.4kFri 23:35“Ah yes, I did use “Buffer” when I played with Arduino C++ UART”
hmmm, it is a custom-defined type, I doubt you used the same “Buffer”, but this is a quite generic name.“::” has several meanings, usually to access static parameters. In this case, “std” is a namespace used for all the STL (standard library of C++). And “array” is one of the data-structure of it.“LX-224HY using analog potentiometer is fake digital”
Seems amazing indeed!!
But don’t mix AD converter resolution with precision: the potentiometer will probably wear faster than your magnetic hall sensor, but magnets are subject to external influence (e.g. put a magnet close to the servo). And you don’t know the resolution of the potentiometer AD used in the Hiwonder.(time to go to the shop for next week food).  2 days later… tlfong014137Sun 16:29@AdrianMaire Buffer: Ah yes, I did use “character buff” when playing with arduino C++ UART projects. I am using python “bytes” data structure, converting to bytes list, which is a list of bytes, and then converting to hex string to print out, therefore making a big mess.Anyway, I will stall for a short while, and resume when I finish testing the FeeTech FE-URT-1, converter of UART to SMS Servo (RS485) & SCS Servo (TTL). But I don’t know nothing about RS485. So it might take me some time to get to know them.AliExpress sells FE-URT-1 at US$14. Here is the link:Feetech FE-URT-1 Multi function serial port signal converter USB/URAT to SMS Servo (RS485) &SCS Servo (TTL) US$14
aliexpress.com/item/…I bought my FE-URT-1 from TaoBao (like AliExpress, belonging to AliBaba) for 40 yuans. In case you are jealous the we can buy cheap, you must understand we workers here also got paid as cheap.飞特总线舵机USB转485.TTL信号转换板 举报 价格 ¥40
item.taobao.com/…tlfong014137Sun 17:05Now I am reading the URT1 board product features/guide and making a summary. The translated version’s English is lousy. I guess I might need to Chinese version to clarify things.Just thinking aloud. Nothing urgent. No need to reply.URT-1 Offline adaptor/interface board for Feite SMS and SCS servos reading notes:
01. Can select USB to 3V/5V signals.
02. Two kinds of signals: (a) Asynchronous half-duplex RS485 for SMS serial servo, (b) – Asynchronous half-duplex TTL-level for SCS servo.
03. URT-1 board has “hardware time multiplex automatic bypass” (not sure what it is, perhaps just full duplex to half duplex by hardware.
04. Two interfaces: (a) SMS serial servo interface using 5264-4AW, (b) SCS series servo interface using 5264-3AW interface.(see full text)tlfong014137Sun 17:20There are two versions of the board: Old and New. Mine is new. 🙂

user image

Locking down supper time! Will come back late this evening to start testing. Cheers.  1 hour later… Adrian Maire13.4kSun 18:30Sound good! 🙂
Alternatively, we could create our own servo driver. We buy the best motor/sensor we can find (at correct price), and use some cheap 2yen ARM with UART to drive it. This way we could even have Sin movements or similarsFor the 555, I need to print a small board (that means to remember all the process or etching, etc.). It’s taking to me some time.  3 hours later… tlfong014137Sun 21:56@AdrianMaire Yes, my long term (3 year) goal is to use Cortex M0 Micro Python, or BBC MicroBit micro python to drive it. But before that, perhaps we can do some sort of pair programming/development: You Cortex M4 C/C++, me Rpi4 python. My short term (1 year) goal is to build a robot cat/dog/turtle, using 4 servos.@AdrianMaire Yes, PCB etching is time consuming. For prototyping, I prefer to use bread board, then proto board. I once thought of learning Eagle PCB CAD, but the learning curve is too steep for me casual hobbyists.Anyway, I have downloaded the FeeTech URT1 Board. It took me some 15 minutes to find the correct software programs.(1) CH340C driver download address:
(2) FD V1.6 .exe download address:
drive.google.com/file/d/…Now I have wired the hardware, and started the FD1.6 debug program.

user image

For Win10, I need to set power switch to 5V. I first set to 3V, but then the CH340 driver was not detected. It took me 10 minutes to find that out. I use 6V to power the servo. I forgot if the max is 7.5V (no longer 11~12V for LX-224HV). But for RS485 servo, the power is 8V~24V. I hope I can use 24V for torque servos, yes higher that 12V of LX-224HV, so those HiWonder guys can not LOL at we FeeTech guys.Anyway, I started the FD1.6 debug tool, and my first impression is that compared to the HigWonder debug board targeted to perhaps 12~16 school children using BBC MicroBit, this FeeTech debug board can entertain Arduino/Rpi users well. The FD1.6 interface looks complex and I think industrial automation engineers should find this tools helpful.

user image

Looking back, I am glad your LX-224HV half duplex program introduced me to the new world of Serial Bus Servos. As I said some days ago, I feel inferior and losing face playing with TowerPro MG995 toy servos, using PWM to do the vary limited control, and open loop, no feedback from the servo to do closed loop control projects.Ah, bed time! Call it a day. Cheers.  11 hours later… tlfong01yst 9:33Question – As I said earlier, I am thinking of using M0 as the target machine. I know it is too weak to be a development machine. I know STM32 can do RS485. Do you recommend any thing like “Blue Pill” which is cheap, newbie friendly, but still can do RS485? I heard of “Black Pill” which has DSP, but I think it is too much for newbie me.  3 hours later… tlfong014137yst 12:08I found this TT-Link mini circuit from FeeTech. What do you think about it?

user image

  3 hours later… tlfong014137yst 15:03Now I am reading the URT-1 Status Byte and Commands List, and making a summary.Serial Bus Smart Control servo SCS15 Manual v1.02 – FeeTech 2016dec21

2.1 Current status byte

BIT7 0 –
BIT6 0 –
BIT5 1 – Over load
BIT4 0 –
BIT3 0 –
BIT2 1 – Over temperature
BIT1 1 –
BIT0 1 – Over/under voltage

Note : All bits = 0 means no error

2.2 Memory control table (edit v0.1 tlfong01 2020sep18hkt1456)

——————————————————————————————————-(see full text)The above text file is not well formatted. Here is a pretty print.

user image

tlfong014137yst 15:29The above pretty print image is not complete. Here is the complete one.

user image

tlfong01yst 15:40So I finished reading the SCS15 Servo’s 10 page long manual. I could not find any other manuals for higher/newer models. So I will come back the the URT-1 board and start learning how to use it. Tea time. See you later. tlfong014137yst 16:03I first tried the program mode to read and write to the memory locations and found everything OK.

user image

  5 hours later… tlfong014137yst 21:03I scratched my rusty little head for 10 minutes but still got no clue how the following TTLinker works. So I gave up. Do you have any idea?

user image

tlfong014137yst 21:17Now I am reading references on FeeTech SCS15 servo. The following article has a good overview and an Arduino demo program. Now I know SCS15 indicates 15kgcm. The most powerful analog servo I have played so far is TowerPro MG996R, which is only 10kgcm. So LX-224HV 20kg is indeed very powerful.FeeTech SC Servo SCS15 Overview and Arduino Demo Program
ecksteinimg.de/Datasheet/…tlfong014137yst 21:38What I don’t understand in the following diagram of TTLinker, why the pink bubble TxD after conversion becomes TxEn.

user image

tlfong014137yst 22:01Now I have found an Arduino library for FeeTech SCS15 Servo. The library seems small. I am going to steal the code and convert it to my own DIY python library for SCS15 servo.Arduino Library for FeeTEch SCS15 – Elecrow
elecrow.com/download/…Ah bed time! Will carry on tomorrow. Cheers. youtube.com/…  12 hours later… tlfong01413710:33FeeTech FAQ – I found that the first time setting up, I could scanned the servo ID, but no longer afterwards. I then googled FeeTech FAQ and found that there are a couple of traps that newbies don’t know that they don’t know. So I think the FD tool is not mature at all. Below is the relevant section of the FAQ.FeeTech FAQ

– English –

5. Why FD search does not find ID?

Part 1 – Only one servo connected:

(c) For SCS15, recommend to power 7V ~ 8.4V

(e) SCS Servo default baud rate is 1Mbaud

Part 2 – More than one servo connected:

(g) Before connecting all servos, each servo must first be individually initialized using FD, with unique servo ID for each servo.

(h) Use exteral power supply with high capacity.

(i) If first search OK, but not afterwards, need to check if parameters have been modified.(see full text)  1 hour later… tlfong01413711:47I am going to test my FeeTech STS3215 Servo, using Rpi4B Thonny Python 3.7.3, with my fake TTLinker Mini (3V3 Full Duplex UART to 5V0 Half Duplex UART (3 versions)) (a) TXS0102/04 based, (b) HC03 + CD4050 based, (c) HC04 based. But at the same time, I have order the real TTLinker Mini from the TaoBao shop below. AliBaba also sells it, but minimum order is 10 pieces!(1) AliBaba Mini TTLinker Signal Conversion Board Connect eArduino to SCS15 Servo – US$1 (10 pcs min order)

(2) TaoBao TTLinker-mini – ¥25
item.taobao.com/…tlfong01413712:17Last time I said the SCS15 Servo Arduino Library seems small. Then I found it is not complete library, without much documentation. So I googled again, and found another one for SCS Servo 1610. The library seem more official and complete. So I forget the old library and try this new one instead.SCServoArduinoLib for SCServo1610.zip
drive.google.com/file/d/….  4 hours later… tlfong01413716:31Now I am studying the FeeTech’s official SCS Protocol Library. The original code has comments in Simplified Chinese characters. I need to load the files into my Traditional Chinese Windows 10 Word and then convert them into Win10 EditPlus in unicode. The .h and .cpp files are fully listed below.

 * SCSProtocol.h
 * SCS 串行舵机协议程序 [serial servo protocol programs - tlfong01's translation from Chinese v0.1  2020sep29hkt1459]
 * 日期: 2016.8.25
 * 作者: 谭雄乐 [Tam Hung Lok]


typedef		char			s8;
typedef		unsigned char	u8;
typedef		unsigned short	u16;
typedef		short			s16;
typedef		unsigned long	u32;
typedef		long			s32;

class SCSProtocol{
	int genWrite(u8 ID, u8 MemAddr, u8 *nDat, u8 nLen);//普通写指令 [general write instruction

(see full text)

 * SCSProtocol.cpp
 * SCS串行舵机协议程序 [scs serial servo portocol program]
 * 日期: 2016.8.25
 * 作者: 谭雄乐 [Tam Hung Lok]

#include <stddef.h>
#include "SCSProtocol.h"

	Level = 1;//除广播指令所有指令返回应答 [except broadcast instruction, all instructions return reply]
	End = 1;//舵机处理器与控制板处理器端结构不一致 [servo processor is different from control boardside structure not identical]

//1个16位数拆分为2个8位数 [1 16-bit integer split into 2 8-bit integer]
//DataL为低位,DataH为高位 [DataL is low, DataH is High]

(see full text)The .cpp file is only 306 lines long. I don’t fully understand all the terms used (eg async write vs general write), so my translation from Chinese to English might be wrong or misleading. Anyway, I will now write a minimal python program to test my fake TTLing Mini board (TXS0104 first, then HC04 + CD4050, theh HX04). tlfong01413717:26I ordered my toy this morning, and the shop shipped it this afternoon. I hope it arrives tomorrow, or day after tomorrow latest.

user image

  4 hours later… tlfong01413721:26Now that I have skimmed the FeeTech SCSProtocol Library, the time has come to write my first python program to talk to the servo. As with the LX-224HV servo, I will only test one command the read Vin command. I skimmed the examples included in the library and found the demo program to read Vin. It is a very short Arduino C++ program. No boring check sum of the command packet, both of which are messy and easy to go wrong.

#include <SCServo.h>


int LEDpin = 13;
void setup()
  digitalWrite(LEDpin, HIGH);
  SERVO.pSerial = &Serial1;

void loop()
  int vol = SERVO.ReadVoltage(1);
    digitalWrite(LEDpin, LOW);
    Serial.println(vol, DEC);
    digitalWrite(LEDpin, HIGH);

So read Vin is just calling the function SERVO.ReadVoltage(), which is a very short function listed below.(removed)

//读电压,超时返回-1 [read voltage in, timeout return -1]
int SCSProtocol::ReadVoltage(u8 ID)
	return readByte(ID, P_PRESENT_VOLTAGE);

tlfong01413722:11Now I am digging deeper into the function ReadVoltage(u8 ID). I have listed the function called by this ReadVoltage(). I can more or less understand the lower level functions called, except the following: (1) virtual int writeSCS(), (2) virtual int readSCS(). I guess for now I don’t need to bother them now, because the corresponding python functions are just read/write “bytes” data to/from serial port. Anyway, below are the functions I will translate to python.

// Read voltage in, timeout return -1
int SCSProtocol::ReadVoltage(u8 ID)
	return readByte(ID, P_PRESENT_VOLTAGE);

// Read 1 byte, timeout return -1
int SCSProtocol::readByte(u8 ID, u8 MemAddr)
	u8 bDat;
	int Size = Read(ID, MemAddr, &bDat, 1);
		return -1;
		return bDat;

// Read instruction
// [servo ID, MemAddr, return nData, data nLen]
int SCSProtocol::Read(u8 ID, u8 MemAddr, u8 *nData, u8 nLen)
	writeBuf(ID, MemAddr, &nLen, 1, INST_READ);
	u8 bBuf[5];
	if(readSCS(bBuf, 5)!=5){
		return 0;
	int Size = readSCS(nData, nLen);
	if(readSCS(bBuf, 1)){
		return Size;
	return 0;

int	SCSProtocol::Ack(u8 ID)
	if(ID != 0xfe && Level){
		u8 buf[6];
		u8 Size = readSCS(buf, 6);
			return 0;
	return 1;

void SCSProtocol::writeBuf(u8 ID, u8 MemAddr, u8 *nDat, u8 nLen, u8 Fun)
	u8 msgLen = 2;
	u8 bBuf[6];
	u8 CheckSum = 0;
	bBuf[0] = 0xff;
	bBuf[1] = 0xff;
	bBuf[2] = ID;
	bBuf[4] = Fun;
		msgLen += nLen + 1;
		bBuf[3] = msgLen;
		bBuf[5] = MemAddr;
		writeSCS(bBuf, 6);
		bBuf[3] = msgLen;
		writeSCS(bBuf, 5);
	CheckSum = ID + msgLen + Fun + MemAddr;
	u8 i = 0;
		for(i=0; i<nLen; i++){
			CheckSum += nDat[i];
	writeSCS(nDat, nLen);

????? protected:
?????	virtual int writeSCS(unsigned char *nDat, int nLen) = 0;
?????	virtual int readSCS(unsigned char *nDat, int nLen) = 0;
?????	virtual int writeSCS(unsigned char bDat) = 0;
?????	virtual void flushSCS() = 0;

@AdrianMaire So now I am writing my own FeeTech servo driver in python. I am writing down some notes to remind myself what I have been doing. YOU DON’T NEED TO READ ALL THE DETAILS. I will later show you my minimal demo program of readVin() and your will then have a more clear idea of what I am doing now.Bed time. Will stop now. See you tomorrow. 

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.