Newbie look for major help - Page 1
Forum section: electronics / beginners

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 07:13:10 am
content: Ok going to make this pretty simple. Im a hardware man and not a software guy and im looking for sumone to help me program micro controllers. I live in the middle of know where and have hit a million dead ends looking for sumone that will help/ teach me to program. And dont say get books becuse they all leave me more confused then ever if i get stuck becuse i got no one to help explain it. Its starting to drive me mental becuse i have a few projects id love to do but can not do them without micro controllers. Any help would be great and even better if we can pm about it. I have skype. Thanks to anyone that maybe able to help

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2013, 07:18:32 am
content: Quote from: Andy932 on August 24, 2013, 07:13:10 amIf you get confused reading books about learning programming then you're probably one of the many people that learn better by pulling apart working code to see how it functions.ie, start with any one of the 1000 example arduino sketches that already flashes an led or whatever and then change things and see what happens.

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 07:21:16 am
content: Iv done that but im looking to control more advanced things

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2013, 07:23:51 am
content: Well, pick something about programming that you just don't understand, write some code that doesn't work then post it here and we will tell you whats wrong and how to fix it.

author: notsob
author_rank: Frequent Contributor
timestamp: August 24, 2013, 07:39:59 am
content: here is a series of very good youtube tutorials on getting started with Atmel microcontrollers, how to install & setup winavr software to write code and program the micros, everything you need and walks you thru with a variety of examples.For a programmer probably get a Usbasp ~ $4 on ebayhttp://newbiehack.com/MicrocontrollerIntroductionABeginnersGuidetotheAtmelAVRAtmega32.aspxhttp://www.ebay.com/itm/USBASP-USBISP-AVR-Programmer-Adapter-10-Pin-Cable-USB-ATMEGA8-ATMEGA128-Arduino-/310506909410?pt=LH_DefaultDomain_0&hash=item484ba76ee2cheersPeter

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 07:52:35 am
content: I allready have done basic ardunio stuff but im stuck on how to setup a pid controller with the ardunio UNO

author: Kremmen
author_rank: Super Contributor
timestamp: August 24, 2013, 08:12:08 am
content: Now you are effectively asking for private tuition. That is usually someone's paid job and i doubt anyone here will commit to anything like that.One doesn't decide to be competent, one graduates into competency. The only way to do so is by climbing the hill from bottom up, as high as you need to go. How exactly you choose to do that is up to you but nobody else can do it for you.Psi already gave the good advice; don't try to leapfrog into writing a PID control algorithm if you don't have a grasp of the basics. A polished piece of software such as a good PID implementation is a non-trivial thing and once you have written it yourself, there is a lot you understand about real time processing, signal manipulation, numeric computation and just plain writing code. All of that understanding won't just jump into your head, however much you want it to.If you haven't yet written the canonical blink-a-led program, then that is where you should start. Achieving that momentous result is not as trivial as you might think because to do that, you need to be able to set up the programming toolchain, HW environment, transfer the program successfully to the device and actually run it there. Whatever you can't do in that exercise, there are people here and elsewhere who are glad to give pointers and identify problems. But it is you who need to do the legwork and strain your brain to understand. If that fails then all fails.

author: notsob
author_rank: Frequent Contributor
timestamp: August 24, 2013, 08:15:25 am
content: although the arduino is a good start, the newbiehack tutorials are in C, this will be of more use to you down the track than the arduino approach

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 08:20:00 am
content: Iv allready blinked a led and combined examples im just want help in geting a pid up and running then modifying it. I get the basics of a pid controller i just need a push in the right direction on getting the dam thing to do wat i want .O and ps like i said in the begging i want sumone to teach me not just give me examples and leave me to work it out myself. Which i cant do as iv try and gone mental over it. Iv program the ardunio in c aswell just for more info for u guys

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2013, 08:50:28 am
content: I don't know your intended application but you probably don't require a PID.A lot of situation where a PID could be used can be done to an acceptable standard without a PID.That said, if you do need one check out some youtube vids on PID controllers. You maybe able to find a vid that shows you each step in simple math which can be converted to a program without too much trouble.I often find youtube vids explaining a concept much better than a pdf document full of advanced math formulas.

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 09:18:28 am
content: Im wanting to build a smart ac unit where the UNO becomes the main controller of the unit. i want it to have a network interface so i can link it to a pc and control it but also still be able to manually control it as a normal ac unit aswell. If u think it can be done without a pod then let me know. The part im stuck at is wat i can and cant do with the softwhere so i can finish off the hardware side.

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2013, 09:36:58 am
content: I've not looked into how modern AC units control the temp, last time i saw inside one they had a relay for heating and a relay for cooling plus one temp sensor on the metal radiator and another temp sensor for the incoming air.I think on modern ones they're more controllable than just on/off in order to get eco mode and different power levels etc.

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 09:46:10 am
content: Most of the modern wall box units use a microcontroler with a pid wich control relays there pretty easy hack but i need help in programming a controller for my needs

author: Psi
author_rank: Super Contributor
timestamp: August 24, 2013, 09:54:28 am
content: If it were me i would get it all wired up and controllable by the mcu before even thinking about the PID. You can make it heat/cool and maintain a temp without a PID using a few simple lines of code to switch on/off cooling/heating at preset temps.It wont maintain a perfectly stable temp and will probably overshoot/undershoot a little but that doesn't matter for testing and is probably acceptable even for general use.Remember old model AC units had no electronics, it was just an adjustable bimetal thermostat, and they worked ok.When you have something that already works it's easier to add in more complex software because you always have the choice to give up and keep it as-is.Working on the project then becomes more of a fun thing to try and add more features rather than a depressing... "if i can't do this the entire project is doomed".

author: Unknown
author_rank: Unknown
timestamp: August 24, 2013, 11:11:07 am
content: Quote from: Andy932 on August 24, 2013, 07:13:10 amOne of the reasons I like this forum is because you can learn so much from the posts; but at the very least you can get a nudge in the right direction. I'd be very surprised if anyone would give you personal tutoring BUT if you get your design done and post your code I'm sure lots of people will help you get it up and running.QuoteOnly a million? you're too impatient! ;-) I spent two and a half years on my PID, mostly on evennings and weekends and it's still not completely finished.https://www.eevblog.com/forum/projects/kiln-controller-project/msg192334/#msg192334

author: Andy932
author_rank: Contributor
timestamp: August 24, 2013, 11:28:01 am
content: Wat do u program in and wat controllers r u using

author: Unknown
author_rank: Unknown
timestamp: August 24, 2013, 12:00:31 pm
content: Quote from: Andy932 on August 24, 2013, 11:28:01 amI used C and a Microchip 16F877A, but those controllers are old-ish now, so best choose something more current.I suggest you get an Arduinoand start reading ADC input from a temperature sensor; then add some code to togggle a LED at the setpoint. If that works then add a relay; then add a LCD display; then add some buttons etc etc. but start small, and keep adding and testing until you get where you need to.Some very simple C type pseudo code might look like:Code:// loop foreverwhile(1) {if (temp > setpoint) {turnOFFRelay();}else {turnONRelay();}updateLCD(); // display some stuff.}[Edit: Sorry I missed your posts about already having an Arduino.]

author: Shock
author_rank: Super Contributor
timestamp: August 25, 2013, 02:30:52 am
content: If you cannot find some generous soul, as others mentioned your going about it in the wrong way.The internet in general does not care about you. Why? Because unless you contribute noones going to dedicate large chunks of personal time to you.Google first, then ask yourself... am I any good at googling things?If you can't find a good book you should be asking what the best books are.After you have spent time on a problem and cannot progress. Clearly define it and ask for input in the appropriate forum.The unwritten rule of asking for help is never actually ASK for help. Just state your problem.Then move onto other work while you wait for a reply. If it never comes ask elsewhere.And if all else fails find an easier hobby.

author: WarSim
author_rank: Frequent Contributor
timestamp: August 25, 2013, 03:56:53 am
content: Quote from: Andy932 on August 24, 2013, 07:13:10 amA microchip can do everything you can do with hardware, with one caveat. There will always be a greater latency, in most cases the delay is acceptable. In situations where synchronous delays are not acceptable reduced asynchronous operations can be achieved with FPGAs etc.The process starts in the exact same way as hardware design, with design specifications and requirements. When you decide on your requirements you select the devices required just like every hardware design. The process is the same just to tools used differ.

author: IanB
author_rank: Super Contributor
timestamp: August 25, 2013, 04:43:07 am
content: On the subjects of home AC units and temperature control, maybe someone could clue me in on a detail?As far as I know (my own AC unit for example), the AC has a compressor which can be turned on and off. Unless it is more sophisticated than the one sitting here beside my house it doesn't have any intermediate load levels; on or off is all it has.My electronic thermostat therefore has a simple function: when the measured temperature exceeds one degree above the set temperature, the unit is turned on. The AC then runs at full power until the measured temperature falls one degree below the set temperature at which point it is turned off. Since the house has a significant thermal capacity these on/off cycles run for maybe 20 minutes at a time.That said, how might PID control come into the picture? PID control is a continuous algorithm. (Granted the industrial version is commonly implemented in discrete fashion, but typically the discrete time steps are so short relative to the dominant time constant of the system that we may assume the control to be continuous.)If PID control is continuous, but an AC compressor is either on or off, then there is a mismatch between the controller and the system being manipulated. One could perhaps render a pseudo-continuous system by applying PWM control to the AC compressor, but this would have the unfortunate potential of turning the compressor on and off at frequent intervals. AC units don't like that and may fail in short order if subjected to such abuse.One could modify the PWM so that the AC compressor is turned on and off at long intervals, but then you are getting back towards the on/off (or "bang bang") control where we started.So I don't get it. How does PID control apply to home AC units?

