Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: TerryW on November 18, 2020, 12:47:45 PM

Title: Do-More motion using analog output
Post by: TerryW on November 18, 2020, 12:47:45 PM
Hello.  My first time on this forum.  I have an old machine with servo drive that takes an analog +/-10V signal.  Is there an elegant way to use the axis object to create an analog output to follow the axis motion profile? 
Using the axis.targetvelocity seems to work for AXHOME and AXJOG but not AXPOSTRAP.  AXPOSTRAP causes a runaway condition.  axis.targetvelocity goes max positive but axis.currentposition counts in the negative direction at full speed.  Axis is configured with encoder feedback that responds appropriately to motor rotation. 
Seems like analog motion control would be a common request.  I didn't find something in search...
Title: Re: Do-More motion using analog output
Post by: BobO on November 18, 2020, 04:29:36 PM
Hello.  My first time on this forum.  I have an old machine with servo drive that takes an analog +/-10V signal.  Is there an elegant way to use the axis object to create an analog output to follow the axis motion profile? 
Using the axis.targetvelocity seems to work for AXHOME and AXJOG but not AXPOSTRAP.  AXPOSTRAP causes a runaway condition.  axis.targetvelocity goes max positive but axis.currentposition counts in the negative direction at full speed.  Axis is configured with encoder feedback that responds appropriately to motor rotation. 
Seems like analog motion control would be a common request.  I didn't find something in search...

I think you would want Axis.CurrentVelocity, not Axis.TargetVelocity.

I might have heard the analog request once before, but it really isn't that common.


Title: Re: Do-More motion using analog output
Post by: DLTimmons on November 19, 2020, 08:27:26 AM
I done what you trying to do. First done it with a H2-CTRIO . Take Axis.CurrentVelocity multiply it by a scaling value (you have to work that out based on your encoder ) then write that out to an analog out.
Title: Re: Do-More motion using analog output
Post by: RBPLC on November 19, 2020, 10:00:45 AM
As DLTimmons said, this seems relatively easy to accomplish with some math/scaling functions. I would assume that the limiting factor is the response time of the analog outputs.
Title: Re: Do-More motion using analog output
Post by: TerryW on November 19, 2020, 02:39:48 PM
Thanks.  I think I've got it now.  Runaway issue was setting to rotary instead of linear causes inappropriate rollover to max position value.  On some commands target velocity is just magnitude and not signed.  Talked to AD support and they got me straightened out.  He advised keeping axis virtual (no encoder feedback) for my application.  Axis object designed primarily to work with deterministic step motors?  Some issue with whether currentvelocity and targetvelocity represent what I would have liked them to be? 
Now using virtual axis.currentvelocity to primarily set analog output.  Using difference between virtual ideal axis.currentposition and real encoder feedback position with PID to trim analog to keep positions better synced.  Seems to work.  Probably a lot of ways to make it work.