Advertisement
Guest User

Untitled

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