View Single Post
  #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.