Arduino Cult Induction release3 — Introducing the DORKBOARD!!!

July 12th, 2008


http://dorkbotpdx.org/Workshops/ACI3

They're HERE! (the Dorkboards have arrived)

July 10th, 2008

And if you want to build one out you can get to the next arduino cult induction on the 27th of this month.

Stepper Motor Control With Arduino/Wiring

July 10th, 2008

Here is a small example of using the arduino/wiring platform to control things in the real world.

A pretty good reference for the controlling stepper motors can be found at.

http://en.nanotec.com/steppermotor_animation.html

The following Circuit fleshes out the sketch at the site above.

And finally here is the sketch to make it go.

/* Rapha Roller Race Controller.
 * The Rapha Roller Race Controller is for a 4 bike 500 meter race The bikes are on rollers which
 * produce pulses. The pulses are used to drive a dial per bicycle which is controlled by
 * a unipolar stepper motor, the dials are geared such that two pulses two each one
 * motor half "step" results in 500 meters per complete revolution.
 *
 * This program uses wirings External Interrupt Mechanism. The program loop is used to
 * watch the control panel and move the dials to a starting position.
 *
 * NOTE: RABBID PROTOTYPE! This was done in a very make it work NOW mode.
 * I am certain there are more elegant solutions.
 *
 * Author Donald Delmar Davis, Tempus Dictum Inc.
 */

#define NMOTORS 4
#define NPINS 4
#define NSTATES 8
#define HALFSTEP 1
#define FULLSTEP 0
#define FORWARDSTEP  1
#define BACKWARDSTEP 0

/*------------------------------------------------------------------------------------
 * Pin Mapping
 */

#define SWITCH1PIN  34
#define SWITCH2PIN  35
#define SWITCH3APIN 49
#define SWITCH3BPIN 50
#define LEDPIN 48
#define BIKE1 36
#define BIKE2 37
#define BIKE3 38
#define BIKE4 39

int motorPins[NMOTORS][NPINS]= {
  { 11,  9, 10,  8  } , // ccw is forward
  { 15, 13, 14, 12  },
  { 20, 22, 21, 23  },
  { 16, 18, 17, 19  },
  //  { 8, 10,  9, 11}, // cw is forward
  //  {12, 14, 13, 15},
  //  {23, 21, 22, 20},
  //  {19, 17, 18, 16},
};

int pulsesPerStep=2;
volatile int pulseCount[4]={0,0,0,0};
volatile int pulseMod[4]={2,2,2,2};
int ledState = HIGH;
int switchState=LOW;
int delayTime = 10;

int motorState [NMOTORS] = {0,0,0,0};

int pinStates[NSTATES][NPINS]= {
  { HIGH,LOW ,LOW ,LOW   } ,
  { HIGH,HIGH,LOW ,LOW   },
  { LOW ,HIGH,LOW ,LOW   },
  { LOW ,HIGH,HIGH,LOW   },
  { LOW ,LOW ,HIGH,LOW   },
  { LOW ,LOW ,HIGH,HIGH  },
  { LOW ,LOW ,LOW ,HIGH  },
  { HIGH,LOW ,LOW ,HIGH  }
};

/* -------
*/
void stepit (int motorNum, int stepDir, int stepSize) {
  int stateSkip=2;
  int pin;

  if (stepSize==HALFSTEP) stateSkip=1;

  if (stepDir==FORWARDSTEP) {
    motorState[motorNum] += stateSkip;
    if (motorState[motorNum] >= NSTATES) {
      motorState[motorNum]=0;
    }
  }
  else {
    if (motorState[motorNum] < stateSkip){
      motorState[motorNum] = NSTATES-1;
    }
    else {
      motorState[motorNum] -= stateSkip ;
    }
  }

  for (pin=0 ; pin < NPINS ; pin++) {
    digitalWrite(motorPins[motorNum][pin], pinStates[motorState[motorNum]][pin]);
  }
}
/*---------------------------------------------------------------------------------setup()
 *
 *
 *
 */
void setup() {
  int motor;
  int pin;
  for (motor=0;motor<NMOTORS; motor++){
    for (pin=0; pin<NPINS; pin++){
      pinMode(motorPins[motor][pin],OUTPUT);
      digitalWrite(motorPins[motor][pin],pinStates[motorState[motor]][pin]);
    }
  }
  pinMode(LEDPIN,OUTPUT);
  pinMode(BIKE1,INPUT);
  pinMode(BIKE2,INPUT);
  pinMode(BIKE3,INPUT);
  pinMode(BIKE4,INPUT);
  pinMode(SWITCH1PIN,INPUT);
  pinMode(SWITCH2PIN,INPUT);
  pinMode(SWITCH3APIN,INPUT);
  pinMode(SWITCH3BPIN,INPUT);

  attachInterrupt(4, bike1, RISING); //
  attachInterrupt(5, bike2, RISING); //
  attachInterrupt(6, bike3, RISING); //
  attachInterrupt(7, bike4, RISING); //
//  Serial.begin(9600);             // Starts Serial to print data

}

/*-----------------------------------------------------------------------------------------
 ************************************* Interrupt Handlers *********************************

 */
/*----------------------------------------------------------------------------------bike1()
 */
void bike1() {
  //Serial.print("bike1 ");
  ++pulseCount[0];
  if ((--pulseMod[0]) == 0 ){
    stepit(0,FORWARDSTEP,HALFSTEP);
    pulseMod[0]=pulsesPerStep;
  }
}
/*-----------------------------------------------------------------------------------------
 */
void bike2() {
  //Serial.print("bike2 ");
  ++pulseCount[1];
  if ((--pulseMod[1]) == 0 ){
    stepit(1,FORWARDSTEP,HALFSTEP);
    pulseMod[1]=pulsesPerStep;
  }
}
/*-----------------------------------------------------------------------------------------
 */
void bike3() {
  //Serial.print("bike3 ");
  ++pulseCount[2];
  if ((--pulseMod[2]) == 0 ){
    stepit(2,FORWARDSTEP,HALFSTEP);
    pulseMod[2]=pulsesPerStep;
  }
}
/*-----------------------------------------------------------------------------------------
 */
void bike4() {
  //Serial.print("bike4 ");
  ++pulseCount[3];
  if ((--pulseMod[3]) == 0 ){
    stepit(3,FORWARDSTEP,HALFSTEP);
    pulseMod[3]=pulsesPerStep;
  }
}
/*-----------------------------------------------------------------------------------------
 ************************************* Main Loop ******************************************
 *---------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------------
 *
 */

void loop() {
  int currentMotor;
  currentMotor=(digitalRead(SWITCH1PIN)*2)+digitalRead(SWITCH2PIN) ;
  switchState=digitalRead(SWITCH3BPIN);
  if (switchState==HIGH) {
     stepit(currentMotor,FORWARDSTEP,HALFSTEP);
   }
   switchState=digitalRead(SWITCH3APIN);
   if (switchState==HIGH) {
     stepit(currentMotor,BACKWARDSTEP,HALFSTEP);
   }
   ledState=!ledState;
   digitalWrite(LEDPIN,ledState);
   delay(delayTime);
}

Cables for DorkbotPDX Programmers (updated for benito7g and dorkboards).

June 27th, 2008

In the course of the Arduino Cult Induction series and the group purchases, I have evolved several versions of the DorkbotPDX programmer and released them into the wild. Unfortunately the pinouts for the programming cable have evolved with the programmers so the cables are unique to each. With the batch of programmers we just purchased this will settle down Though the pinout may not make sense in this particular case it will be the same for at least 1000 boards.

Here is a quick guide to cables for the DorkbotPDX programming boards for the rbba and the dorkboard.

Benito7 rev G
(1000 Currently being released into the wild)

Benito7 rev a
(26 known to be in the wild 16 from Sunstone 10 hand rolled)

Cables for the benito7 should look like this.

Winston (rev3) — hand rolled,

(at least 50 known to be have been released into the wild)

The winston board was my first usb to serial programming board.

Rapha Race Controller

June 24th, 2008

Rapha Sportswear has a stationary race controller prototype that they need replicated for an event next week. The first step int this process was to break out the original design into 3 boards one for input processing one for the stepper drivers and one for the processor itself. Since the customer wanted to be able to modify the code themselves in the future and expand the system an Arduino or Wiring compatible board will be used.

(The completed project)

Motor Boards

The motor boards consisted of 4 darlington transistors on the best performing heat sinks I could find.

The I/O – Processor Board.

The I/O Processor board consisted of to schmidt triggers to clean up the input and a usb to serial connection for programming and future use. The board also has 3 free ports for future use.

Once More With Feeling.

June 16th, 2008

http://www.dorkbotpdx.org/files/cultinductionrev2.jpg
more information at http://dorkbotpdx.org/workshop/arduino/cult_induction_rev2

RSVP to DDelmarDavis at gmail.

Happy Birthday to Me!

June 12th, 2008

I am old. I won’t say how old exactly but I am half way through a few experiments. Life, work.

It makes me very happy that three of these experiments will be funded as Tempus Dictum Projects.

  1. The Dorkboard.

  2. The Benito Serial Programmer

  3. The Arduino Cult Induction Series.
    (Next Induction Sunday June 22)

I would like to thank Tempus Dictum for the opportunity to work on these items.

I am a very lucky man.

Happy Birtday to Me!

June 12th, 2008

I am old. I won’t say how old exactly but I am half way through a few experiments.

Three of these experiments will be funded as Tempus Dictum Products.

  1. The Dorkboard.

  2. The Benito Serial Programmer

  3. The Arduino Cult Induction Series.
    (Next Induction Sunday June 22)

I would like to thank Tempus Dictum for the opportunity to work on these items. I am a very lucky man.

This is clearly Jasons Fault.

June 10th, 2008

See I can bend things

Write Locally Post Globally

June 3rd, 2008

I like wordpress.

It allows me to do much of what I post on the web without having to look at the underlying html and still letting me at the html. In fact I use WordPress to to post on Dorkbots Drupal pages. It is easier than hand rolling html and the new wordpress saves your drafts. This is no small issue: As I was reminded at 2:30 monday morning as Drupal timed out the session that I was writing on and ate my post. Between that and the Eagle files I was working with I lost most of sunday nights sleep. The other issue is portability.  So last night I ran up mysql, unpacked the latest wordpress into my home directory and reconfigured the apache daemon that comes with leopard.

I plan to get more done and loose less sleep.