Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Platform-independent core collection
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
18
Issues
18
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Platform-independent core collection
Commits
33535461
Commit
33535461
authored
Jul 20, 2022
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsp/gc_pi_regulator: fix error calculation signedness
parent
1abac413
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
gc_pi_regulator.vhd
modules/dsp/gc_pi_regulator.vhd
+3
-1
No files found.
modules/dsp/gc_pi_regulator.vhd
View file @
33535461
...
...
@@ -92,7 +92,7 @@ architecture rtl of gc_pi_regulator is
begin
setpoint
<=
resize
(
signed
(
setpoint_i
),
setpoint
'length
);
xerror
<=
resize
(
signed
(
x_i
),
setpoint
'length
)
-
setpoint
;
xerror
<=
setpoint
-
resize
(
signed
(
x_i
),
setpoint
'length
)
;
p_the_pi
:
process
(
clk_i
)
variable
v_integ_next
:
signed
(
g_INTEGRATOR_BITS
-1
downto
0
);
...
...
@@ -114,8 +114,10 @@ begin
elsif
x_valid_i
=
'1'
then
pmul
<=
resize
(
xerror
*
signed
(
kp_i
),
pmul
'length
);
imul
<=
resize
(
xerror
*
signed
(
ki_i
),
imul
'length
);
f_clamp_add
(
integ
,
imul
,
v_integ_next
,
v_integ_limit_hit
);
integ
<=
v_integ_next
;
f_clamp_add
(
integ
,
pmul
,
v_sum_next
,
v_sum_limit_hit
);
y_o
<=
std_logic_vector
(
v_sum_next
(
g_OUTPUT_BITS
+
g_GAIN_FRAC_BITS
-
1
downto
g_GAIN_FRAC_BITS
));
sum
<=
v_sum_next
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment