Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   SRX Position Control Confusion (http://www.chiefdelphi.com/forums/showthread.php?t=143759)

rcdturtle 13-02-2016 12:07

SRX Position Control Confusion
 
1 Attachment(s)
We are attempting to control a gear with a rotation range of about 180 degrees in a subsystem called Pivot. We are using joystick input to manually move the gear by bumping the position each cycle the joystick method is called. This allows the pivot to remain at the last joystick commanded position as barriers are crossed. That code is at the bottom of the attachment. It works just as intended.
Our problem occurs when we attempt to progmatically send the pivot to a particular position. We are attempting to read the current position of the gear, determine the difference between the current and commanded positions and use the difference with a SET() command to move to the desired position.
Apparently we don't understand something because every time we execute the SetPivotAngle command the gear rotates constantly. This is true even though the IsFinished requirements are met in the command.
The code is below as you can see we have made several stabs at it.
Thanks in advance for your help.

Alan Anderson 13-02-2016 13:22

Re: SRX Position Control Confusion
 
Where is angle defined, and where is it set?

rcdturtle 13-02-2016 14:55

Re: SRX Position Control Confusion
 
1 Attachment(s)
Sorry we didn't send all of the SetPivotAngle code. The variable angle comes as a parameter when the command SetPivotAngle is instantiated in OI or as part of a group command; it is in degrees of gear position.


All times are GMT -5. The time now is 03:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi