Go to Post I can't really think of a bad FIRST experience, really, I can't. - Joshua May [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2004, 23:39
Dale(294engr]'s Avatar
Dale(294engr] Dale(294engr] is offline
Mentor/Sponsor since '98
FRC #0294 (Beach Cities Robotics)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Redondo Beach, CA
Posts: 92
Dale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of light
Exclamation Navigate.c Current Sense code=only one polarity

It appears the sample code senses only one overcurrent direction.

Below represents potential ideas NOT tried code !!

dh- it's not clear how(if) neg current is included i.e. for backing into wall
(note: current polarity in code depends on sensor wiring direction)

Provided code may assume NO reverse motor drive will occur in autonomous ???

assumed: ADC return is int counts (10bits, 0 to 1023 counts)
if it was a real voltage proportional to current sensed,
ABS(real) would do the job

suggest something like this:

MAXPOS_CURRENT 700 (511+188)
MAXNEG_CURRENT 511-188 511 =midrange =2.5v =0A

For two AD Current Sensor channels with different zero current offsets

(note that new joysticks have all too easy bump access to wheel ZERO
with consequence !)

add unsigned char ad01cszero ad02cszero
init once @ robot turn-on with no drive (assumes wheel offset proper adj)
sum/difference with the counts representing desired +- current limits

MAXPOS_CURRENT01 ad01cszero+188
MAXNEG_CURRENT01 ad01cszero-188 // 188 = ~45A
MAXPOS_CURRENT02 ad02cszero+188
MAXNEG_CURRENT02 ad02cszero-188 // 188 = ~45A

for +-current tests w/AD01 & AD02 each w/theoretical
rather than actual measured offset+-current

if ( ((left_current[i] > MAXPOS_CURRENT) ||
(right_current[i] > MAXPOS_CURRENT ||
left_current[i] < MAXNEG_CURRENT) ||
(right_current[i] < MAXNEG_CURRENT))
&& (Navigator_State != WAIT_TO_DRIVE)
&& (Navigator_State != AT_TARGET))
{
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2004, 16:25
Dale(294engr]'s Avatar
Dale(294engr] Dale(294engr] is offline
Mentor/Sponsor since '98
FRC #0294 (Beach Cities Robotics)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Redondo Beach, CA
Posts: 92
Dale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of lightDale(294engr] is a glorious beacon of light
Re: Navigate.c Current Sense code=only one polarity

Quote:
Originally Posted by Dale(294engr]
It appears the sample code senses only one overcurrent direction.

A simple fix is to place the Current Sensor in series w/ battery side of the V884. (black lead suggested as 'safest').

All Fwd & Rev motion will have the same current Polarity (2.5-4v for 0-75A)
Direction of current may be determined by joystick position if needed.

Below represents some ideas for implementing bi-direction current processing,
NOT tried code !!


dh- it's not clear how(if) neg current is included i.e. for backing into wall
(note: current polarity in code depends on sensor wiring direction)

Provided code may assume NO reverse motor drive will occur in autonomous ???

assumed: ADC return is int counts (10bits, 0 to 1023 counts)
if it was a real voltage proportional to current sensed,
ABS(real) would do the job

suggest something like this:

MAXPOS_CURRENT 700 (511+188)
MAXNEG_CURRENT 511-188 511 =midrange =2.5v =0A

For two AD Current Sensor channels with different zero current offsets

(note that new joysticks have all too easy bump access to wheel ZERO
with consequence !)

add unsigned char ad01cszero ad02cszero
init once @ robot turn-on with no drive (assumes wheel offset proper adj)
sum/difference with the counts representing desired +- current limits

MAXPOS_CURRENT01 ad01cszero+188
MAXNEG_CURRENT01 ad01cszero-188 // 188 = ~45A
MAXPOS_CURRENT02 ad02cszero+188
MAXNEG_CURRENT02 ad02cszero-188 // 188 = ~45A

for +-current tests w/AD01 & AD02 each w/theoretical
rather than actual measured offset+-current

if ( ((left_current[i] > MAXPOS_CURRENT) ||
(right_current[i] > MAXPOS_CURRENT ||
left_current[i] < MAXNEG_CURRENT) ||
(right_current[i] < MAXNEG_CURRENT))
&& (Navigator_State != WAIT_TO_DRIVE)
&& (Navigator_State != AT_TARGET))
{

[color=DarkSlateBlue]A simple fix is to place the Current Sensor in series w/ battery side of the V884. (black lead suggested as 'safest').

All Fwd & Rev motion will have the same current Polarity (2.5-4v for 0-75A)
Direction of current may be determined by joystick position if needed.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current Monitoring system questions PyroPhin Technical Discussion 44 17-02-2003 15:34
What happens / why do motors stall? DanL Technical Discussion 19 21-11-2002 07:19
Controller Simulator Jay Programming 14 03-04-2002 02:04


All times are GMT -5. The time now is 06:18.

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