Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

New Problem: PID controller in verilog

Altera_Forum
Honored Contributor II
1,392 Views

Hello all, 

 

Ok. I got PWMs (4 phases) work great and shift all the phases out correctly. Now, I need to design PID controller that in verilog. 

 

module pwm_to_up(input clock, in pwm, output reg up) 

// check if pwm is on ... do something  

// output up 

endmodule 

 

 

module up_to_pwm(input clock, output reg pwm, input up) 

// check if up is on .... do something 

// output pwm 

endmodule 

 

 

module main(); 

reg clock; 

wire sync, up; 

...... 

...... 

pwm_to_up pwm_to_up_inst(.clock(clock), .sync(sync), .up(up)); 

up_to_pwm up_to_pwm_inst(.clock(clock), .sync(sync), .up(up)); 

endmodule 

 

 

Does anybody have very simple PID or feedback loop of 2 modules? 

 

Best, 

Sean
0 Kudos
0 Replies
Reply