JT
I attached the component. It has been used as it is now and it works
fine. I dont mind standing in for it. I will be testing it some more
very soon on a real system so if there are any funnies, I will fix and
report back. If you are not comfortable with it this way I could always
submit a new component but I think that would be non productive.
Maybe just to clarify the added line of code. It applies a change in the
Z command over a period of time in stead of applying the new position in
one go. This means that Z axis get a chance to change at a reasonable
rate and leave very little chance of the motor slipping. It sort of
simulates a controlled acceleration slope.
If we dont do this and the machine is set to a fast cutting speed
(velocity), the z axis will sometimes slip as the acceleration
parameters are not adhered to. This solution does not adhere to the
acceleration parameters either but it implements the change at a
programmable slope as a percentage of the requested velocity.
I hope this make more sense now.
On 2014-06-29 14:16, John Thornton wrote:
I'm sorry but I'm not following you or I'm confused or both. If you
could post the complete component that might help.
Just because I managed to hack this component out by trial and error
doesn't mean I feel like I own it in any way shape or form and would
welcome anyone with more programming smarts to make changes to it to
make it better. I don't feel comfortable making changes I don't
understand. I really wish someone like Jeff would give it a once over
and make any changes they see fit.
JT
On 6/27/2014 4:07 PM, Marius Liebenberg wrote:
On 2014-06-27 22:53, John Thornton wrote:
Marius,
Are you dropping the correction_velocity parameter? I'm confused.
Not dropping it but making it rate dependant
#### This is the corrected line that was there
min_velocity = requested_vel - ( requested_vel
-(requested_vel*(velocity_tol/100)));
#### and this is what I added. It applies the velocity change over a
period of time to simulate acceleration
correction_vel= ((requested_vel *(speed / 100)) * fperiod)/10;
This way the correction velocity becomes a percentage of the requested
velocity. It is applied over a period of time in order to prevent the
stepper to slip if the change it to big all at once. This might not be
an issue with servo systems but definitely with steppers. It is a
similar implementation approach that was followed in Mach.
Hope this make sense. It did implement this on several systems with
great results.
JT
On 6/27/2014 12:53 PM, Marius Liebenberg wrote:
Seb
That fixes some of the problem. If you can ask John to look at the extra
line of code I added to make the velocity change at a rate that is a
percentage of the requested velocity instead of banging the velocity to
the next value. The fix is attached to the comment in the ticket
manager. If he can look at that and comment please.
On 2014-06-27 19:08, Sebastian Kuzminsky wrote:
On 6/27/14 05:22 , Marius Liebenberg wrote:
I just found that the issue is still open. The originator never closed
the damn issue. Can you please close it and somehow get the fixed
component into the release.
The ticket number is #348 under 2.6.
On 2014-06-27 13:09, Marius Liebenberg wrote:
Hi Sebastian
I am busy helping someone with a plasma setup and found that the changes
that was made prior to the release of 2.6 does not reflect in master. So
I would expect that it is not in 2.6 either.
I am referring to a change that I made to the THCUD component. Someone
else logged the issue but I fixed it and submitted fixed code on the
issue tracker.
Hi Marius, I spoke with John Thornton about the thcud velocity issue.
He'd fixed the problem in thc.comp but not in thcud.comp, but he fixed
it just now:
http://git.linuxcnc.org/?p=linuxcnc.git;a=commitdiff;h=2394f70
The fix is in 2.6 (v2.6.0-pre4-10-g2394f70) and master
(v2.7.0-pre0-576-g79fd496).
Does this fix the problem? If so i'll close #348.
Thanks for reminding me that this was only half fixed....
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers
--
Regards /Groete
Marius D. Liebenberg
+27 82 698 3251
+27 12 743 6064
QQ 1767394877
component thcud "Torch Height Control Up/Down Input";
description
"""
Torch Height Control
This THC takes either an up or a down input from a THC
If enabled and torch is on and X + Y velocity is within tolerance of set speed
allow the THC to offset the Z axis as needed to maintain voltage.
If enabled and torch is off and the Z axis is moving up remove any correction
at a rate not to exceed the rate of movement of the Z axis.
If enabled and torch is off and there is no correction
pass the Z position and feed back untouched.
If not enabled pass the Z position and feed back untouched.
Physical Connections typical
paraport.0.pin-12-in <= THC controller Plasma Up
paraport.0.pin-13-in <= THC controller Plasma Down
parport.0.pin-15-in <= Plasma Torch Arc Ok Signal
parport.0.pin-16-out => Plasma Torch Start Arc Contacts
HAL Plasma Connections
thc.torch-up <= paraport.0.pin-12-in
thc.torch-down <= paraport.0.pin-13-in
motion.spindle-on => parport.0.pin-16-out (start the arc)
thc.arc-ok <= motion.digital-in-00 <= parport.0.pin-15-in (arc ok signal)
HAL Motion Connections
thc.requested-vel <= motion.requested-vel
thc.current-vel <= motion.current-vel
Pyvcp Connections
In the xml file you need something like:
<checkbutton>
<text>"THC Enable"</text>
<halpin>"thc-enable"</halpin>
</checkbutton>
<spinbox>
<width>"5"</width>
<halpin>"vel-tol"</halpin>
<min_>.01</min_>
<max_>1</max_>
<resolution>0.01</resolution>
<initval>0.2</initval>
<format>"1.2f"</format>
<font>("Arial",10)</font>
</spinbox>
Connect the Pyvcp pins in the postgui.hal file like this:
net thc-enable thcud.enable <= pyvcp.thc-enable
""";
author "John Thornton";
license "GPL";
option singleton yes;
// Input Pins
pin in bit torch_up "Connect to paraport.0.pin-12-in";
pin in bit torch_down "Connect to paraport.0.pin-13-in";
pin in float current_vel "Connect to motion.current-vel";
pin in float requested_vel "Connect to motion.requested-vel";
pin in bit torch_on "Connect to motion.spindle-on";
pin in bit arc_ok "Arc Ok from Plasma Torch";
pin in bit enable "Enable the THC, if not enabled Z position is passed through";
pin in float z_pos_in "Z Motor Position Command in from axis.n.motor-pos-cmd";
pin in float velocity_tol "The deviation percent from planned velocity";
//pin in float correction_vel "The Velocity to move Z to correct";
pin in float speed ;
pin in float min_offset ;
pin in float max_offset ;
// Output Pins
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 cur_offset "The Current Offset";
pin out bit vel_status "When the THC thinks we are at requested speed";
pin out bit removing_offset "Pin for testing";
pin out bit test=0;
pin out bit s1;
pin out bit s2;
pin out bit s3;
pin out bit s4;
// Parameters
//param rw float velocity_tol "The deviation percent from planned velocity";
//param rw float correction_vel "The Velocity to move Z to correct";
// Global Variables
variable float offset;
variable float last_z_in;
variable float z_diff;
variable float min_velocity;
variable float correction_vel;
function _;
;;
#include "rtapi_math.h"
FUNCTION(_) {
if(enable){
s1 = 1;
//min_velocity = requested_vel -(requested_vel*(1/velocity_tol));
/////// there is a problem over here
min_velocity = requested_vel - ( requested_vel
-(requested_vel*(velocity_tol/100)));
correction_vel= ((requested_vel *(speed / 100)) * fperiod)/10;
if(current_vel > 0 && current_vel >= min_velocity){vel_status = 1;}
else {vel_status =0;}
test = 1;
s4 = torch_on;
if(torch_on && arc_ok && vel_status){ // allow correction
if(torch_down){
if(offset > min_offset){
offset -= correction_vel;
}
s2 = 1;
s3 = 0;
}
if(torch_up){
if(offset < max_offset){
offset += correction_vel;
}
s2 = 0;
s3 = 1;
}
last_z_in = 0;
}
if(!torch_on)
{ // remove any offset
s4 = 0;
z_diff = z_pos_in - last_z_in;
if(z_diff > 0 && offset != 0)
{ // torch is moving up
removing_offset = 1;
if(offset > 0){ // positive offset
if(offset > z_diff){ // remove some
offset -= z_diff;
}
else {offset = 0;}
}
if(offset < 0){ // negative offset
if(offset < z_diff){ // remove some
offset += z_diff;
}
else {offset = 0;}
}
}
else {removing_offset = 0;}
last_z_in = z_pos_in;
}
z_pos_out = z_pos_in + offset;
z_fb_out = z_pos_in; // keep axis motor position fb from being confused
cur_offset = offset;
}
if(!enable){
test = 0;
s1 = 0;
z_pos_out = z_pos_in;
z_fb_out = z_pos_in; // keep axis motor position fb from being confused
}
}
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers