« first day (25 days earlier)      last day (22 days later) » 

2:33 AM
FeeTech 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
http://www.feetechrc.com/faq.html

- 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.
 
 
1 hour later…
3:47 AM
I 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)
https://www.alibaba.com/product-detail/Mini-TTLinker-Signal-Conversion-Board-Connect_60584703741.html

(2) TaoBao TTLinker-mini - ¥25
https://item.taobao.com/item.htm?_u=t3thdsbd148&id=560560805365
 
4:17 AM
Last 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
https://drive.google.com/file/d/0Bybjet9xBXeqUzVMTjdReFJ4ZUk/view.
 
 
4 hours later…
8:31 AM
Now 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]
 */

#ifndef _SCSPROTOCOL_H
#define _SCSPROTOCOL_H

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

class SCSProtocol{
public:
	SCSProtocol();
	int genWrite(u8 ID, u8 MemAddr, u8 *nDat, u8 nLen);//普通写指令 [general write instruction
/*
 * SCSProtocol.cpp
 * SCS串行舵机协议程序 [scs serial servo portocol program]
 * 日期: 2016.8.25
 * 作者: 谭雄乐 [Tam Hung Lok]
 */

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

SCSProtocol::SCSProtocol()
{
	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]
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).
 
9:26 AM
I ordered my toy this morning, and the shop shipped it this afternoon. I hope it arrives tomorrow, or day after tomorrow latest.
 
 
4 hours later…
1:26 PM
Now 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>

SCServo SERVO;

int LEDpin = 13;
void setup()
{
  pinMode(LEDpin,OUTPUT);
  digitalWrite(LEDpin, HIGH);
	Serial1.begin(1000000);
  Serial.begin(115200);
  SERVO.pSerial = &Serial1;
  delay(500);
}

void loop()
{
  int vol = SERVO.ReadVoltage(1);
	if(vol!=-1)
  {
    digitalWrite(LEDpin, LOW);
    Serial.println(vol, DEC);
    delay(10);
   }
   else
   {
    digitalWrite(LEDpin, HIGH);
    delay(2000);
   }
}
So read Vin is just calling the function SERVO.ReadVoltage(), which is a very short function listed below.
//读电压,超时返回-1 [read voltage in, timeout return -1]
int SCSProtocol::ReadVoltage(u8 ID)
{
	return readByte(ID, P_PRESENT_VOLTAGE);
}
 
2:11 PM
Now 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);
	if(Size!=1){
		return -1;
	}else{
		return bDat;
	}
}

// Read instruction
// [servo ID, MemAddr, return nData, data nLen]
int SCSProtocol::Read(u8 ID, u8 MemAddr, u8 *nData, u8 nLen)
{
	flushSCS();
	writeBuf(ID, MemAddr, &nLen, 1, INST_READ);
	u8 bBuf[5];
@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.
 
2:45 PM
Please, continue! I am very interested in your progress and see how it's advancing.
In my case, boring stuff: I just setup and tested my printer, so I can make the photolithography mask. (I had troubles in making the printer to make exactly 100% zoom: it was applying margins and changing size). I will probably make the PCB this evening.
 

« first day (25 days earlier)      last day (22 days later) »