« first day (20 days earlier)      last day (27 days later) » 

8:43 AM
Congratulations and many thanks for the library. So I can use command line tools to do the following: "a simple command-line tool to move and check Vin and position"?
I am going very slow. I only know how to use python to read Vin, with intermittent read errors. So I am writing a check sum function and use it to resend readVin command and calculate the error read rate.
I skimmed your source code and found the section of code seemingly to read Vin:
	else if (command == "read_voltage")
	{
		if (!checkArguments(num, 1, "read_voltage")) return 1;

		auto idOpt = getServoId(argsStr[2],1);
		if (!idOpt) return 1;

		HiwonderRpi::HiwonderBusServo servo(*idOpt);
		std::cout << "    " << static_cast<float>(servo.vinRead())/1000.0f << "V" << std::endl;
	}
But I could not any checksum code to steal or borrow. Have you written any check sum function?
I skimmed to found code segment seemingly to do delay 3000 or 200 something. I guess those are for delay of servo operation, say to move to a particular position. But is the 200 something 200us, the command and reply gap?
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.
 
9:26 AM
"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…
1:27 PM
@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.
 
1:44 PM
@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.
 
2:22 PM
"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:
The negation is with the "~", I think it's the same in python
About 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.
 
3:06 PM
@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.
 
4:02 PM
@tlfong01 Buffer is just an std::array<uint8_t,10>, that is, an array of 10 char.
Woo, nice servo!
 

« first day (20 days earlier)      last day (27 days later) »