eBay Mini-vacuum Pump

Quick version: Hey this little thing works and seems practical for robotics, specifically the Pop Can Challenge.

I had to add “mini” to the title of this post, calling this a vacuum pump seems odd when you’ve played around with big pumps. Which leads me to make a mental note to share some information my industrial vacuum pump sometime; my big pump is currently at the SnoCo Makerspace but it seems it gets used as hold-down weight on glue-ups more than it’s intended use but at least it’s getting some love.

I moved workshops; I swear this is related… The kids are at an age were it’s hard for me to get out to my workshop for very long and Melissa works in the evenings right now so I just wasn’t getting any fun-stuff done. I’ll shoot another workshop video… soon-ish. I’ve been slowly filtering through my bins of incomplete or never-started projects in and sorting through it all to bring some organization into my “inside workshop”. In digging through the bins I recently came across most of this eBay purchase: https://ebay.us/2L8SOa . If you want to skip on clicking the link it’s a small motor/vacuum pump with a suction cup grabber. I bought this for PopBot after the 2019 Robothon. I put this aside because I’ve been working on PopBot and a second marine-based robot platform for the last two months. PopBot is getting a deep drive because the SRS Robothon (2020) https://robothon.org/ has been cancelled this year. The thought is I might be able to grab the PopCan with a suction cup instead of actively grabbing it, or in my case I was going to sort hug it/lasso the pop can; time will tell on this. My initial concern is current draw, thankfully thing only pulls a couple hundred milliamps and then it’ll hold it’s suction fairly well for a while. I noticed a solid drop off in current after the suction was “successful”. I would have thought it opposite but I guess based on looking at current curves on squirrel cage fans and seeing them unload without air flow I’ll accept it without figuring out why. My goal is to grab the can with a pair of suction cups, drop the motor PWM or turn it off once the suction is maintained (as determined by current) and then just provide a couple moments of pumping to maintain suction while transporting the can. For testing I came up with a quick little circuit with a Pololu DC motor driver (#2961) and an Adafruit i2c IN219 current sensor breakout board… don’t mind all the other stuff strapped to the MEGA in the photo below. It was on my bench for some sensor fusion testing. The INA219 is hooked up to the i2c ports (20/21) on the MEGA2560 and the motor driver is getting a PWM drive from Pin 6. I didn’t need to use the enable or direction, I just sunk the enable low. The amount of suction is quite adequate if you’re a 14 year old boy trying to get popular by giving yourself a hickey…. this is not recommended of course and mostly a guess as I have 4-day-old vacation stubble so there is no sense in trying.

The code for testing is at the end of the post, anyone with a couple hours of experience with Arduino IDE could whip this out in 10 minutes but just in case you were hoping to save 9-1/2 minutes…

/*  @chasihler iradan.com
 * 
 * 0.1 2020/08/20 Test
 * 
 * INA219 test w/ Vacuum Pump
 * Most of this is from the adafruit library example. 
 * 
 */


#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;

int motor_pwm_pin = 6;
int motor_enable_pin = 7;

int int_stop = 0;
int int_lowSpeed = 950;
int int_highSpeed = 1023;

void setup() {
  Serial.begin(115200);
    
  pinMode(motor_pwm_pin, OUTPUT);
  pinMode(motor_enable_pin, OUTPUT);

    if (! ina219.begin()) {
      Serial.println("Failed to find INA219 chip");
        while (1) { delay(10); }
    }
      //ina219.setCalibration_32V_1A();
      //ina219.setCalibration_16V_400mA();
}

void loop()  {
  float shuntvoltage = 0;
  float busvoltage = 0;
  float current_mA = 0;
  float loadvoltage = 0;
  float power_mW = 0;
  Serial.println("No Load Test");
  Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
  Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("");
  
  analogWrite(motor_pwm_pin, int_lowSpeed);
  delay(1000);

  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);

  Serial.println("Low Speed Test");
  Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
  Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("");
    
  delay(1000);
  analogWrite(motor_pwm_pin, int_stop);  //stop
  delay(5000);
  analogWrite(motor_pwm_pin, int_highSpeed);
  delay(1000);

  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);
  
  Serial.println("Full Speed Test");
  Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
  Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println(""); 
     
  delay(2000);
  analogWrite(motor_pwm_pin, int_stop);  //stop
  delay(10000);
}

Programming ESC with Arduino

The story: I hit a break wall with ODrive. ODrive is an open source brushless DC motor (BLDC) driver built with robotics in mind (my application..). I don’t have faith in the project and after months of trying to make it fit my application I’m abandoning it. It’s painful to spend that kind of money on a product (two even!) … but I’m not hopping back on the Stepper bandwagon just yet. I’ll see if I can put my brushless DC motors to use on PopBot 0.5.

First step was deciding on if I could use an off the shelf ESC or buy one. I purchased a RC “rockcrawler” driver as I assumed the firmware would be most compatible with my application. The car and boat ESCs have forward and reverse speed by splitting the PWM servo input in half. While waiting on shipping I found an ESC for a boat and a few for quads in one robot junk bins. Quads are single directions but the boat one was good enough for testing. It had no torque in the low end but that’s not a surprise based on the application with the motor type. I needed a way to program this ESC without a controller and receiver. Programming is typically performed w/ the receiver/controller by pushing the speed to min-max in a certain order. Well that can be done with the arduino of course. Here is a super simple piece of code for you if you don’t want to reinvent the wheel. This will also allow you to control your ESC once it’s programmed and you can uncomment my basic acceleration code if desired.

Hook up the ESC control signals (servo input). On the ESC the white (signal in, sometimes I think the alternate color is orange?) to digital output 9 on the Arduino Uno or Mega. Tie the black (or brown) wire to one of the grounds. DO NOT HOOK UP RED. We don’t need the power from the ESC.. it’s usually not something we want anyways (like 6V… ).

You’ll need this library. Download it and place the uncompressed directory in your Arduino libraries directory.

https://github.com/maxpowel/ESC

/*
 * Charles Ihler, iradan.com
 * 2020-04-27 build from example of library. 
 * 
 * Open the serial monitor... enter 0 (and enter) for reverse
 * 1 for foward and 2 for idle/stop.. 
 * Most ESCs want a motor hooked up or warn of damage.. make sure the motor is safe and can't spin off and hurt something. 
 * 
 */

#include <Servo.h>
#include "ESC.h"



ESC esc(ESC::MODE_FORWARD_BACKWARD);


int sel = 0;
String ssel;

void setup() 
{
  Serial.begin(115200);  
  pinMode(LED_BUILTIN, OUTPUT);
  esc.attach(9); //change to some other PWM pin if required

} 

void output_high() {
   digitalWrite(LED_BUILTIN, HIGH);
   esc.setDirection(ESC::FORWARD);
   esc.setSpeed(500);   //comment this out and uncomment below for acceleration. When test running motor.
   //for (int i = 0; i <= 150; i++) {
   //   esc.setSpeed(i);
   //delay(25);
   //}
}
void output_low() {
  digitalWrite(LED_BUILTIN, LOW);
  esc.setDirection(ESC::BACKWARD);
  esc.setSpeed(500);   //comment this out and uncomment below for acceleration. When test running motor.
  //  for (int i = 0; i <= 150; i++) {
  //    esc.setSpeed(i);
  //  delay(25);
  //}
}
void output_n() {
  digitalWrite(LED_BUILTIN, LOW);
  esc.setDirection(ESC::BACKWARD);
  esc.setSpeed(0);
}
void loop() 
{
    Serial.print("Forward (1), Reverse (0), Stop/N(2)?(1/0/2): "); 
    while (Serial.available() == 0) {}  
    ssel = Serial.readString();  
    Serial.print(" --> ");
    Serial.println(ssel);
    sel = ssel.toInt();
    if (sel == 1) {
      output_high();
      Serial.println("ON!");
    }
    if (sel == 0) {
      output_low();
      Serial.println("OFF.");
    }
    if (sel == 2) {
      output_n();
      Serial.println("Neutral");
    }
  delay(100);

} 
The setup project with motor removed.

Enjoy…

Project Update: Spunk The Annoying Robot

The last robot I built was a Roomba Sumo Robot (Talos) for a small competition with co-workers. While collecting parts for this little eBay robot platform I got for somewhere in the neighborhood of 15$USD, I grabbed my Pololu motor controller and remember that I wrote that whole Sumo robot in ASM; that was a lot of code between two PICs.

The little robot I’m building now has very few specifications. It’s goal in life is to follow you around, but not too close. It should back away when needed and basically run around, pausing for a while in its search for someone to follow around. My wife named it Spunk because she’s certain to be the one it annoys most.

I’ve built the project as seen in the photo and written all primary code.. ordered a lot of battery management parts to see what I like the best. Determined I can’t get the robot to “find” people with the sensors I have, so I ordered more… so this little guy is half-done. I’ll shelve him until more parts arrive. I really only grabbed it down as it was 4 projects deep in the to-do list because I haven’t kept up with pre-ordering parts, or worse.. ordered the wrong things. I’m still on the hunt for a better display for the WX radio, ordered items for my RS-485 project, etc. etc..

The heart of Spunk is a PIC 18F14K22 on a TAUTIC 20 pin development board. Maybe Jayson ( @TAUTIC ) needs to pay me for all this advertising? 😉 jk.. I just bought a couple of the boards because they fit my type of prototyping perfectly. This was my last one… time to make an order over at @tindie for some more.

Spunk getting probed.
Spunk getting probed.

For now, no code. I’ll post the old ASM code for the Pololu motor controller and the C code as well once it get it properly commented and make sure it at least mostly works. Once I do some real roving tests I’ll throw it on YouTube (and maybe the first tests of Talos as well)… TBC for now.

..workbench chatter

Melissa and I have been out of town for a little while. I was hoping to blog on the road but it just didn’t happen. That midwest weather is in a nasty way; I don’t miss winter weather at all. So I have a little more work on two posts I’m working on but I wanted to update the blog for if no one else myself. I need a little brain purge… I have a lot of stuff to work on.

When I got home I had a dozen and a half packages or so from China. A ton of fun stuff.. most of it was for the little robot I’m working on. I also brought back a ton of stuff from my house (in a storage room) that I have left behind.

On our travel across county we stopped by our house in South Dakota and picked up a bunch of our items in storage. I brought back a few boxes of miscellaneous electronics including a lot of older projects I built years ago.
On our travel across county we stopped by our house in South Dakota and picked up a bunch of our items in storage. I brought back a few boxes of miscellaneous electronics including a lot of older projects I built years ago.

 

Look at that pile of stuff! A part of one box of old projects I built. Only a few more boxes to go! I got excited about a bunch of copper clad board that turned out to be really cheap; lame!

While out of town a mailbox and a half of sensors arrived from China (eBay)! Time to get building.
While out of town a mailbox and a half of sensors arrived from China (eBay)! Time to get building.

 

Sensors! I guess it’s time to get building. I’m not sure what I’ll use.. I’ll just tinker around until I find what I like.

So I've etched PCBs by sharpie.. I've used the tape and stencils... even photo etching which provided decent results. With all the talk in the IRC chat room I finally decided I needed to try out this professionally built business.
So I’ve etched PCBs by sharpie.. I’ve used the tape and stencils… even photo etching which provided decent results. With all the talk in the IRC chat room I finally decided I needed to try out this professionally built business.

 

“My first PCB”… that I didn’t etch myself. The white stencil isn’t right but I knew it would be that way and I was in a hurry to get it on the way. It looks great. I haven’t checked out all the circuit paths but everything looks good. I decided on OSH Park because he is local-ish and seems like a decent guy. The preview feature is nice on his site.. and the price was reasonable. (yeah, I know.. it’s just a proto-board.. I didn’t build it for any specific reason).

Check out the motor controller heatsink!
Check out the motor controller heatsink!

 

Finally I got these tiny heat sinks I ordered .. (look at the motor controller on the robot platform). The motor controller is the same one I used for my Roomba Sumobot… it got very hot a few times I’m hoping to avoid those issues this time around with this heatsink that comes with some sticky stuff that hopefully conducts heat well. It was a 10 pack.. pretty cheap.

That’s it! I need to get along with my other posts…next week I’m out-of-town for training; maybe I’ll get something done then? 🙂

Quickstart guide to a basic PIC based robots – Part 1

While browsing for “goodies” on eBay I ran across a $9 robot chassis. How can you go wrong for $9? I haven’t built a robot since Talus my sumo Roomba, so I thought why not.

If you’re looking for something like the model I purchased, check out eBay and do a search for “Robot Chassis”.  Adam Fabio of TheRegnineer.com mentioned he has almost completed working on a product that is similar. I’m guessing you can look for Adam’s product at his Tindie Store once he has finished it.

.. Fast forward three weeks for shipping from China.

None of my sensors have arrived but you’ll end up wanting to customize you robot for whatever sensor pack you are interested in anyhow. With that said I haven’t written any code for handling any sensors and at the end of the day this robot is just going to drive straight forward all day long. You can follow the code at the repository I set up for it on github to get the latest updates at…

The software:

https://github.com/chasxmd/16F1509_Rover_Robot

The hardware:

I’m using the TAUTIC 20 pin PIC development board as it’s only $10 and takes care of the reset switch capacitor and comes on a nice plug-in board if you solder the connectors the same way I did. Use whatever you like but notice I’m using an internal oscillator so you don’t have to worry about getting a specific development board or having a crystal.

I’m also using the Pololu Quick 2s9v1 Dual Serial Motor Controller which is cost me $25, a little on the high side, but I had one from another project so I’m just re-using it and it makes life a lot easier for development.

Check out the photo at the bottom of the post for the basic schematic.

Beginners:

If you don’t already have MPLABX you’re looking at an upwards battle. However if you don’t mind watching a few YouTube videos it’s not up a creek.

1. Download and install MPLABX and the HI-TECH C compiler.

2. Start a project within MPLABX; selecting PIC 16F1509 and choosing the HI-TECH compiler, and create a main file.

3. Copy my code off the github site and drop it into your main file and compile.

You can download the free version of HI-TECH C and MPLABX which is also free. They are both obtained from http://www.microchip.com. MPLABX is an IDE (integrated development environment) which means it’s a program for programming, compiling and loading your software. HI-TECH is a C compiler which works with MPLABX. There are other programming language options such as BASIC and even assembly (I use assembly most of the time). I don’t know of any free BASIC compilers but I’m guessing someone has one. Google might be your best friend if  you’re looking to go that route.

If you don’t have MPLABX you probably don’t have a PICKit 3 (or other hardware programming tool). I like the PICKit 3 because it will program all the newer Microchip PICs and it’s just about the most affordable tool for PICs. PICKit3 comes from Microchip or Digi-key. There are alternatives.

The Build:

It took me about 30 minutes to put the chassis kit together last night. It was pretty obvious how it went together which was good because there were no directions. The encoder wheels don’t really attach other than compression, I see issues with that if I end up using them… that’s what you get for $9?

The code I put together this morning in about an hour or two after reviewing the manual for the motor driver online; you should also review this document. The idea with the code was just to test the motors and motor driver. I also selected a high/half/normal speed which you can adjust for your motor’s needs. I believe the highest speed setting you can select is 0x7F, I chose 0x4F for my high speed based on my anticipated desire. Adjust as needed.. but keep in mind your low speed should be set so it doesn’t stall on carpet or whatever you want your robot to be driving around on.

That’s about it for now. Once I get some sensors in I’ll add them and then write the code. I’m still new to C programming but I felt it was a better choice since it seems most popular; I usually write everything in assembler. Check out the photo I posted as it has a basic layout of the circuit and how I set mine up on a breadboard until I receive some prototyping PCBs I ordered.

First step of my cheap chassis robot build... getting the motors turning.
First step of my cheap chassis robot build… getting the motors turning.

 

…. to be continued

Weekend stepper fun!

20131004-130715.jpg

I got got home to take delivery of this front end frame piece. Now I’ll be busy this weekend working on electronic steering. The PIC 16F1509 will be controlling all steering functions. I’ve written a remarkable amount of code for how long it’s been since I worked I a project with a F628A and 18F1330 motor control for the Roomba sumo bot. This project has gotten painfully expensive despite scoring some nice freebies. I spent way too much on wire because I want MTW or Teflon.

%d bloggers like this: