View unanswered posts | View active topics It is currently Thu Jul 24, 2014 1:02 pm






Reply to topic  [ 4 posts ] 
Variable PWM on Motor Ports 
Author Message
Rookie

Joined: Tue Jun 21, 2011 9:59 am
Posts: 2
Post Variable PWM on Motor Ports
Howdy folks,
I did a search and couldn't find anything relative to what I was looking for. I'm trying to wire LEDs to our VEX Cortex via the 2- and 3-pin motor ports. I've discovered that the battery voltage pin stays high independent of programming, so I have a constant ~7.2V available, so I realize the only source of variable voltage I have control over would be the PWM signal pin.
I've measured the output at -127 and 127 in RobotC, and the voltage remains relatively the same (~1.8V), but duty cycle varies by over 16%. Is there any way to override the default duty cycles and stretch out the pulse (very very dim LED) vs. very quick (illuminated LED)?
I know the digital I/O ports can be used very simply for LED functions, but we've got a similar setup occupying all of the I/O ports so I only have motor ports to my disposal.

Any help would be appreciated, thanks!


Tue Jun 21, 2011 10:06 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post Re: Variable PWM on Motor Ports
Hi Ravitek,

Unfortunately ROBOTC does not provide that kind of low-level access to the duty cycle. This is largely the case to prevent the motors and motor ports from burning out from accidental abuse.

What is it that you're trying to signal using the LED patterns? Is it something that a fast/slow spinning motor or servo + attachment could show? Also, the VEX Flaslight can be set to different brightness levels using ports 1 and 10: http://robomatter.com/Shop-By-Robot/VEX ... hlight-Kit

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Wed Jun 22, 2011 8:48 am
Profile
Rookie

Joined: Tue Jun 21, 2011 9:59 am
Posts: 2
Post Re: Variable PWM on Motor Ports
Thanks for the prompt response, jbflot.
My idea was to illuminate individual segments of a seven-segment display with each individual motor port. I'm still in the process of wiring a 'breakout' breadboard with the proper wiring, I imagine I'll still give it a shot and see if it's easy to discern the illuminated (127) digits vs. the dimmer (-127) digits.

Would any one have experience with MPLab (or other IDEs) and know if it has the ability to vary the PWM duty cycles? I've seen the screenshot during setup where they declare PWM(2,255) and PWM(2,0) and wonder if the 0-255 range is complete high and low.

Your suggestion may be my plan B, perhaps a servo with an attachment and labels showing it can reach both extremes. The motivation in my project is the ability to test every individual port on the CORTEX before renting the kit out to competitors. I liked the idea of a 7-seg and as long as it presented the proper port number (selected via joystick), the motor ports were functioning.


Wed Jun 22, 2011 9:16 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 403
Post Re: Variable PWM on Motor Ports
I don't believe that MPLAB is compatible with the VEX Cortex, since it's a compiler specifically for PIC microprocessors. ROBOTC and easyC (which provides even less low-level access) are the only two programming environments for the VEX Cortex.

Good luck with the breakout board!

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Thu Jun 23, 2011 2:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.