Limit3 question.

More
10 Jan 2012 15:54 #16531 by dab77
Limit3 question. was created by dab77
Hi. I've always wanted to define acceleration on a hal pin, to change it 'live', but it isn't possible in emc2.

Today, reading here: linuxcnc.org/docs/html/man/man9/limit3.9.html , i've learned about limit3.x.maxs and maxa.

If i understood correctly this limits max acceleration (and velocity) for the given movement into limit3.x.in. Is it?

Do you think can i use some way this parameter connected to maybe a Spinbutton into Gladevcp, where i set the limit of acceleration?
this way i can set an initial Hi acceleration, and then slow this into Gladevcp during axis running.

Any ideas?

Thanks, Davide.

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 17:20 #16540 by dab77
Replied by dab77 on topic Re:Limit3 question.
I would like to try this way, but sincerely i don't know which pin can I feed limit3 with..
or, better, where can i after plug the output?

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 17:51 #16542 by ArcEye
Replied by ArcEye on topic Re:Limit3 question.
Hi

Haven't tried it but would have thought

stepgen.N.maxaccel which is a RW param would be a good place to start

When emc starts, this is set to the MAX_ACCELERATION figure for that axis from the .ini file

Unless you are doing something very clever, would appear to just need a limit1 component to define the bounds within which the acceleration can be adjusted.

regards

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 18:25 #16544 by andypugh
Replied by andypugh on topic Re:Limit3 question.
ArcEye wrote:

Unless you are doing something very clever, would appear to just need a limit1 component to define the bounds within which the acceleration can be adjusted.


Stepgen-maxaccel is a parameter, it can't be netted. (you can only net pins)

The way to do it would be to insert a limit3 between the position-command output and the stepgen-cmd input, then alter the accel limit. However, that would tend to cause an f-error unless the feedback is short-circuited.

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 22:06 #16549 by dab77
Replied by dab77 on topic Re:Limit3 question.
ok, i'll try that. it's a stepper machine, so it will not be so important.

but, what if i do a 'setp stepgen.N.maxaccel my_hal_pin'
does it work?
i would like to set maxaccel with the value of a spinbutton, in the moment when i reset the estop (in the same moment i'm setting my_kins_values from other spinbuttons..), but i really don't know how.

while thinking on this i'll try as you suggest, Andy.
Thanks, Davide.

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 22:39 #16551 by andypugh
Replied by andypugh on topic Re:Limit3 question.
dab77 wrote:

but, what if i do a 'setp stepgen.N.maxaccel my_hal_pin'
does it work?

Yes, setp works with parameters.

Please Log in or Create an account to join the conversation.

More
10 Jan 2012 23:26 #16552 by dab77
Replied by dab77 on topic Re:Limit3 question.
got this error:
...
tgvcp.hal:45: value 'tgvcp.max_acc_out' invalid for float
tgvcp.hal:45: setp failed
Shutting down and cleaning up EMC2...

tried to do this:
# Prova modifica accelerazioni:
setp stepgen.0.maxaccel tgvcp.max_acc_out #this is line 45.
setp stepgen.1.maxaccel tgvcp.max_acc_out
setp stepgen.2.maxaccel tgvcp.max_acc_out
setp stepgen.3.maxaccel tgvcp.max_acc_out

tgvcp.max_acc_out is a out_pin created into python, with the value token from the spinbutton.

Please Log in or Create an account to join the conversation.

More
11 Jan 2012 00:02 #16554 by andypugh
Replied by andypugh on topic Re:Limit3 question.
dab77 wrote:

setp stepgen.0.maxaccel tgvcp.max_acc_out


You can't do that. setp takes a pin or a parameter and a number.

You can _type_ setp at the command line, but it isn't a way to link a gui control to a parameter. And you can't net a parameter.

without re-writing stepgen you can't change the acceleration on the fly.

I say it again, do it in CAM.

Please Log in or Create an account to join the conversation.

More
11 Jan 2012 00:12 - 11 Jan 2012 00:13 #16555 by dab77
Replied by dab77 on topic Re:Limit3 question.
andypugh wrote:

dab77 wrote:

setp stepgen.0.maxaccel tgvcp.max_acc_out


You can't do that. setp takes a pin or a parameter and a number.

You can _type_ setp at the command line, but it isn't a way to link a gui control to a parameter. And you can't net a parameter.

without re-writing stepgen you can't change the acceleration on the fly.

I say it again, do it in CAM.

no, i'm sorry, but in CAM is not the way it should be and it would be a real pita..

I think there should be a way!
as you say, i proved i can setp by typing into the command line, so how can i do that from my python file?

p.s. i've tried the limit3 way, but the acceleration doesn't change.
Last edit: 11 Jan 2012 00:13 by dab77.

Please Log in or Create an account to join the conversation.

More
11 Jan 2012 07:01 #16565 by ArcEye
Replied by ArcEye on topic Re:Limit3 question.
Andy Pugh wrote:

Stepgen-maxaccel is a parameter, it can't be netted. (you can only net pins)

I didn't say anything about connecting it with net

Andy Pugh wrote:

You can't do that. setp takes a pin or a parameter and a number.
You can _type_ setp at the command line, but it isn't a way to link a gui control to a parameter.

You can use setp. One way might be.

Write a handler for the slider or spinbox you set the new max accel with.

From that handler fork halcmd setp stepgen.0.maxaccel [value]

See the Forum discussion under Glade > Label regards writing python event handlers for glade widgets

Another way would be to write a user M code script which does the same thing and call it from your g code at the point
where you want to limit accel to a given value, no pretty gui sliders but can be written in 2 minutes.

regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum