Maker Pro
Maker Pro

Need help from all the pros out there...

DONT KNOW WHICH MICROCONTROLLER TO USE!

Hi im new here and the sole purpose to join this was to get some answers i cant find anywhere! :O Im hoping some of you smart people stumble across this and help me out soon...
So im making an AIR to FUEL RATIO CONTROL SYSTEM for IC ENGINES...what im gonna ask has nothing related to engines so dont worry...
Im taking one input from a fan, that rotates when high pressure air passes through it, in VOLTS(.as the speed of fan increases so does the voltage produced), and im still working on the second input (it would probably be in Volts but it could also be a shaft encoder so in that case it could be 'theta'...)

but anyway, i dont know much about programming...have done some C++ in freshman year but thats it..I need a microconttroller which can
  • read the inputs
  • manipulate them by mathematical formulation into useful data ( that involves a lot of math functions)
  • check and see if the input data matches the required input (or the AFR input)
  • command an actuator (on output) to change the applied voltage (or speed of fan etc) IF the input is not matching the required input

NOW i dont know what to look for in an mcu or how to choose a microcontroller..like how much memory it should have or how many input output ports or if it should have a USB or SERIAL port etc...
once i have it i have a friend who could program it but i need to GET one first! im really desperate....i really need some proffessional advice and hopefully someone who could assist an electronics newbie to make her way through this...
THANKS!
 
Welcome to the forum!

So we are getting 2 inputs, one analog (the voltage) and the other either analog or a quadrature encoder. And one output to control a voltage. Your I/O requirements are minimal. I don't see any need for USB or serial comm unless you want to be able to futz with it interactively while it is running, for instance to tune it.

The big question is how much processing has to be done and how frequently. This might affect your choice of micros. You probably are going to want a PID algorithm to control the mixture quickly without oscillating. Again, how much power you need in the micro is going to depend on how fast a response you need. If it is of the order of 1/10 second or so, that is not very demanding. At 1 ms it gets more demanding if the math is complicated, but I cannot see an engine control needing that kind of response.

From what you have said so far, I would guess that any 16-bit microcontroller with the needed A/D converter would work. You will probably need an external DAC for the output if you are using PIC microctrollers, not sure about others like AVR. Some PICs have hardware support for encoders, but this can also be done is software fairly easily. I say 16-bit because it will be better for the floating point math you are going to want. You could probably cram into an 8-bit if you needed to. That depends on the cost requirement.

Hope this helps a little. Without more info, I cannot recommend a specific part.

Bob
 
Last edited:
Whoa! Thanks I didnt expect such a quick reply when I posted this :)

Ur post was pretty helpful. You're right there are two inputs.. But the outputs have two actuators not one. One will control the voltage of the air-DRIVING fan ( so the air-DRIVEN fan can sense it accordingly) and the other actuator is on/in the fuel duct. Now that could possibly be a stepper motor to control the angular position of a butterfly valve ( a valve that allows maximum flow to pass when it's face is perpendicular and minimum when it's face is parallel to fluid flow) or it could be some other type in which we vary voltage to vary speed of flow somehow ( still working on it). Does that make a change in the type of mcu I want?

Also I think 1/10 s response time for processing is enough as this is a small scale project. and yes theres a lot of floating math. But yes I want to be able to view and change (tune) the controller while it's running. Like I said I don't have much know-how on electronics so j have no idea what a PID algorithm is could u please explain? Plus, what memory should the microcontroller have if I want it to store in all the functions, inputs data, intermediate inputs and data sent for output as well..? :/ plus it would really be great if u could narrow down to a few named mcus so I could get hold of em soon
 

KrisBlueNZ

Sadly passed away in 2015
PID control: http://en.wikipedia.org/wiki/PID_controller
I think the main issues that relate to choosing a controller are (a) the need for DAC(s) - many microcontrollers don't have them, or have only one channel, and (b) the need for floating point speed, if there is a need. Smaller microcontrollers don't have floating point calculation implemented on the chip, so it has to be performed by software using the integer data types available on the controller (8-bit, 16-bit or 32-bit). To improve speed on a controller that doesn't have floating point in hardware you might be able to use fixed point with long integers instead of floating point, if you can find a library for the mathematical functions you need. It would be helpful if you could estimate how many of each type of mathematical function you will need to perform per second, because this may be the critical factor and necessitate a powerful device, or it may be no problem and this will give you a wide variety of choices.
You should also consider the development software available and the programming language you're going to use.
Embedded programming is not for the inexperienced or faint-hearted. You say you have a friend who will do the programming... if he has experience in this field, he should be able to help you with device selection...?
I have used and recommend the Texas Instruments MSP430 series of 16-bit controllers, and they may be suitable for your application. Many have ADCs, some have DACs, but none have on-chip floating point. See www.ti.com/msp430
Here are brief descriptions of micro manufacturers, to give you an idea of which manufacturers to consider:
http://www.edn.com/article/510722-The_37th_annual_microprocessor_directory_a_universe_explored.php
Here is an extensive survey of devices, with a list of applications you can choose from that may help narrow down your options. http://www.embeddedinsights.com/directory.php
 
PID is a universal control algorithm, it stands for Proportional Integral Differential. These are the 3 terms in an equation that you can adjust, the the algorithm is just:

1. Read the input.
2. Calculate the error (desired vs. current value)
3. Compute the next value of the output (and output it)
4. Wait some amount of time and repeat.

Perhaps the math you refer to is already in this form? You can look it on on Wiki for more details.

If this is a one-off project (i.e. not production quantities), you would just use a micro with lots of memory and capabilities, because the cost difference is a matter of a few dollars. In any case you can do this for development, then you would downsize to a smaller micro based on the size of code and memory you actually need for the production version.

How is this going to be built? Prototype board? PCB? That affects you choice as some micros come in DIL (through hole) and are easier to prototype, whereas others come only in surface mount, which pretty much requires a PCB.

Also, for development, or even final if it is quantity one, you could use an alread made up development board, which will cost more, but save you the effort of building one.

If we get closer to specifics, I am only knowledgeable about PIC microcontrollers from Microchip Inc. I cannot say much about other brands.

Bob
 
Last edited:
Top