Go to Post My robot is my significant other. It makes me happy, sometimes it makes me sad, i wish it would lose some weight but it is always there for me. - rachelholladay [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
  #1   Spotlight this post!  
Unread 23-02-2008, 22:20
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Question Custom Circuit Design

Having just completed this season's robot, I have developed a high level of interest in making a custom circuit board coprocessor to process sensor inputs from a robot so that, via a simple RS-232, TTL, or whatever connection (maybe even USB or RS-485), a master processor could poll this coprocessor and get back the output of multiple PID loops or navigation software. I really have no end goal except that the coprocessor would process sensor inputs from a CMUcam, encoders, potentiometers, or just about any other sensor and provide an output to a master processor. Now, I have read up on the Adambots solution to this idea, which was to use a gumstix computer. I have also considered using a mini-ITX motherboard. The only problems I see with these solutions are 1) I have no interest in learning linux just for a coprocessor 2) I'm not convinced an RTOS (realtime operating system) is really necessary 3) Even with an ITX motherboard or a gumstix computer I would need another solution to get sensor inputs.

All that said, I have begun to look at AVR microprocessors. Gumstix sells a $49 robostix board which sports an AVR ATmega128 chip and enough IO ports to handle all the sensors I am thinking of using.

I have just a few questions:
-Is there a better approach to this idea? Is an AVR solution better than PIC?
-Is it worth it to instead build the entire custom circuit rather than buy something like the robostix?

Thanks!
-Matt
  #2   Spotlight this post!  
Unread 24-02-2008, 18:54
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Re: Custom Circuit Design

bump...
  #3   Spotlight this post!  
Unread 24-02-2008, 19:32
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: Custom Circuit Design

We have a pic on a custom circuit board acting as a coprocessor. It communicates with the robot controller by way of the ttl serial port.

An RTOS isn't necessary, for one, it will have significant amounts of overhead and will require an auxiliary board to handle sensors, etc(Gumstix implementation). This further contributes to overhead. While any modern x86 style processor has the processing power to overcome such overhead - it still has significant amounts of I/O latency,

A microcontroller, such as the PIC, is likely a better solution, while far less powerful, it requires far less overhead, and because of this, can work with much lower latency.

We have a hardware counter chip to read in the quadrature encoders, this is probably not needed, but reduces overhead even more. A mentor designed and fabricated for us, and they have been incredibly useful so far.

Last edited by 114Klutz : 25-02-2008 at 00:13.
  #4   Spotlight this post!  
Unread 24-02-2008, 19:44
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Re: Custom Circuit Design

Quote:
Originally Posted by 114Klutz View Post
We have a pic on a custom circuitboard acting as a coprocessor. It communicates with the robot controller by way of the ttl serial port.
Would you mind attaching a link to that picture?
  #5   Spotlight this post!  
Unread 25-02-2008, 00:15
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: Custom Circuit Design

  #6   Spotlight this post!  
Unread 25-02-2008, 00:58
Ken Leedle Ken Leedle is offline
College Student
FRC #0706 (CyberHawks)
Team Role: Alumni
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Wisconsin
Posts: 37
Ken Leedle will become famous soon enoughKen Leedle will become famous soon enough
Re: Custom Circuit Design

I would suggest going with a PIC or AVR over an embedded linux processor, especially if you don't have any experience with them. If you have never used a PIC or AVR before (other than in the robot controller) I would suggest using an AVR. They have a more powerful instruction set, up to 20MIPS vs 10MIPS for most PICs, and all the software development tools are freely available (including C compilers). They also have extensive open source libraries. You can make your own programmer for under $10 by hacking a parallel cable or you can get the AVRISP mkII programmer for $36 bucks. I have used both without too much trouble. If you don't want to mess with making PCBs, you can just buy a dev board, but I would recommend designing your own because it will give you a lot more flexibility.

-Ken
  #7   Spotlight this post!  
Unread 25-02-2008, 03:26
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: Custom Circuit Design

One of the biggest advantages, however, of the PIC8722 over an Atmel AVR is that they are completely compatible with the Robot Controllers, being able to run the exact same software.

They utilize the exact same IDE and compiler, and this familiar interface can be very helpful. Our boards have an interface for an ICD2 compatible debugger, and this is incredibly helpful.

I'm not sure if something similar to the MPLAB + mcc18 + ICD2 combination exists for the AVR.