author: MrAureliusR
author_rank: Unknown
timestamp: August 25, 2013, 05:02:18 am
content: And I guess there's no rule against it but "wat" is spelt "what"... please use correct spelling if not correct grammar, especially when asking for help - it's just common courtesy. It took me twice as long to read your short posts than it did to read the properly written long ones.Typed using Hacker's Keyboard for Android

author: c4757p
author_rank: Super Contributor
timestamp: August 25, 2013, 05:03:44 am
content: Quote from: Andy932 on August 24, 2013, 11:28:01 amwat

author: SeanB
author_rank: Super Contributor
timestamp: August 25, 2013, 05:23:29 am
content: The latest whizz bang units use an inverter on the output side along with a variable valve for throttling the metering of refrigerant into the evaporator. The compressor starts at a low speed and slowly ramps up to give a constant head pressure to the expansion valve which is opened and closed as the load varies to keep the outlet air at a constant temperature and the temperature is adjusted as inlet air temp lowers to reach a set point where the system is only pumping the amount that will handle the heat load of the people in the room and the leak through doors and walls along with solar load. Complex, has a microcontroller inside talking to one outside via a 1 or 2 wire bus and has very poor reliability as the outdoor electronics generally are a bare board with typically no conformal coating or even a dust proof case. Not good from a reliability perspective, and the compressors often get damaged by a failing board, so often you have to replace the board and compressor as a unit.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 05:58:35 am
content: Well wats the best way for me to give u guys a design layout. And i cant spell so yer. I need to make up a design layout and the. For sumone to tell me if it can be done

author: BravoV
author_rank: Super Contributor
timestamp: August 25, 2013, 06:09:59 am
content: Are you simply asking for a complete solution and expecting people here to build it for you starting from the controller selection, circuit building up to PCB layout, and also teach you all the way down ? And for free ?

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 06:25:42 am
content: No im not a complete idiot i can build things i just want abit of help. I want to know how i can give u guys a system design that i create and for i guys to tell if its going to work or not but how do u give u guys a system layout of what. Im not the best at spelling and all i want is abit of help im sick of being in a shitty lil town and every time i go looking for help i get shut down. Fuck im not doing this to make money its a fucking hobbie so i shouldnt have to put up with dicks that want to suck every last cent out of u. And as im not working i dont have alot to spend on getting sumone to do it for me and frankly id rather do it myself anyway. All i need is a lil help. Sorry im frustrated atm. There r so many ppls out there doing it and iv got to be stuck in n outback town without any electronics groups close by

author: IanB
author_rank: Super Contributor
timestamp: August 25, 2013, 07:07:05 am
content: What you are trying to do is really hard. I'm pretty capable when it comes to engineering and technology but I would hesitate to take on such a project. There are loads of things I would have to research and read up on and experiment with before I would have a clue how to do it.I'm sorry, but difficult problems don't have easy answers.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 07:17:13 am
content: The major part im having problems with is programming the controllers. I have no one willing to guide me on how or wat to program these things in and books r not helping becuse u can program these dam things in about a million diff ways. I have basicly learnt every simple sample thing in almost every programming langue. But im now stuck on where to go from there becuse u just cant put many diff example together and they just work. I need sumone to explain how it all fits together.

author: miceuz
author_rank: Frequent Contributor
timestamp: August 25, 2013, 07:22:14 am
content: Are you aware of this Arduino PID library?https://github.com/br3ttb/Arduino-PID-LibraryThere is a great in detail explanation how it works:http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

author: miceuz
author_rank: Frequent Contributor
timestamp: August 25, 2013, 07:31:56 am
content: Quote from: IanB on August 25, 2013, 04:43:07 amI've implemented a PID controller for clay firing furnace that has a relay on/off input only. I chose my control signal to be the time the relay is kept on. Something like 100% output signal corresponds to 10 seconds of keeping AC output on. You can do the same for home heating control, just take 100% to be, say 5 minutes.Another possible solution is to implement phase shift power control similar to light dimmers.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 07:41:09 am
content: Im thinking of programming the UNO in pure c. Or is there sumthing easier to program it with. Id rather try learn c as it can be used with other micro controllers . The other problems im having is yes iv designed the hardware but now will the software let me do wat i want with the hardware. Wat program's can i use to do a schematic or block diagram for you guys to see.

