Energy effeciency factors for microcontrollers [closed] - microcontroller

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How microcontrollers can achieve high energy effeciency?
Is it by using time triggering, event triggering or using sleep time?
What other techniques can be applied to make them effecient?

Most modern microprocessors have several levels of low energy mode operation. These modes are very specific to the particular micro, but have in common turning off the clock or clocks used to run the chip. Turns out running a high speed clock consumes significant power. So the first level of energy savings is to turn off the high speed clock when there is no work to do. Many chips have other modes all the way down to cutting power to RAM (and loosing its contents) so that it can only be awakened with a reset. Again the specifics depend upon the microprocessor and those specifics need to be carefully considered in the overall system design.
Software plays a critical role in energy consumption. For battery powered devices, the way you save energy is to not run the micro and remain asleep as much as possible. So your software design should avoid periodically waking up just to poll something and discover that there is nothing to do so it can go back to sleep.The goal is to be strictly event driven even when it comes to time based activity. The object is to get in, get done what you need to do and get back to sleep. Such designs are often reactive in nature being triggered by happenings in the environment detected by hardware and signaled by interrupts.
Most modern microcomputers have an array of sophisticated peripherals that can do many system activities without involving the CPU itself. This is another system technique to reduce power consumption -- do it in hardware. It is almost always more power efficient to do things in hardware. So things like DMA, timer driven ADC and other techniques are also important to reducing system power consumption.
Many ultra-low power devices have a significant component of the system as custom hardware to reduce the amount of CPU time required run the functions of the system.

Related

BLDC Isolated sensorless control

I've currently developed a BLDC motor controller and it generally works fine. During some events however the microcontroller locks up (e.g. stopping the motor or fast changes of duty cycle). Because of this, I want to isolate the microcontroller from the power side (i.e. isolated supply and optocoupled signals) the issue however is I'm using sensorless control and am wondering what the best way of relaying the phase values back to the microcontroller would be?
I currently detect the zero crossing in software and use this to commutate my phases (as per the Microchip AN970 amongst others). I'd rather not use comparators on the power side and optocouplers to send back a digitized version of the phase voltages as I want to have the ability to change the trigger point.
I've looked at isolation amplifiers but they seem pretty expensive and I was wondering if there were any potentially cheaper solutions.
Thanks
Maybe have a look at this document:
https://www.silabs.com/documents/public/application-notes/AN614.pdf.
We use this design, but in a total different application. I dont' really know much about BLDC motors but maybe it helps.
kind regards

Home automation for software enginners using Arduino [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'd like to create my own smart home automation. Since I'm software engineer and don't had the opportunity to play with hardware, I think that this is a great time to play with some low-level stuff.
I've read a lot about hardware programming (I do work with C for software programming, in case of need and got basic knowledge in ASM) and I've understand that I should go with Arduino / Rassbery Pi since they're the most easiest hardware to start working with electronics.
I've started to use the Arduino starter kit and do know how to control LEDs etc. but now I'd like to communicate with the room electrics, air condition etc. and looking for some information about how to do that. Theoretically I'll wire a WIFI shield to the Arduino device and will create simple REST API. Then, I'll create an iOS and Android applications for communication with this API.
I'm looking for information in the electricity aspect:
- How can I wire the Arduino to the room light?
- Should I need an Arduino microcontroller for any electric input I'd like to control (and WIFI shield too? it won't make the price too high?)
I'd like to note that in case it's really complicated for a person who don't know much about electricity I don't mind to use any other hardware that can ease the process. My objective is just to be able to program a smart home.
Your questions are quite broad, but I'll try to answer you
How can I wire the Arduino to the room light?
You need to use either mosfet components or relays. The most easy one to use is the relay. Usually, you drive the relay with a simple BC337 NPN transistor. What does all that mean? It's all explained on that page.
But be careful, playing with electricity can be really dangerous.
If you want to make a light gradator, then things will become a bit more complicated, involving digitally controlled triacs, or digitally controlled potentiometer (for low current).
Should I need an Arduino microcontroller for any electric input I'd like to control (and WIFI shield too? it won't make the price too high?)
It depends, there's no absolute answer for that. You can wire your arduinos (or even use ATTiny, which are way cheaper) to each of your switches, or you can have one microcontroller per set of switch etc.. That's up to you to look at how your switches are organized in your place, and how you can design your system to better fit your needs.
The best option, imho, is taking control of "state switches" (you know the switches where when you push once, it's on, and twice it's off). On those you can control all your lights from your electric board, depending on the maker of your device, they can be controlled by 5V, 12V or 20V impulses. So one device on the electric board and you're all set. But those switches need a redesign of the light's circuit in your home...

Multiplayer billiards game physics simulation [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I’m building an online multiplayer billiards game and I’m struggling to think of the best approach to multiplayer physics simulation. I have thought of a three possible scenarios, each having its own advantages and disadvantages and I would like to hear some opinion of those that either have implemented something similar already or have experience in multiplayer online games.
1st Scenario: Physics simulation on the clients: The player in turn to take a shot sends the angle of the shot and power to the server, and the sever updates all clients with these values so they can simulate the shot independently.
Advantages:
Low server overheat
Disadvantages:
Problems with synchronization. Clients must simulate the exact simulation regardless of their frame rate. (Possible to solve with some clever algorithm like one described here)
Cheating. Players can cheat by tweaking the physics engine. (Possible to determine when making a comparison at the end of the shot with other players ball positions. If only two players are at the table (i.e. not spectaculars) then who the cheater is?)
2nd Scenario:
Physics simulation on one (i.e. “master”) client (e.g. who ever takes the shot) and then broadcast each physics step to everyone else.
Advantages:
No problems with synchronization.
Disadvantages:
1.Server overheat. Each time step the “master” client will be sending the coordinates of all balls to the server, and the server will have to broadcast them to everyone else in the room.
2. Cheating by the “master” player is still possible.
3rd Scenario: The physics will be simulated on the server.
Advantage:
No possibility to cheat as the simulation is run independent of clients.
No synchronization issues, one simulation means everyone will see the same result (event if not at the same time because of network lag)
Disadvantages:
Huge server overload. Not only the server will have to calculate physics 30/60 times every second for every table (there might be 100 tables at the same time) but also will have to broadcast all the coordinates to everyone in the rooms.
EDIT
Some of similar games to the one I’m making, in case someone is familiar with how they have overcame these issues:
http://apps.facebook.com/flash-pool/
http://www.thesnookerclub.com/download.php
http://gamezer.com/billiards/
I think that the 3rd one is the best.
But you can make it even better if you compute all the collisions and movement in the server before sending them to the clients (every collisions and movements, etc...) then clients just have to "execute" them.
If you do that you will send the informations only once per shot, that will greatly reduce the network issue.
And as JimR wrote, you should use velocity or movement equation instead of doing small step by small step incremental simulation (like the Runge-Kutta method)
The information that the server send to the client would look like this:
Blackball hit->move from x1,y1 to x2,y2 until time t1
Collision between blackball and ball 6 at time t1
Ball 6 -> move from x3,y3 to x4,y4 until time t3
Blackball -> move from x5,y5 to x6,y6 until time t4
Collision between Ball 6 and Ball 4 at time t3
and so on until nothings move anymore
Also, you are likely to need a bunch of classes representing the differents physics equations and have a way to serialize them to send them to the clients (Java or C# can serialize objects easily).

Creating a network adapter - how hard is it? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm interested in building a little (commercial) device on top of Arduino. I want it to be able to interface with network. Network as in standard Ethernet, Cat5, RJ-45, etc.
I know that there is an Ethernet Shield, but it costs even more than the Arduino itself, and it's pretty big. Naturally, I want my device to be as small and as cheap as possible.
So I'm thinking about recreating an Ethernet module myself. The problem is - I haven't got any experience with Ethernet, nor do I have a good idea where to start looking. Thus I can't even say if my ideas are feasible.
Ultimately I would like the device to have three ports - one for incoming signal, two for outgoing, so the device is essentially a little switch where it is plugged in itself as well. The switching capabilities need not be very fast - the volume of data will be low. 10Mbit is more than enough, can be even slower.
If that is not possible, a single port for controlling the device itself will also do.
Another possibility I'm considering is power line communications - sending information through power lines. That's another area I've no experience with. What hardware should I be looking at, and where can I find information about the necessary software?
So - can anyone tell me if these ideas are feasible, and if yes - where should I start looking?
It's feasible, but you're going to need to delve deep into layer 2 of the network stack, especially if you want to build a tiny switch. If you steer clear of layer 3 you can avoid having to implement your own IP stack which would be a major pain.
I'd recommend starting with fully understanding how layer 2 works, from top to bottom. Once you've got a solid grasp of what's going on, especially with regards to the Ethernet spec, then you can worry about how you'd go about doing that on an Arduino. I don't have that much experience with the Arduino, but a buddy of mine implemented a layer 2 hardware stop-and-wait protocol on an FPGA a few weeks ago, so you should be able to get at least something rolling. you probably won't be able to go any faster than 10 Mbit unless you've got a pretty fast clock, though.
First of all I wouldn't think about the powserline technology is too complex, may be wi-fi can be possible, even though you have to deal with microwave frequency.
The best solution is as you said to find an Ethernet Shield, try to find an open hardware solution (drawing of the circuit). If you want to deal your own, you have to fnid a chip and threre are available, have a look on RS components. Probably most of the chips available are SMD, which means that is a pain to solder them, unless you are pretty clever and you have a microscope.
You can find a chip or a ready made solution here; http://www.beyondlogic.org/etherip/ip.htm
You could switch to Rabbit semiconductors, they have microcontroller ready with ethernet, but the dev kit is more expensive and the programming too.
This is a chip that you can use; http://www.wiznet.co.kr/en/pro02.php?&ss[2]=1&page=1&num=102

Robust and easy to implement serial bus (automotive application) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
What serial communication bus would you use in a automotive embedded system if your main selection criteria were:
Electrically robust
Slow speed (32 kb/s)
Easy to program
Easy to interface with microcontrollers
It won't be transferring much data, but it will need to be transferred periodically at high speed (100 - 500 Hz). I find that RS-232 is just not reliable enough if you have noise in your ground line. CAN-bus seems interesting, but I have no experience with it.
We are currently interested in a combination of AVR AT90CAN128 microcontrollers.
You've already chosen the AT90CAN128, whose standout feature compared to other AVR processors is support for the CAN bus. There really is not a better choice than CAN for an automotive application with your data rate and noise immunity requirements. If you march in to an automotive customer with anything other than CAN, you'll end up spending all your time defending the decision not to use it.
With that said, for noise immunity in a hostile environment like a car you'll need a bus using differential signaling. That rules out i2c or SPI, which is unfortunate because they meet your other requirements. RS-485 would be workable as #Andrew Edgecombe points out.
If you're not building a commercial product but instead building something for your own use to put in the engine compartment, you can probably get by with USB. USB will make it easy to interface with a laptop in the passenger compartment, and though it isn't designed for high-noise environments it is differentially signaled at a reasonably high voltage.
For all out reliability you can't go past CANbus (but then that was sort of implied by your choice of processor?)
Depending on what you want to interface to, this can be very simple - the base level protocol is quite straight forward. But if you want to talk to any other non-proprietary devices you'll have to implement the higher protocols (eg. CANopen).
But if CANbus isn't appropriate, then I would recommend RS485 or RS422 (depending on your topology). If all you're trying to achieve is point to point communications it's identical to RS232. (you'll have to put your own protocol layer on top if you're trying to support multidrop comms though.)
Two other excellent choices other than CAN are LIN and FlexRay. LIN is a simpler, slower interface while FlexRay is more robust and designed for safety critical systems like real-time controls of brakes.
For a nice overview chart of how the various bus choices interrelate see this slide.
I would always suggest that CAN is the best in automotive communication.
It has got differential line which can withstand even if there is a electrical glitch in the data transfer in physical layer
it can provide reliable speed, it serves 500KBaud rate speed in most of the automotive software applications.
interfacing is also easy if you know CAN controller mailbox and register structure.
As others said, CAN is standard, robust, more robust with slow speed etc.
And there's even support in Linux kernel for it from version 2.6.15 if you ever need bigger system.

Resources