Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Moved]Code for a controller to navigate a robo on a Uniform plane(using three points

Status
Not open for further replies.

abhijeet.kumar

Newbie level 5
Joined
Jun 23, 2012
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
delhi
Activity points
1,520
Dear sir
This is my code for providing motion to a robo on a uniform plane .designed using three points.I have only two errors please help me & rectify my errors.Errors & coding are given below.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERRORS
ERROR:HDLCompiler:1638 - "C:\Users\dell\Desktop\vhdl\RFID2\iseconfig\HANMAN 2\ROBO.vhd" Line 119: found '0' definitions of operator "=", cannot determine exact overloaded matching definition for "="
ERROR:HDLCompiler:854 - "C:\Users\dell\Desktop\vhdl\RFID2\iseconfig\HANMAN 2\ROBO.vhd" Line 60: Unit <behavioral> ignored due to previous errors.

Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
package controler is
constant rng_row : integer:= 2;
constant rng_clmn : integer:= 2;
constant gps_row : integer:= 2;
constant gps_clmn,lut_clmn: integer:= 2;
constant lut_row : integer:=7;
Type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
signal temp3:lut_datain;
Type gps_datain is array (0 to gps_row,0 to gps_clmn) of std_logic;
Type rng_datain is array (0 to gps_row,0 to gps_clmn) of std_logic; 
-----Type rng_datain is array (0 to rng_row,0 to rng_clmn )of std_logic;
-----signal temp5:gps_datain; ---array (0 to rng_row, 0 to rng_clmn);
end controler;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use WORK.controler.ALL;
 
entity ROBO is
port (clk: in std_logic;
       x1,x2,x3,x4,x5,y1,y2,y3,z1,z2,z3: inout std_logic;
       df_in1,df_in2:in gps_datain;
         df_in3:in lut_datain; -- in array (0 to rng_row,0 to rng_clmn);
         df_out1,df_out2:inout gps_datain;
         df_out3: out lut_datain;
         mc_in1: in gps_datain;
         mc_in2: in rng_datain;
         mc_out1: inout gps_datain;
         mc_out2: inout rng_datain;
         mcomp_out,dcomp_out:out std_logic);
end ROBO;
architecture Behavioral of ROBO is
--Type gps_datain is array (0 to gps_row,0 to gps_clmn) of std_logic;
signal temp1,temp2: gps_datain ;
signal temp5:gps_datain; 
variable gps_data:gps_datain:=
((x1, y1, z1), 
 (x2, y2, z2), 
 (x3, y3, z3));
--------Type rng_datain is array (0 to rng_raw,0 to rng_clmn )of std_logic;
signal temp4:rng_datain; 
variable rng_data:rng_datain:=
((x1, y1, z1), 
 (x2, y2, z2), 
 (x3, y3, z3));
SIGNAL i : integer := 0;
begin
-----------------------------------------for direction finder----------------------------------------------------
p1:process(clk)
type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
constant lut_data:lut_datain:=(
('0','0','0'),
('0','0','1'),
('0','1','0'),
('0','1','1'),
('1','0','0'),
('1','0','1'),
('1','1','0'),
('1','1','1'));
begin
if ( clk = '1' and clk'event)then
for i in 0 to 5 loop
 case i is 
 when 0 => temp1<= df_in1;
 when 1 => df_out1<= temp1;
 when 2 => temp2<= df_in2;
 when 3 => df_out2 <= temp2; 
 when 4 => temp3 <= df_in3;
 when 5 => df_out3<= temp3;
 end case;
 end loop;
  if (df_out1 = df_out2 and df_out1 = df_out2) then
  dcomp_out <= '1';
  else
  dcomp_out <= '0';
  end if;
end if;
end process;
--------------------------for motion control---------------------------------------------- 
p2:process(clk)
begin
if (clk'event and clk = '1')then
 for i in 0 to 3 loop
  case i is 
  when 0 => temp5 <= mc_in1;
  when 1 => mc_out1 <= temp5;
  when 2 => temp4 <= mc_in2;
  when 3 => mc_out2 <= temp4;
  end case;
      if (mc_out1 = mc_out2) then
          mcomp_out <= '1';
      else
      mcomp_out <= '0';
      end if;
    end loop;   
 end if;
 end process;
end Behavioral;

 
Last edited by a moderator:

Re: VHDLCode for a controller to navigate a robo on a Uniform plane ( using three poi

Can you identify which line is 119? It's not apparent from your post.
And in your previous posting of this, I noted that I don't think you can use inout types in your statement "if (mc_out1 = mc_out2)". Have you investigated that?
 

where to start? many many errors. looking on my small phone screen I see variables in the architecture which ia not allowed, and you've initialised them from signals, which again is not allowed.

I think you need to start this while project again. this time start with a pencil and a sheet of paper and draw the circuit you want before you attempt to write any code. vhdl is a description language, so if you dont know the circuit how do you expect to write the code?
 
@tricky dicky.... thank you sir......after listening ur advivice ...i did.....but still have problems ...plz tell me what sud be next.....i have posted my concept along with my new code....please have a look on my concept & new code & give ur precious advice plzz




Motion planning
OUR CONCEPT OF MOTION PLANNING
In our planning one or several objects (robot along with sensors) will move towards destination. There will be a path which should be followed by robot after getting confirmed about to being on right track & in right bearing. First of all we have to provide a plane on which the path of robot will be designed. We can design a plane using these three methods:
1. Using three points
2. Using two points and one normal
3. Using one points & two normal.
MANIPULATION PLANNING
Robot must reach destination configuration along with other objects. The robot will never move alone. It has two equipments :
1. GPS (Global Positioning Satellite) &
2. Proximity Sensor.
GPS – It will provide Current Location, Present bearing & destination Bearing, which will be used to find direction & motion control towards destination configuration.
Proximity Sensor - To estimate the range in 3D to find out next path to move on, towards destination.
These objects (GPS & Proximity sensor) along with robot will provide the input to controller.


GPS will provide following inputs:
(1)Present Location(x)
(2)Current Bearing (y)
(3)Destination Bearing (z)
Proximity sensor will provide following inputs:
►It contains data generated by itself to define its range.
►It will be in the form of 3×1 matrix.
►The elements of matrix will be std-logic.

PLANNING FOR SENSING:-
Sensor can be used to acquire required information about robot environment .It will build a 3-D model or localize object of interests. In this planning we are using active sensing which will acquire information as quickly and reliably as possible. To fulfill this requirement we have to plan the motion of mobile robot equipped with proximity sensor.


Algorithm:
GPS & Proximity Sensor outputs will be represented in matrix (3*3) form, which elements will be std_logic.
1. GPS Data
a. Present Matrix:
Column1- X1,X2,X3= Present location
Column2-Y1,Y2,Y3= Current Bearing
Column3- Z1,Z2,Z3= Destination Bearing
X1 Y1 Z1
X2 Y2 Z2
X3 Y3 Z3

b. Updated Matrix
Column1- A1,A2,A3= New Present location
Column2-B1,B2,B3= New Current Bearing
Column3- Z1,Z2,Z3= Destination Bearing

A1 B1 Z1
A2 B2 Z2
A3 B3 Z3







2. Proximity sensor Data:
Since proximity sensor will create a 3d spherical environment by emitting flux in an all directions. Then the coordinates of range of proximity sensor also can be represented in matrix form as:
n.ds=k

Algorithm for Direction Finder:
Step1. Store X1,X2,X3, & Y1,Y2,Y3, & Z1,Z2,Z3 ( 3*3matrix form) .
Step2. Store range k also in matrix form i.e. K1,K2,K3(3*1).
Step3. LUT has refrence point to direct towards destination.
Step4. Fetch data from column2 & column3 & data from LUT.
Step5. Compare these data.
Step6. Now output will be ‘1’ if data matched otherwise ‘0’.

Algorithm for Motion Planning:
Step1. Same
Step2. Same
Step3. Same
Step4. Fetch data from column1 of present matrix & range k(3*1).
Step5. Compare them.
Step6. Now output will be ‘1’ if data matched otherwise ‘0’.

Timing diagram:
Total number of required clock pulses are 3:
Clock1: Store all data of present matrix & range matrix k.
Clock2: Fetch data column1 & 2 of present matrix , data from LUT.
Clock3: a. Compare column2, 3 & data of LUT then generate output in same clock.
b. Also compare column1 & range k then generate output.






CODE FOR CONTROLLER WHEN PLANE IS DESIGNED USING THREE POINTS



----------------------------------------------------------------------------------

----------------------------------------------------------------------------------


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
package controler is
constant rng_row : integer:= 2;
constant rng_clmn : integer:= 2;
constant gps_row : integer:= 2;
constant gps_clmn,lut_clmn: integer:= 2;
constant lut_row : integer:=7;
Type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
Type gps_datain is array (0 to gps_row,0 to gps_clmn) of std_logic;
Type rng_datain is array (0 to rng_row,0 to rng_clmn) of std_logic;
--------function = (df_out1,df_out2:in gps_datain;df_out3:in lut_datain ) return std_logic;
end controler;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use WORK.controler.ALL;
entity code1f3p is
port (clk: in std_logic;
x1,x2,x3,x4,x5,y1,y2,y3,z1,z2,z3,a1,a2,a3,b1,b2,b3,c1,c2,c3:inout std_logic;
df_in1,df_in2:in gps_datain;
df_in3:in lut_datain; ------------df=direction finder
df_out1,df_out2:inout gps_datain;
df_out3: inout lut_datain;
mc_in1: in gps_datain;
mc_in2: in rng_datain;----------mc=motion control
mc_out1: inout gps_datain;
mc_out2: inout rng_datain;
mcomp_out,dcomp_out:out std_logic);
end code1f3p;
architecture Behavioral of code1f3p is
signal temp1,temp2: gps_datain ;
signal temp3:lut_datain;
signal temp5:gps_datain;
variable gps_data:gps_datain:=
((x1, y1, z1),
(x2, y2, z2),
(x3, y3, z3));
signal temp4:rng_datain;
variable rng_data:rng_datain:=
((a1, b1, c1),
(a2, b2, c2),
(a3, b3, c3));
SIGNAL i : integer := 0;
begin
-------------------------------for direction finder-------------------------------------------------------------
p1:process(clk)
type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
constant lut_data:lut_datain:=(
('0','0','0'),
('0','0','1'),
('0','1','0'),
('0','1','1'),
('1','0','0'),
('1','0','1'),
('1','1','0'),
('1','1','1'));
begin
if ( clk = '1' and clk'event)then
for i in 0 to 5 loop
case i is
when 0 => temp1<= df_in1;
when 1 => df_out1<= temp1;
 
when 2 => temp2<= df_in2;
when 3 => df_out2 <= temp2;
when 4 => temp3 <= df_in3;
when 5 => df_out3<= temp3;
end case;
end loop;
if (df_out1 = df_out2 and df_out1 = df_out3) then
dcomp_out <= '1';
else
dcomp_out <= '0';
end if;
end if;
end process;
--------------------------for motion control----------------------------------------------
p2:process(clk)
begin
if (clk'event and clk = '1')then
for i in 0 to 3 loop
case i is
when 0 => temp5 <= mc_in1;
when 1 => mc_out1 <= temp5;
when 2 => temp4 <= mc_in2;
when 3 => mc_out2 <= temp4;
end case;
if (mc_out1 = mc_out2) then
mcomp_out <= '1';
else
mcomp_out <= '0';
end if;
end loop;
end if;
end process;
end Behavioral;


ERRORS:

Line 89: found '0' definitions of operator "=", cannot determine exact overloaded matching definition for "="
ERROR:HDLCompiler:1638 - "D:\atnrobo\motion planning\MOTION PLAN\codeformp\code1f3p.vhd" Line 109: found '0' definitions of operator "=", cannot determine exact overloaded matching definition for "="
ERROR:HDLCompiler:854 - "D:\atnrobo\motion planning\MOTION PLAN\codeformp\code1f3p.vhd" Line 50: Unit <behavioral> ignored due to previous errors.

[
 
Last edited:

Did you really read my post? There are still variable s in the architecture. You cannot put variables in an architecture. The = function probem is because you have not defined an equals function for your custom array types. I highly re commend you Do not make your own arrays of std_logic.
 

@trickydicky

Dear sir,

after fallowing your suggestion i improved my code but it has remain some errors, please tell e what sud be next. here is the improved code.
The errors are:
ERROR:HDLCompiler:1638 - "D:\atnrobo\motion planning\MOTION PLAN\repair\finalized.vhd" Line 71: found '0' definitions of operator "=", cannot determine exact overloaded matching definition for "="
ERROR:HDLCompiler:1638 - "D:\atnrobo\motion planning\MOTION PLAN\repair\finalized.vhd" Line 93: found '0' definitions of operator "=", cannot determine exact overloaded matching definition for "="
ERROR:HDLCompiler:854 - "D:\atnrobo\motion planning\MOTION PLAN\repair\finalized.vhd" Line 33: Unit <behavioral> ignored due to previous errors.



Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
package controler is
constant rng_row : integer:= 2;
constant rng_clmn : integer:= 2;
constant gps_row : integer:= 2;
constant gps_clmn,lut_clmn: integer:= 2;
constant lut_row : integer:=7;
Type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
Type gps_datain is array (0 to gps_row,0 to gps_clmn) of std_logic;
Type rng_datain is array (0 to rng_row,0 to rng_clmn) of std_logic;
--------function = (df_out1,df_out2:in gps_datain;df_out3:in lut_datain ) return std_logic;
end controler;
 
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use WORK.controler.ALL;
 
entity code1f3p is
port (clk: in std_logic;
x1,x2,x3,x4,x5,y1,y2,y3,z1,z2,z3,a1,a2,a3,b1,b2,b3,c1,c2,c3:inout std_logic;
df_in1,df_in2:in gps_datain;
df_in3:in lut_datain; ------------df=direction finder
df_out1,df_out2:inout gps_datain;
df_out3: inout lut_datain;
mc_in1: in gps_datain;
mc_in2: in rng_datain;----------mc=motion control
mc_out1: inout gps_datain;
mc_out2: inout rng_datain;
mcomp_out,dcomp_out:out std_logic);
end code1f3p;
architecture Behavioral of code1f3p is
signal temp1,temp2: gps_datain ;
signal temp3:lut_datain;
signal temp5:gps_datain;
 
signal temp4:rng_datain;
 
SIGNAL i : integer := 0;
begin
-------------------------------for direction finder-------------------------------------------------------------
p1:process(clk)
variable gps_data:gps_datain:=
((x1, y1, z1),
(x2, y2, z2),
(x3, y3, z3));
type lut_datain is array (0 to lut_row,0 to lut_clmn)of std_logic;
constant lut_data:lut_datain:=(
('0','0','0'),
('0','0','1'),
('0','1','0'),
('0','1','1'),
('1','0','0'),
('1','0','1'),
('1','1','0'),
('1','1','1'));
begin
if ( clk = '1' and clk'event)then
for i in 0 to 5 loop
case i is
when 0 => temp1<= df_in1;
when 1 => df_out1<= temp1;
 
when 2 => temp2<= df_in2;
when 3 => df_out2 <= temp2;
when 4 => temp3 <= df_in3;
when 5 => df_out3<= temp3;
end case;
end loop;
if (df_out1 = df_out2 and df_out1 = df_out3) then
dcomp_out <= '1';
else
dcomp_out <= '0';
end if;
end if;
end process;
--------------------------for motion control----------------------------------------------
p2:process(clk)
variable rng_data:rng_datain:=
((a1, b1, c1),
(a2, b2, c2),
(a3, b3, c3));
begin
if (clk'event and clk = '1')then
for i in 0 to 3 loop
case i is
when 0 => temp5 <= mc_in1;
when 1 => mc_out1 <= temp5;
when 2 => temp4 <= mc_in2;
when 3 => mc_out2 <= temp4;
end case;
if (mc_out1 = mc_out2) then
mcomp_out <= '1';
else
mcomp_out <= '0';
end if;
end loop;
end if;
end process;
end Behavioral;

 

I don't think you can perform those logical comparisons on "inout" ports.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top