Go to Post Be kind to you mentors. They are exhausted and you need them. - MrJohnston [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 20-04-2008, 21:26
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,417
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Question Digital Electronics project - servos and more

In my DE class, we're required to select a project we would like to do for the rest of the year. I had a fun idea, but I'm not exactly certain how to implement it, so I need help.

What I would like to do is make a robotic arm, and a "dummy". Both would look exactly the same, perhaps the robotic arm would be 2-4x bigger. Anyhow, when the dummy is moved, the other arm would mirror it (I'm looking to have 2 joints, and a turret).

So, the design. In essence, I would be creating three custom servos. I would have 3 pots as inputs (2 joints and 1 rotation), and 3 pots as feedback. I've looked through the web, and I've come across a couple sites with ways to make servos, H-Bridges, and servo pulse to PWM converters.

I'm not exactly sure how much of the circuitry I would have to make, but I'm certain my teacher won't let me use an IFI RC or Hi-tech servos.
I would like to use PID control for the servos I create; but I would definitely need a micro controller for that.

So, I've got a few questions.
1) Is there a better way to approach this, or a better design / what would you use?
2) What would be a decent micro controller that would fit my needs (6 analog inputs, 3 PWM, or 3 pulse outputs, cheap ~$30)
3) Have you done something similar to this, or worked with programming micro controllers?
4) Any solid advice before I start?

thanks!
-e.foote
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #2   Spotlight this post!  
Unread 20-04-2008, 22:35
whytheheckme's Avatar
whytheheckme whytheheckme is offline
Registered User
AKA: Jacob Komar
no team
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Providence, RI
Posts: 1,320
whytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond reputewhytheheckme has a reputation beyond repute
Send a message via ICQ to whytheheckme Send a message via AIM to whytheheckme Send a message via MSN to whytheheckme Send a message via Yahoo to whytheheckme
Re: Digital Electronics project - servos and more

Back when I was on FRC #0181, we created a (scaled down) replica of our 'bot's arm for our OI, using pots at each joint and a button for the actuator, to control our actual arm. We won the control award for this.

It really is pretty simple. If you have pots on the controlling arm, and pots on the big arm, you just have to write a relational equation to convert the two values (example: big_pot_1 = mini_pot_1 * .86 + 28)

Then you can pick a micro-controller to handle the job. A PIC16, like we used to use with the PBASIC bots, should work just fine. Get a protoboard (total, the controller, board and cable are usually together in a package in the $50-80 range.) You can then have your pots from your controller arm input into this, and have your output to your motor controllers.

Lets assume you are using motors that you only want to control with on/off/backwards type movement. You could then get some relays (from radioshack, less than a buck a piece), and run your motor voltage through them, with your control signal running back to your micro. Attach your motors to the relays.

Finally, you need to write some code. I hope that you aren't being forced to write in assembly, although this could be done. If not, make sure that when you pick a microcontroller, you pick one in a language that is easy for you to pick up. The PBASIC and C ones should work fine. Simply read in your inputs, convert to your output theoretical value, compare to the actual arm pot value, and drive your motors in the correct direction until they match.

Hope this helps!
Jacob
  #3   Spotlight this post!  
Unread 20-04-2008, 23:00
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Digital Electronics project - servos and more

Quote:
Originally Posted by efoote868 View Post
I would like to use PID control for the servos I create; but I would definitely need a micro controller for that.
http://www.ecircuitcenter.com/Circui...pid/op_pid.htm
  #4   Spotlight this post!  
Unread 21-04-2008, 10:01
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,417
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: Digital Electronics project - servos and more

Quote:
Originally Posted by mluckham View Post
Alright, so there is a way to do it without a micro controller, but I don't want to try to tune an analog PID...

I think what I need to know is how much of this circuit I would build myself, and how much I would buy just in chips (make my own H-bridge vrs. buying one, make my own analog to digital converter or getting it on board with the PIC, etc.)
Any thoughts?
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #5   Spotlight this post!  
Unread 22-04-2008, 21:18
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,417
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: Digital Electronics project - servos and more

(Sorry for the double post, but I'm going to answer a few of my own questions)
I do not have to build any part of the circuit myself if it is available, for instance, the H-bridges, I can just buy as is, or the analog to digital converter can be embedded in the PIC, as well as the PWM outputs.

I've got a question as far as the PIC goes, which of the line have analog inputs, and pwm outputs? Which chips are able to be programmed in C?
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #6   Spotlight this post!  
Unread 24-04-2008, 13:07
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Digital Electronics project - servos and more

Quote:
Originally Posted by efoote868 View Post
I've got a question as far as the PIC goes, which of the line have analog inputs, and pwm outputs? Which chips are able to be programmed in C?
Get onto Microchip's website and dig into the manuals.
  #7   Spotlight this post!  
Unread 25-04-2008, 04:32
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Digital Electronics project - servos and more

If you decide to use a PIC, you can either go with the PIC16 or PIC18 series.

PIC18:
This is the same product family as the one in the RC, so you can use the same development environment (MPLAB + mcc18, but not IFI loader). Most of these come in non-DIP packages or are too large for what you need, but given your requirements the PIC18F1220 will work.

PIC16:
These are generally smaller and less powerful than the PIC18, but still plenty powerful for your needs. The problem with PIC16 is there are no free fully featured C compilers for it (as far as I know), but there are some free limited ones you may be able to use. The assembler is free if you're insane. There are too many PIC16s that match your requirements, so use Microchip's product comparator to find the right one for you (get one with flash memory, ie 16F series, and at least one CCP for PWM). The PIC16F88 is a popular choice.

With any PIC you'll need to find a programmer (to actually get the code onto the processor). You can buy one from microchip, but they can be pretty expensive. Or you can try to google some cheap versions you can build/buy (make sure to get the software you need too).

A good alternative to a PIC is an AVR. Unlike PICs, there is an AVR gcc C/C++ compiler that comes with a great set of tools. You can compare AVRs here, but I recommend the ATtiny44. You'll also need a programmer for the AVRs. There are some cheap ones, but you'll have to find one that works with a ATtiny.
  #8   Spotlight this post!  
Unread 12-05-2008, 14:48
keen101's Avatar
keen101 keen101 is offline
Ubuntu Linux User
no team
Team Role: College Student
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Loveland, CO
Posts: 228
keen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the roughkeen101 is a jewel in the rough
Re: Digital Electronics project - servos and more

http://ladyada.net/make/mshield/index.html
  #9   Spotlight this post!  
Unread 13-05-2008, 11:02
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Digital Electronics project - servos and more

Quote:
Originally Posted by efoote868 View Post
1) Is there a better way to approach this, or a better design / what would you use?
2) What would be a decent micro controller that would fit my needs (6 analog inputs, 3 PWM, or 3 pulse outputs, cheap ~$30)
3) Have you done something similar to this, or worked with programming micro controllers?
4) Any solid advice before I start?
1) Your approach looks good. The only thing I would suggest is doubling up your "PWM" outputs on your microcontroller, so that you can signal your H-Bridge directly (you won't need any intermediate circuits like a servo to PWM converter). Looking at the website you linked to for H-Bridges, the circuit has two signal inputs: A and B. Depending on which direction you'll be spinning your motors, you'll keep one signal input low, and pulse the other high. You'll have to handle the logic to change directions in your micro now by swapping which one is kept low, and which one is pulsed high when you go in reverse. To me this is actually more elegant (and easier) than building an external circuit, at the cost of double the number of outputs - most micros can be had with at least 6 DIO anyway. By signalling the H-Bridge directly, you also won't need specific PWM outputs. A simple digital output that's turned on and off with some regularity should do. Precise carrier frequency timing of your signal is not important if you do this, which is what a "real" PWM output gives you. For your particular example H-Bridge circuit, they recommend a max 300Hz pulse frequency, so as long as you're not pulsing your outputs faster than 300Hz, you're good to go.

2) Grab a sample of a PIC18F series, a PicKit 2, and download the student (60 day free) version of C18 and MPLAB. If you've already done some FRC programming, you can hit the ground running very quickly. The biggest difference will be the naming conventions and aliases. That's how I'd do it, given my FRC experience, and assuming a student's budget =).

3) The experience we all have in common is FRC programming. Many don't realize that even though everything's been abstracted out nicely for us by IFI, the FRC programming experience is NOT that different than other C-based embedded programming environments. Outside of FRC, I have done embedded work on PIC18, 68HC11, 68332, and ATSAM7S in both assembly and C. The work has ranged from making blinky lights, to electricity meter user interface panels, to prototyped redundant automobile drive-by wire control systems.

4) My advice? Be patient, "procure" an oscilloscope, order 3 more than you need of everything, and have fun =). A minor suggestion is that I think you can do all this without timers/interrupts. Timers and interrupts are great, don't get me wrong, but if your target is to wrap up by the end of the school year, the last thing I'd want is to spend a week stamping out concurrency problems. A nice clever sequential while(1) loop is your ticket... This sounds like a great (and ambitious) project!
__________________
In life, what you give, you keep. What you fail to give, you lose forever...

Last edited by Mr. Lim : 13-05-2008 at 11:20.
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
More than 6 RC digital input interrupts? Jared Russell Programming 2 06-02-2007 15:41
pic: More Electronics Christian Extra Discussion 7 28-11-2006 12:47
More Digital I/O Help RedOctober Programming 1 28-01-2006 17:32
More Digital I/O Help RedOctober Technical Discussion 1 28-01-2006 17:32
More on Project Unicorn archiver 2000 4 23-06-2002 22:59


All times are GMT -5. The time now is 05:33.

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