Show Posts
Pages: 1 2 [3] 4
31  Using Arduino / General Electronics / Re: need help completing this circuit on: April 28, 2012, 11:42:29 pm
Use a resistive divider to reduce it.

Connect your gnds so that you have a common reference and use large value resistors so that you don't dissipate a lot of power and burn up the resistors.
10k and 47k would be a good choice but you should make sure the input is really 5.6 volts as it could be higher when it's unloaded ...

32  Using Arduino / General Electronics / Re: Seeking an alternative to transistor on: April 28, 2012, 11:29:51 pm
is there a way to prevent power dissipation?

Yes, use a logic level N-channel MOSFET to switch the low side. You want logic level as it won't require more than 5v to turn on fully.
A FET with a low Rds(on) will dissipate much less that a transistor, you can calculate dissipation with P = V*V/R.

If you want SMD, the IRLML2402 is a nice part in SOT23.

For through hole parts, Digikey's parametric search comes up with many choices, the first one is good for 600mA at 5v gate, second one is quite beefy with a really low Rds(on):

33  Using Arduino / Project Guidance / Re: How to sync motor speed??? on: April 12, 2012, 09:24:46 am
Here's a more conventional example:
34  Using Arduino / Project Guidance / Re: HMC5883L compass huge error [SOLVED] on: April 11, 2012, 08:37:29 pm
So I just take the x,y,z values from here:
and plug them into here directly?  Combining the 2 sketches.

Yes, that is correct. Raw values or scaled doesn't matter, raw is faster and more accurate.
In process, the library scales everything up with an equal multiplier to reduce quantization losses.

sixDOF.compCompass(-(raw.ZAxis), -(raw.XAxis), raw.YAxis, -(accel.z()), -(accel.x()), accel.y(), true);
Mine are raw values also?
Why do the first 2 - Z,X have minus signs, Y does not?
Do I include these signs before my x,y,z too?

You may want to play with the arrangement and sign of xyz depending on the orientation of your accelerometer and compass.
My PCB is mounted vertically and the xy of the accelerometer was not the same as the xy of the compass.
This is why I have (-z, -x, +y).  The default order is (+x, +y, +z).

I don't see how this can work for small tilt angles, because the Z value doesn't change, in my case.
Can you explain how it works without this value?
Let's say you have tilt and X,Y from HMC5883, but no Z.

The libraries trigonometry is non-linear and ratiometric.
Non-linear as in on axis effect is the lowest, while a right angle axis will have the highest effect.
Ratiometric as in a change in only one axis effects the ratio and therefore the end result.
35  Using Arduino / Project Guidance / Re: How to sync motor speed??? on: April 10, 2012, 10:11:10 pm
Does it look like this?:

The 12CPR likely indicates it's using a pair of hall sensors and a multipole disk magnet for the encoder.
Which would be 64:1 x 12 CPR = 768 CPR at the shaft. With the gear head that is a pretty good count.

Edit: Just saw the back of the motor, it's slotted disk and opto, not multipole magnetic and hall...
36  Using Arduino / Project Guidance / Re: How to sync motor speed??? on: April 10, 2012, 09:47:38 pm
The main points of your code look good.
You are using interrupts to read the encoders.
The PID loop is on constant timebase.

My approach would be to run PID on each motor individually, which also makes for an incremental approach.
And command them to turn by specifying a different number of steps for each wheel for the same time.

If the behavior is to run away, try reversing either the motor wires, or reversing the direction bit in sw...
What is the transition count of your encoders per revolution? Low count can be tricky...
37  Using Arduino / Project Guidance / Re: Needing info on garage door IR beam and interrupt input on: April 10, 2012, 09:26:00 pm
I don't believe the IR sensors are simple photodiodes, they communicate with the door opener with some proprietary protocol.

If this is the case, you might try making your own.
Modulate an IR led at 38khz, use a lens to extend range...

And receive it with either one of these demodualtors, TSOP4038 or TSOP58038.
These two specific parts are rated for continuous use, I found both at Mouser.
Regular TV remote demodulators will stop responding to a continuous signal (over 20% duty cycle) after a short while due to the gain control.
38  Using Arduino / Project Guidance / Re: Reading Slot Car IR on Different Frequencies on: April 10, 2012, 09:20:35 pm
You might try decoding the frequency in software.

Capture the signal with a photodiode using a timer.
With either an external interrupt, pin change interrupt, Input Capture or T1/T0...
What you will get is the time value for the wavelength.

Once you get a couple of samples, average and use a case/switch to identify.
Or you might try this design note, sw FSK decoding:
39  Using Arduino / Project Guidance / Re: HMC5883L compass huge error [SOLVED] on: April 10, 2012, 08:53:37 pm
You will want to implement some tilt compensation for the compass, using the accelerometer to figure roll, pitch and yaw.
Here's a library we (my friend and I) wrote:
40  Using Arduino / Project Guidance / Re: How to sync motor speed??? on: April 10, 2012, 08:48:29 pm
As already mentioned, PID is what you want.
In addition, you want to command a position, not a speed.
As a loose PID will normally suffer from some velocity following error.
If you find it difficult to tune and/or are going slowly, drop the D and just do PI.
41  Using Arduino / Project Guidance / Re: Needing info on garage door IR beam and interrupt input on: April 10, 2012, 08:40:36 pm
It might be an open drain output, if it is, it will require a pullup resistor to set it before you see anything...

The IR itself is modulated with a carrier frequency much like a TV remote, maybe 38kHz?

42  Using Arduino / Project Guidance / Re: Moving motors to a reset (0,0) point on: April 10, 2012, 08:33:35 pm
In most CNC equipment, there is only one limit/home switch per axis.
Once it's calibrated to home, the machine software (MACH3 for ex) "knows" how far it can go in each axis...

You might try the pin change interrupt library to signal when a limit/home switch is triggered.
It will be more repeatable than polling as the interrupt will fire regardless of what the main loop is doing.

When my CNC mill homes, it pulls the Z up first for safety, then does X and Y.
When it finds the home switch, it then backs up and slow approaches again to negate switch bounce.
43  Using Arduino / Project Guidance / Re: Too much amperage for Arduino power supply? on: April 10, 2012, 08:22:20 pm
I've had a few cases where a large inductive load (such as a motor) causes the supply to dip enough to reset the AVR.
It will depend on the pump startup current and the internal resistance of the battery.

In extreme cases where adding bulk capacitance close to the Arduino isn't enough, a series diode before the capacitance is the fix. 
The diode will block the reverse drain of the bulk capacitance.

The other option is to control the pump with a FET instead of a relay, and ramp up the FET with PWM for a soft start.
44  Development / Other Software Development / Re: Bootloader using photocell? on: April 09, 2012, 12:00:19 pm
Some of the datasheets for these parts indicate less than 20% duty cycle which is about what I'm seeing.
The continuous bit stream I want to send them probably averages very close to 50%.
I suspect the shutdown is due to the automatic gain control circuitry.

I now understand why the NEC protocol has a specific command for repeated hold.
The repeat code is extremely low duty cycle...

The datasheet for one of the parts I've tried (TFM5360) is quite revealing.
According to page 5, the suitable TFM part is the TFM1xx0 series...   
45  Development / Other Software Development / Re: Bootloader using photocell? on: April 08, 2012, 09:20:55 pm
Screen programming could be faster if different colors are used, something akin to FSK as opposed to OOK...

The 38kHz 2400 baud IR bootloader I'm working on is almost going.
But I've just discovered the IR demodulators I'm using are not rated for continuous operation. 
After a few bits in a row, exceeding a certain duty cycle, the demodulator stops responding.
I have some TSOP58038 parts on order, rated for continuous, that should fix this.

With 2400 baud and ten bits per byte (8 + start and stop) we get 16 carrier waves (@ 38Khz) in a single bit.
The carrier wavelength being 26.3us and the the baud bit length being 426us.
There is some phase shift (about 8 wavelengths) as a result of the demodulation circuit that prevents it from being any faster.

Interestingly, IRDA specifies the carrier to be 3/16 the wavelength of the bit length.
So the carrier for 115k baud is 614 kHz, and the carrier for 9600 baud is 51kHz. 
This is considerably better than the 1/16th I'm getting with the 38kHz TV remote demods..
I've also looked at the audio bootloader.
It's going to have the same speed issue as 38kHz IR, a little slower, the maximum carrier will be 20kHz.
At least with audio, multiple carries can be used for a multi-bit FSK scheme.
But that would require either decoding FSK in the AVR or some external analog filters...

Pages: 1 2 [3] 4