Go to Post I may be an engineer, but I am not smarter than a 5th grader. - Josh Drake [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2002, 15:24
diego25 diego25 is offline
Registered User
#0897
 
Join Date: Jan 2002
Location: Toronto, Ontario
Posts: 10
diego25 is an unknown quantity at this point
Output voltage in PBASIC

How does the output voltage in PBASIC work?

I know 0-255 in PBASIC means a voltage from 0 to +5V, but how does the motor go backwards then? That'd require negative voltage...

From what I've seen, I think
127 means 0V
> 127V means forward
< 127V means backward

Is that right? If that's right, what provides more power? 0 or 126V?

e.g.

hi neg power no power hi pos power
0------------------------------127------------------------------255

or

low neg pwr hi neg pwr no power low pos pwr hi pos power
0----------------------------------127------------------------------255

Hope this wasn't too confusing

Thanks,

Diego
  #2   Spotlight this post!  
Unread 31-01-2002, 15:53
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
INPUTS work different than OUTPUTS...

The analog inputs have a 0-5V range (0-255).

The PWM outputs range from 0-254 (not 255! see other messages).

The Victors map 0 to -Vbatt, 127 to 0 V, and 254 to +Vbatt.

They have an H-bridge that puts the proper voltage to the motor leads.

Actually, they don't really have the ability to put 6V to the motor, they just put 12V to the motor for 50% of the time.

It is a very clever thing really, but for our purposes, you can imagine that you have a variable output voltage.

Hope this helps.

Joe J.
  #3   Spotlight this post!  
Unread 31-01-2002, 21:29
diego25 diego25 is offline
Registered User
#0897
 
Join Date: Jan 2002
Location: Toronto, Ontario
Posts: 10
diego25 is an unknown quantity at this point
Thanks!
  #4   Spotlight this post!  
Unread 31-01-2002, 22:01
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
Dr. Joe,

What is exactly that thing you said, about providing 12V 50% of the time instead of 6V? How does it work?
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
  #5   Spotlight this post!  
Unread 31-01-2002, 22:32
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,644
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Think about it this way...

The problem is that high current transistors really don't like being half on. They are much happier being all the way on or all the way off (happier being defined in this case as cooler).

So... ...what is an engineer with a high current applciation to do? Well, as it turns out, transistors can be very fast at changing from on to off (and off to on). So... what they do is turn the full voltage on for only a percentage of the time.

Basically, if they want half the voltage, they turn the motor on for half the time. If they want 75% of the voltage, they turn the motor on for three fourths of the time. Assuming that the on/off frequency is fast compared to the reaction time of the motor, the current gets sort of averaged and the motor more or less behaves like it is driven continuously by the reduced voltage.

One way of thinking about it would be to have a hammer that could hit somthing with a force of 10 lbs. If you wanted to accelerate a 10 lbs block at .5g's I could hit the mass with 10 lbs for half the time. The mass would begin to acclerate with each hit. The mass of the block would smooth out the velocity (sort of, if I didn't look at it TOO closely) and assuming that my hit frequency was fast enough, I could pretend that I had a 5 lbs. hammer hitting the block continuously.

The mass is playing the role of the motor. The hammer is the voltage. The velocity is the current.

Don't know if this helped but I tried...

Joe J.
  #6   Spotlight this post!  
Unread 31-01-2002, 22:37
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
I found the concept easy to understand. Basically, the motor gets full power for amount of time per cycle, and the inertia and momentum of the motor will make the motor keep spinning until the next chunk of full power is applied (like, nano-seconds after). That's how I visualized it, although I'm not sure how much help that is to anyone else, seeing as Joe defined it pretty well too. I guess my description is the "Super-Layman's-Terms"
  #7   Spotlight this post!  
Unread 31-01-2002, 22:49
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
I think I got it, correct me if I'm wrong:

it's much more on/off/on/off (...) , with each on or off being a very small interval, than a very large on and an equally large off.

Right?



Thanks for your help,
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
  #8   Spotlight this post!  
Unread 31-01-2002, 22:50
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Exactly correct.
Closed Thread


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
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
Current Monitoring system questions PyroPhin Technical Discussion 44 17-02-2003 15:34
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
PBASIC access to 1 pin only diego25 Programming 13 21-01-2002 10:55
Simplifying PBasic IDiggles General Forum 16 06-11-2001 01:36


All times are GMT -5. The time now is 01:16.

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