Posts Tagged ‘motor’

Connecting to two Arduinos at once to drive four stepper motors

Sunday, July 29th, 2012

I’m really starting to love Java. It’s so easy! Here I’ve taken the code for the Drawbot and modified it a little so that it will run my new project. From here I’ve got control over 4 motors and it’s no big stretch to reach for 6 or more.

The biggest challenge will be keeping the NEMA17 stepper motors from getting criss-crossed in my new application. I think I’m going to take a page out of the Burning Man city plan and name each motor 10:00, 2:00, 4:30, and 7:30. Then +X will be 3:00 and +Y will be 12:00.

Almost as important as doing the job as advertised, I’ve got to get my robots looking really slick and professional. Appearance and PR are starting to be a big concern – if I don’t market well, I don’t sell, and I need to sell if I intend to keep doing what I love.

Gimbal: Off the shelf parts have arrived

Wednesday, May 16th, 2012

I’ve also got an Arduino, some motor drivers, a 9DOF sensor, and a mess of wires. I’ll probably need at least one more trip to Lee’s for a few more bits and bobs and then I’ll be able to assemble the first test rig.

Would you like to know more? Contact me or comment below.

Drawbot: Automatic Calibration Update

Friday, May 4th, 2012

I had it stuck in my head that I needed to use digital pins to read the value of the switches. On Thursday I downloaded the Adafruit Motor Shield EAGLE schematic and layout files and started reading, only to discover that the empty holes on one corner of the board are intended for analog sensors.  In about an hour I got the switches and the auto-calibration code written & tested.  Victory!

To add the limit switches to your Drawbot, you will need:

  • some female headers
  • a soldering iron
  • two limit switches
  • 2 two-foot lengths of wire in red
  • 2 two-foot lengths of wire in black
  • 2 two-foot lengths of wire in green
  1. The headers I got came in a 20-pack.  I only needed the sets of three so i cut with some pliers and filed them down.
  2. Unplug your Drawbot completely.  Remove the shield from the Arduino.  You may find it easier to remove the stepper wires, too.
  3. In one corner of the motor shield you will see white letters that say “+5/GND/A0-5″.  You want to solder one set of pins into each of the three holes on the right.  I use a set of helping hands to hold the board sideways, then placed the +5 triplet in first.  After soldering it in place I repeated the process with the GND and then the A3/A4/A5 pins.
  4. I soldered one red, one black, and one green wire to a switch. The green is soldered to the C pin that connects to A5. The red is soldered to NC which is connected to +5V. The black is soldered to NO which is connected to GND.  This is now my right limit switch.
  5. I soldered one red, one black, and one green wire to the other switch. The green is soldered to the C pin that connects to A3. The red is soldered to NC which is connected to +5V. The black is soldered to NO which is connected to GND.  This is now my left limit switch.
  6. Grab a copy of the experimental branch from Github.
  7. Reassemble & connect your Drawbot.
  8. Test your limit switch to make sure you solder it in the correct way using the sketch in the download package @ ./arduino/test_switch/test_switch.ino.  The limit switches are wired as “on” by default – when the switch is hit they turn off and the machine thinks it has made contact.  If you have no switch or a bad connection the machine will think you are touching the switch already. You should only see one message from each switch when they are pressed or released. Any more and the switches are “debouncing” which will require a breadboard and some 10k resistors to fix.
  9. Upload the new Drawbot code (./Arduino/arduino.ino) code to your Drawbot.
  10. Either
    • Type “HOME;” in the serial window or
    • Choose “HOME” in the Java app

    Drawbot motors should begin to move the plotter towards the left motor.  When the left limit switch is touched it will reverse direction and move until it touches the right limit switch.  Now the robot knows exactly how much string has been released and it can move the plotter to the (0,0) position automatically.

What are “steps per turn”?

Wednesday, February 22nd, 2012
Dear Dan,
Recently I am working on the Delta Robots. I look your forward and inverse Kinematics of the delta robots and it help me a lot.
In your application of forward and inverse kinematics there is a term “Steps per Turn” and this term in controlling the resolution.
What do you mean by this term ?
I am implementing this kinematics in MATLAB. How I can implement this “Steps per Turn” in my code or how I can calculate the resolution in my case.
I use three NEMA17 stepper motors to control movement of my robot.  Hobby servos have 256 positions in 180 degrees.  My steppers have 3200 steps per turn. I calculate resolution as distance tip moves when servo makes one step.  Better would be to calculate all steps at all positions and find max/min but this is javascript and it would probably kill your browser.  I have some code in the open source project that calculates the exact shape of the envelope.  It could easily be expanded to calculate the min/max step (which might not be the same size everywhere in the envelope).

How do I Drive a High Amp Stepper Motor from an Arduino?

Saturday, November 5th, 2011

What you want are drivers from CNC machines like automated lathes, mills, and routers. Your Arduino will be the encoder generating the pulses that tell the drivers when to move each stepper.

When you build your machine, you’ll need code to make it move. My code contains a virtual model of my machine. When I want to move the machine to XYZ, my code adjusts the virtual model, figures out where the steppers need to be to make that happen, and then instructs the Arduino what to do. Going from model->steppers is known as Inverse Kinematics. Forward Kinematics is when you go steppers->model: You know what the steppers are capable of and what they’re doing right now, and from that you figure out what the virtual model is doing. It is often a lot more challenging to calculate but it pays off in other ways – like it helps you calculate how accurate your machine will be if you use parts AB&C.

If you design your machine in a program like Alibre or SolidWorks then you’ve already got a virtual model, which makes things a lot easier.

More than that I can’t really tell you because
a) It depends on your implementation and
b) I’m in talks to build some similar machines myself

I hope that helps!