Thursday, May 21, 2009

84 Channel Multifunction Servo Controller SD84

Specifications

Servo Channels - Up to 84
Logic Outputs - Up to 84
Logic Inputs - Up to 84
10-bit Analogue Inputs - Up to 36
Servo Refresh Rate - 20mS under all conditions
Position Control - Directly programmed in uS
Speed Control - From maximum down to 20 seconds for full rotation
Servo Power - Separate terminals for voltage of your choice in groups of 8 servo's
Logic Power - Direct from the USB Bus
Control interface - USB

Overview
The SD84 is an 84 channel servo controller module. It will drive up to 84 RC servo's and maintain a 20mS refresh rate, regardless of the number of servo's used or their positions (pulse widths). It controls both the speed and position of the servo's. It's controlled by sending commands to the on-board processors over the USB bus. Each of the 84 channels can be a Digital Input, Digital Output or Servo Output. Additionally, 36 of the channels can be 10-bit Analogue inputs, making this a great animatronics controller.

Features
Up to 84 channels of digital inputs.
Up to 84 channels of digital outputs.
Up to 84 channels of servo outputs.
Up to 36 channels of 10-bit analogue inputs.
Controlled and Powered from the USB bus.
Drivers available for
Windows, Apple, Linux and Open BSD.

Connections

"Robots" Redirects here. For other uses, see robot

A robot, a mechanical or virtual artificial agent is. In practice, this is usually an electro that their presence or movements, said that the agency's intentions or his own sense conveys a mechanical system. Both physical and virtual robots, robot voice software for agents, but usually in the form of bots to send can mention. [1] there in the form of robots, machines on which a consensus is not eligible, but a consensus between experts and the public that the robots, operate, and exhibit intelligent behavior, which mimics the human or other animal behavior, especially a mechanical part, the spirit and manipulate the environment around them some or all of the following are:.

Partners and stories artificial assistants and effort to make them fully autonomous machines only appeared in the 20th century, but has a long history. The robot program and operate the first digital, Unimate, 1961 in a die casting machine and stack them with pieces of hot metal was established to take. Today, extensive use in commercial and industrial robots are performing more and more jobs and cheap or accuracy and reliability in comparison with men. He also dangerous for jobs that are dirty or dull for humans to be appropriate are employed. Robots comprehensive manufacturing, assembly and packing, transport, earth and space exploration, surgery, weaponry, laboratory research, and consumer and industrial goods are mass produced. [2]

In fact, they encounter one of the robots generally positive impression. Domestic robots for cleaning and maintenance is faster and are common around homes. This concern, however, the economic impact of automation and robotic arms, which in several popular entertainment, intelligent portrayal of the villainous robots, acrobatic has not helped by the threat of concern. Compared with its imaginary counterparts, the real robots, even then, be gentle feeble-minded and clumsy.

Sunday, April 13, 2008

C-52EVB Robot Controller

C-52EVB Robot Controller

Use a C-52 EVB for simple robot experiments. Build a simple two wheels robot with L293D H-Bridge driver and IR sensors. Write a C program controls robot tracked with black tape. Fun with Ving-Peaw Competition 2543, course layout, day-by-day changed rule and scoring also included!


Introduction

One of my student has made a disgraceful robot that used two stepper motors and with a simple IR sensor. Yes, above picture is what I'm talking. Without battery carrying, a little bit torque of the stepper and misalignment of driving shaft, makes it crawling not walking, but first demo, showed quite impressive to me. He said he wrote a couple of program lines using C, his robot can track the black tape. I feel delighted his intention and endeavor. I thought, " he borrowed me DS5000, expensive one, a soft uController with internal bootloader, why shouldn't try with our learning board C-52 Evaluation Board instead". Another one, told me the same day "I found the L293 Push/Pull Four Channel Driver at Ban-Moah, it costs 1.5 US$ ". I've been searching this chip for a year. The MiniBoard, a Motorola 68HC11 Robot Controller board designed by Fred G. Martin, also uses this driver. The day after, I then decided to prepare the page describing how to use C-52 EVB as a robot controller board. I asked my student for competition, build yourselves robot that can track the black tape. Prize for the winner is 100 US$, with a bit condition that the winner must pay for a big party at Soi Jinda's Somtum (Papaya Salad) shop. And one of the competitor is me. I thought the rule should be conceived roughly by students and technically by me. The picture on that day will put here soon.

