Solved: Please Help (Fried Pins) I think i am slowly killing my STE

Troubles with your machine? Just want to speak about the latest improvements? This is the place!

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Mon Sep 04, 2017 10:08 pm

Yes although the resistor values are wrong, especially the one on the left, for 22v. It will toast the IC.

The layout is ok though - for the simplest version of it.

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Tue Sep 05, 2017 8:59 am

THe 22v shouldnt touch it.
Its not going to be connected across the rails. I still intend to use the GND rail and the separate rail that runs necxt to the GND which i would feed with 5v

Image

You can just about see the separate rail.

I assume we probably need to have some capacitors etc to protect the 4N25 ?

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Tue Sep 05, 2017 9:26 am

Yep ok - but I'd still calculate the resistor from the optoisolator datasheet vs 5v. Don't just copy something from the internet without checking stuff.

e.g. for 10mA to the optoisolator @ 5V:

5V / 0.010A = 500ohm.

But use the mA rating from the actual datasheet - somewhere between switching threshold and maximum rating.

The optoisolator should cope with typical noise from the motors but adding a small cap across it should help with noisy switching. Too large a value will suppress or prevent detection though.

If switching is still flaky (getting multiple on/off signals for a single event) you can debounce it by adding more bits to filter the switching. But see if it works at all first.

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Sep 07, 2017 11:27 am

Hi Doug

You are very right.

I now have a cheap oscilloscope on its way. I think this will help me check things a lot better than my simple DVM.

I can then approach this in a much less panicky way.
I have some caps of varying sizes now (up to 10uF) i can experiment with those too.
Also I now have some PC817s as well as 4n25s

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Mon Oct 16, 2017 9:58 pm

Hi Everyone

Well after a series of setbacks, fried HDs, dead laptops etc. None connected with this issue, i returned to the problem at hand.

Regarding the timing i have a system working now using Opto Isolators

Specifically...

I am using
Image

Where
A is 470 Ohm
B is 1K8 Ohm
C is 1K8 Ohm

This seems to be running really well, very solid, but my numbers are somewhat arbitrary, how do i figure out what the best resistors will be? I've been trying to keep the numbers up to reduce current. But i just dont know.


OK now onto the Transformers
Image

I'm not at all sure how to attach them across the rails without short circuiting things?
Plus its DC, so i'm not sure what to do in that respect, i think in fact instead of being proper DC its a half wave thing which might mean we have effectively AC to transform, but i'm not sure.
I've torn apart an old dead VCR for coils so hopefully i have something to work with.

All advice gratefully received.

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Mon Nov 13, 2017 3:26 pm

Double post
Last edited by AtariOwl on Mon Nov 13, 2017 3:30 pm, edited 1 time in total.

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Mon Nov 13, 2017 3:30 pm

I switched to linear opto isolators and for a while that seemed to work, but now it is not.

In essence, what is happening is that the IL300 seems to be deadening the input of the LM741

The input goes into the LM741 just fine and comes out with the waveform i expected. A DC offset with half sine on top.

This is all fine until i connect it to the IL300, then instead of transferring the signal across as it did yesterday it deadens it to a slightly lower DC.

The same think happens with all my IL300s and did not happen yesterday.
I have checked my circuit several times but the problem remains.

Image

Any ideas?

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Tue Nov 14, 2017 10:40 am

Hi,

The optoisolator input is basically a LED, which is basically a diode.

A diode has a fixed forward voltage. i.e. it acts like a clamp.

So if the LED has a forward voltage of e.g. 1.5V, then applying 1.2V will result in 1.2V across the diode and ZERO current flowing. It's not enough to meet the diode's forward voltage.

Applying exactly 1.5V will produce 1.5V across the diode, with still no current flowing.

Applying 3V will still produce 1.5V across the diode, plus a *lot* of current flowing.

So applying signals to a LED will turn the (excess) voltage waveform into a current waveform, and clip the voltage waveform flat. Which is what you are seeing.

The fact your signal is completely flat suggests the DC offset is above the LED forward voltage, and the LED is therefore always on. You need a lower offset voltage to get the LED to turn off in the 'troughs'.

e.g you have:


/\/\/\/\/\/ 2v-5v (led always on, voltage always clipped to 1.5v by diode)

------------- 0v


...when you want more like...


/\/\/\/\/\/ 0v-3v (led only on when voltage > 1.5v, and is clipped at 1.5v)
------------- 0v


These are example numbers only - I don't know the forward voltage of the IL300 LEDS, or the output volage range of your circuit. But this is how the two things would behave. Diodes are clamps, which turn the excess (clamped) part directly into current (and/or smoke = DEDs) which is why a small resistor is always needed to limit the current.

Also be aware opamps have limited current output -LM741 considers >25mA as a short circuit. This is probably ok as it is, but driving anything more current-hungry than a LED+100R could fault the LM741.

D

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Nov 16, 2017 1:00 am

Hi Doug

As always your help is invaluable and i am making much progress.

I am now generating a very nice response from the system however once i connect the input to the EJP it goes wrong.

Is this because the current is too small from the LM741?

When i do not connect to the ADC i get a nice smooth line (when it is off i am running from 5v down)
Image
When the car runs i get a nice smooth have sine DOWN from this line which is NOT clipped. I am having difficulty getting a screen shot at the same time as this. I am happy with it though

When i do Connect to the ADC i see this,
Image

And if I have a cap across this to smooth it
Image

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Nov 16, 2017 9:29 am

OK and running with the throttle on and a car on track

Image

Connecting to the EJP does something odd to teh signal as you can see

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Thu Nov 16, 2017 9:51 am

AtariOwl wrote:I am now generating a very nice response from the system however once i connect the input to the EJP it goes wrong.

Is this because the current is too small from the LM741?


It's an optoisolator so the input side shouldn't be influenced by the output side (or vice versa). There's an 'air' gap between the LED and the photodiode.

However if you have connected both GNDs together then you might get some issues depending on the rest of the circuit. Keep the ground and power lines isolated at both ends. Hopefully you're not *taking* power from the computer somehow. Also you should probably have a resistor in series with the computer/EJP side of the circuit.

BTW I assume EJP = joystick port?

D

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Thu Nov 16, 2017 9:57 am

BTW a smoothing capacitor isn't always a great way to debounce switching noise because it reduces amplitude (filters). A better way is to use something like a Schmitt trigger IC for digital, or an opamp arranged as a comparator (or a dedicated comparator IC like LM397) for analog circuits.

These accept fuzzy signals in, and put something like digital out. They has some hysteresis so there's a region in the middle which doesn't trip easily - it requires a slightly higher voltage to turn 'on' and a lower voltage to turn back 'off' with a cushion between them. This turns messy switching signals into nice square output.

I wouldn't complicate matters with this just now but I'd look into it after you sort out the other issues.

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby dml » Thu Nov 16, 2017 10:09 am

I've been looking at your 741 circuit and realise I don't know what its meant to do. I thought it might be configured as a comparator (wobbly in, digital out) with a resistor-configurable threshold but it's not that.

It looks more like its using feedback from one photodiode to regulate activity to the LED. Like a current regulator or something. Is it there because the supply voltage for the LED is really unstable?

Where did you find the diagram for this and how is it explained?

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Nov 16, 2017 11:17 am

umm

Those are good questions

It came from a place called mikrocontroller.net as a Unipolar Photovoltaic Amplifier. It contained an Op Amp on the output but i was already getting levels i liked from the opto isolator and i havent included it yet.

This is what i am NOW running...

Image
I fixed the diagram

The output of the IL300 is connected to the 5V and GND of the Joystick port. I Assumed maybe wrongly that it would work like a potentiometer for an analogue joystick.

The other GND and 5V are entirely independent of the STE

The Signal i am watching is between pin 9 and 5
EJP is Enhanced Joystick Port

My scope is between pin 9 and the point between R4 and Pin 5 so that i can still monitor if pin5 is connected or not
If i do not connect Pin 5 i get the to two traces
If i DO connect pin 5 i get the bottom two


The 741 seems to to have something to do with the IL300, apparently the matched photo diodes at 3/4 and 5/6 keep it stable, feeding back from the 3/4 photodiode ... i would imagine its a little sensitive because its a linear coupler instead of a simple on/off thing.



I should put the other opamp in shouldnt i? Instead of the cap?

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Nov 16, 2017 4:10 pm

OK New circuit with buffer OpAmp instead of cap
Image

Different results
Image

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Thu Nov 16, 2017 5:24 pm

Hmmmmmmm
Well i changed my circuit slightly and the response is much cleaner but the ADC is not giving teh correct values.
If i connect the +5v to pin5 (via a resistor of course (I'm not crazy) i get about 5 from the ADC, if i dont connect anything i get about 140, if i connect GND i'm still getting 140 hmmmm

AtariOwl
Atari freak
Atari freak
Posts: 64
Joined: Mon Nov 03, 2003 2:04 pm

Re: Solved: Please Help (Fried Pins) I think i am slowly killing my STE

Postby AtariOwl » Sat Nov 18, 2017 1:31 pm

It is solved

Thank you so much for your help.

Essentially the ADC in the EJP cannot be used as a voltage follower, in essence what it does is measure resistance between pin5 or 15 and pin 7 (i've been writing 6 i think but it is 7)

Therefore i do not need a buffer op amp. By connecting the STE to pins 5 and 6 of the IL300 i get a signal which covers 70% of the range (values 40-220)

This is perfect for my purposes and now keeps my STE fully isolated from the track.. and safe.

Cheers. :)


Social Media

     

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 5 guests

cron