Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_globular_clusters_winners.thumb.jpg.13b743f39f721323cb5d76f07724c489.jpg

pmlogg

Relays for Lesvedome

Recommended Posts

Hugh

Thanks for that - encouraging that you think I'm not far off. 

I suspect that I do have that newest version installed so I will download 6.0.12, install and re-input the settings.

I'll disconnect the Hall Switch - easy to do.  Should I disconnect the encoder at the same time?  I wasn't going to be able to properly replicate, for Lesvedome, its rotation as the motor shaft rotates, using my model-size motor.

Thanks

Peter

Share this post


Link to post
Share on other sites
Posted (edited)

Hi Peter,

As Hugh said you're almost there. :smile: Disconnect the output from the Hall Effect switch going to Digital Input 2 and try it again. Are any of the brackets you've got fixing the enclosure holding the Hall Effect sensor, or any nearby metal possibly magnetic causing it to stay on.

You can leave the encoder connected. I don't know whether the Lesvedome requires an output to confirm the dome is moving, but using the test software Hugh mentioned I expect it doesn't. You could always rotate the encoder by hand after giving a move command to simulate this. Hugh should be able to say for certain.

Alan

Edited by symmetal

Share this post


Link to post
Share on other sites

Peter,

I am fairly sure that Lesvedome does need the encoder output to work. You can test the operation of the encoder on the bench using the Velleman board software. Goto https://www.velleman.eu/support/downloads/?code=VM110 and download the 'Complete SDK Pack for K8055 / VM10 (Rev 4.0). Download and unzip. You will find a little program called K8055N_Demo.exe.

I suggest you start with a direct USB connection to a Windows PC without using the Pi as a relay. When you run the software and turn the encoder shaft (with the encoder powered of course) you should see the count increase in one of the windows. 

If you don't see this you will need to investigate further. But - hopefully - you will get a positive confirmation that the encoder is working and sending a signal to the Velleman board.

HTH

Regards, Hugh

 

Share this post


Link to post
Share on other sites

Hugh and Alan

I disconnected the Hall Switch and the Encoder - easier to do as they are both connected to the rest of the system by a single DB9 plug/socket.  Thought I would try that before uninstalling and reinstalling the early version of Lesvedome.  It was just as last night other than the Hall Effect switch led.  Last night I did try hand rotating the encoder wheel, before the disconnection took place but it had no effect.

I understand about changing version but shouldn't I expect to hear a click from two of the relays i.e. no. 4 then 1 or 2 before 3 seconds have elapsed?

Thanks

Peter

Share this post


Link to post
Share on other sites

Hugh, Sorry I was typing my last before your message was on my screen.  I'll read it now.

Share this post


Link to post
Share on other sites

Hugh

I'll try what you suggest, disconnecting just the Hall Effect Switch, and using the test programme. Going to download that now.

Thanks, Peter

Share this post


Link to post
Share on other sites

Alan

I didn't answer about metal near the Hall Switch.  The brackets are aluminium and all the screws are stainless - none are in front of the sensor - which from previous testing is very directional and also reacts only to one pole of a magnet that passes.  I may have something wrong in the internal wiring.  I'll attack that once I get a reaction from the Relays.

Thanks, Peter

Share this post


Link to post
Share on other sites

Hugh and Alan,

OK, I've tried that with the demo programme.  Pressing the connect button got a "Card 0 not found" response but search devices found the board as device 3. 

Selecting Output 1 activated the relay and the motor turned.  Having got that I thought that selecting Output 2 might have got the other relays to reverse, so that with Output 1 pressed again  would get a reversal of rotation but I didn't, it went the same way as before. 

I could not get any of the Inputs to retain the check mark so could not get a count from the encoder. Having closed that down I ran v20 of Lesvedome but no difference. I've not yet switched to V12.

So does this suggest a wiring issue or issues in the connection to both the encoder and the hall switch - presumably on one side or other of the DB9 connection?  Last night the Hall Effect switch was certainly getting power as the LED was illuminating.

Thanks, Peter

Share this post


Link to post
Share on other sites

Peter,

I can't help you much with the Lesvedome software so you'll have to rely on Hugh to help you with that.

It's certainly worth double checking the wiring to your DB9 connection as if there's an error causing the Hall Effect Switch to malfunction it could also have affected the Encoder. With 12V powering the Hall switch it should just work so measure that the volts are correct and that the 0V or ground connection to the switch really is that and not say a VM110 data input pin due to a wiring error. A wiring error may light the power led on the switch but it may not be good enough to allow the switch to function properly.

Alan

Share this post


Link to post
Share on other sites

Alan and Hugh

The wiring of the Hall Effect switch checked out OK including the ground.  The voltage across blue and brown was 11.51V.

Unfortunately the Encoder connection was incorrectly wired - so I'm fearful that I have fried it.  Is there a way of checking that independent of the rest of the circuitry?

My question about reversing the direction of rotation related to the Velleman test program rather than the Lesvedome software.  Is there a way to test that part of the circuit's function from that program?

My only real progress today was mechanical, drilling the dome for the enclosure box and the Pulsar/Rigel unit for the extra 3-way switch, and also a plate for the spring tensioner for the encoder box.  At least that went to plan.

Thanks, Peter 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Peter,

You need to check the Hall Effect switch again independent from the VM110 by removing the output wire (black) from the VM110  board and temporarily connecting a pull up resistor (10k or so, value not important) between the output wire and the +V (brown) wire. Like you did previously when you tested it as a stand alone device. Then measure the output wire voltage with your multimeter while the magnet is waved around it to see if the voltage switches between 0V and 12V. If it doesn't try moving the blue (ground) wire from the analog ground on the VM110 and connect it to the digital ground instead (below Digital I/P 5). According to the schematic Hugh provided for the board similar to the VM110, the grounds are the same and it should make no difference, but it's possible the analog ground connection is different on your board. Unlikely but it's worth trying. On higher quality analog to digital converter boards it's usual to keep the analog and digital grounds separate to give a cleaner (less noisy) analog ground for the conversion process. If the Hall Effect switch still doesn't work then it's likely it's failed somehow.

You can test the encoder by applying power to it (leave it all connected up and power up your project will be easier) and measure the voltage on the A and B encoder outputs. Put your voltmeter on VM110 Digital I/P 1 to start with. As you rotate the encoder very slowly the voltage measured should flip between 0 and 5V. It will flip very quickly, so if you rotate the encoder too fast you will end up measuring the average voltage of around 2.5V as the meter can't respond quick enough to the voltage changes. 

If this appears to work OK then measure the voltage on VM110 Digital I/P 5 and repeat the test by slowly rotating the encoder. You should get the same response as before on your meter. If you do then you can safely assume the encoder is working.

Alan

Edited by symmetal

Share this post


Link to post
Share on other sites

Alan

Thanks for those suggestions.  I've been soldering connectors tonight so I'll get on with that in the morning.

Thanks, Peter

Share this post


Link to post
Share on other sites

Hi Peter,

I am afraid that due to family problems I won't be around much today. I will be back again later on this evening and if you are not sorted by then will offer any help I am able to.

Regards, Hugh

Share this post


Link to post
Share on other sites

Alan and Hugh

OK, I tried all those suggestions.

With the Hall Switch, detaching the black wire, and adding back the 10K resistor returned performance to the way it was in initial testing of the Switch i.e. LED only illuminating on approach of the magnet.  I tried adding back another ground, as well as switching the Hall Switch ground to another of the grounds on the VM10 but it made no difference (the 10K was still in circuit for that testing) i.e. the LED came on.

Testing the encoder, measuring voltages across In1 and In5 while rotating did demonstrate the voltage flips, but between 2.79V and 0.03V rather than 5V and 0V.  And the flips took place regardless of he direction of rotation.  So I guess the encoder is working - but is 2.79V enough?

So, left unsure what to do next.

Thanks, Peter

Share this post


Link to post
Share on other sites

Hi Peter,

I am confident that the 2.79 volts from the encoder is enough to drive the Digital Inputs on the Velleman board, so I don't think you need worry about that and you haven't fried the encoder. 

I think that the reason you found the VM110 as Device 3 is that you haven't installed the two jumpers (little shorting links) . This won't have any bad effects but you will need to tell the Lesvedome software that the board is at address 3. The text below is from the Lesvedome help file.

Velleman K8055 module address

Previous Top Next


In Dome and Switch Setup windows, select the address of your Velleman board (0 to 3) in accordance with the  jumpers SK5 and SK6

SK5 installed     and  SK6 installed         address = 0
SK5 unstalled    and  SK6 installed         address = 1
SK5 installed     and  SK6 unstalled        address = 2
SK5 unstalled    and  SK6 unstalled        address = 3

For your debugging I think the easiest way to do it is by checking only one thing at a time. If it was me, I think my approach would be like this:

Remove ALL connections from the VM110 board. (But remember where they all go)

Connect the VM110 directly to my computer via a USB cable.

Run the Velleman demo software and, using your voltmeter, check the board is working. I would be very surprised if it's not but if it isn't then I think the only option would be a new board - sorry!

OK - the board is working fine. Next we need to get the relays working. What will help here is to connect the relay board to the VM110 but do not connect the encoder or the Hall switch. In other word only connect the DO1 and DO2 terminals on the VM110. Nothing else!

Now see what happens when you use the demo software to switch outputs 1 and 2 on and off. You can use your voltmeter to measure the voltages at the relay board COM1 and COM2 terminals. From your post on Friday, it sounds as if DO 1/Relay 4 is working as planned but there are problems with DO2/Relays 1 and 2. I suggest that you make a table in Excel that shows the voltages on all the relay output connections for each value of DO1 and DO2

 

DO1

DO1

DO1

DO1

 
 

INACTIVE

INACTIVE

ACTIVE

ACTIVE

 
 

DO2

DO2

DO2

DO2

 
 

INACTIVE

ACTIVE

INACTIVE

ACTIVE

 

COM1

 

 

 

 

 

NO1

 

 

 

 

 

NC1

 

 

 

 

 

COM2

 

 

 

 

 

NO2

 

 

 

 

 

NC2

 

 

 

 

 

COM3

 

 

 

 

 

NO3

 

 

 

 

 

NC3

 

 

 

 

 

COM4

 

 

 

 

 

NO4

 

 

 

 

 

NC4

 

 

 

 

 

With luck, this should be enough to spot any problems with the relay board or the wiring. Post a copy of the table if you are stuck, we can all have a go at deciphering what's going on.

When you have got the relays working as they should, I think the next step is to connect the rotary encoder to the VM110 and check that you see the ticks being counted using the demo software. Then the Hall switch, again using the demo software to make sure it operates as you expect.

Only at this point would I think about trying everything using the Lesvedome user interface software - not he full blown ASCOM driver, just the user interface and still using a direct USB connection to your computer.

OK - so far so good? Now add the Pi to the mix and see if it all still works? It does - congratulations, you have an automatic observatory!

HTH

Regards, Hugh

Share this post


Link to post
Share on other sites

Peter,

So the Hall effect switch indicator led works OK as long as the output isn't connected to the VM110 and has a pull up resistor to 12V. The led is connected to the 12V internally in some fashion so it may be that the switch itself is working fine when the output is connected to the VM110 board but the pull up to 5V via the VM110 input has enough voltage across the led to illuminate it. Connect the Hall effect switch to the VM110 as your latest circuit diagram (without the external 10k resistor to 12V) and actually measure the voltage on the VM110 Digital I/P 2 while moving the magnet around and see it the voltage does actually change between 5V and 0V. Ignore the Hall switch indicator led for the moment. If the voltage does change the switch is working OK, it's just the internal led giving the wrong indication. Do you have a model number for the Hall effect switch. It may have been designed for 12V output switching and is not a true open collector output though will actually work with a 5V pull-up on its output, just giving an incorrect led indication.

The Bourns EM14 series of rotary encoders data sheet does say the output is 4V minimum for a high so only giving 2.79V even with the built in 5V pull-up on the VM110 is a little strange. Are you able to measure the actual +5V going to the encoder power pin from the Pi. It's possibly the Pi is having trouble supplying the necessary current to the encoder and the volts are dropping. Unlikely I'd have thought as the encoder only draws 26mA maximum according to the data sheet. Worth a check though. The 2.79V output you're getting though, should be enough for it to work correctly with the VM110, as Hugh says. The encoder outputs will switch between low and high whichever way the encoder is turned, it's how the low and high transitions occur looking at the A and B outputs together, which enables the VM110 to work out which way the encoder is turning.

Alan 

Share this post


Link to post
Share on other sites

Hugh and Alan

Thanks for the list of things to check as I was stumped.  Also glad that the EM14 looks as if it's OK.  The Home Switch is a 'NJK-5002C' Hall Effect Sensor.

If for some reason the Pi is not putting out enough current there are still two spare usb sockets on it and I may even have the necessary Y-cable.

Thanks

Peter

Share this post


Link to post
Share on other sites

Peter,

The information sheet for the NJK-5002C does say it has an NPN transistor open collector output (as was expected) so the output should have no problem being connected to the 5V VM110. Hopefully it's just the indicator led giving a false display.

Alan  

Share this post


Link to post
Share on other sites

Hugh and Alan

The reply I drafted last night and thought I had sent has gone walkabouts.

I didn't manage to do all the testing last night.  It took me longer than I'd expected to label all the cables in advance of detaching them.

With the components not yet screwed down they move about a bit as I'm working and I noted that one of the cables into relay 2 had come loose.  So I decided to test as before just to see if that made any difference.  Also I set the two jumpers to make the VM110 address = 0 and told Lesvedome that.  It didn't make any difference within Lesvedome but in Dome.exe the encoder did produce a count so it is definitely working.  I also checked voltage into the Encoder and it recorded at 5.06V.

I tried the Hall Effect switch without the 10K resister but with the magnet - it did not affect the voltage which was 3.33V all the time.  It remains connected to the 12V supply which, as I'm now set up that way, is easier than switching to 5V.  Also, what I found with the usb cable that I cut to take power from the Raspberry Pi to the Encoder was that the wires are much thinner than all the others I'm using - probably the weakest point in the setup. As the power moving to the encoder is so low the diameter of the wire will not be the issue electrically, just it's mechanical robustness. 

I hope to get back to do more of the suggested testing tonight. 

Thanks, Peter

Share this post


Link to post
Share on other sites
Posted (edited)

Peter,

Check that the voltage on Digital Input 2 is actually 5V when the Hall effect output is disconnected from the VM110. I'm wondering if the push switch SW2 on the VM110 isn't stuck down which would pull Digital I/P 2 to ground via a 10k causing problems. Push and release SW2 and check that the voltage does go from 5V to 0V when SW2 is pressed.

If the above is OK, reconnect the Hall effect switch output to the VM110 Digital I/P 2, but keep the 10k pull-up resistor to 12V and see if that works. The 12V appearing on the VM110 Digital I/P when the Hall effect switch is off won't cause any problems even though the VM110 is 5V powered as the ULN2803 on the VM110 board digital inputs can cope with up to 30V on its input. There will be a constant 0.2mA trickle from the 12V to the 5V with the 10k pull up connected but at this point we just want to see the Hall effect switch work when it's connected. :smile:

The thin USB power wires to the encoder is not a problem power wise as you say as its only supplying up to 26mA. When you do your final installation see if you can tie the USB cable to something to stop it moving about. That should be fine.

Alan

Edited by symmetal

Share this post


Link to post
Share on other sites

Peter,

If the Hall effect works with the 10k external pull up it's preferable to include a diode as shown below. This prevents the 12V power supply from trying to feed 0.2mA into the 5V power supply which isn't good practice.

1156247738_Hallinterface.png.30a05a8303a22a139d1d899d8ef8c026.png

I've just used a commonly used general purpose signal diode but any similar diode will do. 

Alan

 

Share this post


Link to post
Share on other sites

Allan

As that suggestion for the Hall Switch was quicker to do I've given it a shot. 

With output (black wire) disconnected, 10KOhm added and 12V applied voltage, across Dig. Input 2 (output to ground) was 1.72V dropping to zero when the button was pushed.  I reconnected the black wire, leaving the resistor in place: the red led illuminated on power up as before.  Set like that the button barely affected the voltage (9V dropping to 8.72V) across Dig. Input 2.

As I have a 2nd Hall Switch I tried connecting it instead.  With no resistor, but black wire attached, again red led on immediately, just like the other one.  Voltage across Dig. Input 2 = 2.84V.

Now back to start Hugh's suggested tests.

Thanks, Peter

Share this post


Link to post
Share on other sites

Alan,

My reply written before reading your newest.  The Hall Effect Switch did not work with or without the 10Kohm resistor when the black wire is connected to Dig. Input 2, it only worked with the resistor when the black wire was disconnected.

Rather than get involved with more soldering of diodes you suggested last evening that the Hall Effect switch could operate from 5V taken from the VM110.  From what connection would 5V be available to power the Hall Effect Switch. If that is possible it would be neater to also use that 5V source for the Encoder and get rid of the bulky USB cable.

Thanks, Peter

Share this post


Link to post
Share on other sites

Peter,

Reading the data on The Digital Inputs of the VM110 they are are not simple 5V hi/lo inputs, but darlington transistors. This explains why the voltage you measured from the Bourns Encoder was only 2.79V and not 5V. The Encoder output is effectively open circuit for a high and switches to ground for a low so the measured VM110 Digital input voltage is determined by the current supplied by the input pull-ups to turn on the darlingtons. About 2.7V is the minimum voltage to turn on the darlingtons which is what you measured for an encoder high o/p.

The VM110 input darlingtons are on (high) normally, sitting around 2.7V, so all you can do to change the inputs is by shorting them to ground or by a resistor to ground up to around 10k.

The Hall effect switch output (by the information sheet) is the same as the encoder, open circuit for a high and 'shorted' to ground for a low. However it doesn't seem to be that way (open collector) by the way it behaves. The fact that you measured 9V on Digital input 2 with the 10k pull up to 12V dropping to 8.72V when you pressed SW2 (which connects the input to ground via 10k) means the Hall effect switch output wasn't on (low) even though the led indicated it was. Your test with the second Hall effect switch had the output at 2.84V (close to open circuit input voltage) when connected to the VM110 so the switch again wasn't on

I'm at a loss at the moment as to what to suggest next with this Hall effect switch as it doesn't behave as it should.

I didn't imply you could run the switch off 5V in my previous post as it's rated at 6V minimum though it may work from 5V. It can't be any worse than using 12V at the moment. :D

5V isn't available on the VM110 terminals but you can get 5V from one of the pins of the jumpers SK2 and SK3 next to RV1 and RV2, which you aren't using. See diagram below. You can use this to power the encoder instead of the usb lead. Also try the Hall switch off the other 5V too if you wish.

1974421582_K8055sch.png.9244279c187eb0d6a3b0ffabeba64204.png

1471160773_K8055layout.thumb.png.23e56bec74da3196008b54817b181f12.png

ULN2803.png.626ab24f281c9a58c708abbf4a0754e7.png

Alan

Share this post


Link to post
Share on other sites

Alan

Thanks for the huge amount of detail there. 

On the encoder, given that in the Velleman Demo program I did get a count from it do I need to do anything, or just use it as is (other than potentially using a different 5V source)?  On 5V supply, when doing the testing of the VM110 suggested by Hugh the two Analog Inputs registered 4.92V; might that be enough?  I just suggest it as the connection would be easy.

On the Hall Effect switch, if it is not going to play when connected to the circuit I could dump it and go instead for a Reed Switch or the Optical switch suggested by Hugh last month (still on my Ebay watch list). Life would be easier of course if I could use it as the hardware for that is ready to go.  And the fact that it does work when operating on its own suggests it does have the capability of measuring the approach of a magnet (by the LED illuminating - I don't know the voltages).

Thanks, Peter

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.