background preloader

Motor Control

Facebook Twitter

Secrets of Arduino PWM. Pulse-width modulation (PWM) can be implemented on the Arduino in several ways.

Secrets of Arduino PWM

This article explains simple PWM techniques, as well as how to use the PWM registers directly for more control over the duty cycle and frequency. This article focuses on the Arduino Diecimila and Duemilanove models, which use the ATmega168 or ATmega328. If you're unfamiliar with Pulse Width Modulation, see the tutorial. Briefly, a PWM signal is a digital square wave, where the frequency is constant, but that fraction of the time the signal is on (the duty cycle) can be varied between 0 and 100%. PWM has several uses: Dimming an LED Providing an analog output; if the digital output is filtered, it will provide an analog voltage between 0% and 100% . Simple Pulse Width Modulation with analogWrite The Arduino's programming language makes PWM easy to use; simply call analogWrite(pin, dutyCycle), where dutyCycle is a value from 0 to 255, and pin is one of the PWM pins (3, 5, 6, 9, 10, or 11).

Timer Registers. Blog : Hacromatic: Electronics kits and projects worldwide. I couldn’t find much information about how to use the Arduino motor shield (as of late 2012), so I thought I’d show how to set up the connections for both stepper motors (4, 5, 6, and 8 wires) and DC motors, along with some basic sketches to drive them.

Stepper Motors Steppers can be broadly classified as 2/4-phase or 5-phase. This breakdown covers the vast majority of stepper motors you’re likely to encounter. 5-phase motors typically provide lower vibration and smaller stepping angles than 2 and 4 phase motors, but they are less common and won’t work with the Arduino motor shield, so I’m not going to talk about those here. That leaves 2/4 phase motors. Why do I group these together? 8 Wire Stepper Motors If you have the wiring documentation for the motor then you can skip ahead to the section on power supply issues. When you’re first starting out though, or if you’re unsure about the motor, it doesn’t hurt to make a resistance table, for each wire pair, like so:

Arduino Projects: Telescope Control with GOTO. Why make your own Arduino control system?

Arduino Projects: Telescope Control with GOTO

After completing my homemade telescope mount it was powered by a Meade DS motor kit. This system was extremely slow, underpowered and unreliable. It was also impossible for me to change the programming or maintain the system. I decided to make my own telescope control system from the ground up and the Arduino platform seemed the obvious choice. This project needed a wide range of inputs and outputs, so has been done using an Arduino Mega 1280 board, although a Mega 2560 would do just as well.

DC motors or Stepper motors Microcontrollers like Arduino have a fundamental problem with stepper motors. Smooth Head Rotation. Did you ever tried to rotate the robot head and found the movement nervous?

Smooth Head Rotation

This tip can help to smooth movements out. Did you ever looked at a robot and found its movements human like? This tip can tell you how you can humanize your robot's moves. Motivation Most of us one day have the challenge to rotate something from one angle to another. In this tip we want to go one step further and use a non-linear movement to make the move smooth. Introduction The movement must start from zero velocity and go to zero velocity. One function that has this nature is the Sinus Square velocity over time function.

Using this Sinus Square function makes sense in almost every move your robot makes. Improving the Beginner’s PID – Introduction « Project Blog. In conjunction with the release of the new Arduino PID Library I’ve decided to release this series of posts.

Improving the Beginner’s PID – Introduction « Project Blog

The last library, while solid, didn’t really come with any code explanation. This time around the plan is to explain in great detail why the code is the way it is. I’m hoping this will be of use to two groups of people: People directly interested in what’s going on inside the Arduino PID library will get a detailed explanation. Anyone writing their own PID algorithm can take a look at how I did things and borrow whatever they like. It’s going to be a tough slog, but I think I found a not-too-painful way to explain my code.

The Beginner’s PID Here’s the PID equation as everyone first learns it: This leads pretty much everyone to write the following PID controller: Compute() is called either regularly or irregularly, and it works pretty well. Sample Time – The PID algorithm functions best if it is evaluated at a regular interval. Playground - PIDLibrary. Arduino PID Library by Brett Beauregard contact: br3ttb@gmail.com PID Library Latest version (now hosted on GitHub): v1.0.1 PID Front-End using Processing.org Latest version: v0.3 Older Versions can be viewed / downloaded here What Is PID?

playground - PIDLibrary

From Wikipedia: "A PID controller calculates an 'error' value as the difference between a measured [Input] and a desired setpoint.