Show Posts
Pages: [1] 2 3 ... 86
1  Using Arduino / General Electronics / Re: Limiting current to motor? on: April 15, 2014, 06:59:39 pm
Yeah, I've got the PWM part nailed down.  I will either be using a dedicated controller IC, or mosfets with flyback diodes.

Or are you saying I can just use a lower duty cycle to reduce the torque?  That will reduce the speed of my motor under load though.  What I really want is a way to prevent the motor from exceeding the current it draws under load, so that if it's stalled there will be insufficient current, and therefore torque.
2  Using Arduino / General Electronics / Limiting current to motor? on: April 15, 2014, 05:57:07 pm
I have a small DC gear motor and I'd like the limit the torque it outputs, without impacting the speed of the motor under a normal load.  But I also want to keep costs and component count low.

So I was wondering, what effect a simple resistor attached to the motor would have, and why it would be preferable to use a more sophisticated current limiting circuit over that.   Ie, how would it affect the speed and torque? 

I'm guessing with a motor things are going to be a little more complex than just choosing a particular resistor to limit the voltage and current to a specific level.

Oh, and I'm going to be controlling this motor with PWM.
3  Using Arduino / General Electronics / Reset into programming mode circuit for an Xmega. on: March 31, 2014, 05:21:17 am
Hey guys,

I think I finally figured out that reset/programming circuit I was working on.

This circuit is designed to allow an XMEGA to be reset into programming mode with a single button press.

Normally, if you have the board powered from the USB port, you'd have to press and hold reset, then press and hold a program button, then release reset, and finally release the program button.  Or you'd need a switch or jumper on the board to enable programming mode. 

With this setup, you just push the button, the board resets, and assuming you don't release the button faster than the reset occurs, the program line will be pulled low when that happens, and the board will enter programming mode.

In addition, because the programming pin by default is on one of the SPI lines, and I didn't want to lose an SPI port, I needed to find a way to ensure that SPI on the programming pin wouldn't reset the board, that it would still be possible to reset the board if the programming line were being pulled high or low, and that pressing the button while SPI was active would not short the pin to ground. 

This circuit does all of the above:

Java simulation: http://goo.gl/Jp7jex

Note that the forward voltage drop on the diodes (well, the one on the reset pin at least) needs to be below 400mv or the capacitor discharge will cause the voltage to spike above the 3.8v max on the MEGA's reset pin.  It isn't tolerant of high voltage like the Atmega and 32U4.

Also, the 25K capacitor by the reset pin is the internal 25K pullup on that pin, so the final part count is 2 resistors, 2 diodes, and a capacitor.

I have not tested this circuit myself yet, so buyer beware. 

It should be possible to add an additional reset button that performs a normal reset with the addition of another diode, but I never end up using those things, I just reprogram.  It's easy enough to unplug the board to reset it anyway. 

Anyway, if anyone has any thoughts on the circuit let me know.  The only thing I'm not certain about is that the reset line is pulled low for long enough to trigger the reset, but I think the timing is the same as the Uno here, so it should be okay.  The Mega requires a maximum of 1000ns low I think to trigger it which is a really small amount of time.

[edit]

Oh, and in the above circuit, the resest pin is the dot on the right side of the schematic, and the programming pin is the white dot at the top left.  The switch highlighted in blue is the pushbutton that triggers the reset and programming mode.  Above it is a switch to test what effect spi communication via the programming pin would have.  It's the miso line, and without that diode there, going low would trigger the board to reset.  There's also a switch next to it which disconnects that other switch from the circuit so the programming pin will be as it would be in its normal input state.

Also, the scope on the left is the reset pin, and the scope on the right is the program pin.
4  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 31, 2014, 12:34:44 am
Yeah, I got confused.  I was thinking ISP and FTDI functioned the same as far as the reset line was concerned.
5  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 05:48:49 pm
Yes, I get that... But it wasn't doing anything in the simulation of the Uno or Leonardo circuits.  When DTS went low, reset simply followed DTS.  It didn't go low, and then high again.

I haven't figured out the problem with the Leonardo schematic, and I've given up on it, but I have finally had some success simulating the Uno schematic.

Here is the Uno schematic:


And here is the simulation of it:

Sim: http://goo.gl/DNRTxu

As you can see it now peaks slightly above 5V.  So far so good.

But look at what happens when I set Vcc to 3.3V:

Sim: http://goo.gl/bkByZb

That is with a diode forward voltage of 700mv.   Approximately the fv of the diode Crossroads says is used on the Uno:
http://forum.arduino.cc/index.php?topic=86389.msg1178112#msg1178112

In order to keep the spikes below 3.6v, I have to set the diode's fv to less than 325mv.

I suppose that doesn't matter on the Uno (or the boards that use the 32U4) because the reset pin is special and can handle up to 13v regardless of Vcc.  But I thought I'd mention it because I'm looking at using an Xmega and the reset pins on those are the same as any other pin, aside from a 25K internal pullup so their reset pin can't stand more than 3.8v max.

Anyway, I guess my problem is resolved.
6  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 06:29:37 am
I'm gonna see if I can figure out LTspice and try simulating the circuit in that.  It's high time I started using a decent tool instead of that Java app.  I just hope it has a way to show the current flow.  I find it very helpful in visualizing what's going on.
7  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 06:19:44 am
I just looked at your schematics Pito.  It seems you have a square wave generator V1 connected to DTS.  But why is V1 also connected to ground?  I can't tell from your still image if when V1 outputs 5V it goes to both traces attached to it or not, and that would make a difference whether R2 is connected to ground or... 2.5V?  when V1 is on.
8  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 06:12:03 am
Btw Pito, neither of your schematics actually represent the Uno or Leonardo reset circuits.  Whether your circuits are correct or not, I don't know, but what I'm trying to figure out here is if the Uno and Leonardo schematics are correct.
9  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 06:10:02 am
Here ya go:
10  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 06:03:45 am
Pito:
The schematics I am referring to are all on this site.  I'm talking about the differences between the Uno and Leonardo auto reset circuits. 

The first few simulations I posted were simulations of those circuits.  The simulations indicated they would not behave the way they should.  The only thing a screenshot of the simulator would show you is that the circuit I constructed is identical to the one in the schematic.

Either the simulator is wrong, or the schematics are wrong.  You have the schematics., so at the very least you can see that they should, or should not work as advertised, and explain why they are different.

If  I posted a picture of the simulator all you would see is a still image of the circuit in the UNO schematic, with an osilliscope output showing a square wave on the reset pin when I switch the DTS high and low.
11  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 05:27:31 am
I still haven't had any success with the actual Uno circuit, but I've made some progress.  This variation seems to work how it's supposed to, at least for the DTS portion:

http://goo.gl/D0b3t9

I still need to add the reset button to this and figure out how to make it function the same way though.   

[edit]

Well, this seems to work...

http://goo.gl/XJEeFy

It doesn't drop and bounce back on its own while the button is held, but it does go back to 5v after you release it which ought to have the same effect.  I'd rather it snap back to 5v while held down though.  Would feel more responsive.
12  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 05:18:54 am
Pito:
If you don't want to click the links because you're concerned then don't, but posting an image of a simulation defeats the purpose when I'm trying to show people what's happening with the simulated circuit.


13  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 04:37:15 am
Actually, I noticed it's only the Leonardo that has two caps.  The Uno does not.  Nor does the Ethernet.

Futhermore, the Leonardo's two caps are connected on the 5V side of the diode and resistor, then to ground.  But the single cap on the Uno and Ethernet is connected to the reset line and ground.

The two are very different circuits, and neither one seems to work as it's supposed to with the simulator I'm using.  Instead of the results I was getting before which mostly made sense, now when I flip flop the DTR line, I just get 5V or 0V on the reset line, and the voltage doesn't revert via the cap as before:

http://goo.gl/zjES7n

I also see no action on the diode.  It seems to do nothing.

Is the simulator broken?  It could be.  But if it is, what about the different placement of the caps in the schematics?   Which is correct?  Do both work, or is one wrong?

[edit]

I guess the main difference is in the Leonardo you have two caps to ground, with a resistor between them and the reset line, whereas in the Uno you have one cap to ground with no resistor between it and the reset line.  So  I guess they're not totally different.  But still no clue which is better or why they're different. 

Also doesn't explain why the simulator doesn't actually show them doing anything.
14  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 03:53:50 am
Okay, well I guess my next question is, why does the new reset circuit have two capacitors?
15  Using Arduino / General Electronics / Re: Help me understand what's going on with the reset circuit in this simulation. on: March 30, 2014, 01:58:12 am
Coding:
Well, it explains it, but at the same time, it doesn't.

What is the mechanism which causes the other side of the capacitor to rise to 10V?  Is it the like charges repelling?

That doesn't seem to make sense though if I think about it as electrons and holes instead of charges.  The plate on the reset side is lacking electrons.  When the other plate goes from negative to positive...  well, I guess the plate on the side of reset might not be completely depleted of electrons.  So that could force some more out maybe, thus making it even more positively charged?

So I guess it kinda makes sense?
Pages: [1] 2 3 ... 86