Asked — Edited

Training In Ez-Script

I would like to have some help in writing code. A long time ago I coded in Basic. Before Windows. Therefore I have some understanding of coding and can code a little bit with EZ-script. I would like to understand it better and how to apply it.

I have finished all the training sections. I understand what each EZ-Script does as it is explained very thoughtfully. It does seem that you need to have a pretty good understanding of programming to be efficient with the EZ-script.

  1. Is there anywhere I can read how to apply EZ-Script in EZ- Builder?

  2. Do I need to learn VB.Net?

  3. Is there a book I can buy?

  4. How do I proceed with EZ.script to add code to EZ.builder program.

If I really understand how to do this I would be able to go a lot faster in creating my robot.

Thank you for your help.


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

United Kingdom
#1  
  1. It's really a case of adding either the EZ-Script or the Script Manager controls in ARC and then triggering the scripts either manually with the start button or by using the ControlCommand()

  2. No

  3. No

  4. See answer 1.

#2  
  1. The only info I know is what comes up beside the script writing area in ARC(Add control > scripting > Ez-script)

  2. ARC is set up to require no passed programming knowledge.

  3. You based on ez-robot? No, but there are books on the principles of robotics.

4.Add control > scripting > Ez-script. I came here with no experience, and now I can write fairly easily. Just read through the script help beside where you make your code.

#3  

I find the best way to learn is to load some examples (ARC has tons of example projects) that come with the ARC download and start messing with them... Make subtle changes and see what kind of affect it has....

You will have a eureka moment that will make everything kind of make sense... Don't give up, stick with it... You know you can always ask here if you get stuck on something specific....

:)

#4  

Ellis,

The best way currently is to download some of the public project and look at how people are using the scripts. I have a public wall-e project that has a lot of scripts in it. Rich has a lot of them out there that are projects with specific purposes that are tutorials on specific things like automated ping roaming.

A book would be outdated by the time it was written with as quickly as new features are added so none have been written. There is help available in when writing scripts in the tools available for writing scripts. This and the examples from others, along with posting questions here are the best options available.

#5  

I dont mean to pile on here but I just would like to validate what the others have said. The way I started to understand how to write EZ Script was to download other people's projects (mostly DJ's) to see how they used the EZ scripts and how they coded them. Sometimes just a series of one line commands with Sleep() pauses in between in the script is all you need for basic EZ Robot control. Sometimes you need to get more complicated with loops and commands that pause the script and wait for other things to happen before they restart.

There is a EZ Script manual with all the commands in each EZ Script control. Look for the tab that says "Script help" to the right of the script your writing. It has examples under each command. You can also study the commands here in the Learn section under the EZ Script manual tab:

EZScript-Manual

Heck, if you've already written script in Basic your way ahead of most of us were when we started here. It' mostly just structuring the script in a logical step by step way. Scripts are stupid. You need to tell them what to do each step of the way.

I'm by far no expert but a couple of important concepts I've learned are: *You can have many scripts in ARC. *You can have as many scripts running as you want at one time. *One script can start or stop any other script in ARC. *Write scripts with system resources and what is happening physically to your robot in mind. Place the needed Sleep() or Waitfor() commands where needed in loops or between commands. If you have a loop running without a pause it will take over your computers CPU and slow everything down. Sleep() commands also give actions time to complete. The next command may cancel out the first one. Without them it may appear your script is not doing anything.

If you get stuck there always seems someone is around here to lend a hand.
;)

United Kingdom
#6  

@Anthony, I can see you haven't really delved too deep in to EZ-Script if it's "just basically putting all the widgets in order of operation";)

You can be basic and throw ControlCommand() in everywhere to set built in controls going and what not. You can use SayEZB() to get the robot to speak etc. but you can go so much deeper than that...

My newest "Ping Roam" which I've been working on since releasing the last version, so over a year now, uses some pretty complex maths to calculate turning circles, to stay running parallel to a wall, to move around objects and then return back to the path it was on...

Even my latest "Speak The Time" script uses a fair amount of IF statements to check different things and respond more naturally than a computer.

My "Weather Forecast" script responds dynamically like Jarvis has done for a couple of years, using the same methods I used on Jarvis but in EZ-Script.

Melvin is script with a lot of interlinked scripts and actions and has really developed his own attitude. Each thing he does, each thing I do, each thing I don't do affects his attitude and his desire to do what is asked of him.

These last examples are more than just listing widgets in order of operation. They are carrying out a whole host of checks dependent on the results of previous checks, sensor readings, dates, times, information scraped from the internet and in some cases data logged by other devices within my home.

EZ-Script can be as advanced as you can imagine it to be but it can also be simple. Start simple. The rest will fall in to place as you get more and more ambitious.

@Ellis, I've been adding my robot info, including scripts, to my website recently. Once I get the script pages to a point that I can publish them you will find I have explained every line, every segment of code, what it is and why we use it. This should hopefully help you and others looking for guidance. There is no ETA for when that'll be but I'll certainly bump a few of the smaller scripts up the to do list so I can get them published to guide you sooner rather than later. Until then, check out my cloud projects, most of my scripts (if not all of them) are well commented explaining each part of the script, what it does and why we need it.

#7  

Thanks everyone. I will look at the samples and see if I can understand how and where to insert the script. Thanks for all the feedback.

I will get back to you after looking over the samples.

United Kingdom
#8  

I forgot to mention, I wrote this topic a while ago which may be of some help. However please note that some syntax may have been changed since writing it and new commands have been added which may make some of my methods a little over complicated now.

PRO
Synthiam
#9  
  1. load ARC

  2. press the File OPEN button

  3. press the EXAMPLES button from the top of the open file dialog

  4. view projects in either the EZ-Script Examples or EZ-Script Function Syntax folders

I'm the only programmer, tutorial writer, website content writer, and a billion other responsibilities:). Thank you for the kind words on the tutorials. I have a bunch of todo items for the tutorial section, including EZ-Script lessons.

I would like to have lessons that introduce how to start with basic programming concepts.

now, keep in mind that you do not need to program at all with ARC. There are nearly a hundred controls that just "do stuff". The idea of ARC is to use controls that perform the function of what you want to do.

For example, we had a guy "review" our product from Make Magazine. In his review, he was used to Arduino programming - which is a very oldschool way of using robotics. Writing code to do low level stuff is like a carpenter cutting down a tree to get wood to build a house. Now days, we get our 2x4's pre-cut from home depot:D

The author of the review was "programming" and not using the controls to help him. It took him days of burning out servos to figure out how new-age robotics (like ez-robot) work. If he would have asked on the forum to begin with, like you are doing, there would have been no burned servos:) .. So the answer to your question about programming is, we want you to learn but you don't actually have to start with programming right away. You can start with using ARC and using the tutorials first.

Start with making your robot do "stuff". Such as making it dance. Control it by your phone and voice. Have fun with it... then, start looking at the code behind the buttons while you wonder "hey, how does this work?"

Do not think that you have to start with programming - because that's not how we want you to feel. We want you to enjoy the robot first. You will learn quicker when you enjoy it, rather than it feeling like work.

BTW, that author of the review I mentioned earlier... he had hours into a small program to avoid objects and he took too long to ask a question, so instead he burned out a bunch of servos trying to learn on his own. The question was regarding object avoidance. Even if he had written the program in similar fashion with an Ardiuno, it would have burned up:). So this goes to show that no matter how you program, it's a good idea to start from a basic understanding. Enjoy your robot now, and learn to program it tomorrow.

Using the pre-built ultrasonic radar scan control in ARC for the Six robot, I was able to make the robot avoid obstacles and navigate autonomously in less than 30 seconds without code. This is by using pre-built controls. Here's a video..

Don't think that you have to program to use an ez-robot. Understand that you only need to program an ez-robot to fill in the blanks of stuff that we don't already provide.

#10  

@Ellis... By the way, If you know basic (I learned basic on a Commodore 64 ...LOL) then I think you will find ez robot scripting is very similar... I'm sure you'll catch on quick....:)

#11  

