Posts with «servo» label

Arduino Absentmindedly Blows Bubbles

If you ever wanted to make an occasion festive with bubbles, [Sandeep_UNO] may have the project for you. As you can see in the video below (and, yes, it should have the phone rotated and it doesn’t), his Arduino uses a servo motor to dip a bubble wand into soap solution and then pulls it in front of a fan. The entire operation repeats over and over again.

There’s not a lot of detail and no code that we could find, but honestly, if you know how to drive a servo motor from an Arduino, the rest is pretty easy to figure out. Look closely at the motion of the robot. What is often accomplished with a spinning wheel of bubble wands and a constant fan becomes much more interesting when applied intermittently. The lazy cadence is what you expect to see from human operation and that adds something to the effect.

We’ve seen faster bubble blowers, but they were not so simple. We’ve even looked at other bubble-blowing robots. If you want to find out more about servo motors in general, our own [Richard Bauguley] has what you need to know.


Filed under: Android Hacks
Hack a Day 31 Jul 00:01

A Pi Robot Without a Hat

Daughter boards for microcontroller systems, whether they are shields, hats, feathers, capes, or whatever, are a convenient way to add sensors and controllers. Well, most of the time they are until challenges arise trying to stack multiple boards. Then you find the board you want to be mid-stack doesn’t have stackable headers, the top LCD board blocks the RF from a lower board, and extra headers are needed to provide clearance for the cabling to the servos, motors, and inputs. Then you find some boards try to use the pins for different purposes. Software gets into the act when support libraries want to use the same timer or other resources for different purposes. It can become a mess.

The alternative is to unstack the stack and use external boards. I took this approach in 2013 for a robotics competition. The computer on the robots was an ITX system which precluded using daughter boards, and USB ports were my interface of choice. I used a servo controller and two motor controllers from Pololu. They are still available and I’m using them on a rebuild, this time using the Raspberry Pi as the brain. USB isn’t the only option, though. A quick search found boards at Adafruit, Robotshop, and Sparkfun that use I2C.

This approach has challenges and benefits. A stack of daughter boards makes a neat package, where external boards makes a tangle of wires. Random sizes can make mounting a challenge. Providing power can also be a hassle because of the random placement of power pins. You can’t rely on USB power, especially from a Raspberry Pi whose USB is power limited.

On the other hand, external boards can offload processing from your main processor. Once a command is sent, these boards handle all the details including refresh requirements. They are likely to provide capabilities beyond the microcontroller software libraries since their processors are dedicated to the task.

I am using an 18-channel board from the Pololu Maestro Servo Controller family of boards that control from 6 to 24 servos using a single board. You might find the Adafruit 16 channel I2C board a useful alternative. For motor control I turned to the Pololu Simple Motor Controller family using one that will handle 18 amps. Others will handle from 7 to 25 amps. Or consider the Sparkfun Serial Controlled Motor Driver. Another source for USB controllers is Phidgets. I experimented with one of their spatial devices for the original robot. I should have used it to measure the tilt since one of my robots rolled over on a hill. Ooops!

Servo Control

The board currently installed on my robot is the Mini Maestro 18. The Maestro provides control over the servo speed, acceleration and movement limits. A home position can be set for startup or when errors occur. You can even do scripting or set movement sequences to play on command.

On the hardware side, the Maestro also allows channels to be used for digital input or output, and some channels for analog input. On some there is one channel for pulse width modulation output. An onboard regulator converts the servo power input to the voltage needed by the processor, simplifying part of the power distribution challenge.

My previous robot used the Maestro to control pan and tilt servos for camera positioning, a servo to lift samples from the ground, and a safety LED. Two analog inputs from current sensors on the motors helped avoid burnout during stalls, and four inputs from a simple RF key fob transmitter provided control. The latter came in handy for testing. I’d program a test sequence such as starting a 360° camera scan for landmarks or drive onto the starting platform and drop the sample. A button press on the key fob would initiate the activity. One button was always set up as an emergency halt to stop a rampaging robot. The rebuild is following this pattern with some additions.

Motor Controller

The two Simple Motor Controllers (SMC) each handled the three motors on either side of the Wild Thumper chassis. The SMC does more than just control the motor speed and direction. You can set acceleration, braking, and whether forward and reverse operate at the same or different speeds. The board monitors a number of error conditions for safety. These stop the motor and prohibit movement until cleared. Such blocking errors include lost communications, low input voltage, or drivers overheating.