What an ICD2 does is this - it allows you to specify a breakpoint in the C code, and will stop the program from running as it gets there. At that point, It can list out the status of all variables and registers, and at the same time, allow you to step forward or backwards, and MPLAB will display the steps on screen - in C. You can order it to move through the steps slowly, and MPLAB will animate the parts of your code where the program is currently executing. This has been incredibly helpful in our development process.

The fact the FIRST board lacks a jack for an ICD2 annoys me - but being able to test code out on our custom circuit board then port it to the RC is one reason why we chose to use a PIC. (The other reason was the mentor designing these things is very familiar with pics)

If you need any more details, simply ask. Our custom boards can interface with a radio, and has headers for PWM outputs along with Digital/Analog inputs and an integrated breadboard. We plan to use them for other projects after this season is over.

If you would like to see a circuitboard, please drop by our pit at Oregon Regional.

Last edited by 114Klutz : 25-02-2008 at 03:40.
  #8   Spotlight this post!  
Unread 25-02-2008, 07:17
t3hroxor's Avatar
t3hroxor t3hroxor is offline
We are Marcos Pernas!1
AKA: eric erzah
FRC #0408 (RoboTicks)
Team Role: Mechanical
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Pompano Beach, FL
Posts: 23
t3hroxor is an unknown quantity at this point
Send a message via AIM to t3hroxor Send a message via MSN to t3hroxor
Re: Custom Circuit Design

1. tl;dr, sorry
2. What is the co-processor useful for?
__________________
2008 mech/elec team leader

"Koza!! We need math!!!"

More comming soon!

frc4ut0m8ion
  #9   Spotlight this post!  
Unread 25-02-2008, 18:05
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: Custom Circuit Design

Debugging - keep in mind, there is no port for a debugger on the FRC controller - and printf is a poor substitute for a debugger. Even if you intend to write code for the RC only, it's a good idea to test such code on the circuit board first, so it can be debugged there, and then utilized on the RC later.

The second thing is to offload processor intensive tasks such as keeping track of the encoder count to another processor. While generally, encoders shouldn't make a significant difference, if you use high pulse per revolution encoders and a very fast wheel, you can easily end up with the red light of death.
  #10   Spotlight this post!  
Unread 25-02-2008, 18:40
pakratt1991's Avatar
pakratt1991 pakratt1991 is offline
Registered User
AKA: Tim L.
FRC #0997 (Spartan Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Corvallis OR
Posts: 192
pakratt1991 is just really nicepakratt1991 is just really nicepakratt1991 is just really nicepakratt1991 is just really nice
Send a message via AIM to pakratt1991 Send a message via MSN to pakratt1991 Send a message via Yahoo to pakratt1991
Re: Custom Circuit Design

