Thread: Motor Drivers
View Single Post
  #22   Spotlight this post!  
Unread 15-02-2013, 00:47
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Motor Drivers

The point of a real-time pre-emptive operating system is to manage high priority timing critical tasks and low priority less critical tasks on the same CPU.

An operating system can pre-empt the slower or more resource-intensive task to execute a higher priority task, then return to the slower task. In FRC, the slower task could be vision, and the faster task could be everything else. Since it takes at least 100ms to process an image, the faster task could pre-empt the image processing several times for each image processed. The higher priority stuff gets done on time, and the lower priority stuff gets done eventually.

The cRio's PowerPC actually sends data to the FPGA (I'm not entirely sure if it's through mapped memory or something else, but it gets transferred to the FPGA's RAM space) which then deals with the actual sensors. It's almost like your input/output coprocessor except it runs fully parallel at 40mhz. Since an FPGA describes hardware, instead of operating on a vector of instructions to execute it actually arranges logic gates to pipeline the operations all in parallel, so everything happens at once or at a lower clock frequency (e.g. many DIO loops run at only ~150khz to match the max speed of the DIO data).

If things ever stop happening because vision is too demanding, then you need to architect the code to run vision in a lower priority task and VxWorks will schedule it like a lower priority task, pre-empting it when the control code needs to run. This is possible and not very difficult to do, it's quite trivial in LabVIEW.



I also suggest you try to find the time it takes to do a 64-bit double precision floating point divide on the cRio's PowerPC vs the Propeller. Actually, tell me if the Propeller can even do it at all.

The propeller and it's cousin the BASIC stamp are probably my definition of low-power microprocessor. There are many far better chips available which can do a far better job at handling embedded controls.


A far better design direction would be to put vision on a co-processor. There are many solutions that have been tried, I can't recommend any of them personally but some sound reasonably fast.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack