jkkroll is currently certified at Master level.

Name: Jeff Kroll
Member since: 2002-01-13 23:58:31
Last Login: 2010-03-19 17:02:43

FOAF RDF Share This

Homepage: http://robotguy.net

Notes: I am an electrical engineer working for a company that builds deep sea remote operated vehicles and telerobotic arms. I have been interested in hobby robotics for about 12 years and currently have about 26 robots that I have built.

Recent blog entries by jkkroll

Syndication: RSS 2.0

24 Aug 2010 »

Perl for Puzzlers

I was working on creating a puzzle a couple of weeks ago and needed sets of a dozen 5-letter words that all “interacted” in a certain way (sorry, don’t want to give away too much).  One of the software guys here at work suggested a Perl script to find sets words, specifically Strawberry Perl. I have been programming since I was a kid (basic on a VIC-20) but lately have been resistant to learning new languages because I can usually accomplish my goals with the languages I already know. This time I decided to take his advice and was pleasantly surprised with the simple learning curve and thought I’d pass on a bit of intro on how to set up and start using Perl to help create puzzles.

Disclaimer:

I am not a Computer Scientist, nor do I play one on TV. This is a description of how I went about solving a specific problem, not necessarily the best method. For informational purposes only. Use at your own risk.

Installation of Strawberry Perl was completely straightforward on my XP machine. I haven’t tried any Win7 installs, but the home page suggests it is just as simple. I just downloaded the Windows installer and let it run. This will install Perl on your machine let you run scripts from the command line.

1. Create a folder to place all of my code and research material.

2.  Create a text file in the folder where I had all of my puzzle related info called “prompt.bat” (no quotes), and consisted of the single word “cmd” (again no quotes). Double-clicking this file will open a command prompt within the folder so you can launch the scripts easily.

3. Download a word list that can be easily read into your script. I used output from Tea, but I also found some other word lists here: http://wordlist.sourceforge.net/

4. Create a text file (I prefer Notepad++ for text editing. Be sure to set the Language to Perl to get the correct syntax hi lighting) with the name of the puzzle and a “.pl” suffix. This file will be your Perl Script.

5. Start the script with “#!/usr/bin/perl” This tells the computer that it is a Perl script.

6. Here’s a script I wrote to find all the rotations of a word (anyone who saw my sample puzzle on the forum may recognize this) listrotator.pl (Save target as… or you may get an error. No idea why). You can run this by typing “perl listrotator.pl words.txt” at the command prompt.

#!/usr/bin/perl
#use strict;
my %words;
my $i;
open(DATAIN,”<$ARGV[0]“) || die “cannot open \”$ARGV[0]\”: $!”;
while(my $line = <DATAIN>){
$line =~ s/\s+//;
$words{$line} = 1;
}
foreach my $word1 (sort keys %words){
my $num=0;
my $word=$word1;
print “-$word\n”;
for($i = 1; $i < length($word1); $i++){
$word= rotate($word);
print “$word\n”;
}
}
sub rotate{
my $foo=shift;
chomp($foo);
my $out=substr($foo,1,length($foo)-1).substr($foo,0,1);
return $out;
}

The beginning of the script reads in the command line argument (words.txt in the example above) then reads the word list into memory. Specifically into a hash structure named words hash, but I’ll discuss that later. While reading the file into memory, it also strips carriage returns and unprintable characters.

Next the script steps through each entry in the hash (%words). It takes this entry, and rotates it using the rotate function, once for each letter in the word. This way we end up with all possible rotations.

In a future post I’ll cover some of the neat things you can do once you have a word list in memory.

Syndicated 2010-08-24 18:57:35 from robotguy.net/Blog

21 Jun 2010 »

Portable Electrick Storage Device – Mark I

My daughter has swim meets every Saturday morning from 7am until around 1pm. During this time she is actually swimming a total of about 4 minutes, so the entire family tries to stay occupied the rest of the day. Almost every week someone complains “Oh, man! My iPod is dead!” Answering the tinkerer’s call to arms, I would like to present the Portable Electrick Storage Device Mark I:

Outside

Inside

USB Connectors

Charging my iPad

Specs:

  • Box – $6 brand new at the local thrift store, I only added electronics and handles. (I need to head back and get a couple more!)
  • Battery – 12V 7Ah (~12 iPod charges or 3.5 iPad charges)
  • Output – 5V @ 1.5A (will charge iPad while watching video)
  • Connectors – 3x USB Type-A female
  • 3A fuse directly on battery
  • Power switch with blue LED indicator

Plans for the future:

  • “Working” steam power plant
  • Microcontroller based monitor (Battery charge level, internal temp, etc) with 128×128 OLED screen
  • Embedded wireless web server (WRT54G based)

Syndicated 2010-06-21 19:29:33 from robotguy.net/Blog

12 Jul 2009 »

Steampunk PDA – Again

I have been convinced to add the Steampunk PDA back to my list of projects I am allowing myself to work on, so the list currently stands as Deskpet, Mazetrix, PDA and notebooks. I ordered the accelerometers for the next 3 Mazetrix tiles (should be here Monday), and I should be building a couple of notebooks for some guys at work, but this sounded like more fun.

I have been thinking about the PDA for a week or two now, and decided to make a custom case rather than attempting to use a pocketwatch case. I picked up a 2″ brass pipe fitting from the hardware store and  started shaping it on the lathe. It should be just about the right size…

PDA Case

Steampunk PDA Case - Size Comparison

PDA Case

Steampunk PDA Case

Steampunk PDA Case

Steampunk PDA Case

Steampunk PDA Case

Steampunk PDA Case

Syndicated 2009-07-12 02:47:50 from robotguy.net/Blog

26 Jun 2009 »

#mazetrix video 1

I spent about 4 hours programming last night trying to simulate the physics of a rolling ball on the AVR. I think it turned out pretty well:

Here’s the timer interrupt that services the analog to digital converter and the multiplexing of the LEDs:

ISR(TIMER2_OVF_vect){
static unsigned char activeLine=0;
static unsigned char adcChannel=0;
PORTC=0xFF;
PORTA=0xFF;
selectLine(activeLine);
PORTC=~green_display[activeLine];
PORTA=~red_display[activeLine];
activeLine++;
if(activeLine>7){
activeLine=0;
}
switch(adcChannel){
case 0: x_accel=(ADCH-x_flat)/10;
if((x_loc<500)&&(x_accel<0)){ x_accel=0; } if((x_loc>7500)&&(x_accel>0)){
x_accel=0;
}
x_vel=limit(x_vel+x_accel,-MAXVELOCITY,MAXVELOCITY);
ADMUX=0xE1;
adcChannel=1;
break;
case 1: y_accel=(y_flat-ADCH)/10;
if((y_loc<500)&&(y_accel<0)){ y_accel=0; } if((y_loc>7500)&&(y_accel>0)){
y_accel=0;
}
//if((abs(y_accel)>1)||(abs(y_vel)>20)){
y_vel=limit(y_vel+y_accel,-MAXVELOCITY,MAXVELOCITY);
//}else{
// y_vel=0;
//}
ADMUX=0xE2;
adcChannel=2;
break;
case 2: z_accel=(ADCH-125);
ADMUX=0xE0;
adcChannel=0;
break;
default: adcChannel=0;
}

}

And the main loop:

while(1){

if((abs(x_vel)>STICTION)||(abs(y_vel)>STICTION)){
x_vel=(int)((ELASTICNUMERATOR*(long int)x_vel)/ELASTICDENOMINATOR);
x_loc+=x_vel;
y_vel=(int)((ELASTICNUMERATOR*(long int)y_vel)/ELASTICDENOMINATOR);
y_loc+=y_vel;
}
if(x_loc<0){ x_loc=-x_loc; x_vel=-x_vel; } if(x_loc>7999){
x_loc=7999;
x_vel=-x_vel;
}
if(y_loc<0){ y_loc=-y_loc; y_vel=-y_vel; } if(y_loc>7999){
y_loc=7999;
y_vel=-y_vel;
}
x_pos=(unsigned char)(x_loc/1000);
y_pos=(unsigned char)(y_loc/1000);
plotBall(x_pos,y_pos);
_delay_ms(50);

}

Syndicated 2009-06-26 04:03:08 from robotguy.net/Blog

23 Jun 2009 »

Mazetrix Update

I received the pcbs for Mazetrix and started the build. After 4 1/2 hours of troubleshooting I realized that I connected the SCK line to the wrong pin and finally managed to get AVR Studio to recognize the processor. Then I wrote enough code to verify the LEDs would all light up.  However I then started having problems with the firmware. Finally, during my 15 minute lunch today, I found the problem was the fuse settings in the ATMEGA128 (either 103 comaptibility mode or JTAG enabled).

I just added the 3-axis accelerometer, but haven’t soldered on the supporting components. Also I still need to add the Li-Po charge IC. I am currently using the STK500 both to power and program the board.

So without further ado, here are some pics…

Mazetrix project

Mazetrix project

Mazetrix Bottom

Mazetrix Bottom

Mazetrix Top

Mazetrix Top

Syndicated 2009-06-23 02:01:14 from robotguy.net/Blog

37 older entries...

 

jkkroll certified others as follows:

  • jkkroll certified bronson as Master

Others have certified jkkroll as follows:

[ Certification disabled because you're not logged in. ]

Robot of the Day

Nanomouse

Built by
Carl Kalkhof

Recent blogs

3 Sep 2010 AI4U (Observer)
1 Sep 2010 Mubot (Master)
31 Aug 2010 Flanneltron (Journeyer)
24 Aug 2010 jkkroll (Master)
22 Aug 2010 Roko (Apprentice)
20 Aug 2010 MissySB (Observer)
19 Aug 2010 svo (Master)
16 Aug 2010 The Swirling Brain (Master)
11 Aug 2010 robotvibes (Master)
10 Aug 2010 Pi Robot (Journeyer)
3 Aug 2010 steve (Master)
30 Jul 2010 botronix (Observer)
25 Jul 2010 Etoro_Bots (Observer)
22 Jul 2010 Bunnyfoo (Observer)
22 Jul 2010 Andra (Observer)
7 Jul 2010 jmhenry (Journeyer)
8 Jun 2010 AndyMass (Observer)
7 Jun 2010 Wes_Hewell (Apprentice)

Newest Members

3 Sep 2010 santhomos (Observer)
3 Sep 2010 wanghanzhi (Observer)
3 Sep 2010 caozhengwen (Observer)
2 Sep 2010 karnbharani (Observer)
1 Sep 2010 elan_arr (Observer)
30 Aug 2010 shristi (Observer)
30 Aug 2010 yagashooin (Observer)
30 Aug 2010 sarath_kumar (Observer)
29 Aug 2010 nicopasso (Observer)
29 Aug 2010 am-dv (Observer)
29 Aug 2010 ujrail (Observer)
27 Aug 2010 yvonne (Observer)
26 Aug 2010 MrRoboto1965 (Observer)
26 Aug 2010 817Robots (Observer)
25 Aug 2010 amitholmes (Observer)

Newest Robots

7 Aug 2009 Titan EOD
13 May 2009 Spacechair
6 Feb 2009 K-bot
9 Jan 2009 3 in 1 Bot
15 Dec 2008 UMEEBOT
10 Nov 2008 Robot
10 Nov 2008 SAMM
24 Oct 2008 Romulus
30 Sep 2008 CD-Bot
26 Sep 2008 Little Johnny
X
Share this page