Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16598 Discussions

write code vhdl cruise control how ???

Altera_Forum
Honored Contributor II
4,027 Views

hello everyone:) 

places anyone can help me to write code vhdl about cruise control :confused:??? 

thanks for any can help me:-P
0 Kudos
27 Replies
Altera_Forum
Honored Contributor II
917 Views
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Cruise control can simply be a PID controller. You can use DSP builder to design your PID controller and then generate VHDL code from that. Or you can code it by hand.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

first think thanks to reply 

excuse me sir how can show my process
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

first look into pid controllers. Then create a simple PID model in some tool like Simulink / Matlab. Then you can work from there. Creating the PID model and simulation would be your first step.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

please help me

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

but i have only program Quartus II i know is Difficult i'm really tired to Search about the code in google  

i do no how i use Matlab or  

please help me  

I appreciate your efforts
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Look at this paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.471.1660&rep=rep1&type=pdf 

 

This is a good flow about implementing PIDs in FPGAs.
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

sir the website not work  

We are sorry ! 

The URL does not match any resource in our repository.
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Here is the pdf as a download

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

it is no useful sorry sir  

i have project write code vhdl about cruise control plase help me  

I appreciate your efforts
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Instead of just asking for help when you don't appear to have done any work yourself, you'll get a better response it you try doing some work yourself and come back here with specific questions about your code.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

OK i will try thanks for you advice

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

ok if found program cruise control is write java there any program to compiler to VHDL  

package concurrency.cruise; import java.awt.*; import java.awt.event.*; import java.applet.*; public class CruiseControl extends Applet { CarSimulator car; CruiseDisplay disp; Controller control; Button engineOn; Button engineOff; Button accelerate; Button brake; Button on; Button off; Button resume; public void init() { String fixed = getParameter("fixed"); boolean isfixed = fixed!=null?fixed.equals("TRUE"):false; setLayout(new BorderLayout()); car = new CarSimulator(); add("Center",car); disp = new CruiseDisplay(); add("East",disp); control = new Controller(car,disp,isfixed); engineOn = new Button("engineOn"); engineOn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.engineOn(); control.engineOn(); } }); engineOff = new Button("engineOff"); engineOff.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.engineOff(); control.engineOff(); } }); accelerate = new Button("accelerate"); accelerate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.accelerate(); control.accelerator(); } }); brake = new Button("brake"); brake.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { car.brake(); control.brake(); } }); on = new Button("on"); on.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.on(); } }); off = new Button("off"); off.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.off(); } }); resume = new Button("resume"); resume.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { control.resume(); } }); Panel p1 = new Panel(); p1.setLayout(new FlowLayout()); p1.add(engineOn); p1.add(engineOff); p1.add(accelerate); p1.add(brake); p1.add(on); p1.add(off); p1.add(resume); add("South",p1); } public void stop() { car.engineOff(); //kill engine thread control.engineOff(); } }
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

Java andvhdl are very different languages. Java is a programming language and vhdl is a hardware description language. Conversion is a manual prices you will have to do yourself.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

i try to isolation cruise control by method Components  

i have this (Error (10465): VHDL error at cruise_control.vhd(31): name "cruise_on" cannot be used because it is already used for a previously declared item)  

 

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

LIBRARY ieee; 

USE ieee.std_logic_1164.all; 

 

ENTITY cruise_control IS 

PORT (cancel, accleartor, Rest, break, set, cruise_on, cruise_off : IN STD_LOGIC; 

setspeed: OUT STD_LOGIC); 

END cruise_control; 

 

ARCHITECTURE structural OF cruise_control IS 

 

COMPONENT crease_speed IS 

PORT (accleartor, Rest: IN STD_LOGIC; setspeed: OUT STD_LOGIC); 

END COMPONENT; 

 

COMPONENT increase_speed IS 

PORT (break, set: IN STD_LOGIC; setspeed: OUT STD_LOGIC); 

END COMPONENT; 

 

COMPONENT cancel1 IS 

PORT (cruise_off: IN STD_LOGIC; setspeed: OUT STD_LOGIC); 

END COMPONENT; 

 

COMPONENT cruise IS 

PORT (cruise_on: IN STD_LOGIC; setspeed: OUT STD_LOGIC); 

END COMPONENT; 

 

 

 

 

SIGNAL cruise_on: STD_LOGIC; 

BEGIN 

 

U1: crease_speed PORT MAP (accleartor, Rest, setspeed); 

U2: increase_speed PORT MAP (break, set, d, setspeed); 

U3: cancel1 PORT MAP (cruise_off, setspeed); 

U4: cruise PORT MAP (cruise_on, setspeed); 

 

END structural;  

---------------------------------------------------------------------------------
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

You have an input called cruise_on, you can't also have a signal called cruise_on.

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

have error :confused: why 

 

(Error (10481): VHDL Use Clause error at cruise_control.vhd(3): design library "work" does not contain primary unit "my_components") 

(Error (10800): VHDL error at cruise_control.vhd(3): selected name in use clause is not an expanded name) 

 

LIBRARY ieee; USE ieee.std_logic_1164.all; USE work.my_components.all; ENTITY cruise_control IS PORT (cancel, accleartor, Rest, break, set, cruise_on, cruise_off : IN STD_LOGIC; setspeed: OUT STD_LOGIC); END cruise_control; ARCHITECTURE structural OF cruise_control IS COMPONENT crease_speed IS PORT (accleartor, Rest: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT increase_speed IS PORT (break, set: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cancel1 IS PORT (cruise_off: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; COMPONENT cruise IS PORT (cruise_on: IN STD_LOGIC; setspeed: OUT STD_LOGIC); END COMPONENT; SIGNAL setspeed1 : STD_LOGIC; BEGIN U1: crease_speed PORT MAP (accleartor, Rest, setspeed); U2: increase_speed PORT MAP (break, set, setspeed); U3: cancel1 PORT MAP (cruise_off, setspeed); U4: cruise PORT MAP (cruise_on, setspeed); END structural;
0 Kudos
Altera_Forum
Honored Contributor II
917 Views

You haven't included the my_components package. But if you have all the components declared in the code, why do you need a components package?

0 Kudos
Altera_Forum
Honored Contributor II
917 Views

I deleted ( USE work.my_components.all;) but have problem what i should to do  

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

Error: Node instance "U1" instantiates undefined entity "crease_speed" 

Error: Node instance "U2" instantiates undefined entity "increase_speed" 

Error: Node instance "U3" instantiates undefined entity "cancel1" 

Error: Node instance "U4" instantiates undefined entity "cruise" 

Error: Quartus II Analysis & Synthesis was unsuccessful. 4 errors, 0 warnings 

Error: Quartus II Full Compilation was unsuccessful. 6 errors, 0 warnings
0 Kudos
Altera_Forum
Honored Contributor II
822 Views

You didn't include the source code for the components in your project

0 Kudos
Reply