Can you explain this one?
I programmed my Javelin Boe-Bot with the following code from the yahoo javelin group and it worked fine...well it use to...
Well, the code and documentation in the Roboticsv2_2.pdf is way out of whack, but I can deal with that...kudos whoever prepared the java version of the docs....
An example is the 255 value in the update() method signature.
From JBotServo1.java to JBotServo4.java, this value changes from a 2000 to a 255 with no explanation of why...
When I got to this program, I ran it, and like I said, the robot performed correctly.
Then I changed the value from 255 to 2000, to attempt to see what the difference was.
One wheel moved backwards while the other wheel moved forwards. This happened every second, with a slight pause in between; so there was no continuous rotation. It was as if the program was in some loop.
I thought i was extremely odd, so I changed the values back to 255.
Reprogrammed, and still the same thing.
I reprogrammed, same thing.
I reset...same thing.
The only thing that seemed to solve the issue was for me to unplug the board from power, shut down the IDE, plugged it back in and pressed reset. It then acted normal....
I programmed another piece of code and it worked fine.
I then thought I would give the piece of code I had before another shot, but again, the same thing happen.
What in the world is going on?
import stamp.core.*;
/**
* Drives both servo at high speed
*
* @version 1.0 5/7/02
* @author Parallax, Inc.
*/
public class JBotServo4 {
static PWM pwmR = new PWM(CPU.pin12); // create right servo
static PWM pwmL = new PWM(CPU.pin13); // create left servo
public static void main() {
pwmR.update ( 110, 255 ) ;
pwmL.update ( 240, 255 ) ;
pwmR.start () ;
pwmL.start () ;
CPU.delay(10000); // run for one second
pwmR.stop () ;
pwmL.stop () ;
}
}
Well, the code and documentation in the Roboticsv2_2.pdf is way out of whack, but I can deal with that...kudos whoever prepared the java version of the docs....
An example is the 255 value in the update() method signature.
From JBotServo1.java to JBotServo4.java, this value changes from a 2000 to a 255 with no explanation of why...
When I got to this program, I ran it, and like I said, the robot performed correctly.
Then I changed the value from 255 to 2000, to attempt to see what the difference was.
One wheel moved backwards while the other wheel moved forwards. This happened every second, with a slight pause in between; so there was no continuous rotation. It was as if the program was in some loop.
I thought i was extremely odd, so I changed the values back to 255.
Reprogrammed, and still the same thing.
I reprogrammed, same thing.
I reset...same thing.
The only thing that seemed to solve the issue was for me to unplug the board from power, shut down the IDE, plugged it back in and pressed reset. It then acted normal....
I programmed another piece of code and it worked fine.
I then thought I would give the piece of code I had before another shot, but again, the same thing happen.
What in the world is going on?
import stamp.core.*;
/**
* Drives both servo at high speed
*
* @version 1.0 5/7/02
* @author Parallax, Inc.
*/
public class JBotServo4 {
static PWM pwmR = new PWM(CPU.pin12); // create right servo
static PWM pwmL = new PWM(CPU.pin13); // create left servo
public static void main() {
pwmR.update ( 110, 255 ) ;
pwmL.update ( 240, 255 ) ;
pwmR.start () ;
pwmL.start () ;
CPU.delay(10000); // run for one second
pwmR.stop () ;
pwmL.stop () ;
}
}
Comments
of which only 0xD0 is used (= 208 decimal)
regards peter
Do you use a seperate power supply for the servos?
regards peter
2) So is 208 the max number that can be supplied to that constructor?
[noparse][[/noparse] Error IDE-0056] Possible Javelin on COM3 did not respond
[noparse][[/noparse] Error IDE-0054] Unable to find a Javeling on any port.
Seriously...what am I missing?
are 8 bit values (0-255) expressing the time in 8.68uSec units.
Does your board not have servo connectors?
regards peter
regards peter
I have a Javelin Stamp Demo Board Rev B. It has 1 X5 jack at the top where the 2 servos are plugged into 12 and 13
I have 1 wire running from Vm to the first hole in Vin.
Why would this repeat over and over and over and over......???
My output is
here
here
here
here
...
and the wheel moves in one direction only...over and over....
Why does this think it is in a loop? If I take out the 2nd move(-100) and delay, it works once, like advertised...
What the hell?
public class BasicWheelServoTest1 {
public static void main ()
{
System.out.println("here");
BasicWheelServo leftWheel = new BasicWheelServo (CPU.pin12 , 110, 175, 240, 2000) ;
//BasicWheelServo rightWheel = new BasicWheelServo(CPU.pin13, 240, 175, 110, 2000);
leftWheel.move ( 100 ) ;
//rightWheel.move ( 100 ) ;
CPU.delay(10000); // run for four seconds
leftWheel.move ( -100 ) ;
//rightWheel.move ( -100 ) ;
CPU.delay(10000); // run for four seconds
leftWheel.stop () ;
//rightWheel.stop () ;
}
}
I checked JBotServo2 to JBotServo4 programs, the value 2000 is probably
a typo and should read 200. (only values 0-255 are valid, anything above
gets remapped into that range by using value %= 256).
regards peter
public class BasicWheelServoTest1 {
public static void main ()
{
System.out.println("here");
BasicWheelServo leftWheel = new BasicWheelServo (CPU.pin12 , 110, 175, 240, 200);
// if this is a -100, like in the docs, all this will repeat over and over
leftWheel.move(100);
CPU.delay(10000);
leftWheel.stop() ;
}
}
Could my version of the IDE or JBot or required lib/stamp/util/os be wrong or mismatched?
I just now placed the required lib/stamp/util/os' package in my Javelin Stamp IDE folder. I see it overwrites Task and TaskManager.
I have yet to do any testing though.
Is there any up to date documentation anywhere? I'm finding my most important bits of information sprinkled all over the place, from forum postings to docs that have not been updated for well over 2 years..... I mean i had a hell of a time just getting power to the servos; i only found that I had to connect Vm to Vin by stumbling across a tiny note about it in the documentation. It seems that this would be way more visible and apparent.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Jon
www.jonkeinath.com
In the Robotics 2.2 pdf on page 59, we identify your board carrier.
None of the versions listed match what I have.
I have Javelin Demo Board Revision B, and I am just guessing as to which board it corrisponds to in this document.
Mine resembles Board of Education Rev B mostly, except I only have X5, not both X4 and X5, and my X3 has a Vm pin.
The reason I have not tried to plug in AC power is because the document states :
"The Board of Education Rev B does not have a jumper setting for power. Only use the 6V battery pack as a power supply for the Board of Education Boe-Bot projects".
Seems a little contradicting....I don't want to mess up my board...
These links may be useful.
http://www.cim.mcgill.ca/~dudek/417/notes/Boebot.html
http://www.cim.mcgill.ca/~dudek/417/notes/BoeBotExamples/
regards peter
In the examples link there is a file ServoExample.java. Notice the low parameter for each PWM of 2304.
static PWM ServoL = new PWM(CPU.pin12,173,2304);
static PWM ServoR = new PWM(CPU.pin13,173,2304);
You stated yesterday:
"The pwm update takes 2 parameters, time high and time low, both
are 8 bit values (0-255) expressing the time in 8.68uSec units."
So why is this value here 2304 and in the documentation examples 2000, when you said that the 2000 was probably a type and should be 200. Anything above 256 will be set to 256...
Why would 2 completely different sources have values like this?
My mistake. The values can be larger than 255.
The 2304 equals 2304*8.68uSec = 19.99872 mSec = 20 mSec
and the 173 equals 173*8.68uSec = 1.50164 msec.
Remember servos require pulses of 1-2 msec every 20 msec.
So the high time parameter for 1 mSec = 115*8.68uSec
the high time parameter for 2 mSec = 230*8.68uSec
So the high time parameter must be 115 to 230, with 173 being the stop value (1.5mSec pulse).
regards peter
Thanks so much.
Now, about my previous power question... Is it safe for me to use AC power with this board and the servos??
Since you connect Vin to Vm you cannot supply more than 6VDC
to Vin, because the servos can only handle 6V.
The javelin, which is powered with Vin to its pin24, can accept up to 24VDC.
Before you connect a regulated 6VDC adapter, measure the output
to be certain it is 6VDC. Some adapters (especially unregulated ones) may output
a higher output voltage that only decreases·with heavy loads.
I suggest a regulated 6VDC/1A adapter. That should give you enough power.
regards peter
·
Something seems fundamentally wrong with this entire situation right?
With all the people that are using this board and stamp and the boe-bot kit, am i really the only person seeing this?
A quick recap of my current setup: Hopefully someone can say "Oh you cant do 'that'!" or "Oh you have that piece, that wont work..."
Javelin Demo Board Rev B
I have a mini-usb -> serial connector plugged into it
I have a usb cable plugged from computer to mini-usb jack on board
Board is powered by 4 Eveready 1.5v Alkaline batteries
I have 1 wire plugged from Vim to the 1st out of 3 Vn holes
One servo is plugged into X5 12
One servo is plugged into X5 13
Using the JBot.zip files from the yahoo javelin user group
Its unzipped in the parallax home/projects directory
The following code, when programmed with the Javelin IDE causes the bot to barely nudge forward, over and over and over; "never" leaving the main().
import stamp.core.*;
public class TestServos
{
static PWM pwmR = new PWM(CPU.pin12);
static PWM pwmL = new PWM(CPU.pin13);
public static void main()
{
pwmR.update ( 110, 255 ) ;
pwmL.update ( 240, 255 ) ;
pwmR.start () ;
pwmL.start () ;
CPU.delay(10000);
pwmR.stop () ;
pwmL.stop () ;
}
}
When connected to batteries, there is only enough power to do this a handful of times.
This is written in the documentation for both the Javelin and Basic stamps regarding servos.
You need to step the power up to 100% (and back down again when stopping). Try modifying your
code to run the servos at say 10% of the max. As a bonus, you'll extend the life of both
your batteries and your servos.
The JBot example on the yahoo group includes a RampingJBot class. This steps it at 33%, 66%,
and finally 100%. I found I had better luck increasing the number of steps myself.
- Andrew
Post Edited (aprunicki) : 9/11/2007 9:35:30 PM GMT
- Andrew
Andrew is right about the batteries. And don't forget the javelin itself draws 60-65 mA.
So when using 2000mAh batteries, these will last 33 hours max, most probably less
when also powering servos. Originally the BOE-BOT shipped with a BS2 which
only draws 8mA or so.
regards peter
I`m receiving a Error IDE 0054. I am using a usb link. This happens when I try to test the connection.
message>>
Found javelin on com 8, testing power.
resetting javelin.
The error then appears. IDE 0054 (Unable to find javelin port)
http://forums.parallax.com/showthread.php?p=656527
However, if you are using a javelin demoboard with a usb to serial cable,
from javelin IDE menu: Project->Global options, tab debugger.
Click ... button.
Add port 8 to known port list, if not already added.
Click ok to accept.
Then try Project->Identify again.
regards peter
Post Edited (Peter Verkaik) : 10/25/2008 10:38:57 AM GMT
I now receive a
Error IDE-0022 (Error reading from serial port) (Timeout)
I will try the thread link.
Thanks
If you have a usb to serial cable obtained from parallax (has a FTDI chipset)
go into the usb driver properties and set latency to minimum (1 msec).
Usb to serial cables with other chipsets may not allow you to alter
the latency setting and in that case I recommend to get the parallax cable.
regards peter
··