adafruit music player

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: adafruit music player

Post by adafruit_support_bill »

An analog sensor would not be my choice for a home/limit detector. You will need to calibrate it to determine the threshold level for detection. And depending on the type of sensor, this may be subject to drift which must be accommodated in your code.

Since you have positive tension pulling down on the bridge, there must be something blocking or resisting movement in that last millimeter. If there is not enough pressure to activate the switch, there probably isn't enough to register reliably on a pressure sensor either.

I'd check the position and alignment of your switch as well as making sure that the rails are clean and aligned to prevent binding. Look to see if the alignment changes between the raising and lowering phase. It is possible that the tension in the lowering phase alters the strain on the towers enough to slightly alter the alignment.

User avatar
roadshark
 
Posts: 652
Joined: Sun Nov 29, 2015 5:53 am

Re: adafruit music player

Post by roadshark »

Here is a photo of the home switch. I am also have a video of the homing movement which is processing on u tube at the moment. should be ready in 20 mins.
Attachments
bridge switch homing.jpg
bridge switch homing.jpg (182.96 KiB) Viewed 113 times

User avatar
roadshark
 
Posts: 652
Joined: Sun Nov 29, 2015 5:53 am

Re: adafruit music player

Post by roadshark »

On looking you may be right on the pogo pins pushing the bridge away from the sensor. I think the motor is trying to get to the sensor but it keeps getting pushed away. It did this on the other motor but never both motors at the same time. Thoughts???
https://www.youtube.com/watch?v=Mu0aZ8k9FnM

This is the sensor I looked at. https://www.jaycar.com.au/thin-film-pre ... o/p/XC3738

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: adafruit music player

Post by adafruit_support_bill »

Looks nice and symmetrical. The tension cable is centered between the pogo pins and the switch button is aligned with the cable. That should minimize any alignment issues.

The second video seems to show the button being actuated, but then it looks like the motors are released and the pogo springs push the bridge back up off the switch. Then the cycle repeats.

I can think of 2 possible remedies:
1) lower the pogo pins to reduce the spring compression. This is probably fussy work to get right, but should result in a stable system.
2) maintain holding current on the motors. This would be quick to implement in the code. But your motors are going to get pretty warm for the duration that the bridge is down.

User avatar
roadshark
 
Posts: 652
Joined: Sun Nov 29, 2015 5:53 am

Re: adafruit music player

Post by roadshark »

lower the pogo pins to reduce the spring compression.
The pins are at the height to engage the rail on the deck which has to line up with the rails on the towers. So they can only be moved so far down. If I place more packing on the switch bumper under the bridge it pushes the switch down but pogo pins do not touch the rail. I have to find the right spot I guess.
I have also thought of replacing the switch with two of the same pogo pins used for power supply to the bridge. (Fussy work as I would have to remove the switch and make up new stuff.) I would place them slightly below the level of the track pogo pins so they would make contact but when released the other pogo pins would still have spring tension on the track. I would place a copper strip on the switch bumper that I used to hit the original switch.
More R & D tomorrow by the looks.
If all else fails I can start the homing sequence then when the bridge is at the bottom physically push the bridge down to home. When I do this the bridge then raises and lowers as per the first video but being a fuss pot I could never do that!!!!!!! Where there is will there is a way.

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: adafruit music player

Post by adafruit_support_bill »

Another option is to keep the holding current on the motors, but reduce it to the minimum necessary by using PWM.

AccelStepper does not support that directly. But depending on the motor drivers you are using, you can probably do that with the enable pin.

User avatar
roadshark
 
Posts: 652
Joined: Sun Nov 29, 2015 5:53 am

Re: adafruit music player

Post by roadshark »

Welcome to clux 101!! In testing on the bread board I pushed the homing switches individually and simultaneously. Everything worked as it should. When connected to the bridge I tested the switches manually simultaneously before risking the bridge. Everything fine however I forgot to test the switches manually. What a serious laps in testing protocol!! Last night at midnight:( (I have good neighbors), I tested the switches individually. Found the left switch was working the right motor and right switch operated the left motor. So in the video the left switch hit the home button stopping the right motor before it hit the homing switch. Therefore the right switch was not activated so the left motor kept on trying to home, hitting the switch but of course the info went to the right motor. I checked the wiring and everything was correct with button matching motor in the code and in the hard wiring. Then I realized I had placed the left motor driving cables on the right motor driver board and visa versa. I could not swap them as over I would need a longer cable for the left motor. Solution. Just swap the homing pins over in the code. Worked. Bridge now homes properly. Hits switch and then moves off. Pogo pins look like contacting so will test today.
Have you heard of the magnorail system? I plan to use this to move a model Great Lakes ore transporter freighter (N-2050 Sylvan 258' Great Lakes Freighter kit, L.19.25" W. 3.25")under the bridge and have also purchased a split rock lighthouse kit. Due to its length the ship will take some thought and planning. Not sure moving a model this size has ever been attempted!!

User avatar
roadshark
 
Posts: 652
Joined: Sun Nov 29, 2015 5:53 am

Re: adafruit music player

Post by roadshark »

The whole sequence. THX for all you have done. Keep safe and upright.
https://www.youtube.com/watch?v=kQsLCDWcRR8

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: adafruit music player

Post by adafruit_support_bill »

God to hear you found the problem. The bridge looks great! Thanks for the vid.

Saw some Magnorail at a train show last fall. But they were just using it with some HO scale cars. Might take a bit of engineering to move a freighter with that.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”