Then I tried to send those values through the RaspberryPi, and the oscilloscope give me the exact signal you shown.
However the servo is still not responding, so I am wondering the following issues:
– The servo has burn, due to any mistake during the test.
– The servo expect 12V signal (HV version). I expect the signal to be 5V even if the input voltage is 12V. Trying 12V bus imply burning the servo in case it expect 5V.
– Any other error in the electronic (?) 11 hours later… Adrian Maire13.2kSun
1) Disconnect the servo (as it is not HV)
2) Connect a higher source to the board, e.g. 8V should not be a risk for the board
3) Send some signal (rotate or what-ever).
4) See if the signal is 5V or 8V?
19 hours later… tlfong013973Sun 22:39
(1) Reading and testing about UART, it transmit 10bits for each (8bit) byte of data:
(2) First it transmit a “10” and then the data.
(3) Also, it transmit first the less significant bits and after the most. But I don’t seem to find this protocol in the LewanSoul command user guide. I need to read the guide one more time and update my summary shown below。
I am also considering the test command strings I should try use first. I found you use of the broadcast address 0xfe a bit confusing. I need to think again to see 0xfe is a good address to test. I am studying the following to get to know more.
I think the simplest commands I might try first is 0x26, 0x27, and 0x28, (1) Read Temperature, (2) Read Vcc, and (3) Read Position (I can move the servo by hand and see if Position changes).For your suggestion on testing the offline tester board, let me make some comments first.
(1) The BusLinker V2.4 is for old version LX-16A, so it says Vin = 6V ~ 8.4V, so there should be no problem if I set Vin to 8V and send a rotate commend. I will do that later, but as you have guessed, the logic output should be 5V.
“x55 x55 x01 x03 x1B xE0”.
I need to read the command table to see what this means, but I will also try to use my terminal emulator Win10 RealTerm, or RpiCuteCom, or Rpi python to send this string, and also your decoded command
“10-10101010 10-10101010 10-10000000 10-11000000 10-11011000 10-00000111”
and see what happens.
I will also try read temperature, Vin, and Pos as I suggested earlier.
You said perhaps the following: “The servo expect 12V signal (HV version)”. I think this is very unlikely, but I will, as you suggest, try Vin = 8V and see what happens. Anyway, will carry on tomorrow. Cheers.
Adrian MaireSun 23:35I need to read the command table to see what this means,
I did that already, just read my previous comment, it explains each bytes 🙂 14 hours later…
tlfong013973Mon 13:10Yes, I saw that you explained each byes of my bus link rotate motor screen capture. But I don’t understand why my “Rotate Motor” string becomes your “Read Voltage Input Request”?
2 hours later…
Adrian Maire13.2kMon 14:53>But I don’t understand why my “Rotate Motor” string becomes your “Read Voltage Input Request”?
IMO, When you use the software (Hiwonder windows UI), it request periodically temperature/voltage/position to the servo, to display them in the screen.
The “rotate” directive is probably sent before.
Te more clear: I think that out of the many communications that happens between the servo and Hiwonder software, you made zoom on the one which request voltage input. 1 hour later… tlfong013973Mon 16:13
(1) I did also suspect the Bus Servo Terminal does repeatedly request Vin, Temp, Pos.
In other words, there is no need to rotate the motor in order to display waveform on the scope.
(2) So this time I set to servo mode, and adjust position to around 735 and watching the scope.
(a) I did try to change Vin from 6V to 8V and found no change in the amplitude of the 5V UART waveform, so I guess Vin is solely for powering the motor, and has nothing to do with the UART stuff.
(b) I also guess, the BusLinker is for LX-16A which is not HV and only work to 7.2V. But the servo LX-824HV should work to 11.1V, so I increase Vin to 10.0V and found every body happy to work as usual, for at least about 15 minutes without any smoke coming out.
So If I am going to use a terminal emulator, or later a python program, I can forget the “10-” part and just start a commend with 0x55, 0x55. I have not yet decided not to do next. Comments and suggestions welcome.Please also feel free to ask me to try other things you like.
Ah, jogging time. See you late this evening or tomorrow. Cheers.
Thank you very much for testing 8V and 10V and confirming that the UART signal is always 5V. With this, I can discard the issue of voltage and try others ideas.
Considering the “10”: it is nothing about the servo itself, but about UART protocol in general. Reading a bit more about the subject:
UART send a “0” before each bytes and a “1” after each byte (so we see the “10” between them).
This is used to synchronize clocks in the serial communication. you don’t need to add them to the string, it is automatically done by the UA…(see full text) 6 hours later…
tlfong013973Mon 23:06(removed)Now I have set up and tested the following hardware and software to prepare testing sending commands to servo to request temperature.
(2) Setup Win10 RealTerm and test loopback (hex) numbers
Tomorrow will test the real thing:
(4) If all goes well, LX-824HC should return temperature.
Bed time, call it a day, carry on tomorrow. 13 hours later… tlfong013973
(1) Servo expect 12V signal (HV version). I expect the signal to be 5V even if the input voltage is 12V. Trying 12V bus imply burning the servo in case it expect 5V.
(2) Any other error in the electronic (?)
I noticed that there are many shops in CN selling LX-224HV, to newbies and schools.
That is one of the reasons I posted detailed info of the toy I ordered.
I found that in CN there are a couple of flagship or big authorized or seemingly authorized shop.
One of the big shops has the following note in their ad: “We Accept Returned Goods“, that means they accept used toys, usually paying a low fee, to any used toys, damaged or good, without asking any question.
Then they may resell it to bad eBay guys, …
3 hours later…
Adrian Maire13.2kTue 16:04
Here, we have not that many choices where to buy them. I got it on Alibaba, and usually what I get there works fine. Any way, I should receive the controller soon, so I will let you know if it works with it.
Also, eBay is not that evil: you can be cheated (ofc), but usually (and if you are a bit careful) you get correct stuff. I had never issues with eBay in my case.
Yesterday, I wrote a small C++ code to send the UART signal and activate/deactivate writing mode. (using WiringPi lib). It works mostly, but I have issues synchronizing UART and the “writing” pin, because UART is buffered: I activate “writing” then send the signal to UART, and finally deactivate “writing”, but that way the UART signal finish after the “writing” is disabled.
I tried with some timers, but in the micro-seconds, those don’t work reliably. I am thinking how to implement that by hardware.(see full text)
1 day later…
I agree eBay is not always evil, but I think eBay’s quality control is not as good as Amazon or AliExpress.
Actually I was once a member of AliBaBa, but I later opened an account in AliPay and TaoBao, which belongs to Alibaba.
(2) I think I understand what your C++ code is trying to do, but I think it is tedious.
Now I have decided to switch to Rpi4B CutCom which is simpler than RealTerm, and CuteCom is easier to convert to Thonny python.
But I have only 50% confidence that my TXS0102/04 can replace the BusLink. Will take me a couple more days to find out. Cheers.
If your HC126 adapter is almost identical to BusLink Terminal, perhaps you can also try this python LeWanSoul LX-16A library. For now I will still carry on my TXS0104 setup.
Hi tlfong01 🙂
I finally got the controller board from Aliexpress, so I could try the different servos. As a note, the HV version is also moving with 5V (much easier to avoid frying the servo).
I managed to do the C++ code, but unfortunately, I can’t manage to reliably disable TX on time. The problem is that the OS timers and scheduling is on the 10ms range, while this communication happens in the 0.1ms.. This makes impossible to control enTX and TX by software on any modern OS.
1) I will try to use the 5V TX RX GND of the board to control the servo from the RPI.
2) Revert-engineer the board if possible.
Depending on result… we will see.
14 hours later…
As I see, there are at least two more alternatives:
(1) Use level shifter to shift Rpi’s TxD, RxD to 5V and use the plain HC126 cct or BusLink Terminal Board to talk to servo,
(2) My suggested TXS0102/04 level shifting and auto direction control two-in-one solution.
WARNING – I have not yet tested it. I think I have only 50% chance winning. 🙂
The python library by Maxim Kulkin is well documented, but I am not interested to over simplify the 625 lines long python code to start my preliminary testing. I will just first try it in CuteCom, and then use Thonny python to test the very basic commands, (1) Read Position, (2) Read Temperature, and (3) Read Vin.
2 hours later…
– The raspberryPi Tx and Rx are converted from 3.3V to 5V, and then connected to the 5V/Tx/Rx/GND pins on the board.
– I implemented some additional logic in C++ to make it rotate and request Vin.
1) Your python approach is interesting, I am excited to see if it’s going to work.
2) On my side, I will reverse-engineer the board, to see if I can skip it. But probably your suggestion of TXS0102/04 is a good approach.
(2) Your idea of “reverse-engineer the board, to see if I can skip it.” is good. I have no idea of how difficult it is. I have the feeling that it might be very difficult, as the BuskLink Terminal App is a bit complicated, as Maxim Kulkin’s terminal + UI python code. Anyway, good luck.
Now I have read the “LewanSoul Bus Servo Communication Protocol”. It is only 11 pages long, implying not too many commands to deal with. As said earlier, I will only test the read temp, vin, and pos commands.
what do you mean by “favorite night stand”?
I was about to curse that the guide seemed to be written by a nerd/geek in a hurry.
Geeks usually have high IQ like the uni profs and so their ordinary IQ students find the prof’s lecture hard to follow.
Ah, I used to highlight my lengthy reports to my very busy ex boss, who only has time to play golf, no time to read my rubbish. So if he is very busy, he will just read the pink sentences, and so not busy, the green stuff, and so so, read the blue stuff.
(1) Display anything on the Windows screen,
(2) Crop/Capture the interesting portion of screen into a JPG file,
(3) Use the very powerful PhotoShop to edit the jpg image,
(4) use the PhotoShop “TRANSPARENT” thing (I am using Chinese Windows, so I don’t know the “thing” in English! :)) to highlight what you want.
Ah, I missed my afternoon tea! See you later. 2 hours later… tlfong0117:37
I feel jealous that the other guy next Continent is making great progress today. So to catch up, I abandoned the Rpi CuteCom I am setting up, and went back to the not so stable Win Real Term to test the read temperature LeWanSoul command with my LX-224HV.
I have already done the following before the test this time.
(1) Use BusLink board to test servo can rotate, move to position, read temp, pos, and vin.
(2) Adrian helped to decode the read Vin request as
0x55, 0x55, 0x01, 0x03, 0x1b, 0xe0.
(4) I ten tested Win10 RealTerm UART loopback at logical level 5V0, using TXS0104 to do level shift up,
(5) Next is the fun part:
(a) I power servo with 5V,
(b) set RealTerm input string to readVin,
(c) send readVin without connecting the signal (TxD shorted to RxD) to servo. RealTemp output displayed the readVin string and nothing else.
(e) I repeated send without signal connected, and then connected to servo). The RealTerm output is displayed below.
tlfong01Thanks a lot. So I will do my always dodgy calculation after supper. Cheers.
x55 x55: start communication frame
x01: ID from the servo replying
x05: length of the message, including this byte and following
x1B: command: 27 is response to VIN_READ
x4E and x14: value of voltage.
Ha, so the value is 0x4E14. I will ask the online hex to decimal converter for help.
There is no description of what does that mean, but considering other parameters, it seems like mV, thus 5.198V tlfong01
Ah, yes I first tried 4e14 returning some rubbish, then 144e gives 5198. I hope it means 5.198V.
tks bye Adrian Maire18:27
Ohh! I though you had some tool to directly highlight the PDF. Like with Okular PDF-reader The last message was posted 3 hours ago.