Show Posts
|
|
Pages: [1] 2 3 ... 66
|
|
2
|
Using Arduino / Sensors / Re: Does serial buffer discard old data when buffer is full and new data comes?
|
on: March 27, 2013, 12:43:54 am
|
In version 0022 (copy of source below) a character received when the buffer is full will be lost/ignored. // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the // current location of the tail), we're about to overflow the buffer // and so we don't write the character or advance the head. if (i != rx_buffer->tail) { rx_buffer->buffer[rx_buffer->head] = c; rx_buffer->head = i; }
So in the example of a 4 byte buffer and receiving 12345, we would read this as 1234 an remain "happily" unaware of the 5th character received.
|
|
|
|
|
3
|
Using Arduino / Motors, Mechanics, and Power / Re: Motor Controllers for car seat motors?
|
on: March 25, 2013, 01:41:12 am
|
I agree that your "we" crowd should stick to products that you ("we") will be able to understand.  Excellent, then I will be looking forward to your follow up post on how you interface the "240W high-power H-Bridge Motor Driver". I'm particularly curious when it comes to "Retrogression" (should I be worried) and also "Free rotation" (note that both H-Bridge outputs are active according to the "datasheet"). If we can't trust the logic truth table then what can we trust? Also how would you set the current limit and what is the default limit (no-current)?
|
|
|
|
|
4
|
Using Arduino / Motors, Mechanics, and Power / Re: Motor Controllers for car seat motors?
|
on: March 24, 2013, 05:42:10 am
|
Google skills are hardly what the op is seeking. To interface a motor driver, we need (as a minimum) a schematic for the driver board and a link to the datasheet for the driver IC. This listing offers neither and so fits well into the cheap-n-cheerful category along with your previous link.
|
|
|
|
|
5
|
Using Arduino / Project Guidance / Re: Help me break this mental block--degrees to heading
|
on: March 15, 2013, 02:58:24 pm
|
Yup... if ( headingError < -180 ) { headingError = headingError + 360; }
if ( headingError > +180 ) { headingError = headingError - 360; } Why insist on making this a lot more difficult than it is. Convert to -180 +180 and you're good to go. degrees-to-turn = desiredHeading - currentHeading + > turn right - > turn left Always shortest turn, no if's - done.
|
|
|
|
|
6
|
Using Arduino / Project Guidance / Re: Help me break this mental block--degrees to heading
|
on: March 14, 2013, 01:23:32 am
|
If holdHeading is 359 and currentHeading is 10 then headingError should be 11 if holdHeading is 10 and currentHeading is 359 then headingError should be -11
The calculations are easier to deal with if you convert heading into the +/- 180 degree range. 359 (from your example) then becomes -1 and so headingError is a simple difference: headingError = holdHeading - currentHeading headingError = -1 - 10 = -11 headingError = 10 - (-1) = 11 For display and input however you may want to keep the 0-360 range and convert accordingly, but stick to -180 to 180 internally.
|
|
|
|
|
8
|
Using Arduino / Microcontrollers / Re: Recommendations for microcontroller with internal clock
|
on: February 13, 2013, 04:35:10 pm
|
From Figure 30-366.ATmega328P: Calibrated 8MHz RC Oscillator Frequency vs. VCC the 25 °C band is roughly 7.8 MHz to a bit over 8.1 MHz. That's -2.5% to +1.25%.
In comparison, a Quartz crystal has a typical frequency tolerance of about 0.001% and a ceramic resonator (such as those made from zirconimum titanate) about 0.5%. I trust most will agree that the difference is indeed substantial. It also has an internal PLL which can provide 16 MHz clock, however the other oscillator (8 MHz) can be calibrated. I think the PLL clock locks onto the 8MHz internal resonator and so they are essentially subject to the same accuracy constraints. If you calibrate the internal 8MHz oscillator, you should see the effect on the PLL clock as well.
|
|
|
|
|
9
|
Using Arduino / Project Guidance / Re: Complimentary Pins on Arduino?
|
on: January 23, 2013, 12:10:37 pm
|
The arduino does not have this feature, in fact there are only a few processors that have it.
I would say the exact opposite is true. Most microcontrollers support complementary pins and the AVR AtMega is no exception. This comes from the fact that IO pins are mapped in clusters (8-bits on the AtMega) and a full cluster (a port) can be set/reset within the same cycle and on the same clock edge. You can use direct port io (as suggested by CrossRoads) - or you can program one of the timers to toggle two pins with complementary logic. When using direct port io it is convenient to use the toggle instruction. Example: PIND = 0x03; // toggle digital pin 0 and 1
|
|
|
|
|
10
|
Using Arduino / Networking, Protocols, and Devices / Re: I2c always reads as 255
|
on: December 28, 2012, 12:58:12 am
|
I am going to write a bit-bang sccb function. How would I convert 5v to 3.3v (bit bang is not open drain like i2c)
Your bit-bang function better be open drain if you want it to be I2C compatible. The way to do this is to toggle the SCL/SDA pins between output low and input mode. Logic high (pin mode input) is then limited to your external pullup voltage.
|
|
|
|
|
11
|
Using Arduino / General Electronics / Re: Blown Caps in 0-30v 0-10a bench supply repair
|
on: December 25, 2012, 05:44:23 am
|
You connected the battery backwards perhaps? This is making a lot more sense than assuming the load killed it. A bench supply will (should) protect itself against overload. There is a protection diode across the bench supply output that will short input to ground in case of reverse polarity. The idea here is to allow a fuse to blow on the supply side (your battery in this case). The battery however is not fused and so damage will occur. I would attemt a repair by replacing what's obviously broken (the open capacitors, the PCB trace) and also the reverse protection diode.
|
|
|
|
|
12
|
Using Arduino / Sensors / Re: Best method to measure liquid level?
|
on: December 22, 2012, 05:14:27 am
|
Now if they misstated that it's measuring hydrostatic pressure applied against the tape, but rather the absolute liquid level relative to the tape then they are not using hydrostatic pressure but some other means which wouldn't be obvious to me.
This is a multi-element sensor that use hydrostatic pressure to add/subtract individual resistive elements from the circuit. Individual element sensitivity is related to pressure, but total restiance is proportional to and determined by liquid level only.
|
|
|
|
|
13
|
Using Arduino / General Electronics / Re: MOSFET Driver Types
|
on: November 30, 2012, 05:26:01 pm
|
The AVR output pins are pretty robust and are active sinking and sourcing so many pwm switching applications using 'logic level' n-channel mosfets in a low side switching configuration don't require external driver help at all, just drive the gate directly with the arduino output pin. But again it's all about your specific device, applications, and how much load power you are trying to switch. For PWM power switching, general advice would be to always use a driver (learning how to calculate switching losses and avoiding issues with heat-spots is mandatory). The driving force towards logic-level MOSFET’s is not CMOS logic level switching, but the possibility of using a single (shared controller and driver) supply. A logic-level MOSFET has a higher total gate charge and so requires more switching power than standard drive. High power means high-current, and low voltage means higher current still (peak current drive requirements are in excess of 1 amp for popular logic-level power MOSFET’s and may be as high as 10 amps). A standard drive MOSFET reduces current requirements two-fold in comparison to logic-level drive.
|
|
|
|
|
14
|
Using Arduino / General Electronics / Re: Measuring small changes in high AC voltage
|
on: November 07, 2012, 02:04:04 pm
|
Well, not very high AC voltage, around 50 P-to-P from a transformer. The voltage is expected to fluctuate between 49v and 51v, and I'd like to see the changes with high resolution. That is voltage dividing 50v to 5v range would not work as the steps would be 5/1024*10 = 0.05v resolution. If I could bring the edge of the AC wave into the 0-5v region, that would offer 0.002v resolution.
What would be the easiest way to do this?
Some alternatives to high res ADC and the op-amp peak detect circuit: - Variations in transformer output voltage comes from variations on the supply or load side. If you consider the supply side constant, you could measure variations in load current (such as voltage drop across a shunt resistor). A change in load current will cause an inverse proportional change in transformer output voltage. - You can use a string of zener diodes (plus a resistor) to drop the output voltage into the AtMega ADC range. Zener diodes around 5V are good picks as they’re temperature neutral. You measure the peak voltage across the resistor which also defines the required zener current. - Use an opto-coupler to trigger at a voltage level close to peak and measure the time between the rising and falling edge of this pulse. Pulse width will be proportional to changes in transformer output voltage.
|
|
|
|
|
15
|
Using Arduino / General Electronics / Re: P-Channel mosfet controlling car 12v light
|
on: November 05, 2012, 01:18:45 pm
|
Now I don't know what you guys are talking about again. The drive transistor is a MOSFET, not a bjt. All the 10K pullup does is hold the MOSFET "off" when the NPN is off, and bias the MOSFET gate to approx -12V when the NPN is on.
The only time current flows through the pullup is when the NPN is on. If you lower the value of the pullup, all you are doing is causing the NPN to work harder, and waste electrons. With 110 ohms, the NPN will have to pull 12V/110 = 109mA, just a waste.
10K is a good value for the pullup.
Also, you get economy of scale - the more components of the same value you have, the less they cost. I regularly use 10K in various combinations to make other resistances - 5K, 20K, etc - because I buy 10K in bulk they are considerably cheaper. Economy is a secondary concern - you need a working circuit first. With FET's we need to pay equal attention to switching it on as we do to switching it off. In the proposed circuit, switch-on is fast (only limited by the NPN on-state resistance). Switch-off however is slow as the FET is left to discharge its gate through the 10k resistor. For a switching application (such as PWM) this is inadequate even for moderate loads. A proper design requires a push-pull driver for the gate - not a 10k resistor.
|
|
|
|
|