
stakutis
USA
Asked
— Edited

I have yet to buy my first one and am curious about the programming model. I can't tell if you write programs that run on the device, or run on a host that talks to the device, or both.
And I'm not sure what the platform is. It looks like a lot more powerful than an Arduino (which is slow and low memory), but I saw some post that made me think otherwise.
I want to write my own code that runs on the device and that supports my own interface to my own host where I control many other types of devices. How possible is it? Or, to do the more complicated moves do I have to use the GUI tools?
The way that servos work is that there is a pulse sent to the servo of a certain length, which indicates to the servo what position it should move to. The board on the servo handles checking the pot and determining how fast or far it needs to move. The host sends the signal to the EZ-B to tell it to send a pulse of a certain length to the servo.
I hope this helps.
Also, on the website development side, you can connect to a custom webserver on ARC and change the code on [edit]the website[/edit] to be anything you want it to. This web server exposes [edit] most of the features [/edit] of ARC including the camera. I know its not exactly the solution you are looking for, but may be worth investigating. I believe that this would allow you to use javascript or any other web based language to control the robot. Calling scripts or actions within ARC becomes very simple.
One more piece of information... No, you wouldn't have to wait to get a confirmation back that the action is complete with servo movement as there wouldn't be one. The servo (hobby grade) doesn't report back that the movement has completed. You can send a second command immediately after sending the first to move the same servo or a different one.
[edit]
There might be an acknowledgement from the EZ-B saying something like "Command Received" that you might be able to check for, but DJ will have to answer this.
[/edit]
Just so you know, you can do the same thing with the EZ-B as far as monitoring output. It just happens on the host and not the EZ-B. For example, you can tell the robot to go forward until you get a reading from another port (analog, serial, i2c, digital or Camera) of a certain value, and then stop the robot. Some people believe that this is slower than having things run onboard the controller. I haven't found a situation yet where this has been any sort of issue. It works very quickly. I just wanted to make sure you knew that this was possible.
@d.cochran
Does that mean the EZ-Bit servos actually do have a pot in them so each can determine it's actual position? Just that the pot reading is not available to the user so we can't use it for position verification.All servos have pots inside of them. It is how the controller board tells the position of the servo. By controller board, I mean that it is the controller in the servo. The servos are connected to a digital port. The digital port only has the ability to be high or low (on or off). The command is sent from ARC to the EZB which says to tell the servo to go to position 90 for example. The EZ-B then sends a pulse of electricity to the controller board in the servo of a specific length, which the controller board then interprets to mean "Go to position 90". The controller board in the servo reads the pot location and determines the direction and speed that the servo has to turn to in order to achieve this position. There is nothing sent back to the EZB or any other controller saying "I am at position 90". This is all controlled within the servo.
You can bypass the controller board in the servo and run power directly to the motor in the servo, and attach the pot to an analog port, which would allow you to read the position of the servo.
All of the parts are there as far as hardware except for the feed to an analog or serial port to tell the location of the servo. It just isn't how hobby grade servos are made to work. There are higher end servos that do have this communications port available to tell the location of the servo. These are called Dynamixel servo (smart) motors. This too can be controlled by the EZB. These do tell you their location without having to hack the hobby grade servos.
BTW, this will get clear as mud when you start using Ping sensors which are also Digital. You can tell distances with ping sensors which goes against all logic of how a digital port is setup to work because distance is variable.
Ping sensors are unique in that they use 2 digital signal ports. One is to tell the sensor to send out a ping, and the other is used to catch the ping. The difference in time from the send to the receive is actually what is being measured. The digital ports are still just sending a pulse and reading a pulse. There are calculations on the host to calculate distances. This often blows my students minds and they struggle with it because it is a digital device returning variable data. Digital isn't variable, only on or off, but when you understand what the device is doing, it is understandable.
@WBS, it is a good idea to visit the LEARN section of this website and follow the tutorials. There is a complete tutorial on learning how a servo works in the learn section. It will explain how a servo works so you may better understand. Do not over complicate EZ-Robot. The EZ in EZ-Robot stands for EASY, but it's spelled different - which is kind of a slang. The EZ part means we have created a platform which performs the complicated parts for you. The idea of making a robot is the function which it will perform, not the silliness of communication and moving servos, etc.. You should never need to care about how that works or why it works - just accept that it does like you do with 99.9999% of everything else you do on your computer today.
I can answer questions that you may have of how it works, but the priority is to get you building robots
Here is a direct link to the tutorial of how a servo works: https://synthiam.com/Community/Tutorials/48
@stakutis, i would also recommend that you follow the above tutorial to understand how a servo works.
The EZ-B takes care of holding the position of the servo for you once you tell it what position to hold. You only need to tell the EZ-B one time to do something, not repeatedly.
You send a command to the TCP socket of the EZ-B v4 and it performs the function. There is no response, unless it's a return type command. If you need to understand more about how TCP works and why a completion response is unnecessary, i would recommending googling. TCP stands for CONTROLLED communication, which you can rely on it for connection verification. Unlike UDP, where there is no verification that the command had been received by the host.
Some networking tips is to start learning about the OSI model and where TCP lies on the layer model.
However, knowing any of that is unnecessary to use the EZ-B v4 - but if you're asking those questions, it will help.
Thank you all for your explanatory posts.
Before I begin, however, let me just say ...

MY JD ARRIVED TODAY! <imagine large group singing the Hallelujah Chorus and left over July 4th fireworks going off>


@DJ Sures Spent several hours going through all the JD tutorials (calibrating and fine tuning to boot) and getting it to work, which it does!
The only thing I had a problem with was getting it into WiFi client mode. My computer just won't see any other networks and no USB wifi adapter I tried will work with it. Anyway, I managed to use my tablet by downloading the mobile ARC app. and connecting to it in AP mode that way. Then set it to client mode via that app. Then used my Router setup program to "discover" it and give it an IP number which I typed into in the PC version of ARC (in place of the default of 192.168.1.1) to connect to the ezb via my PC.
Once I did that it connected to the ezb, no problem. And the ezb connects to my network every time I turn it on. So that's good to go. Thing is, it won't hold the IP address I type in. I have to type it in every time I start ARC. Is there a way to make it permanent? Didn't see anything in the tutorial about that issue.
EDIT Nevermind. I just started ARC again and the IP address was there. Must have forgotten to save it or some such the previous time. Sorry.
Also, FWIW, among the extra parts I ordered with my JD kit was an extra body. I noticed that the orientation of the on-off switch was opposite one to the other. I don't know if this is any big deal to you, but I thought I'd mention it. To me it would be good if they were all inserted the same way so people get used to flipping the switch the same way regardless of the body used.