Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Project Guidance / Re: Controlling the Intensity of a Heater Element during a PID loop on: September 07, 2013, 03:01:47 pm
I like the idea of burst-fire control.  it is what I use in my reflow oven for soldering although I didn't know it was called that.  I just think of it as super slow PWM.  I use a 1 second period and an SSR that has zero-crossing built in.  Seems to work really well.  The heating elements have such a slow time response that there is really no need to do this faster.

Regarding the control method.  If you desire a controlled temperature increase rate then you could make that your controlled variable instead of setpoint temperature.

I have both types of loops in my controller and I switch between the two.  The control loop that handles temperature rise is very stable and this is likely because my desired rate requires pretty much maximum oven power.  at first it was a little bit to get my head around it but in the end it seems easy.  I only have "PI" terms in the loop that uses a temperature rise setpoint.

For reflow soldering the scheme is:
heat slowly (20% duty) until temperature is 40C
Control slope to 1.5 Degrees C per second until temperature is nearing 140C
Control temperature to 150C for 2 minutes
Control slope to 1.5 Degrees per second rise
Temperature reaches 215C - stop.

so you can see the system changes between the two control loops depending on the goal.

Maybe it does not apply to your application but wanted to mention this just in case.
2  Using Arduino / Installation & Troubleshooting / Re: Leonardo doesn't talk to serial monitor on: December 09, 2012, 10:37:07 am
Do you need brackets after this line?

your code above

while(!Serial);

like this instead

while(!Serial){}

3  Using Arduino / Installation & Troubleshooting / Re: Alternate programmer for Leonardo - recommendations? on: December 09, 2012, 10:33:54 am
What I ended up doing is using a Mega temporarily to create and debug my code.  It has Serial1 so I was able to use some conditional compiling and still get similar function to the Leonardo.

Nearly all of the problems I had were caused by a bug that i had - it caused the setup() to constantly be running.

The bug was instantly seen when I moved to the Mega but on the Leonardo I couldn't get past the USB connection problems.


 I think the other problem was addressed by the Arduino update 1.0.2
4  Using Arduino / Installation & Troubleshooting / Alternate programmer for Leonardo - recommendations? on: November 04, 2012, 01:37:38 pm
I did read the troubleshooting guide but there is not any Leonardo specific information.

I need to give up on the USB programming with Leonardo as it has become too unreliable.  Sometimes I get a good run and can work for an hour with all the automatic features working ok - then occasionally I get stuck and nothing works.  I think when my code gets hung up it also prevents me from easily getting new code into the device.  The Uno and similar products did not behave this way. 

typical problems are:

Serial port already in use
Serial port not selected
Device not recognized
Ubuntu Linux not recognizing the board at all
Windows repeatedly wanting to install drivers on machines on which the Leonardo has previously worked.

Rather than work on troubleshooting any longer, could I get some advice on programmers?

What would be a recommended programmer to replace what I used to do through the FTDI chip?  Maybe I can use just an FTDI basic like DEV-09716 from sparkfun.  Would the "USBtinyISP AVR Programmer Kit" from Adafruit be better?

thanks,

mark
5  Using Arduino / Sensors / Re: IR Remote Controller Library - Interrupt based rather than polled on: May 10, 2012, 08:42:13 am
awesome!  thanks for this.

What IR code types does it understand?

For example RC-6?  Panasonic?

I'll have to check it out!
6  Using Arduino / Sensors / Re: Photo tachometer with digital output (completed project) on: February 22, 2012, 11:24:35 pm
Here are some code snippets that may help a person get started

Code:
short getTachSpeed(){

  //Calculate the most recent tach speed here, considering
  // it is only polled 1 time per second anyway.

  long tachspeed=0;

  switch(tach01){

  case 0:
    tachspeed=pulseToTachRPM*tachPulses[2];
    return tachspeed/(tachTime[2]-tachTime[1]);
    break;

  case 1:
    tachspeed=pulseToTachRPM*tachPulses[0];
    return tachspeed/(tachTime[0]-tachTime[2]);
    break;

  case 2:
    tachspeed=pulseToTachRPM*tachPulses[1];
    return tachspeed/(tachTime[1]-tachTime[0]);
    break;
  }

}

timer setup

Code:
void setupTimer0 (){  //An 8 bit timer clocked to the CPU

  /*bit values BEFORE this function (probably set by Arduino Environment
   due to the fact the millis() function is used in the setup()
   
   B1    TIMSK0
   B11   TCCR0A
   B11   TCCR0B
   B0    OCR0A
   
   bit values AFTER this function
   B10   TIMSK0
   B10   TCCR0A
   B100  TCCR0B
   B1011 OCR0A
   */
  cli();                  // disable interrupts while changing settings

  //reset all bits in the setup registers to 0.  Not all are R/W but the
  //compiler does not seem to mind:  breaks Arduino millis(), micros()
  //and delay()

  TIMSK0 = 0 ;
  TCCR0A = 0;     
  TCCR0B = 0;

  //set to 256 prescaler  (CS02:0 = B100)
  //prescaler means that this timer clocks 256X slower than the CPU
  sbi(TCCR0B, CS02);   

  //set to CTC mode (clears timer when it reaches count)
  sbi(TCCR0A, WGM01);

  /*
     256 prescaler, and interrupt on 6 counts causes this timer to
   interrupt at a rate of 10,416.666 Hz which gives a resolution that we
   need and it also has the IDEAL condition that it is perfectly scaled
   with the Timer2 that has been set up. It is EXACTLY 336 times faster
   */

  //OCR0A = 11;  //every 12th count gives a rate of 5208.33333 HZ
  OCR0A = 5; //every 6th count gives a rate of 10,416.6666666 Hz

  sbi(TIMSK0,OCIE0A); //enable the timer to raise overflow interrupts

  sei();              // turn interrupts back on
}



Code:

//call this in setup
 attachInterrupt(0, ISRtachpulse, FALLING);
 
 
void ISRtachpulse(){  //An ISR defined using the Arduino command set


 
  if(requestTach){

    //time stamp and memorize number of pulses accrued
    tachTime[tach01]=counter0; //put the current time into the waiting spot
    requestTach=false;
    tachPulseCounter+=1;
    tachPulses[tach01]=tachPulseCounter;
    tachPulseCounter=0;

    switch(tach01){

    case 0:
      tach01=1;
      break;
    case 1:
      tach01=2;
      break;
    case 2:
      tach01=0;

    }

  }
  else {
   
    // the most common result of this ISR is to simply count
    tachPulseCounter+=1;
  }

}

hope it helps.  I tried to post my whole code but I was over some character limit


7  Using Arduino / Programming Questions / Re: Can Timer 1 event capture pin ICP1 wake Arduino/ATmega328 [Solved] on: February 07, 2012, 01:58:02 pm
I marked this as solved even though I will not directly test this.  I decided that for my RC6 decoding the timing is not as critical as I had first thought.  I will use INT0 to wake from sleep.  I may not need ICP1 at all. 

The general answer to the question is that ICP1 will not directly wake the processor but there are some decent workarounds.

Thank you gentlemen for your excellent answers.
8  Using Arduino / Programming Questions / Re: Can Timer 1 event capture pin ICP1 wake Arduino/ATmega328 on: January 28, 2012, 07:05:03 pm
Thanks everyone for the quick and thorough replies.  Looks like I have as about as much information know as can be had without trying it.  I do like the option of using INT0 just to wake as member johnwasser suggested and of course the only downside is the use of a pin that might otherwise be used for additional functions.

One other thing that confused me is whether an event capture would be considered a "timer interrupt";  the overflow and compare match is what I think of as a timer event.

Would another option be to configure the pin as a port change interrupt before going to sleep?  After waking I could reconfigure the pin to act as the event capture.  I would lose some timing accuracy at the beginning but I am not sure that will matter much.

I am using the Arduino IDA and standard Arduino boards although obviously I am deviating from standard commands.  I am pretty much a beginner but learning is so easy with all the resources out here.


I don't get much spare time to work on the project but when I do I will test the options.

thanks again!
9  Using Arduino / Programming Questions / Can Timer 1 event capture pin ICP1 wake Arduino/ATmega328 [Solved] on: January 28, 2012, 02:10:54 pm
Hello,

As the subject says.  I have read the datasheet many times as well as a lot of forum posts and code.  I have not been able to find a good answer to this question.

I plan to use an infrared receiver chip to create a bitstream for an arduino Uno to read.  The event capture of Timer/Counter 1 seems to be a good way to do this because the time stamps will be really accurate.

I have found that pin change interrupts and of course INT0 and INT1 can be use to wake the chip from sleep.  I cannot find explicit information so far for the case in which ATmega328 pin 14 (Arduino digital pin 8, DIO8) which is also ICP1 is used for waking.

If this will not work I can do a work-around in which I also connect my signal to the INT0 pin but I hope I can keep it free for potential other uses.  INT1 is already occupied because I am using OC2B to create an output waveform to blast IR to other components.

My device will be an infrared repeater and decoder and it will be used to wake up my home theater PC and possibly some other home theater components or devices.

thanks in advance!
10  Using Arduino / Sensors / Re: Heat detection with thermopile sensors/non-contact / NEWBIE on: June 09, 2011, 09:30:38 am
sorry, I cannot be certain about the plastic.   It might be Nylon or Delrin.  The datasheet doesn't say and I don't want to set mine on fire to find out what it is smiley-eek-blue
11  Using Arduino / Sensors / Re: Precise distance measurement (sub mm range) on: May 06, 2011, 12:37:29 pm
.01mm is really very tight precision and normally a simple drilled hole would not need to be so precisely located.  I suppose you are looking for better resolution than your target tolerance and that does make sense.

consumer grade inkjet printers have optical encoders for the carriage travel and I think are going to be at least 300 lines per inch. With quadrature that is 1200 locations per inch.
12  Using Arduino / Sensors / Re: AnalogRead input from LabVIEW/DAQ on: March 28, 2011, 06:10:28 pm
Electrical noise would be a classic cause of problems like this but as others said more information is required to solve the problem.  Are you running the wires a long distance?  Are the wires twisted pair? Shielded?  etc..
13  Using Arduino / Sensors / Re: Multiple Melexis MLX90614 on the same i2c, how to change addresses ?? on: March 03, 2011, 02:04:43 pm
after a bit more investigation, my money is on 00Eh as being the correct address for holding the address.

The bildr post led me to a Melexis PDF publication about changing the Emissivity of the sensor in which the address for Emissivity is described as 0x04.

this corresponds to the data from Page 11  and I'd say 2 of 3 wins.

I wish you success!
14  Using Arduino / Sensors / Re: Multiple Melexis MLX90614 on the same i2c, how to change addresses ?? on: March 03, 2011, 01:46:54 pm
There's a pretty awesome example here:

http://bildr.org/2011/02/mlx90614-arduino/

I hope it helps you instead of confusing you even more (I'm still a bit confused myself)

The Melexis data sheet lists the address in two different ways and places

on Page 11

8.3.3 EEPROM (32x16)

SMBus address 00Eh

Then on page 14

8.4.1 Functional Description

....write access to 9 EEPROM cells (at addresses .....0x2Eh....)

I am enough of a beginner that I think this could be something about memory addressing or Hex number format that I just don't understand.


one thing about your code, a spy, that seems off is the fact you are attempting to write a PEC to the device... I would guess there's no point to that.


Do you have the 3.3V version of the device?

15  Using Arduino / Sensors / Re: Debouncing rotary encoder when using interupts? on: March 03, 2011, 01:12:32 pm
You could also add a Schmitt trigger chip between Arduino and the encoder....might help.  I guess if the bounce goes full scale...maybe not.. but then could you add 1st order filter with a resistor and a cap.  You just have to make sure it can respond to the maximum speed you expect to turn the encoder at.

I recall something from the ATMEL datasheet where you can filter the INTerrupt but that probably involves going outside of the Arduino library.

I'm a beginner myself so..... trying to help but I guess you can take my advice with a grain of salt
Pages: [1] 2 3 ... 5