[SOLVED] axes follow other axes

More
17 Jul 2014 18:07 - 29 Jul 2014 18:35 #48879 by bkt
I'm new user but not in linuxcnc.

I search for suggestion about these situation ... with some type of command (python, bash or c++) I need to make sure that an axis chase another axis ..... the leader axes have an pid and encoder command, the follow axes have stepgen command. Sometime in my gcode (or mdi command if the program that pilot is c++) the first axes follow the second one. sometime the first is free to move and directly command by normal gcode (or mdi command if the program that pilot is c++).

There are some doc about??
Last edit: 29 Jul 2014 18:35 by bkt. Reason: solved

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

More
17 Jul 2014 19:51 #48891 by andypugh
Replied by andypugh on topic axes follow other axes

There are some doc about??


Almost certainly not, for this particular application.

You want a stepper axis to chase a servo axis?

I would configure the stepgen in velocity mode, and then configure a second PID to control the stepgen velocity. It could either take the same command value as the servo axis, or it could literlay "chase" it by following the encoder feedback.
Depending on the application you might be able to simply net the stepgen position command (of a position-mode stepgen) to the encoder feedback or position command.

You can change the linkages around in HAL either by driving "mux" components, or actually re-wiring the hal components.
The following user(s) said Thank You: bkt

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

More
18 Jul 2014 01:21 #48902 by bkt
Replied by bkt on topic axes follow other axes

You want a stepper axis to chase a
servo axis?


yes .... exactly i wont to chase only an encoder signal with an stepper axes... there is only a motor+inverter+encoder without PID control.

do I understand correcly? you suggest to create a NET signal (connect to digital input for example?) this signal starts or stops the chase process......

thank a lot for Any reply you would give

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

More
18 Jul 2014 03:50 - 18 Jul 2014 03:50 #48905 by andypugh
Replied by andypugh on topic axes follow other axes

do I understand correcly? you suggest to create a NET signal (connect to digital input for example?) this signal starts or stops the chase process.


As always, the devil is in the detail.

Do you actually want the stepper to "catch" the other motor, or just match speed?

You can probably use the built-in velocity and accel limits of the stepgen component to make things rather simpler.

In theory, if you simply
net catch-me-if-you-can encoder.0.position => stepgen.0.position-cmd

Then as soon as you
setp stepgen.0.enable 1
the stepgen will run at full speed to catch the motor. But you probably don't want it to catch up all the previous revs, so perhaps
setp encoder.0.reset 1
setp stepgen.0.enable 1
is the way to go.

I am not 100% sure how you set HAL pin values from inside code, but you could simply copy how halcmd does it:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...0aca31d;hb=HEAD#l691
Or, for that matter, shell out to halcmd.
Last edit: 18 Jul 2014 03:50 by andypugh.

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

More
23 Jul 2014 02:32 #49031 by bkt
Replied by bkt on topic axes follow other axes
I think is possibile to use encoder-ratio isn't it?

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

More
23 Jul 2014 06:21 #49037 by andypugh
Replied by andypugh on topic axes follow other axes

I think is possibile to use encoder-ratio isn't it?


Ah, yes, well spotted. I had wondered what that was for!

Yes, you should be able to let that do most of the work.

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

More
24 Jul 2014 00:24 #49057 by bkt
Replied by bkt on topic axes follow other axes
:( this afternoon I try to add->sum encoder.0.position to stepgen.0.position-fb without success .... I feel ashamed own. :blush: .... I thought it was a good way to add position on desired axes .... or chach my axes ... but I'm not sure ... i'm doing the right thing?

if i use sum2 I have this error : stepgen.0.position-fb invalid for float

if try to open new thread on hal it close whit -1 error because unable to read thread

yes...

As always, the devil is in the detail.

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

More
24 Jul 2014 01:54 #49061 by andypugh
Replied by andypugh on topic axes follow other axes

if i use sum2 I have this error : stepgen.0.position-fb invalid for float


Hmm.
At times like this I head for "Documentation" at the top of the page, and from there to html, to this page: linuxcnc.org/docs/html/
Specifically, in this case linuxcnc.org/docs/html/man/man9/stepgen.9.html
And there we see that stepgen.N.position-fb is an output, and so is encoder.N.position. You can't connect together two outputs.

You might want to be using stepgen.N.position-cmd
The following user(s) said Thank You: bkt

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

More
24 Jul 2014 03:13 #49063 by bkt
Replied by bkt on topic axes follow other axes
:laugh: yess ... but now the problem is sum axis.0.motor-pos-cmd with encoder.0.position .... are both the out value => sum2 is not permitted is correct? then there are other way to do this?
I very much appreciate your guide ..

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

More
24 Jul 2014 04:10 #49064 by bkt
Replied by bkt on topic axes follow other axes

but now the problem is sum axis.0.motor-pos-cmd with encoder.0.position


my mistake to write .... problem is sum stepgen.N.position-cmd with encoder.0.position ..... encoder.0.position is out value and operation is not permitted ... there are other way to do these?

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

Time to create page: 0.144 seconds
Powered by Kunena Forum