C-52 EVB resources

Beforehand, let look at available resources of C-52 EVB for robot experiments.

Actuators
DC motor
PWM with
timer2 helps
P1.4,P1.5,
P1.6,P1.7
Sensors
digital/analog
IR detector
with comparator chip/ for analog input, see
use of PIC16C711
digital input/T0,T1 for pulse input
Brain
C program
available code and data space approx. 32kB
8000H-FFFFH
Program
Downloader
Running
without monitor
PAULMON2
with PAUL's
startup header
9600, 8n1
P3.0 (RxD)
and P3.1 (TxD)

DC Motor Driver

Basic circuit of using L293 forms an H-Bridge Driver is shown in Figure 1. As shown for such inductive load as DC motor, external diodes for suppressing back EMF must be connected. The MiniBoard uses L293D instead, the L293D has internal diodes, however providing a bit less driving capacity, i.e., 600mA @4.5V-36V. From the truth table, we see that direction of the motor can control by pin C and D. VINH enable/disable power to the motor, thus for speed regulation, we then use this pin for PWM signaling. See details, L293.pdf data sheet.

Figure 1: Basic circuit of L293 forms H-Bridge Driver

A circuit connecting C-52 P1 to L293 driver chip is shown in Figure 2. As shown Enable pin 1 connected to P1.0 is for PWM signaling. We use additional inverter at pin7 and pin 15 to provide proper logic for easy directional control. Please note that pin 4,5,12,13 are tied to ground and if heat sinking needed, one method is to make a large area of PCB or soldering it with a metal sheet, say.

Figure 2: Connecting C-52 EVB P1.4-P1.7 to L293. External diodes must be connected for L293(not shown in circuit diagram). My latest design put additional inverter for PWM signal at pin 1 and pin 9 to prevent full power delivering to DC motors when resetting the 89C52(i.e., all bits of P1 is logic high). Check the logic of PWM pins for another microcontrollers.

Line Tracking Sensor (I have to KUK)

Since there's no ADC for 89C52 chip, each competitor may build their own Line Tracking Sensor, some may use LM339 QUAD comparator with IR transmitter and receiver, some may use LDR as described in Line Follower Robot . With an external comparator, it may not necessary to have ADC, but with LDR, we need external ADC. " Having additional ADC for 89C52 would be better", I thought. How can we provide ADC for 89C52 with a cheap method? I chose PIC16C711 with 4-channel ADC, and 7-pin input port. Interfacing to 89C52 is done with simple PISO protocol by using RB0 for SCLK and RA4 for SDA. The code for such purpose was written in C, here is the source file, C52ADC.C and the HEX code, C52ADC.HEX. After some initialization, the 711 chip wait for trigger read signal at pin RB0, i.e., high-to-low transition, then it responses by sending 40-bit through RA4(SDA) with low-to-high transition. 40-bit data stream begins with LSB of ADC0 to MSB of PORT B. Example of program fro testing ADC is ADC.C and the hex file is ADC.HEX.


Figure 3: Using PIC16C711 to be a 4-channel ADC and 7-bit input port for C-52 EVB.

Simple Power Supply and Charger Circuits

Figure 4 shows a simple power supply circuit. I have tested with KABO, it works fine. For those who have a big capacity rechargeable battery, the resistance value of R can be selected for approx. 10% output charging current. DC in can be higher if your battery voltage higher than 8.4V, say. To ensure the output current is within the value calculated by R, measure DC current before. The maximum supply for LM317 is ~35V.


Figure 4: Circuit Diagram of battery supply +12V Alkaline and +8.4V NiMH with a constant current recharger circuit. For ~20mA, use R~60 Ohms. S1 is main switch for CPU and L293 circuits.

Using PAUL's Startup Header file with Micro-C

Before writing PWM generation for testing above circuit, let study how to use Paul's header. With a PAUL's startup header at the beginning of the application C program, after successfully downloading the hex code, just press RESET, the 89C52 then will run the application instead of PAULMON2 monitor program. As long as the program remain in SRAM, running the program can only be done with pressing RESET. To return to PAULMON2 prompt, turn the board power off for a while, then back the power on again. This concept of startup header allows us to use C-52 EVB as a dedicated controller beside as a learning board. Originally Paul has made with entirely in Assembly code. However, I have adapted for Micro-C Compiler. I have put the header for startup code in the startup and runtime library for small memory model. The file C52ROBOT.ASM, will compile and link to the main( ) function with S=c52robot.asm when invoking command coordinator. Example of command line is;

c:\mc\cc51 %1 -ilp h=c:\mc m=s s=c52robot.asm

%1 is hello(.c), say

Let try hello.c and compile with above command line, download the hello.hex into the C-52 board, then press RESET, see what happen?

Manual Control Program demonstrates PWM generation with KABO

One method of delivering DC power to motors is to use PWM. The PWM method supplys DC pulse with fixed frequency but with adjustable duty cycle. I used TIMER2 in AUTO reload producing 1000Hz PWM frequency. Each time executing has entering into service routine, a 16-bit PWM1 was shifted out to P1.7 and PWM2 to P1.6. Main program has a task that set the power for motor1 and motor2 by writing 16-bit PWM pattern into PWM1 and PWM2 for motor1 and mortor2 respectively. The service routine for timer2 is put in startup code. See example program, KABO1.C and C52ROBOT.ASM, for PWM demonstration with manual control. I have designed and built my own robot for the competition also. It names KABO having differential drive method. As shown in right-hand side, is the rare part powered by C52-EVB. The motor driver chip L293D and a 74LS04 are put at the soldering pad.

Ving-Peaw Competition

I suppose there should have ten robots to be competed. Details Rule and Scoring will be launched soon, day by day changed. But first of all, competitors must know how difficult of the circuit and programming are. Hear is the actual course layout.


Figure 4: Actual Course Layout for Ving-Peaw Robot Competition

The original idea of what kind of the competition would be, came from Zongwit. Each round has two robots. Each robot must run along black tape and try to touch the the other's target. Who touch first will be the winner. The slower is allowed to detect the faster, shifted out of the line for 20 seconds, then back again. No limit for the robot size and uControllers, you may use ranging from a PIC16F84, 16F873/877, 89C2051/4051, 89C51/52/55, or 68HC11, say.

Robot parts

Robbie MK3


A little history


Way back cica. 1987 I decided building a robot would be a way cool idea. I set out building a beast
of a brain for my creation. I put together the excellent Talking Electronics TEC-1B Z80 based
computer. After weeks of building and testing (I was only 13!) I had it up and running.
Ah, those were the days, programming a Z80 in hex...
So my Dad helped me put together an aluminium light weight frame. It was slightly modelled
on the old Hero robot from Heathkit. Luck was not on our side, and Robbie Mk I got destroyed
before he every really came into being. A non fatal car accident saw Robbie Mk I thrown from
a trailer - ending up in pieces all across the highway. The electronics were not hurt, but
the shell was destroyed beyond recognition. So died the dream of Robbie Mk I.

Many years later the idea of building a robot again seemed like a good idea. This time I
began experimenting with the PIC series of microchips, namely the very popular 16F84. Again
my father came to the rescue with his woodworking skills and built me a platform on which we
mounted some geared motors. I still laugh thinking back how i tried to control the motors
using a complex array of relays to change the current direction. You should have seen the
sparks fly! I was truely a happy man the day I discovered what an H-brige was :)

So Robbie Mk II was born, on a chipboard base with 2 geared motors. I got it to the stage
where it could drag itself *very* slowly around the room aided by an infrared proximity
detector circuit. I have a few old photos of the base which i will upload in the coming weeks.

My brother having declared Robbie Mk II as being an insult to the eye offered his services as
a model builder. He came up with the stunning design you see below.

The motorized platform for Robbie III is almost complete.



Over the Christmas break i will start adding the electronics.



The under belly.
A big thank you to brother Nathan for his tireless work in getting the platform up and
running. As you can see the boy has got skills!