An additional capability I found extremely helpful is the ability to read signals from a radio control (RC) receiver. These signals can be used to control the motor and, with some cross wiring between two controllers, provide differential drive control. This is useful for driving the robot to a new location using an RC transmitter. I didn’t use the RC inputs directly. Instead I read the RC inputs and issued the control commands from my program. This let me monitor the speed in my program logs for correlation with the other logged data. I also used an input to command the robot into autonomous or RC control operations. There are also two analog inputs that can be used to directly control the motor and can be read through commands.

Serial Communications

USB ports were my choice for communications but there is also a TTL level serial port with the standard RX and TX pins. This port can be used by the Raspberry Pi, Arduino, or any other microcontroller that has a TTL serial port.

The Maestro boards using USB appear as two serial ports. One is the command port that communications with the Maestro processor. The other is a TTL port. This port can serve as simply a USB to TTL serial port converter to allow communications with other boards, even from another vendor. Another use of the TTL port is to daisy chain Pololu boards. I could attach the SMC boards in this manner and save two USB ports for other devices. These boards support this by having a TXIN pin that ANDs the TX signal from the connected board with the TX on the board.

Both of these controllers support a few different communications protocols. I use the one Pololu created and is available on some of their other products. The command details are different between the boards, but the basic command structure is the same. They call it their binary protocol, and the basic format follows:

0xAA, <device address>, <command>, <optional data>, <crc>

All the fields are single bytes except for the data field which is frequently 2 bytes to transmit 16-bit data. The returned data is only one or two bytes with no additional formatting. Note they provide for detecting errors in the message by using a CRC (cyclical redundancy check). This is probably not critical over USB but a TTL line might receive noise from motors, servos, and other devices. A CRC error sets a bit in the error register that can be read if the command is critical.

I wrote my own code, C++ of course, for the PC and converted it just now to the Raspberry Pi. The main change is the different serial port code needed by Linux and Windows. Pololu now provides Arduino source for the protocol making it easy to use these boards with that family of controller boards.

Wrap Up

The chassis, Pi, and these boards are now installed on the Wild Thumper chassis along with a pan and tilt controlled by servos. A safety LED is on when power is applied and flashes when the robot is actively controlling the system. A LiPo battery powers all but the Pi because I need to configure a battery eliminator circuit to provide five volts. I’m powering it temporarily using a USB battery pack.

A test program, cross compiled from my desktop, moves the robot forward, pivots left than right, and then reverses. The pan / tilt moves and the LED flashes. I originally used a web camera for vision processing but will switch to the Pi camera since it is better. The Neato lidar discussed in a previous article will soon find a place onboard, along with an accelerometer to detect possible rollovers.

I’m sure I could have done this using Pi daughter boards despite the challenges I mentioned earlier. There are trade-offs to both approaches that need to be considered when working on a project. But there is one final advantage to the external boards: they have a lot of twinkly LEDs.

Product photos from Pololu.


Filed under: Arduino Hacks, Raspberry Pi, robots hacks

Venduino Serves Snacks, Shows Vending is Tricky Business

Seems like just about every hackerspace eventually ends up with an old vending machine that gets hacked and modded to serve up parts, tools, and consumables. But why don’t more hackerspaces build their own vending machines from scratch? Because as [Ryan Bates] found out, building a DIY vending machine isn’t as easy as it looks.

[Ryan]’s “Venduino” has a lot of hackerspace standard components – laser-cut birch plywood case, Parallax continuous rotation servos, an LCD screen from an old Nokia phone, and of course an Arduino. The design is simple, but the devil is in the details. The machine makes no attempt to validate the coins going into it, the product augurs are not quite optimized to dispense reliably, and the whole machine can be cleaned out of product with a few quick shakes. Granted, [Ryan] isn’t trying to build a reliable money-making machine, but his travails only underscore the quality engineering behind modern vending machines. It might not seem like it when your Cheetos are dangling from the end of an auger, but think about how many successful transactions the real things process in an environment with a lot of variables.

Of course, every failure mode is just something to improve in the next version, but as it is this is still a neat project with some great ideas. If you’re more interested in the workings of commercial machines, check out our posts on listening in on vending machine comms or a Tweeting vending machine.

[via r/arduino]


Filed under: Arduino Hacks, misc hacks
Hack a Day 02 Jul 21:01

Arduino Meets da Vinci in a Gesture-controlled Surgical Robot

