Go to Post I care that teams took some time to put in safe guards to prevent shrapnel hitting people because I'm selfish and I enjoy the use of all of my limbs. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 09-05-2016, 16:41
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 521
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: Continuous Feedback Sensor on CANTalon

Quote:
Originally Posted by TimTheGreat View Post
So if the sensor is at 200 and I want it to go to 1000 it will go backwards 223?
So assuming 1024 units per rotation (analog sensor), if you want to go "backwards" set the target to -23. This will move backwards by -223 (since your current position is 200), instead of moving forward by 800 (pos200=>pos1000).

The basic idea is if you want to move forward, use the appropriate multiple of your target position in the positive direction. If you want to move reverse, use the appropriate multiple in the negative direction. If you want to servo using the shortest distance, calculate how far the target is moving forward, and moving backwards, pick the shortest one, and use that as the final set point.

Attached is an excel sheet demonstrating a few examples of how to do this.
Attached Files
File Type: xlsx continuous_wheel.xlsx (13.2 KB, 14 views)
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 23:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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