go away spammer

Author Topic: Desperately need a microcontroller recommendation!  (Read 3678 times)

0 Members and 1 Guest are viewing this topic.

Offline Mike88Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Desperately need a microcontroller recommendation!
« on: January 20, 2011, 02:38:07 PM »
I know these posts get written alot but I have searched everything and have been unsuccessful in finding anything.

I am looking for a microcontroller to control a small hybrid electric vehicle. The absolute minimum requirements are fairly simple:
- At least 5 digital inputs
- At least 3 analog inputs
- Output a 0-5V signal to two different motor controllers:
Specifically this one:
http://kellycontroller.com/kdc7260124v-72v600a-pm-with-regen-p-424.html
- Control a servo or stepper motor to control the engine throttle.
- Run simple calculations and conditional statements based on the digital inputs.
- Must be responsive, rugged, and able to withstand reasonable amounts of heat and vibration.

My budget is about $500 (however I would prefer if it was under this amount). I also have very limited knowledge in programming microcontrollers so I would prefer the software and wiring be as user friendly as possible.


I originally was going to purchase the MIT Handyboard but realized that it did not have an analog D/A output.

Could anyone suggest a microcontroller that could satisfy these requirements?

Thank your for any replies.

Mike

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: Desperately need a microcontroller recommendation!
« Reply #1 on: January 20, 2011, 03:44:07 PM »
You could get just about any controller, and then add an external DAC (I2C, perhaps).  Suggested ones on this forum are ATMega328/644/1280, or PIC controllers.  If you need an integrated DAC, you could try the Cypress PSoC controllers, which have DAC on all pins. 

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Desperately need a microcontroller recommendation!
« Reply #2 on: January 20, 2011, 04:51:51 PM »
Quote
I originally was going to purchase the MIT Handyboard but realized that it did not have an analog D/A output.

Very few MCUs have a DAC output.
As rbtying said add one externally.

Offline Mike88Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Desperately need a microcontroller recommendation!
« Reply #3 on: January 20, 2011, 05:17:06 PM »
Thanks for the replies guys,

For the situation I'm in its more need than want. And yes its desperate.

So could I add an external analog output to the handy board?

Is this simple to do? How would I go about doing this?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Desperately need a microcontroller recommendation!
« Reply #4 on: January 20, 2011, 07:23:54 PM »
Do you have a link to the Handy board documents?
Since I've never heard of this board I can't guess on how to connect anything to it.

DACs come in two basic interface flavors, parallel or serial. The common serial interfaces are SPI and I2C.
What does the Handy board support?
Many of the common u-controllers used by hobbyist support both.

The common u-controller boards used by people on this forum are the Arduino and the Axon. Others here use PIC, ATmega and AVR processors but build their own boards.

Offline Mike88Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Desperately need a microcontroller recommendation!
« Reply #5 on: January 20, 2011, 09:35:46 PM »
I apologize. I am very new to this, I thought the handy board was a very popular board (guess not). Its used alot for education purposes (or so I am told).
http://gleasonresearch.com/prod.php?sku=HB

I was leaning towards it simply because it is programmed in interactive C and seemed like the easiest and most user friendly to use. I did however contact the company and they stated that adding a DAC would be possible but no easy task.

Honestly, I have almost no experience with micro-controllers. I have could spend up to $1000 on this controller, I just need it to work (ie have a DAC connector) and be easy to program  and install.
So is there a micro-controller out there that can do this?

Offline john bond

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Desperately need a microcontroller recommendation!
« Reply #6 on: January 21, 2011, 04:37:10 AM »
Some quick thoughts

You got the first part right – ask, ask, ask. Use that annoying trick the Japanese (and 3 year old children) always use, keep asking “but why?...”

First a health warning – I am not a Robotics nerd so listen to the Robotics experts comments first. I play more with Mecatronics but find this site VERY useful.

Now my observations - Choosing microcontrollers is mainly about the learning curve, the power and the cost.

Learning Curve
Learning to use a microcontroller is great fun but can also be quite daunting. Not just the software but also the electronics and all those strange special features and wrinkle that make each one unique AND VERY FRUSTRATING!
Tips
  • Choose one of the popular, main stream products. In democracy they say the masses are usually roughly right and that is doubly true of microprocessors. Go with the majority users (in your chosen field).
  • Make sure your choice will allow you to progress in the future. Choose carefully to avoid having to change brands later. Changing brands means investing in another learning experience.
  • Use a high level language, preferably one that can be used on a variety of brands (you may have to change later). Some people choose their controller because the language is easy to learn. This probably makes sense if your microcontroller is just a means to breathing life into your robot.
  • Choose a product that has LOTS of on line support, libraries and so on. You are going to need the support. (Don’t be stupid like me and choose a product that has lots of support in Korean, you’ll need it in English)

Power
This is almost self explanatory. In the hobbyist market, the cost of the chip is usually almost insignificant in the overall cost so it is usually safe to over-specify. Ask yourself, why don’t inexpensive MCUs come with analogue outputs. This is because it is easy to add this on using PWM or resistance ladders. There are also D2A chips available if you need accurate, very repeatable outputs.
Tips
  • The marketing life of Electronic components is short so don’t choose an old product near the end of its product life. Choose something newer, more powerful.
  • Power isn’t just about processing speed and memory. It includes topics like how well the I/O is protected (mistakes always happen pay for added protection), what is the power consumption and how easily does the chip handle UARTS (special communication I/O) like SPI, I2C and RS232.
  • If some feature you need isn’t available, ask “is this feature easy to produce in software or by some other means?” It sometimes is.

Cost
This isn’t what you think. The cost of microcontrollers has plummeted so the cost of the chip is becoming insignificant. This is about the overall results you get for both your time and your money. Even if you are playing in your workshop, your time is worth a lot. Using gears where a stepper motor would work can cost lots on getting the right gears.
Tips
  • What are other people who are trying to do the same thing as me using? Why?
  • How do similar commercial products handle this issue?
  • What is my hobby time worth to me and how much am I prepared to spend to avoid 1 hour (which usually ends up as 20 hours!) of frustration.
   
Learning to use a microprocessor is loads of fun but also hard work. I assure you it is worth the effort.

If there is just one overriding tip, it is choosing a system that many other people in your field use. Your goal is to build a robot, not experiment with microcontrollers to see which one is best able to perform the line following algorithm with PID control (whatever that is  :D ).


Regards from Kwa Dukuza – lost somewhere in Darkest Africa...


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots

Offline Mike88Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Desperately need a microcontroller recommendation!
« Reply #8 on: January 21, 2011, 08:41:53 AM »
Thanks for the insightful post John Bond.

As for the Axon, does these 55 I/O ports include a digital to analog output? (One which I could get 0-5V output)?




Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Desperately need a microcontroller recommendation!
« Reply #9 on: January 21, 2011, 09:04:12 AM »
Thanks for the insightful post John Bond.

As for the Axon, does these 55 I/O ports include a digital to analog output? (One which I could get 0-5V output)?

DAC ports are very rare in microcontrollers, and no the Axon doesn't have any.

That said, a DAC is simply a PWM (square wave output) being applied to an RC (resistor capacitor) circuit. It's very simple to make.

See this:
http://en.wikipedia.org/wiki/RC_circuit

Where Vin is from a microcontroller digital output port with PWM, and Vc is the analog voltage:



Also, if you attach Vc to an ADC (analog to digital port), you can create a closed loop feedback control system that modifies the PWM to keep the analog voltage a steady constant output. ie the PWM increases or decreases to make the analog output voltage keep steady.
« Last Edit: January 21, 2011, 09:07:46 AM by Admin »

Offline Daanii

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
Re: Desperately need a microcontroller recommendation!
« Reply #10 on: January 21, 2011, 11:13:28 AM »
I'm doing a similar project. After a lot of back and forth with the maker of my Alltrax 4834 controller (similar to your Kelly controller), and some advice from Soeren on this board, I decided to use an Arduino microcontroller.

To control my Alltrax controller, I will use the 0 to 5 Volt signal from a digital output pin that is pulse width modulated (PWM) to simulate an analog signal. As the Admin says, you will probably need to build a simple low-pass filter, using just a resistor and capacitor, to smooth out the PWM signal. That will take away some of your range, at the top and bottom of your signal. So you will just go from, say, 0.1 Volts to 4.9 Volts instead of the full 0 to 5.

I have found the Arduino very easy to work with. I program it in C using the Arduino Sketchpad. Then download the program using a USB cable.
« Last Edit: January 21, 2011, 11:16:45 AM by Daanii »

Offline Mike88Topic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Desperately need a microcontroller recommendation!
« Reply #11 on: January 21, 2011, 11:34:41 AM »
Thanks for the schematic admin, looks like ill have to attempt to build a DAC from a PWM digital output.

Daanii were you successful in being able to control the Alltrax controller with decent response with your set up?
Did you use a closed loop design? Or were you able to do this with an open loop circuit?

Offline Daanii

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
Re: Desperately need a microcontroller recommendation!
« Reply #12 on: January 21, 2011, 11:58:22 AM »
Unfortunately, Mike88, we have not tested the Arduino throttle system.

We will use the Arduino to control two separate motors, using two separate Alltrax controllers. We have had some trouble with shortening the half shafts and connecting them to the motors. We will not be able to test the Arduino throttle system until we have the motors installed. That will take a few more weeks.

I have breadboarded up the Arduino throttle system, and it works well. We are using it as a software differential, and when we input the desired throttle and steering, the Arduino throttle system puts out two nice-looking, smoothed 0 to 5 Volt signals that are correct. Whether the system will work in real life remains to be seen.

As an alternative, I've also built a circuit using digital potentiometers to send a 0 to 5k Ohm throttle signal to the Alltrax controllers. That has its own problems. But between the two circuits, I'm confident that we can find one that will work.

Offline Daanii

  • Robot Overlord
  • ****
  • Posts: 138
  • Helpful? 3
Re: Desperately need a microcontroller recommendation!
« Reply #13 on: January 21, 2011, 12:17:35 PM »
Let me add a couple of things.

First, to answer your question, we have not added a closed loop feature like Admin suggests. But we plan to. We will be looping the output voltage back to the Arduino for checking. We will also sense the wheel revolutions per minute and use that data to adjust our throttle signal. For now, though, we are just using as simple a system as possible to replace the mechanical throttle with an electronic one.

Second, I found this article about the low-pass filters (like Admin suggested) to be helpful: http://www.electronics-tutorials.ws/filter/filter_2.html

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Desperately need a microcontroller recommendation!
« Reply #14 on: January 21, 2011, 01:25:02 PM »
we have not added a closed loop feature like Admin suggests. But we plan to. We will be looping the output voltage back to the Arduino for checking. We will also sense the wheel revolutions per minute and use that data to adjust our throttle signal.
Wheel revolutions would be much better for feedback than output voltage, assuming you have encoders all set to go ;D

 


Get Your Ad Here