Lots of us get to take home a little e-waste from work once in a while to feed our hacking habits. But some guys have all the luck and score the really good stuff, which is how these robotic surgical tools came to be gesture controlled.

The lucky and resourceful hacker in this case is one [Julien Schuermans], who managed to take home pieces of a multi-million dollar da Vinci Si surgical robot. Before anyone cries “larcency”, [Julien] appears to have come by the hardware legitimately – the wrist units of these robots are consumable parts costing about $2500 each, and are disposed of after 10 procedures. The video below makes it clear how they interface with the robot arm, and how [Julien] brought them to life in his shop. A quartet of Arduino-controlled servos engages drive pins on the wrist and rotates pulleys that move the cables that drive the instruments. A neat trick by itself, but when coupled with the Leap Motion controller, the instruments become gesture controlled. We’re very sure we’d prefer the surgeon’s hands on a physical controller, but the virtual control is surprisingly responsive and looks like a lot of fun.

When we talk about da Vinci around here, it’s usually in reference to 3D printers or a Renaissance-style cryptex build. Unsurprisingly, we haven’t featured many surgical robot hacks – maybe it’s time we started.

[via r/arduino]


Filed under: Arduino Hacks, Medical hacks

Mechaduino- Closed Loop Stepper Servos For Everyone

Is it something in the water, or have there been a lot of really cool servo projects lately? Mechaduino is a board that sits on a regular stepper motor and turns it into a servo with a closed loop control of 0.1degree.

Whenever we post something about using cheap brushless motors for precision control, someone comments that a stepper is just a brushless motor with a lot of poles, why not just control it like one. That’s exactly what the Mechaduino does. They also hint at doing something very clever with a magnetic encoder on the board which allows them, after a calibration routine, to get the accuracy they’ve promised.

T
he Arduino-sounding bit of the name comes from their full compatibility with the Arduino development environment. The brains of the board is the compatible,  SAMD21 ARM M0+  chip. They wanted the board to be as accessible as possible. On top of this, it also allows the user to use any control algorithm they want for the board. Most industrial controllers are limited to PID control, for returning to the last sent position. Opening up the control allows for interesting applications, such as motors that behave like mass spring damper systems, or electronically gearing the input of one stepper to the output of another.

The board supports lots of standard communication protocols, but the acceptance of regular stepper inputs make it extra interesting. It can become a drop-in replacement for the motors on a normal CNC or 3D printer, which have full closed loop control as shown in the video after the break.

They intend to keep working on the project until it gets to a level where they could kickstart it. However, rather than vaguely promise an open source release sometime after the launch like some have done, interested readers can skim all the design files off their GitHub and get to playing with it today. Firmware and Hardware.


Filed under: cnc hacks

Cardboard And Paperclip CNC Plotter Destined For Self-Replication

Last November, after [HomoFaciens]’ garbage-can CNC build, we laid down the gauntlet – build a working CNC from cardboard and paperclips. And now, not only does OP deliver with a working CNC plotter, he also plans to develop it into a self-replicating machine.

To be honest, we made the challenge with tongue firmly planted in cheek. After all, how could corrugated cardboard ever make a sufficiently stiff structure for the frame of a CNC machine? [HomoFaciens] worked around this by using the much less compliant chipboard – probably closest to what we’d call matboard here in the States. His templates for the machine are extremely well thought-out; the main frame is a torsion box design, and the ways and slides are intricate affairs. Non-cardboard parts include threaded rod for the lead screws, servos modified for continuous rotation, an Arduino, and the aforementioned paperclips, which find use in the user interface, limit switches, and in the extremely clever encoders for each axis. The video below shows highlights of the build and the results.

True, the machine can only move a pen about, and the precision is nothing to brag about. But it works, and it’s perfectly capable of teaching all the basics of CNC builds to a beginner, which is a key design goal. And it’s well-positioned to move to the next level and become a machine that can replicate itself. We’ll be watching this one very closely.

The HackadayPrize2016 is Sponsored by:

Filed under: cnc hacks, The Hackaday Prize

Circuit Bender Artist bends Fresnel Lens for Art

Give some mundane, old gear to an artist with a liking for technology, and he can turn it into a mesmerizing piece of art. [dmitry] created “red, an optic-sound electronic object” which uses simple light sources and optical elements to create an audio-visual performance installation. The project was the result of his collaboration with the Prometheus Special Design Bureau in Kazan, Russia. The inspiration for this project was Crystall, a reconstruction of an earlier project dating back to 1966. The idea behind “red” was to recreate the ideas and concepts from the 60’s ~ 80’s using modern solutions and materials.

The main part of the art installation consists of a ruby red crystal glass and a large piece of flexible Fresnel lens, positioned in front of a bright LED light source. The light source, the crystal and the Fresnel lens all move linearly, constantly changing the optical properties of the system. A pair of servos flexes and distorts the Fresnel lens while another one flips the crystal glass. A lot of recycled materials were used for the actuators – CD-ROM drive, an old scanner mechanism and old electric motors. Its got a Raspberry-Pi running Pure Data and Python scripts, with an Arduino connected to the sensors and actuators. The sensors define the position of various mechanical elements in relation to the range of their movement. There’s a couple of big speakers, which means there’s a beefy amplifier thrown in too. The sounds are correlated to the movement of the various elements, the intensity of the light and probably the color. There’s two mechanical paddle levers hanging in there, if you folks want to hazard some guesses on what they do.

Check out some of [dmitry]’s earlier works which we featured. Here’s him Spinning a Pyrite Record for Art, and making Art from Brainwaves, Antifreeze, and Ferrofluid.


Filed under: hardware, musical hacks

IntelliServo

Servos are extremely versatile actuators used in a large number of applications which need controlled mechanical movement. The usual way of driving them is by using a PWM output from a micro-controller. But if you’re building a robot or a drone which requires a large number of servos, then it makes sense to add smarts directly to the servo.

[Alvaro Ferrán Cifuentes] did just that by building IntelliServo – an add on board which makes regular servos smart by giving them enhanced capabilities as found in high-end versions. His approach is different compared to other takes on this theme. The IntelliServo is designed to replace the electronics in any regular servo and is not limited to any particular make or type. Once upgraded, it’s possible to read the servos position, temperature and current consumption. This allows interesting uses, such as controlling one servo by moving another one, or detecting collision or stalling by monitoring the servo current. Multiple servos can be daisy-chained and controlled over I²C from a micro-controller, or over USB directly from a computer. Each board features an LPC11U24 32-bit Cortex-M0 micro-controller, a DRV8837 motor driver, a TMP36 temperature sensor and a PCA9508 I²C repeater.

The project is open source and the Github repository contains the board design, Arduino library and examples, servo firmware and mechanical parts as well as use instructions. It’s a modular design which allows using either an external controller or running it directly via the on-board micro-USB socket. Check out the videos after the break to see the IntelliServo in action.


Filed under: hardware
Hack a Day 22 Apr 09:01

Automated Blinds Open the Window to our Heart

[Brian Harms] made his living room window blinds open and close automatically using servos, an Arduino, and a SmartThings Arduino shield. Best of all, it’s connected to his Amazon Echo so that merely saying “Alexa, turn on/off the blinds” will open and close them.

To accomplish the feat [Brian] used two laser cut acrylic gears; one of which was attached to the servo horn, and the other to the long square rod running the length of the blinds. Despite using the bulky Arduino and shield, the finished product is inconspicuous and streamlined, and the single Arduino controls all three of the blinds in the living room. [Brian] answered a bunch of questions on a Reddit thread.

Blinds are a common connected home hack, and while none of the hacks we’ve covered in the past were voice activated, we have seen temp-sensitive blinds and a Raspberry Pi-based solution.


Filed under: home hacks

Listen to the hypnotic sound of a red crystal


Red is an optic-sound electronic object that uses simple light sources and optical elements to create audiovisual performance. The machine was named as a color because at the center of the work there is a red glass crystal and a flexible Fresnel lens. Dmitry Morozov aka :: vtol: : created it using Arduino with pure data and python scripts:

The project includes many reworked electronic devices – a CD-rom, an old scanner, reused electric motors. Multiple moving elements provide wide variability for rather primitive optical elements. It is accomplished by constant change of focal length between the light source, crystal and lens, as well as by changing the crystal’s tilt angle and mechanical distortion of the lens. The object works autonomously, by algorithm with many accidental events tied to feedback, with sensors defining the position of various mechanical elements in relation to the range of their movement. The sound part has up to 4 voices which depend on the activity of various elements. The sound is also in direct interaction with actual position of those elements, and basically is voicing the process of movement, brightness of light, and intensity of the piece.

Watch how it works in this hypnotic video:

Arduino Blog 11 Apr 21:59