Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Relays for Lesvedome


pmlogg

Recommended Posts

Hugh

I've done that testing now.

On the VM110 the demo program seemed to indicate that it is OK.  I measured the voltages. 

All The Digital inputs read 1.7V dropping to zero when selected.  The Digital outputs read 0.82 to 0.86V dropping to 0.6V when selected.  The Analog inputs (as I wrote above) were at 4.92V.  The clamp voltage was 0.79V rising to  0.9 when the digital outputs were on.

To test the relays I did have to make one other connection and that was from the DC- on the relay board to Ground on the VM110.  I did not at first but the motor wouldn't run in any combination until I did.  These are the results with ground connected.

 

DO1

DO1

DO1

DO1

 
 

INACTIVE

ACTIVE

INACTIVE

ACTIVE

 
 

DO2

DO2

DO2

DO2

 
 

INACTIVE

ACTIVE

ACTIVE

INACTIVE

 

COM1

 0

 12.2

 0

 12.21

 

NO1

 0

 12.2

 0

 12.21

 

NC1

 0

 0

 0

 0

 

COM2

 0

 0

 0

 0

 

NO2

 0

 0

 0

 0

 

NC2

 0

 12.2

 0

 12.21

 

COM3

 0

 0

 0

 0

 

NO3

 0

 0

 0

 0

 

NC3

 0

 0

 0

 0

 

COM4

  12.25

 12.21

 12.37

 12.21

 

NO4

  0

 12.21

 0

 12.21

 

NC4

 12.25

 0

 12.37

 0

  

 

As before the motor runs with Output 1 on or with Outputs 1 and 2 on, but always in the same direction.

I wondered whether the issue might Relay 2 so I switched to the spare  Relay 3 but that made no difference.

I didn't proceed any further.

Thanks, Peter

 

Link to comment
Share on other sites

Hi Peter,

Thanks for filling in the chart. I have had a look and as far as I can see, Relays 1 and 2 are not operating. Relay 4 is operating as expected. I can't see any obvious reason why they aren't working but assuming your wiring is as per your Version 18 layout, then something is wrong.

The next test is to disconnect the wire that goes from DO2 on the VM110 to IN1- and IN2- on the relay board. Disconnect it at the VM110 end and then power up everything. Now touch the free end of the wire to ground (DC- connection on the relay board). Relays 1 and 2 should operate. If they do work then there is either a wiring fault in the connection to the VM110 DO2 terminal or a problem with the VM110 board. Obviously check the wiring very carefully

If they don't work you need to check that your voltmeter shows about +12 volts at the IN1+ and IN2+ terminals. If that voltage isn't right, I would suspect a wiring fault in the links between the 5k resistors.

If there is about +12 volts on the IN1+ and IN2+ terminals, try a new, direct wire connection from IN1- to the DC- connector. This should cause Relay 1 to operate. Repeat with IN2- to DC- and check if Relay 2 operates. 

If the relays still don't work with a direct connection to ground on INx1- and +12 volts on INx+ then I think the relay board may be  faulty.

HTH

Regards, Hugh

                   
               

 

Link to comment
Share on other sites

Hugh

Many thanks for that.  I will try that tonight.  I remember that Alan was buying one of the same relay boards - would there be an easy way to see if it's behaviour is similar to mine without it being attached to a Velleman board etc.?

Have you any thoughts on reasons for the Hall Effect Switch problem?  I know your preference was for a photo sensor.

I had a look at the information on the EE-SX3009-P1 sensor and the EE-SX4009-P1 which seems to be basically the same.  In the specifications it suggests input of 10V and output of 20V.  I thought from your posting last month that you run yours on 5V.  If it does need 10V could it operate on 12V?  In my implementation I would see it replacing the Hall Effect Switch, attached by a bracket onto the box housing the encoder.  If I understand how it functions correctly I could fix an L-bracket to the dome wall so that one leg of the 'L' would pass through the gap in the sensor when the dome, with the sensor fitted to it, rotated past the home position.  I see that it has 3 wires so would they just go to the same connections as the Hall Switch?

Thanks, Peter

Link to comment
Share on other sites

The encoder readings are fine so no problem there. You can't use the Analog Inputs as a 5V source as they are, as there is a 1k resistor between 5V and the Analog Input terminals. With the encoder drawing 28mA this resistor would drop 2.8V so only 2.2V would be left for the encoder. If you didn't want to solder a wire directly to SK2 or SK3 to obtain 5V you could short out the 1k resistors (R12 and R13) with a link of wire on the rear of the board and plug jumpers into SK2 and SK3. Then you would have a proper 5V on the two Analog input terminals.

I would go with the optical switch suggested by Hugh in place of your Hall effect switch as you know that would work.

I did receive the relay board like yours so I can test it with or without resistors to find optimum values. Have you used 1k resistors connected to the IN+ terminals as my recommendation several posts ago. You did say at the time you had forgotton to change the drawing from 5k to 1k on your last drawing post but were going to use 1k.

Alan

Edited by symmetal
Link to comment
Share on other sites

Alan

Thanks for that.  I'll not bother changing the power sources unless I need to.

I've now ordered an optical switch - due to arrive at the weekend. I hope it can be implemented in a similar way to the Hall Effect Switch.

Concerning the relay board, yes I have a 1K resistor on each line going into the IN+ terminals, all coming after the diode, as in the diagram.  As Hugh has suggested I'll be aiming to check that part of the circuit tonight, along with the rest of his suggestions.  I'm hoping that my soldering skills won't have been the cause of problems, although finding the source of the problems is the priority.

Thanks, Peter

Link to comment
Share on other sites

Peter,

Regarding the photo-sensors you mentioned the 10V Power supply voltage and 28V output voltage are the maximum values you can use, voltages below this will be fine. The data sheet doesn't specify a minimum power voltage but I'm sure it will work from 5V. The three wires are the same as the Hall effect switch so can be a direct replacement. The difference between the two sensors is the 3009 is 'on' when it's dark while the 4009 is 'off' when it's dark. For your application where the bracket on the dome blocks the light path in the home position the 3009 mimics the effect of the Hall effect switch (if it worked) or reed switch. Hugh can give you a more informed answer.

If you wanted to power it from 12V you could put a resistor in the power lead to the photo-sensor, around 330R which should drop the voltage at the power terminal to about 6V.

Alan

Link to comment
Share on other sites

Hi Peter,

I'm a bit late to the party - again! Can you tell me which optical switch you have ordered? To confirm what Alan said, you really want an 'on when dark' switch and ideally one that will work with a 12 volt supply. The 3009 will work very happily with a 5 volt supply, as far as I remember, it's the one I use. 

Getting a +5 volt supply from the VM110 is possible and I'm sure the way Alan described will work but don't forget that the VM110 is getting all it's power from the USB connection to the Pi. So the Pi usb supply will be powering the Pi itself, the VM110 board, the encoder and the optical switch. I know it's late in the day but a 12 volt to 5 volt buck converter module with screw terminals only costs a pound or two and it would eliminate any possible power problems. Just a thought!

Good luck with tonight's testing.

HTH

Regards, Hugh

Link to comment
Share on other sites

Alan and Hugh

Thanks for those explanations of the two types - I'd missed that differenced and wasn't helped by ads for the two types which gave the same description - so you can guess what happened.  So, now having ordered the correct (3009) version I'll be adding the 4009 to my collection of unused parts.  I doubt that it will come before Monday though.  From what Alan read from the specs the maximum input voltage is 10V.  Your suggestion of the buck converter reminded me that I have a switch mode UBEC that I bought years ago for a project that didn't go ahead.  Attached is an image of it with the instructions.  I looks like I can feed it 12V and output a regulated 5V or 6V.  So I may use it to supply the Encoder too, and get rid of that butchered usb cable.  I presume that should be OK? I've not yet tested though as I had to search around to find it tonight. 

Unfortunately my plans for the evening had to change - booking holiday flights etc. had to take precedence with just 10 days before we fly.  Hopefully I can press on tomorrow night.

 

UBEC2.jpg

UBEC1.jpg

Link to comment
Share on other sites

Peter,

Unlucky that you ordered the wrong opto-switch at first. Isn't that always the way.

A buck converter is a good option to get your 5V instead of the Pi USB cables. I think that was mentioned at the start of this thread. :D Your UBEC is a buck converter under a different name. (I had to google what it was, Universal Battery Eliminator Circuit used in RC models). That would be fine to use if you didn't want to spend a few pounds on one from eBay. There's no need for the toroid in the output lead of the UBEC in your case as you don't need to worry about receiver interference, unless you specifically want to use the output connector as it is. You can use it to power the encoder and the opto-switch as you say. :smile:

Alan

 

Link to comment
Share on other sites

Alan and Hugh

That's great, it looks easy to use, even plastic sleeved so I won't need to secure it as another PCB. 

I didn't initially go down that route as it seemed easier to use a redundant usb cable from the Pi but now that I have both sensors needing 5V its a neater solution.  Also, using the 'UBEC' means one less thing that's been sitting about.

Link to comment
Share on other sites

Hugh

In your implementation of the Omron EE-SX3009-P1 as your Home Position Sensor what do you use to interrupt the beam?  I see that the aperture for the optical beam is just 0.5mm wide x 1mm high. 

I reckon my dome rotates at around 4.3cm/sec if that matters. As the sensor will be moving, whatever I use to interrupt the beam will be attached to the dome wall, projecting inwards around 11.5mm according my drawing (scale on my computer is 10 pixels/mm). Might something as simple as a 2mm screw, aligned to be on the centreline of the sensor slit, work? 

The vertical positioning of the sensor in my drawing is not quite as it is was in practice when I was aiming to use the Hall Effect Switch.  The static magnet in its housing had to be positioned so that its fixing screws were out of the way of the motor drive wheel as it moved along the outside of the dome rim, and the housing out of the way of the encoder wheel.  The Hall Effect Switch was positioned accordingly and that will be the same issue affecting fitting the optical sensor and the object to break the beam.

Thanks, Peter

OpticalSensorEnclosuresideV6.jpg

Link to comment
Share on other sites

Hugh and Alan

I've updated the circuit diagramme to add the Voltage Regulator, replace the Hall Effect Switch and remove the usb power link from the Raspberry Pi to the Encoder.  I've put the Encoder and Voltage Regulator to ground on the VM110, I presume that's correct.  Does the Voltage Regulator need protection from the diode on the positive line?  The instructions suggest it is protected from reverse polarity.

Thanks, Peter

0419DomeWiringDiag20.jpg

Link to comment
Share on other sites

Peter,

I've found the resistors going from IN+ on the relay board to +12V aren't actually needed now. I drew out the circuit of the relay board yesterday (I'll post a neater drawing later) and there is a 2k2 resistor on the board in series with the led in the opto-isolator. If you connect all the IN+ terminals you are using to +12V, the opto led will draw 4.5mA which is fine. Leaving off the resistors should make wiring easier.

The encoder and UBEC grounds going to the VM110 is fine.

The reverse protection diode on the battery +12V to the relay board DC+ isn't actually needed either as I've found the relay board has its own protection diode on the board. The UBEC as you say is also reverse protected so doesn't need external protection. You can leave the diode you've drawn there if you wish, as a belt and braces approach. :smile:

Alan

Link to comment
Share on other sites

Hi Peter,

Have a look at the attached datasheet for the EE_SX3009. The gap between the two 'arms' is 5 mm wide and 10.5 mm deep. In my setup I use a length of brass strip about 3 mm wide and 1.5 mm thick. I mounted the brass on the flange of the dome so it sticks out horizontally and I mounted the sensor on a piece of wood glued to the side of the observatory. The brass strip is held to the flange by a single nut & bolt, not done up too tightly, so that if for any reason the brass bar hits the sensor, it will just bend out of the way.

I think there is a photo showing this in my SGL  photo album.

Regards, Hugh

 

en-ee_sx3009_p1_4009_p1.pdf

Link to comment
Share on other sites

Alan

Thanks for that investigation of the Relay Board. Do I still need the Diode protection of the three IN+ connections?  I presume I still need the Diode on the ground/negative line to NO1, NO4 and NC2.

Thanks, Peter

Link to comment
Share on other sites

Hugh

Thanks for the guidance regarding the Optical Sensor - a very good point about not having the strip, or equivalent mounted too firmly, i.e. not a screw as I suggested.  I note that the layout of the sensor itself looks different from what is set out in the spec sheet and also that it has 4 wires rather than 3.  It looks as if the 4th is ground wire; would that be right?

Thanks, Peter

Link to comment
Share on other sites

Hi Peter,

There are dozens of similar models from Omron and I am probably wrong about using the 3009 model. I 'think' the one I used has 4 wires because it allowed me to switch between dark operated and light operated. The 3-wire dark on type (EE-SX3009) is perfect for what you want. When you look at the little internal circuit schematic on the data sheet it shows that the output is an 'open-collector' type so it does need a pull-up resistor connected to the +5 volt supply. The VM110 board has a 20k pull-up built in (2 x 10k resistors in series) on each of the digital inputs. This might be a bit high but try the sensor wired directly without an external pull-up first. If it doesn't work try adding a 1k external pull-up between the V and O connections.

HTH,

Regards, Hugh

Link to comment
Share on other sites

Peter,

The diode protection on the IN+ inputs isn't necessary. If the power got reversed, the leds in the optocouplers would behave as zener diodes of around 5V but the 2k2 series resistor on board would limit the current so no harm would occur. The diode going to NO1, NO4 and NC2 is required as that protects the board from any reverse voltage spikes generated by the motor.

Here's the diagram of the relay board. I've just shown 1 relay but the other 3 are just copies of what's inside the dotted line. I used Kicad to draw it so it's a bit neater than my scribbles. :D 

1143538143_RelayBoard.png.2cd4843395ccd75399910e64a94fda65.png

Alan

Link to comment
Share on other sites

Alan

Thanks for the diagramme.  If for the moment we assume that my relay board is OK, could the un-needed resistors, or anything you've now found out about the board be responsible for the voltages that I noted in the table, and for the seeming lack of action by Relays 1, 2 and 3 (I swapped connections from 2 to 3 to see if it made any difference).  I'm just about to start the additional testing of the relay board that Hugh suggested.  I could try taking out the diode and resistors on the lines to the IN+ terminals and DC+ (the Hall effect and encoder are disconnected at the moment anyway).

Thanks, Peter

Link to comment
Share on other sites

Hugh

I've done the test of the relay with DO2 at the VM110 disconnected.  Before I did so I made the changes Alan suggested - basically taking out the diode and resistors from the positive line coming from the 12V battery.

When I touch the disconnected wire to DC- on the relay board relays 1 and 2 activate.  I've checked the wiring from DO2 and there is continuity on all the wires indicated in the diagramme.

One thing that I have not reported is that when I apply 12V from the battery relays 1 and 2 both activate and their LED's illuminate and stay on.  Relay 4's LED does not illuminate until, in dome.exe, I select Digital Output 1 or Digital outputs 1 and 2. So, I assume that then all 3 connected relays are active at that point - but rotation continues in the same direction either way.

Does this suggest that perhaps my wiring diagramme, noting what Alan has found about his identical relay board, needs alteration?  I don't know how I further fault find VM110.

Thanks, Peter

 

Link to comment
Share on other sites

Peter,

Touching the disconnected wire from DO2 to relay board DC- operating the relays means the relay board and wiring are working. When you say that applying 12V at the start relays 1 and 2 activate and stay on, that is with DO2 connected? If so it looks like DO2 output is permanently on (output low). When you did the tests filling in Hugh's table you said the Digital outputs were 0.82V or so when off and 0.68V when on. I'm assuming the wires from DO1 and DO2 were not connected to the relay board at this point or the relay board was not powered. When switched off DO1 and DO2 outputs should rise towards the relay board power rail via the opto-isolator led and series resistor. With the VM110 and relay board wired together and powered, measure the voltage on VM110 DO1 while you turn DO1 on and off with the test software. Do the same with DO2. I assume DO1 voltage goes high/low with DO1 off/on but DO2 is low/low with DO2 off/on. Is that correct?

If so can you move the DO2 connection to one of the other unused DO terminals and tell the software to use that terminal instead for the motor direction signal instead of DO2.

Alan 

Edited by symmetal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.