I am also a noob with ARC and what I know would be helpful is what DJ started in doing in order to actually understand the steps to create a script, save it, and then manage the script in script manager. Similar things to getting power plugged in....I want an AC/DC power source...not a battery as I am learning...I will go through way too many batteries.

To figure out what the commands within a script do can be figured out from examples of other builders or reading the help file but what I was struggling with is getting familiar with the EZB GUI interface and how to navigate basic functions to get wi-fi connected or actually open or load a soundcard window or create a script.

The only way I have been able to accomplish this is...if you click on everything...you will stumble across the menus but it would be great to actually have "A Getting Started Guide" that says...to get sound working on your EZB controller internal speaker.....do this....> Open this menu item, select this item, add .mp3 file from laptop...etc.

NONE of that is documented to help someone not familiar with the interface do this easily and it doesn't require ANY programming either.

I love the EZB controller so far but it is difficult getting out of the gate.

Bob J

United Kingdom
#12  

@bobjacon, Every control is covered in the ARC Manual. Each control in ARC has a ? which when clicked on will take you to the relevant page of the ARC manual.

Also, the Lessons cover some of ARC. As has been said before, the lessons are slowly becoming more and more as they are written, proof read, adjusted and perfected. Mark them as complete when they are done and we know what you have read and seen. So far, we can see you checked out the opening of Roli's box but that's all.

#13  

@Bojacon... First thing to do is to get a rechargeable battery... Most wall ac adapters cannot supply enough current to run more than a servo or two... Like everything in life... new things seem daunting and difficult at first, but if you start small and keep at it you will be programming in no time... The problem with humans is we sometimes quit when we hit an obstacle... Those of us who are successful see obstacles as challenges not an end wall....

Open some simple sample projects and play with them.... As I mentioned before... you will eventually get this "eureka moment" when it all starts to make sense....

#14  

Hi Rich,

Thanks for the tips...I do like a challenge! I wanted to get the EZB controller up and running to see that it worked and was able to do just that. Had to upgrade from Windows Vista to Windows 7 and add RAM and also get to Microsoft.NET Framework 4.5 as well. I also got the wi-fi working as well. So many hurdles so far and clearing ALL of them!

This allowed me to start learning by actually seeing the screens on ARC.

I am not building any of the EZB robots but building a custom B9 robot like Dave's so a lot of the tutorials show how things are done with EZB robot parts but I know that they cover robotic basics. Yes, there is much that can be learned from them.

I have a 110V AC to 12VDC 15AMP power source but I'm finding that 12VDC may be too much for most servo motors and especially servos from EZ-robot. I think I read that the HD servo can only have a max of 7.4VDC. I haven't been able to read what is the recommended power source for the EZB controller. Maybe it depends on what you are trying to do with it and what is connected to the ADC ports?

My car charger was only 6VDC but was enough to get the EZB board powered on but then it had the annoying warning which I quickly figured out why...rechargable battery low so I configured it to shut it off as I was not using batteries.

I've only just started with EZB this weekend/today...so these tips will be very helpful as I progress.

Thanks, Bob J

#15  

Yeah, you want to keep those 12Vs away from hobby servos... Or else you could release the magical blue smoke that somehow stops electronics from working....:)

Ask your questions here...

United Kingdom
#16  

Battery voltage depends on what you connect to the digital ports. The ADC ports are regulated.

12V is too much for most servos. You will want 7.4 volts ideally. You will need high amps too (15A should be ok to start with).

#17  

Rich,

Thanks for the info...and btw: for those reading this thread....just go through the lessons. (I hadn't done that when I made my first comment) They have the information embedded in them for certain things as they apply to all robots...like scripting and power...etc.

Also, should I be looking for a way to step the voltage down to 7.4vdc for the main input voltage before connecting power to EZB controller? In other words, DO NOT CONNECT 12vDC to EZB at all?

BobJ

#18  

@Bobjacon

if your are connecting the servos to the EZ-B to power them, then yes. DO NOT run 12v through it using standard hobby servos. It'll fry them. You can easily get a wall plug that'll supply 7v from just about anywhere:D

#19  

Thanks everyone for all the comments. I have already learned a lot more by following your suggestions. I am trying to build a medium sized robot that can do the things the little robots do. I am using two 12 v 9 amp batteries in parallel. For the EZ-B i am using a 14 amp voltage regulator turning the 12 v to 7.2 v. Voltage and amps have so far not been a problem.

I am totally convinced that I will get it but i will have to also some assistance from time to time. It is good to know that it is so readily available.

I know how busy you must be with all the things going on at EZ-Robot. When you find time I agree that there needs to be a good getting starting with EZ-Script to help understand how to put all the scripts in the right places and order.

Thanks again everyone. It is good to have such knowledgeable and helpful people in the community. Ellis

#20  

Bob J,

Here's a section of a long personal letter I just sent you. Hope this isn't seen as a continued hijacking of this thread but I think it answers some of the questions Bob raised.


Now as far as power feeds; This can be completed and could take time.  However I'll try to explain. The best way to start with any electric circuit design is to look at each device you have and see what it's voltage requirements are and how many amps it will draw. Add up all the amp draw and you will know how much current your power supply will need to be rated for. Then look at the voltage needs of each device and you will know where you will need to boost or buck the voltage. A lot of electronic devices have a voltage range they can operate in. Try to buy devices that match the power supply you have chosen. In your case 12 vdc is good because there are lots of devices that run at that voltage. If I have to change the power down line of the main power supply I like to buck (decrease) the voltage with a DC to DC power converter.  Make sure you get a power converter that is rated for the peek amp draw of the device your converting to. The best kind if converter is a switching power converter because they are a lot more efficient and produce very little heat (your main power supply should be this kind). However  when you start converting these smaller loads they are hard to find and expensive. With these smaller loads it's OK to use linear power converters. They waist a lot of energy and make a lot of heat but if they are quality and sized to your load you shouldn't have problems. 

With all that said and as I said above you need to design your power grid starting at a main power supply that can handle the load your going to apply to it. Then from there you need to branch off to the different devices (loads) your going to power. You should also fuse each branch line (circuit) at what the amp draw of the devices on each line will add up to. Make the fuse size a little higher then the load. If it blows and you know there are no shorts or problems then up the fuse size a little more. Also place large motors and sensitive equipment on their own circuits. Buy and learn how to use a multi meter and a AC and DC amp probe. They will save your ass some day. 

Here's a good tester I use: http://www.amazon.com/gp/product/B009CNYJG2/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1

When you sectionalize like this it makes it easier to troubleshoot problems and better protects devices from shorts and power surges. This method also helps you balance the total load across your system. You also may find it best to use several main power converters and daisy chain the AC side feed of them together (place them in series).  This will also help isolate any electronic and keep it out of your sound system. Put noisy lights and control boards on one supply and the sound system on another. 

Here's an example of a good adjustable DC to DC linear converter I'm using to decrease voltage from 12 vdc to what ever I need and is rated for 8 amps:
http://www.amazon.com/gp/product/B00C4QVTNU/ref=oh_aui_detailpage_o08_s01?ie=UTF8&psc=1

Now, the EZB will accept anyware from 4 to 17 vdc. It has a power converter on board that will give 3.3 vdc to the power pins on the ADC and i2c ports at a very low amp rating. This is for powering sensors like pots only. The power pins of the digital ports are pass through voltage of exactly the same voltage your powering the EZB with. If you power the unit at 12vdc then you'll get 12vdc at these pins. The amp rating is exactly what your power supply is rated fro because the power is coming from there. EZB has a 20 amp fuse onboard so they say the unit can have 20 amps pulled through it. I dont advise powering any large loads through thi EZB. I've had it brown out while powering a HD servo through it that only was pulling a few amps. Feed all your large loads around the EZB. However make sure they all have the ground wires interconnected. 

You wont need to match the amp protection on the AC side with what your pulling on the DC side of the converters. While your AC amperage will raise a little as you add DC devices beyond the converters it wont be that significant. I have a 6 amp main fuse where the AC power enters my B9. I have many, many more amps then that being used past the DC converters. The converters will take on the extra DC current. 

I hope this helps clear some things up. I gotta go now and watch for Santa. I hear he's bringing me some parts for my B9! 

Have a great holiday!
Dave