author: IanB
author_rank: Super Contributor
timestamp: August 25, 2013, 07:44:40 am
content: Quote from: miceuz on August 25, 2013, 07:31:56 amYes, with an electric furnace you can do the PWM thing as you say. You can make 100% correspond to having the relay on continuously, 0% the relay off continuously, and 50% having the relay on for 5 seconds, off for 5 seconds, with all variations in between. As long as you don't wear out the relay contacts...With home heating and air conditioning it's more difficult. For instance once you switch the furnace or AC compressor on, you must allow it to run for a reasonable time before switching it off again. So that limits the shortest on time of your PWM. And once you switch it off, you ought to let it remain off for a certain time before switching it on again. Rapid cycling is bad. It's best if you have a system specifically designed for variable control rather than on/off control.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 07:53:45 am
content: The pid system i want to build needs to have a cooling off and warming up setting for the compressor so that the compressor does not turn off and on to fast and it also needs to have a restart delay for the compressor in the event of a quick black out the compressor wont restart untill its cooled

author: Psi
author_rank: Super Contributor
timestamp: August 25, 2013, 07:58:59 am
content: Have you chosen a AC unit to use yet?If it doesn't have all the fancy refrigerant valves and other controls it will be much easier.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 08:04:21 am
content: Yer i have and its a basic wall box with a electronic control panel that easy to hack. Now all i want to do is replace the control system with one of my own that i can interface with

author: Psi
author_rank: Super Contributor
timestamp: August 25, 2013, 08:11:52 am
content: I mean, is it a simple on/off heating/cooling one?If so then you have no problem. Just start wiring up the micro to the control box until you can turn each function on/off from the micro and read the temp sensors

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 08:14:20 am
content: U must have missed one of the posts its not as easy as just on and off it needs to also have sum time delays so its not turning the compressor on and off to quick. Compressors hate being switched on under a half or even full load

author: M0BSW
author_rank: Frequent Contributor
timestamp: August 25, 2013, 08:46:47 am
content: I know nothing about this stuff I don't even know what pid is, anyway . I want to learn how to program PIC, the way I'm doing that is to copy a program and then alter it and see what happens, my sister law designs and makes programs for nestle, and has given me a few basic programs, to alter and play with, I'm getting there many brick walls, what I'm saying is get on with it, long as you copy the program, not change the original , what's the worst that can happen,, you'll just have to start over.

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 08:51:52 am
content: Iv tryed changing a pre built program but nothing works to start with. How can i use stuff that dont work in the first place. If i found sumthing that work i could easly change it to do want i want. If anyone has a pid programed in c for UNO then let me know.

author: Psi
author_rank: Super Contributor
timestamp: August 25, 2013, 08:55:16 am
content: Quote from: Andy932 on August 25, 2013, 08:14:20 amna, I saw that mentioned. Time delays is easy, just add a counter and check it before changing state.So the compressor is always on for Xmin or longer and always off for Xmin or longer.

author: M0BSW
author_rank: Frequent Contributor
timestamp: August 25, 2013, 08:55:55 am
content: Cricky wish I could help, I'm just learning a pic program for a frequency counter I've built, Im lucky my sister in law will debug it and show me where I went wrong later today.

author: Shock
author_rank: Super Contributor
timestamp: August 25, 2013, 03:04:30 pm
content: Quote from: Andy932 and edited a littleTo make a schematic/flow/block diagram you can simply use any editor such as MSpaint. But check this outhttp://www.asciiflow.com/#DrawClick on export once you made one. To format it correctly in the forum wrap these BBcodes before and after the diagram  and  and you will get:Code:+-----------------------+ +-----------------------+ +-----------------------+| | | | | || drawing an ascii +---------> flow diagram is an +--------> addictive way of || | | | | |+----------^------------+ +-----------------------+ +------------+----------+| |+--------------------------------------------------------------------+

author: Andy932
author_rank: Contributor
timestamp: August 25, 2013, 03:12:20 pm
content: Thanks but i think i will just draw a block layout and a schematic of a controller iv pre built but havnt been able to program yet.

author: MrAureliusR
author_rank: Unknown
timestamp: August 25, 2013, 04:21:27 pm
content: Man I'm really confused. You have your hardware all set up already? Like you've got everything wired up, it's just your MCU that's not programmed? I don't understand how you're stuck -- you know exactly what you want it to do, and I'm sorry but there will definitely be some reading involved -- I don't understand how a simple Google search won't answer your questions. If you want to have this up and running without any reading of books, then throw the whole thing in the garbage because nobody on here got anywhere without reading LOTS and lots of books. And watching thousands of hours of videos, to boot. You can't learn it all (or even a little bit) without lots of reading. If you find a book on programming an Arduino or whatever you're using in C, and read the entire book from front to back (assuming you've picked a halfway decent one) then you should know exactly what you need to do, and if the book hasn't shown you how to do it you will at least know exactly where to look to figure out how to do it.I'm just really having a hard time understanding what your problem is.