Go to Post Robotics is my football! - Nemo [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
  #16   Spotlight this post!  
Unread 08-08-2006, 14:56
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Globe Motor Programming Questions

Quote:
Originally Posted by Mark McLeod
You're correct that if pwm01 gets set to a number greater than 255 it will wrap around to zero and you'll suddenly go from full forward to full reverse.
In the TxData struct, all PWM values are defined as type 'unsigned char' - or one byte. Assigning a value greater than 255 will cause unpredictable processor operation unless you are VERY lucky.

Most programmers are used to C/C++/C#/C.NET which traps all your errors.... such as overflow. In the processor, it does exactly what you tell it to do. All defining some thing as a uchar does is tell the linker to offset the next thing in memory by 1 byte. Sooooo if you write a number bigger than a byte, you will interfere with the next bit down the line in processor memory. This would in effect change the value of the next variable.

-Q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #17   Spotlight this post!  
Unread 08-08-2006, 15:03
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Globe Motor Programming Questions

Quote:
Originally Posted by Matt H.
To respond to the original question; the type of motor is not incredibly important as long as it runs on a PWM signal. What you need to do is set your PWMs as shown in the first response and assuming you are using the FRC robot controller and default MP labs code it will convert that data into a usable signal for any standard PWM motor.

Matt something you may want to try sometime to understand better the premise on which PWM motor control works is examining the output of a Victor or other H-Bridge Drive's output.

If you have access to an oscilloscope, hook the probe end to M+ and the alligator clip to M-, and set your oscilloscope to trigger on a rising edge. Then use a joystick to vary the 'power level' (duty cycle percentage) to the motor. As the speed of the motor changes, watch what the ratio of up and down time on the pulse train does.

If you have any questions i'll be happy to answer them.

-Q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
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
globe motors arabsponsor Motors 16 29-01-2005 00:12
2 Globe Motors??? ChuckDickerson Motors 18 25-01-2005 15:53
Globe Motors? Brett W General Forum 3 10-01-2003 21:13
Globe Motors archiver 2000 1 24-06-2002 00:15
Spare Globe Motors archiver 2000 9 23-06-2002 22:48


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

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