domingo, 20 de diciembre de 2015

FPGA control for a robotic arm.

FPGA


A field-programmable gate array (FPGA) is an integrated circuit designed to be configured by a customer or a designer after manufacturing – hence "field-programmable". The FPGA configuration is generally specified using a hardware description language (HDL), similar to that used for an application-specific integrated circuit (ASIC). (Circuit diagrams were previously used to specify the configuration, as they were for ASICs, but this is increasingly rare.)

A Spartan FPGA from Xilinx
FPGAs contain an array of programmable logic blocks, and a hierarchy of reconfigurable interconnects that allow the blocks to be "wired together", like many logic gates that can be inter-wired in different configurations. Logic blocks can be configured to perform complex combinational functions, or merely simple logic gates like AND and XOR. In most FPGAs, logic blocks also include memory elements, which may be simple flip-flops or more complete blocks of memory.



Project objective 


The objective of this project is to create a sequence for a robotic arm trough the FPGA card, 
the robot should take 4 pieces in a store and put them in a pallet. 




The robotic arm has 5 joints, each joint is moved by a DC motor,



A L293 D Integrated Circuit was used as H bridge in order to move the DC motors forwards and backwards. The integrated circuit also is used as power stage.


The integrated circuit can manage 2 motors in both directions, as the robotic arm has 5 motors, 3 integrated circuits were used in this case, you can see the final connection in a protoboard in below image.









You can download the whole code here

---------------------------
-- Robot Control
-- Rodrigo Romo
-- Sistemas Digitales
-- UTZAC
-- Aug 12 2015
---------------------------

library ieee;

use ieee.std_logic_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity wep is

port (
a,b,c,d,clk: in std_logic;
q,r,s,t,u,v,w,x,y,z: out std_logic
);
end wep;

architecture narf of wep is
signal counta :integer:=0;
signal countb :integer:=0;
signal countc :integer:=0;
signal countd :integer:=0;
begin
process (a,b,c,d,clk)
begin



if ( clk' event and clk= '1') then
if (a= '1') then  -- Figura 1
counta <= counta + 1;

if (counta < 5) then – w8

q <= '0';
r <= '0';
elsif  (counta >= 5 and counta < 21)then -- moves anti clockwise

q <= '1';
r <= '0';

elsif (counta >= 21 and counta <27) then -- w8


q<= '0';
r<= '0';

elsif (counta >= 27 and counta <30) then -- motor 3 up

u<= '0';
v<= '1';




elsif (counta >= 144) then

counta <=0;
q<='0';
r<='0';
s<='0';
t<='0';
u<='0';
v<='0';
end if;

No hay comentarios:

Publicar un comentario