Go to Post Don't let Dean's homework assignment enter into the equation; his homework is about spreading his organization and has nothing to do with you doing what you want to do. - jonathan lall [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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
  #17   Spotlight this post!  
Unread 19-02-2004, 11:54
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Drill Motor + Gearbox + Breaker Problems

Quote:
Originally Posted by sear_yoda
Also being the electronics dude, I checked all of our wiring. Everything is straight to FIRST specification, and I've got the current sensors all built and ready to be read by the RC (that's another issue: figuring out what the ~500 value I get from the sensor really is, and what's the correct formula to convert it to amps). Neither motor draws more than the assigned voltage, as tested by a multimeter, but I don't think that really means much.
Hopefully I can help you out with the current sensors, at least. Some other sucker on our team is responsible for the drive train

I also read about 500 counts from the Get_Analog_Value(rc_ana_inXX) function call in the software, when the motors aren't moving. When you think about this for a minute it makes sense. Get_Analog_Value() returns an unsigned int (16 bits), but only the 10 least significant bits represent the voltage on the analog input. The biggest number you can make with 10 bits is 1023. We're reading about half of that, around 500. The analog input on the robot controller can read voltages between 0 and 5 volts. 2.5 volts output from the current sensors corresponds to 0 amps (no current, motor stopped). Maybe we're onto something!

Since we're digitizing the input voltage using 10 bits, we have to scale the number that comes out of Get_Analog_Value() appropriately:

input_voltage = Get_Analog_Value(rc_ana_inXX) * 5 / 1023;

The current sensors put out a voltage between 0 volts and 5 volts. 4 volts corresponds to 75 amps (fast forward), and 1 volt corresponds to -75 amps (fast backwards). It's pretty linear in between. Do a y = mx + b on this and rearrange to solve for current in terms of voltage. Try it yourself, and you will find that drive_current = 50 * input_voltage - 125. This will only give you an integer value for the current but at least it gets you started. There are some tricks you can play with averaging and bit-shifting in order to get more resolution, but I'd concentrate on making the sucker drive first.

Hopefully this helps with the current sensing. Let me know if you have any questions at all.

{edit} There's a far easier way to do all of this. In your message you mentioned converting the voltage reading to current, and I tried to answer along those lines. But you don't have to convert to current in order to do simple current limiting. All you have to do is figure out what voltage from the sensor corresponds to your threshold current where you want to limit the motor, and then figure out the corresponding number you'd get from Get_Analog_Value() for that voltage. That's your threshold. Note that there are actually two threshold voltages if you drive the motor backwards, because the current is negative if you drive backwards. {edit}

Last edited by WillyC : 19-02-2004 at 12:55.
 


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
Portable cordless drill press Gui Cavalcanti Technical Discussion 25 03-08-2003 22:21
drill motor mounts- again Jeff Sharpe Motors 6 07-04-2003 23:20
Emergency drill trade/sell Anarkissed General Forum 3 16-02-2003 22:37
More drill motor problems, jeeze. blindguy Motors 4 12-02-2003 09:06
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32


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

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