Posts | Comments

Planet Arduino

Archive for the ‘motor controller’ Category

The sort of pumps used in the filtration systems of fountains and swimming pools don’t take kindly to running dry. So putting such a pump on a simple timer to run while you’re away comes with a certain level of risk: if the pump runs out of water while you’re gone, you might come home to a melted mess. One possible solution is a float sensor to detect the water level in whatever you’re trying to pump, but that can get complicated when you’re talking about something as large as a pool.

For his entry into the 2019 Hackaday Prize, [Luc Brun] is working on controller that can detect when the pump is running dry by monitoring the phase shift between voltage and current. With an inductive load like a pump, the current should lag behind the AC voltage a bit under normal operation. But if they become too far out of phase with each other, that’s a sign that the pump is running in a no-load condition because there’s no water to slow it down.

As [Luc] explains in the project write-up, simply monitoring the pump’s peak current could work, but it would be less reliable. The problem is that different motors have different current consumptions, so unless you calibrated the controller to the specific load it’s protecting, you could get false readings. But the relationship between current and voltage should remain fairly consistent between different motors.

The controller is powered by a Arduino Nano and uses a ACS712 current sensor to take phase measurements. Since he had the ability to toggle the pump on and off with a relay attached to the Arduino, [Luc] decided to add in a few other features. The addition of a DS1307 Real Time Clock means the pump can be run on a schedule, and an HC-05 Bluetooth module lets him monitor the whole system from his smartphone with an Android application he developed.

Since the theme of this year’s Hackaday Prize is designing a product rather than a one-off build, judges will be looking for exactly the sort of forward thinking that [Luc] has demonstrated here. As the controller is currently a mass of individual modules held inside a waterproof enclosure, the next steps for this project will likely be the finalization of the hardware design and the production of a custom PCB.

The sort of pumps used in the filtration systems of fountains and swimming pools don’t take kindly to running dry. So putting such a pump on a simple timer to run while you’re away comes with a certain level of risk: if the pump runs out of water while you’re gone, you might come home to a melted mess. One possible solution is a float sensor to detect the water level in whatever you’re trying to pump, but that can get complicated when you’re talking about something as large as a pool.

For his entry into the 2019 Hackaday Prize, [Luc Brun] is working on controller that can detect when the pump is running dry by monitoring the phase shift between voltage and current. With an inductive load like a pump, the current should lag behind the AC voltage a bit under normal operation. But if they become too far out of phase with each other, that’s a sign that the pump is running in a no-load condition because there’s no water to slow it down.

As [Luc] explains in the project write-up, simply monitoring the pump’s peak current could work, but it would be less reliable. The problem is that different motors have different current consumptions, so unless you calibrated the controller to the specific load it’s protecting, you could get false readings. But the relationship between current and voltage should remain fairly consistent between different motors.

The controller is powered by a Arduino Nano and uses a ACS712 current sensor to take phase measurements. Since he had the ability to toggle the pump on and off with a relay attached to the Arduino, [Luc] decided to add in a few other features. The addition of a DS1307 Real Time Clock means the pump can be run on a schedule, and an HC-05 Bluetooth module lets him monitor the whole system from his smartphone with an Android application he developed.

Since the theme of this year’s Hackaday Prize is designing a product rather than a one-off build, judges will be looking for exactly the sort of forward thinking that [Luc] has demonstrated here. As the controller is currently a mass of individual modules held inside a waterproof enclosure, the next steps for this project will likely be the finalization of the hardware design and the production of a custom PCB.

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.

maestro familyOn 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.

smcAn 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.

smc txinThe 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
Ott
08

Open-source BLDC motor driver

Brushless motors are ubiquitous in RC applications and robotics, but are usually driven with low-cost motor controllers that have to be controlled with RC-style PWM signals and don’t allow for much customization. While there are a couple of open-source brushless drivers already available, [neuromancer2701] created his own brushless motor controller on an Arduino shield.

[neuromancer2701]‘s shield is a sensorless design, which means it uses the back-EMF of the motor for feedback rather than hall effect sensors mounted on the motor. It may seem strange to leave those sensors unused but this allows for less expensive sensorless motors to work with the system. It also uses discrete FETs instead of integrated driver ICs, similar to other designs we have covered. Although he is still working on the back-EMF sensing in his firmware, the shield successfully drives a motor in open-loop mode.

The motor controller is commanded over the Arduino’s serial interface, and will support a serial interface to ROS (Robot Operating System) in the future. This shield could be a good alternative to hobby RC controllers for robots that need a customizable open-source motor controller. The PCB design and source code are available on GitHub.

 


Filed under: Arduino Hacks
Ott
08

Open-source BLDC motor driver

Brushless motors are ubiquitous in RC applications and robotics, but are usually driven with low-cost motor controllers that have to be controlled with RC-style PWM signals and don’t allow for much customization. While there are a couple of open-source brushless drivers already available, [neuromancer2701] created his own brushless motor controller on an Arduino shield.

[neuromancer2701]‘s shield is a sensorless design, which means it uses the back-EMF of the motor for feedback rather than hall effect sensors mounted on the motor. It may seem strange to leave those sensors unused but this allows for less expensive sensorless motors to work with the system. It also uses discrete FETs instead of integrated driver ICs, similar to other designs we have covered. Although he is still working on the back-EMF sensing in his firmware, the shield successfully drives a motor in open-loop mode.

The motor controller is commanded over the Arduino’s serial interface, and will support a serial interface to ROS (Robot Operating System) in the future. This shield could be a good alternative to hobby RC controllers for robots that need a customizable open-source motor controller. The PCB design and source code are available on GitHub.

 


Filed under: Arduino Hacks
Gen
08

[Jack], a mechanical engineer, loom builder, and avid sailor wanted an autopilot system for his 1983 Robert Perry Nordic 40 sailboat with more modern capabilities than the one it came with. He knew a PC-based solution would work, but it was a bit out of reach. Once his son showed him an Arduino, though, he was on his way. He sallied forth and built this Arduino-based autopilot system for his sloop, the Wile E. Coyote.

He’s using two Arduino Megas. One is solely for the GPS, and the other controls everything else. [Jack]‘s autopilot has three modes. In the one he calls knob steering, a potentiometer drives the existing hydraulic pump, which he controls with a Polulu Qik serial DC motor controller. In compass steering mode, a Pololu IMU locks in the heading to steer (HTS).  GPS mode uses a predetermined waypoint, and sets the course to steer (CTS) to the same bearing as the waypoint.

[Jack]‘s system also uses cross track error (XTE) correction to calculate a new HTS when necessary. He has fantastic documentation and several Fritzing and Arduino files available on Dropbox.

Autopilot sailboat rigs must be all the rage right now. We just saw a different one back in November.

[Thanks Jeremy]


Filed under: Arduino Hacks, gps hacks, misc hacks, transportation hacks
Ott
28

microslice

[SilverJimmy] already had a full-sized 50 watt laser cutter, but he decided to try his hand at putting together something smaller and microcontroller-driven. The result is this adorable little engraver: the MicroSlice.

To keep the design simple, [SilverJimmy] opted for a fixed cutting table, which meant moving the cutting head and the X-Axis as a unit along the Y-Axis. The solution was to take inspiration from gantry cranes. He snagged a couple of stepper motors with threaded shafts, designed the parts in Inkscape, then fired up his full-size cutter to carve out the pieces. An Arduino Uno and the relays for the laser and fans sit on the MicroSlice’s bottom platform, and two EasyDriver motor controllers sit above them on the next layer.

Swing by the Instructables for more details including the source code, and to see a video of the engraver below. [SilverJimmy] sourced his laser from eBay, but check out the engraver from earlier this year that used a DVD diode.


Filed under: Arduino Hacks, laser hacks
Set
22

Talkbot: an Arduino-driven robot for beginners

arduino hacks, bump sensor, digital audio hacks, how-to, motor, motor controller, robots hacks, School, voice Commenti disabilitati su Talkbot: an Arduino-driven robot for beginners 

talkbotguts

It isn’t exactly WALL-E, but [Bithead's] affordable introduction to robots – Talkbot – is made out of a trash can. This little guy runs off an Arduino and comes packed with features, including a voice chip, a motor shield, and a pair of bump sensors. Talkbot will cruise around until a bump sensor slams into an obstacle. One of his prerecorded messages will then play through the speaker while he backs up, turns, and tries to find a clearer path.

According to [Bithead's] build log, tracking down the right bargain voice chip was a bit of a hassle; he skipped over the text-to-speech options only to be stalled by vendor issues. He finally settled on a clone of Sparkfun’s WTV020SD chip sourced from eBay, which allows you to access pre-recorded WAV files stored on a Micro-SD card. The robot’s body comes straight off the hardware store shelf, with PVC pipe for arms and a polystyrene base to hold all the parts.  At the bargain price of $110, [Bithead's] students will have a true hacker experience cobbling the Talkbot together rather than using a prefab kit.

Be sure to see Talkbot  in a video below, performing either his green-eyed “friendly mode” or red-eyed “grumpy mode,” which dictates how pleasantly he responds to obstacles. Need something more advanced? Check out the tentacle robot, just in time for Halloween.


Filed under: Arduino Hacks, digital audio hacks, how-to, robots hacks
Gen
27

High-Power Motor Controller

arduino, motor controller, Power Racing Series, PPPRS Commenti disabilitati su High-Power Motor Controller 

grabThis looks intriguing, the Paragon, an Arduino motor controller designed to be robust enough even to control an electric car, evidently designed to run a Power Racing Series car. The maker, Alex McLees, is a founding member of Madison, WI hackerspace Sector 67. [via PPPRS]Filed under: Arduino

Read the full article on MAKE

Nov
06

Dumpster diving nets 100 Arduino-powered motor controllers

arduino, arduino hacks, dumpster diving, Featured, motor controller, stepper motors Commenti disabilitati su Dumpster diving nets 100 Arduino-powered motor controllers 

Never one to pass up the recycle pile at work, [Scott] usually doesn’t find much. A few old hard drives, maybe a ancient laptop every once in a while, but on very rare occasions he finds something actually useful. This latest haul is a gaggle of stepper motor drivers that, with a bit of work, can be reverse engineered and turned into an Arduino.

After prying into one of the plastic-enclosed boards, [Scott] found a LED, a quartet of transistors for powering the motor, and an ATMega168 microcontroller. Interestingly, most of the pins for the 168 were already broken out on the DA15 connector on each controller. The only thing needed was to build a programmer to dump the Arduino bootloader onto these little widgets.

After much trial and error (and building a new programming interface), [Scott] now has 100 Arduinos with a single stepper motor controller built in. He’s already made a toy light cycle rotate on a small stepper (after the break) and blink a LED, but with this many widgets, we’re wondering what crazy contraption [Scott] will come up with.


Filed under: arduino hacks, Featured


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook