Go to Post Mmmmmmmm. Donuts! - Sean Schuff [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
  #16   Spotlight this post!  
Unread 14-06-2010, 02:46
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,078
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Jaguar/Victor question

Once you set up the P, I and D constants on the Jaguars, they can do all the PID calculations onboard itself. The only thing the main robot controller does is send it a new command position/velocity over the CAN bus.

You can easily use a small microcontroller to communicate to CAN bus devices; there are a thousand different ways to do this, but some of the easiest would be use a microcontroller which supports CAN natively, use a SPI-to-CAN hardware adapter, or use a RS232-to-CAN hardware adapter.

OR...

// What follows is not FRC-legal, but it's a really sweet (and cheap!) solution for offboard PID calculations for other projects.


Let's say you have a really simple speed controller. Maybe it's a Victor, or maybe it's a similar style one rated for different currents or voltages. And you want to use PID, and you want to do it offboard from your main controller. And you're looking to spend no more than a few bucks to do so. Luckily, the Atmel ATtiny series microcontrollers (among many others) was invented for this very reason!

For $1.94, you can buy an Atmel ATtiny13 microcontroller. With six I/O lines (including a 10-bit ADC) and the capability to run up to 20 MHz with an external crystal, you have your main robot controller output a desired output position* to the ATtiny. Once you write the code for it, the ATtiny takes in this signal, takes in the desired PID sensor (potentiometer, encoder, etc), processes the PID calculations, and then outputs the correct PWM signal. Voila, offboard PID!

* The simplest way I wan think of to achieve this (e.g. least additional custom hardware and software) is to plug the robot controller PWM data line into one of the digital I/Os on the ATtiny13, and write a bit-banged function to read the PWM input to ascertain what the 0-255 value was. Then calculate PID, and set the PWM output. To enable the PWM output you'll have to read through the Atmel product manual for the correct internal clock register values to enable PWM output.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.

Last edited by artdutra04 : 14-06-2010 at 02:48.
  #17   Spotlight this post!  
Unread 14-06-2010, 08:27
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: Jaguar/Victor question

Quote:
Originally Posted by Chris is me View Post
We're talking about someone's rule question, which would determine whether or not this small personal project is likely to be legal next year. This is useful information for people deciding whether or not to learn about the topic.
This project that I am doing doesn't involve FRC, or FIRST.

I can guarantee it isn't legal, because I will also be having a gas engine on board.
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
Victor vs Jaguar JShortino Control System 6 17-02-2010 22:01
Victor Vs Jaguar kapolavery Electrical 26 06-04-2009 13:14
Yellow Flashing Jaguar/Victor Lights AlbertW90 Electrical 10 16-02-2009 11:06
Jaguar and Victor Flashing lights? programmr FRC Control System 24 17-12-2008 15:44
pic: Jaguar next to Victor ajlapp Extra Discussion 26 10-08-2008 17:56


All times are GMT -5. The time now is 20:53.

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