Show Posts
Pages: 1 ... 232 233 [234] 235 236 ... 838
3496  Using Arduino / Programming Questions / Re: Problem getting to work TEA 5767 on: January 13, 2014, 04:03:54 pm
Iron too cold?  Clean the iron properly?

I always find a close visual inspection after construction is worthwhile - use a lens
and expect every joint to be suspect, then you'll find the otherwise really frustrating
problems early  smiley
3497  Using Arduino / Programming Questions / Re: Compilation error: " ‘size_t’ has not been declared " on: January 13, 2014, 04:01:34 pm
All #includes have to be listed in full in the sketch - the Arduino compilation strategy
first copies all the included libraries and your sketch files to a blank directory, then
compiles them there.  It gets the list of what to copy from your sketch file, it doesn't
walk the #includes recursively.

This means if library A uses library B you have to #include A and B in the sketchfile
at the top.

This is likely the cause of your error.
3498  Using Arduino / Programming Questions / Re: int position; definition please on: January 13, 2014, 03:58:26 pm
int - integer type
position - variable name.
3499  Using Arduino / Programming Questions / Re: Why do people use #define insted of int/char/float ? on: January 13, 2014, 03:56:45 pm
#define's are handled by the pre-processor and are purely textual substitution at
compile time only.  Nothing is present at runtime.

If you declare a variable it will need storage at runtime (unless the compiler
succeeds in optimizing the declaration away).

If you are declaring a constant it pays to declare it const, then the compiler is
let in on that fact.
Code:
const int RED = 1 ;
The compiler will both be able to report assignments to RED as an error, and probably
succeed in optimizing the declaration away if its not needed.

BTW the prefered way to do a #define of a value is to have parentheses around
it to prevent any mis-parsing of the substituted code:
Code:
#define RED (1)

This really matters if you define constants in terms of others:
Code:
#define RED (1)
#define GREEN (RED+1)
#define BLUE (GREEN+1)

This means if you go
Code:
  int foo = BLUE * 256 + RED ;
You get no surprises due to operator precedence (* binds tighter than +)
3500  Using Arduino / Motors, Mechanics, and Power / Re: Software short-circuit protection for outputs - fast enough? on: January 13, 2014, 11:02:45 am
Transistor datasheets usually have a graph of maximum power against pulse-length,
which should give a value for how many us or ms the device can stand for any particular
overload condition.

Less commonly you may get a similar graph for max current pulses.  High current pulses
can melt/vaporize the bonding wires even if the device total power isn't a problem, so
ideally you'd like to know the maximum current and maximum power that the circuit can put
through the transistor, then work out the maximum safe delay to act in protecting the
device.

In general high current and voltage circuitry gives very little margin for error in a
hard short condition (sometimes 10's of kW are available to dump into a device, and
microseconds matter).   For instance shoot-through in a bridge is like this and you'd
normally use a comparator to catch a hard-short condition as fast as possible.

When the "short" is through a motor you've got a less extreme condition as motors are
inductors and the current rises more slowly - so knowing the winding inductance is
useful for calculating how fast the current can rise to dangerous levels.

Having a bridge/switching configuration that prevents shoot-through means you will have
an easier time with protection circuitry (but remember a wiring-short is as fast as
shoot-through).
3501  Using Arduino / Motors, Mechanics, and Power / Re: motor that can pull 40 pounds on: January 13, 2014, 10:50:18 am
I did physics, where SI units are the only units...  So torque is N-m and the
equations have few if any arbitrary constants (so you can easily remember
them all!)

For mechanics the only constant you need to remember is pi and the gravitational acceleration at the earth's surface, namely 9.8 m/s/s  (though that is planet-dependent
of course).

The benefit of using N-m (newton-metres) for torque is the simple relation

power = torque x angular velocity

Which is needed all the time when choosing motors and gearing.
3502  Using Arduino / Motors, Mechanics, and Power / Re: Translating the Phases of a motor from A,C,B,C to A, A(bar) ect.. on: January 13, 2014, 10:33:51 am
Windings are usually given letters, so for a common stepper you have A and B windings,
for a three-phase motors there are A, B and C (though some people use
U, V, W for no readily explicable reason).  A five-phase stepper has A, B, C, D, E.

Sometimes windings are separate, so each winding has two wires, and these are
labelled A and A-bar (or A+, A-) etc.   Typical 3-phase motors have 3 wires in total,
since they are connected star or delta internally, but in theory they could bring out each
separately with 6 wires total.
3503  Using Arduino / Programming Questions / Re: code for 3-8 decoder on: January 13, 2014, 10:23:54 am
You can also avoid stutter by using a Gray code sequence

000
001
011
010
110
111
101
100

And re-arrange the output pin numbering to match.

The code to drive this is
Code:
#define S0  ...  // address select bit 0
#define S1  ... // address select bit 1
#define S2  ... // address select bit 2
#define del ... // delay in ms

void setup ()
{
  pinMode (S0, OUTPUT) ; digitalWrite (S0, LOW) ;
  pinMode (S1, OUTPUT) ; digitalWrite (S1, LOW) ;
  pinMode (S2, OUTPUT) ; digitalWrite (S2, LOW) ;
  ...
}
void sequence ()
{
  delay (del) ;
  digitalWrite (S0, HIGH) ;  // change 000 to 001
  delay (del) ;
  digitalWrite (S1, HIGH) ;  // change 001 to 011
  delay (del) ;
  digitalWrite (S0, LOW) ;  // change 011 to 010
  delay (del) ;
  digitalWrite (S2, HIGH) ;  // change 010 to 110
  delay (del) ;
  digitalWrite (S0, HIGH) ;  // change 110 to 111
  delay (del) ;
  digitalWrite (S1, LOW) ;  // change 111 to 101
  delay (del) ;
  digitalWrite (S0, LOW) ;  // change 101 to 100
  delay (del) ;
  digitalWrite (S2, LOW) ;  // change 100 to 000
}
3504  Using Arduino / Programming Questions / Re: Don't undestand this compiler error on: January 13, 2014, 10:11:09 am
Not what I get (after removing the obvious b tags)

Quote
cplusplus.ino: In destructor ‘CArray<T>::~CArray() [with T = CVirtualLED]’:
cplusplus.ino:226:   instantiated from here
cplusplus:72: error: cannot convert ‘CVirtualLED*’ to ‘CArrayElement<CVirtualLED>*’ in assignment
which refers to this line:
Code:
    pCurrent = m_pHead->m_pNext;


I just concatenated all the code together for a quick test.
3505  Using Arduino / General Electronics / Re: Wrong connection to a 74HC595 Shift Register ? on: January 13, 2014, 09:55:51 am
0.1uF ceramic decoupling capacitor on each logic chip is recommended practice,
right up close to the chip.

On a breadboard that's a little awkward, but you can put it between the power rails.

I note you are using ground on the bottom pair of rails, +5V on the top pair.  That's
not ideal way to do it - use a single pair of rails, then the decoupling caps
can simply be on that pair.  Keep power and ground close together to avoid big loops
and their stray inductance.

If you are switching lots of LEDs then decoupling is very important as you are switching
perhaps 100's of mA at nanosecond timescales - I would recommend both 0.1uF per chip
and 10uF to 100uF per breadboard.
3506  Using Arduino / General Electronics / Re: Connecting USB power directly to the mini pro's VCC or RAW pin on: January 13, 2014, 09:45:11 am
Ignore what the supply says and actually measure the output voltage with a multimeter
on both AC and DC.  The DC reading ought to be 5.0 +/- 0.1V and the AC reading less than
0.1V.   If not then is not a regulated supply and mustn't be connected to Vcc.

Having said that USB supplies ought to always be good regulated 5V, but it costs nothing
to check.

Vraw needs 6.5V or more IIRC correctly to guarantee the on-board regulator has enough
headroom.  Something like a 9V wall-wart can conveniently power the DC jack (which feeds
into Vraw via a diode)
3507  Using Arduino / Project Guidance / Re: Can I "Borrow" a Signal from a Stepper Motor? on: January 13, 2014, 09:41:17 am
Unless you find out what the stepper motor driver is there's no way to know the kind
of drive the motor is getting.  A microstepping driver will be putting out continuous
PWM of all the stepper wires all the time, in that case you'd have to give up on camping-on
to the wires (they might be at high voltage too - some microstepping drivers have 80V
supplies for instance.

If its unipolar and driven from a simple single supply voltage it would be feasible.

Adding a magnet to the shaft and a hall-sensor has the advantage of not needing to know
anything about the motor, and is a general technique for any motion system.
3508  Using Arduino / Project Guidance / Re: Currect and Voltage supplies on: January 13, 2014, 09:35:28 am
If you have all the sensors its a few minutes work to measure their current consumptions
with a multimeter (probably easier than trawling all the datasheets).
3509  Using Arduino / Project Guidance / Re: NTC Thermisitor on: January 13, 2014, 09:32:35 am
You need to either find a performance curve or equation for your particular
thermistor from its datasheet, or to measure it yourself.   You also then have
to allow for the voltage divider equation to translate thermistor resistance to
input voltage.

For logging data SD cards are often used.  There are data logging shields which
tend to have an RTC as well as SD socket and level translation for the SD card
(which need 3.3V).
3510  Using Arduino / Motors, Mechanics, and Power / Re: [Resolved] Erratic operation when motor is supposed to be "asleep" on: January 12, 2014, 06:32:28 pm
Good smiley
Pages: 1 ... 232 233 [234] 235 236 ... 838