Servo not working

Hi everyone,

I have had no problems with speech, but I have a lot of problems with Arduino. I can not get the servo to work. so I changed over to Eclipse and I am still having problems. I have sent a no-worky.

If some one could help me that would be great.

Thanks

BC

Mats's picture

Servo problems

Hi BillC 

The best way to get the servos working is to use the 1412 version that you can find a link to at the top of the shoutbox. So try that first. 

Create a new empty folder, for example C:\MRL1412 and put the downloaded myrobotlab.jar there.

Start MyRobotLab.

Go to the  runtime tab and start an Arduino service. 

In the Arduino tab you will find the sketch that needs to be compiled and uploaded to the Arduino using the Arduino IDE. So start the Arduino IDE and copy paste the code. Check the settings so that you use th correct board and port. 

After a successful upload of the code to the Arduino, shut down the Ardino IDE and restart MyRobotLab.

You will see some error messages about a version missmatch 34 vs 35, but it should still work ok with the servos.

 

-------------------------------------------------------------------------------------------------------------------------------------------------------

The latest build is a bit different from all previous versions, because it automaticaly uploads the Arduino sketch if it's out of sync. .

So if you use the latest build you need to use this script the first time you use the Arduino.

ard = Runtime.createAndStart("Arduino","Arduino")
ard.arduinoPath="C:\Program Files (x86)\Arduino"
ard.connect("COM3") 
 
Change C:\Program Files (x86)\Arduino to the name of the folder where your Arduino IDE is installed.
Change COM3 to the port where your Arduino is connected.
 
-------------------------------------------------------------------------------------------------------------------------------------------------------
 
If you are a developer and really want to use Eclipse to get the latest version and see all of the source code, then be aware that you need to clone the develop branch to get the latest versions. The branch master is the now very old 1.0.119.
 
I hope this helps to get your servos working.
 
/Mats
 
BillC's picture

Servo still not working

Hi Mats, Thank you for your help. After going back to  version 1412 I am still having the same problem. I am getting the MRL error -Bad magic number 10 - 1rx errors. I am sorry about being a pain in the a@@ about

this but I don't were to go with this.  I have sent a no-worky.

Thanks BC

Mats's picture

No-worky

Hi Bill

I don't know where to find the no-worky, so to be able to help I need to be able to recreate the problem.

What script are you using ?

/Mats 

BillC's picture

no script

Hi Mats, I am not running any script at this point. This is what I am doing.

1. Start mrl version 1412.

2. go to the run tab and start arduino

3. From the run tab start servo.

4 I have a servo attched to the arduino board at pin 2

5. start arduino by putting in com5

6. go to the servo and attach it to the arduino.

7. it will move in one direction for about 1 second and stop and will not work after that

I am getting an error about wrong magic number.

If you need any more info please  let me know.

Thanks.

calamity's picture

Hi Bill   the symptom look

Hi Bill

 

the symptom look like you are drawing too much current from the arduino, so it reset

Is your servo drawing current from your arduino board?

they have to use external power supply as arduino board can't provide them enough current

BillC's picture

servo not working

Hi calamity, I think you are right. I am drawing current from my arduino board. I have a 6 volt battery, so I will try that to see if that is the problem.

Thanks

BC

BillC's picture

servo is working now

Hi calamity, I used a 6 volt battery and that worked fine. I would like to thank everyone for the help they gave me. This is a great group of people that devotes their time to help others.

Again

Thank you all

BC

calamity's picture

It's a pleasure remember that

It's a pleasure

remember that to avoid servo jitter, the arduino and the servo need to have a common ground with the battery

now you are ready to build great things, remember to show us what you are up to, we like to know what people are doing