we do basically the same thing as 114 (if I understood all your technical lingo properly,) although with a different board.
We also worked over the summer with AVRs and had our programming student build his own micro processor board, it worked very effectively for what we were using it for. Even got it to work controlling some Victors via PWMs (not for competition, I know it's against the rules )
__________________


2010 Oregon Autodesk Regional Winner (997, 2130, 1515) (Event Volunteer)
2008 UC Davis Semi-Finalists
2007 Championship Semi-Finalist (494, 254, 997)
2007 Davis Sacramento regional Champs (100, 997, 1458)
2007 PNW regional, Champs (997, 272, 1087)
  #11   Spotlight this post!  
Unread 25-02-2008, 19:07
MCahoon MCahoon is offline
Registered User
FRC #3826 (Sequim Robotics Federation)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Sequim, WA
Posts: 129
MCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud ofMCahoon has much to be proud of
Re: Custom Circuit Design

We use a smaller PIC (18F252) to interface to the SRF04 Ultrasonic module - handles the trigger/echo timing and converts to a digital input. I find it amusing that the SRF04 uses a small PIC to generate the ultrasonic pulses in response to the trigger, generating the echo pulse, which we measure with a 2nd PIC, so we can send the data to the PIC in the RC.
  #12   Spotlight this post!  
Unread 28-02-2008, 20:02
lynca's Avatar
lynca lynca is offline
Andrew Lynch
FRC #2587 (DiscoBots)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Houston, TX
Posts: 1,613
lynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond reputelynca has a reputation beyond repute
Send a message via AIM to lynca
Re: Custom Circuit Design

Quote:
Originally Posted by 114Klutz View Post
One of the biggest advantages, however, of the PIC8722 over an Atmel AVR is that they are completely compatible with the Robot Controllers, being able to run the exact same software.
whether you are using a PIC18F722, AVR or another microcontroller, your C code will be very similar, the PIN names might change but if your willing to learn another micocontroller's ".h" file , then don't worry about porting to a new microcontroller. More importantly, you should consider the processing speed performance and the available peripherals (CAN, I2C..etc) and the I/O options (ADC, DAC ...etc)

Read this thread for more info on non-PIC microcontrollers,
http://www.chiefdelphi.com/forums/sh...ad.php?t=64816

Quote:
Originally Posted by 114Klutz View Post
The fact the FIRST board lacks a jack for an ICD2 annoys me - but being able to test code out on our custom circuit board then port it to the RC is one reason why we chose to use a PIC. (The other reason was the mentor designing these things is very familiar with pics)
IFI Robotics is protecting their design by not bussing out the ICD2, you could possibly build a complete replica of the RC if they bussed out an ICD2.

I agree not having an ICD2 port on the RC is annoying. The good news is, most of the other hobby micro-controller companies open their JTAG ports and source code.
__________________
History: 624 - Cryptonite --> 118 - Robonauts --> 2158 - AusTIN CANS --> 2587 DiscoBots
Bio: Andrew Lynch "How I Work" ---- LinkedIn , Facebook, Twitter

Last edited by lynca : 28-02-2008 at 20:06.
  #13   Spotlight this post!  
Unread 29-02-2008, 01:20
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Lightbulb Re: Custom Circuit Design

All right. So I looked at the documentation for the gumstix robostix and the number of external interrupts that are connected to pins is to small. Thus, I have decided to use a MEGA AVR (don't know which one yet). This means we will have to build our own circuit board. Does anyone have suggestions for how to go about designing, building, or implementing a board? Should I go for perfboard or order a PCB per a design that I make? Is there a free CAD software I should use? What about outputs from the board: should I provide other connections than just the no-brained TTL/RS232? I really want to have a prototpe that might work with next year's control system.

Any suggestions/comments are very much appreciated! I so intend to document the prototyping project and make it nearly entirely open-source so other teams can learn to do this too...

Last edited by manderson5192 : 29-02-2008 at 01:22. Reason: spelling and grammatical corrections
  #14   Spotlight this post!  
Unread 29-02-2008, 08:04
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Custom Circuit Design

Altium is available for free to all teams. I use it for my day job as an electrical engineer. You would be very hard pressed to find something better (in my humble opinion), even if you were to pay.
  #15   Spotlight this post!  
Unread 02-03-2008, 13:42
114Klutz 114Klutz is offline
Registered User
AKA: Li Pi
FRC #2984 (Viking Robotics)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Los Altos
Posts: 152
114Klutz is a jewel in the rough114Klutz is a jewel in the rough114Klutz is a jewel in the rough
Send a message via AIM to 114Klutz
Re: Custom Circuit Design

Quote:
Originally Posted by lynca View Post
whether you are using a PIC18F722, AVR or another microcontroller, your C code will be very similar, the PIN names might change but if your willing to learn another micocontroller's ".h" file , then don't worry about porting to a new microcontroller. More importantly, you should consider the processing speed performance and the available peripherals (CAN, I2C..etc) and the I/O options (ADC, DAC ...etc)
I understand this point - but I believe certain differences do exist in the way the processors handle things such as interrupts. At the same time, for those of us who tend to use things such as timers or counters, relearning how can be slightly annoying. For the students involved, its often nice to have consistency between the co processor and the main processor.

As for IFI - why? It's not like the board design is complicated nor ingenious. It simply a PIC with some software, and a master processor which has a relay to control the outputs of the user processor.

Our team has a similar board which was designed by a mentor to have almost identical capabilities to the IFI board, it has PWM headers along with analog/digital in/out abilities. At the same time, it has other robotics specific features such as a 2 channel counter for quadrature encoders.

This isn't considered anything especially complex to do - nor is it unique. Even if the ICD2 header was open, and someone reversed engineered it, people would be required to purchase and use the KOP boards anyways, and I haven't heard of anyone buying the RCs separately for use in other applications.
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
Custom Circuit Boards Billius Electrical 7 14-04-2003 12:48
Serial Port and Custom Circuit Ryan Meador Programming 40 06-02-2003 11:34
Custom Circuit Katie Reynolds Technical Discussion 3 06-01-2003 14:13
So what's in YOUR Custom Circuit this year? kmcclary Technical Discussion 7 10-04-2002 12:20
custom circuit boards ctartist236 Technical Discussion 5 08-01-2002 00:10


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