Go to Post Build a robot that isn't 119.999999 lbs - Peyton Yeung [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-07-2009, 14:18
shadowraze shadowraze is offline
Registered User
no team
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New York
Posts: 3
shadowraze is an unknown quantity at this point
PWM signals from computer?

Hello,
Jaguars and victors are currently connected to the digital sidecar and then to the cRIO by a PWM cable. Is there was a way to connect a PWM cable directly to a computer so that you can directly control a Jaguar or Victor from it?
  #2   Spotlight this post!  
Unread 30-07-2009, 14:43
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,022
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: PWM signals from computer?

If you get the right computer (such as the old IFI controller) it's pretty easy...but if you have a PC or something you need some type of interface.
  #3   Spotlight this post!  
Unread 30-07-2009, 15:05
shadowraze shadowraze is offline
Registered User
no team
 
Join Date: Jan 2008
Rookie Year: 2008
Location: New York
Posts: 3
shadowraze is an unknown quantity at this point
Re: PWM signals from computer?

I have a linux computer and I was trying to use the serial or parallel port as an output. However, I'm not really sure how to connect the PWM to those ports. Would it be possible if I used the parallel port and connected it to a digital sidecar then attached a PWM on that?
  #4   Spotlight this post!  
Unread 30-07-2009, 15:34
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: PWM signals from computer?

http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=151001 &

I've had good success with the above part - RS-232 in and 8 PWM servo outputs.

Russ
  #5   Spotlight this post!  
Unread 30-07-2009, 15:39
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: PWM signals from computer?

The 37-pin interface on the digital sidecar isn't related in any direct way to the 25-pin parallel port on a PC. The 10 PWM outputs from the DSC are "bit-banged" from the digital output module in the cRIO. The DSC is only present to buffer the cRIO's outputs and thereby provide additional current. Using the DSC would help if you can bit-bang the parallel port outputs with resolution in the 10s of microseconds or better (but I don't think that you can reliably twiddle those bits as needed).

Russ
  #6   Spotlight this post!  
Unread 30-07-2009, 19:48
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: PWM signals from computer?

Quote:
Originally Posted by shadowraze View Post
I have a linux computer and I was trying to use the serial or parallel port as an output. However, I'm not really sure how to connect the PWM to those ports.
As has been stated, there are many products available that offload control of servos and can be interfaced over RS-232 (serial), IEEE-1284 (parallel), or USB.

Of the three, parallel is probably the best suited for an attempt at directly controlling a servo. And while this is physically/electrically possible, a stock Linux installation is not well equipped to be able to handle this kind of a task. The problem exists in the task scheduling mechanism of the OS, which typically runs on somewhere between a 1ms and 10ms clock.

Explanation of task scheduling:
One of the main jobs of an operating system is to schedule which programs get to use the CPU. The handoff between tasks occurs whenever a program calls any of the faciilities provided by the OS, such as hardware interface, timed delay, writing to the screen, communication between programs running on the system, etc. A scheduling clock of 1ms to 10ms means that a new task is switched into the processor at a minimum of 1ms to 10ms.

The problem that this generates for servo control is that standard servos require a control pulse that varies between 1ms and 2ms. So your program would look something like: turn on servo control output, wait for 1ms-2ms (depending on desired position), turn off servo control output. However, since timed waiting is one of the things provided by the OS, this means that when you call wait in your program, the OS will most likely let another task run on the CPU. This means that for most operating systems, asking your program to wait for 1.3ms doesn't actually mean it will wait for 1.3ms, but is more likely to wait somewhere between 10ms and 20ms.

There is a possible solutions to this. If you're particularly comfortable with Linux, there is a kernal patch available called PREEMPT_RT which enables an alternate scheduling algorithm called preemptive multitasking which basically allow the OS to wrench control away from any of the running programs whenever it wants to, allowing your program to request much more accurate timing intervals, but the process of patching and recompiling a Linux kernel can be painful. Once you have the support in the kernel however, it should be possible to do what you want, and there are a couple articles published by a someone who did something similar to what you are proposing.

All told, though, I think you'd be better off purchasing one of the controller modules, unless you're feeling especially adventurous.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
  #7   Spotlight this post!  
Unread 02-08-2009, 14:30
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: PWM signals from computer?

Check this thread. I was trying to do the same thing.
http://www.chiefdelphi.com/forums/sh...ad.php?t=77614

After trying to write a PWM class for my computer I decided that it would be easier to use a stamp as a PWM serial interface. I happened to have one, so it was very simple to do. You could also use a PIC. Any cheap microcontroller will do.
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
Measuring PWM input signals virtuald C/C++ 5 03-03-2009 07:15
Download from RC back to computer? geeknerd99 Programming 10 02-04-2007 18:37
No PWM from controller ctshirk7 Control System 10 27-01-2006 18:55
PWM Signals stevex Programming 1 28-10-2004 18:03
visual signals from operator allowed? angelina Rules/Strategy 16 23-01-2003 20:11


All times are GMT -5. The time now is 07: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