Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 23cef6ecb169ef8d6348cb81ccb36a9207b6b108 Mon Sep 17 00:00:00 2001
- From: John Thornton <bjt128@gmail.com>
- Date: Thu, 13 Aug 2015 17:06:48 -0500
- Subject: [PATCH] thc component: add pin to show current offset
- Signed-off-by: John Thornton <bjt128@gmail.com>
- ---
- src/hal/components/thc.comp | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
- diff --git a/src/hal/components/thc.comp b/src/hal/components/thc.comp
- index 63af503..79fe909 100644
- --- a/src/hal/components/thc.comp
- +++ b/src/hal/components/thc.comp
- @@ -72,6 +72,7 @@ pin out float z_pos_out "Z Motor Position Command Out";
- pin out float z_fb_out "Z Position Feedback to Axis";
- pin out float volts "The Calculated Volts";
- pin out bit vel_status "When the THC thinks we are at requested speed";
- +pin out float offset_value "The Current Offset";
- // Parameters
- param rw float vel_scale "The scale to convert the Velocity signal to Volts";
- @@ -94,7 +95,8 @@ FUNCTION(_) {
- // convert encoder velocity to volts
- volts = (encoder_vel - scale_offset) * vel_scale;
- if(volts < 0){volts = 0;} // make sure volts is not negative
- -
- + offset_value = offset;
- +
- if(enable){
- float min_velocity = requested_vel -(requested_vel*(velocity_tol*0.01));
- if(current_vel > 0 && current_vel >= min_velocity){vel_status = 1;}
- --
- 1.7.10.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement