PRO
rb550f
USA
Asked
— Edited
BN-880 GPS Compass
— Standalone autonomous navigation using Beitian BN-880 GPS/Compass with real-time map waypointing and offline map caching; requires Arduino.
Try it →
I made a quick cable and connected an arduino to my Meccanoid servo's using tutorial and then connected EZB to arduino via UART. I wrote a quick script from samples and worked very well (THANKS FOR WRITING THIS UP).
Has anyone written a script to read current server position. (Disable Servo, Manually move, read servo position).
Thanks.
Hi @Richard_R The Meccanoid Servo's may be junk and no torque but they did one thing right, they have a potentiometer in them so they have the ability to report servo position. You can put the meccanoid in LIM mode and then record a series of movents by manually moving arms head etc. Meccanoid records the movements and plays them back. The Arduino Firmware appears to support it if you read the meccabrain.cpp file but the sample code on the arduino that interfaces with the EZB does not appear to support it.
The existing code did not support reading servo positions. It appears to be supported in the official BIOS but was not intuitive or clearly documented. I decided to use meccontrols BIOS and wrote a script to do the following with meccanoid servo's, an Arduino and EZB V4
This is my first ez-robot script so code is spaghetti. Error correction on reading data from the UART is complex as the data size changes dependent on if the servo is at 99 degrees or 100 degrees. There is no Start Code only end code (CR/LF) in packet. Each number for servo location is sent by the BIOS as its ASCII equivalent for the actual number. So 120 degrees is sent as 5 separate numbers to represent 1,2,0 and CR LF. You receive the servo position in 5 fields 49 50 48 13 10 (No idea why the BIOS does this). Writing to the bios is done in a string so you have to get 3 separate numbers convert each to ASCII and then reassemble them back into a string to write back to the BIOS software. Because the meccontrol firmware writes in single string but reads in 4 to 5 numeric fields of ASCII code there is lots of messy converting back and forth.
I need to clean up and create subroutines so you can have more servo without duplicating code. It is very slow as it can only read or write one servo at a time. I need to be able to read multiple servo positions at 1 time and write new positions at 1 time. I am not sure yet how to approach this, I may have to fork the BIOS. If someone who knows EZ-Script can clean up I would appreciate it.
https://synthiam.com/Community/EZCloud/RobotAppDetails.aspx?id=5184