TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 4:45 pm

Hello,

I need some assistance in troubleshooting or redesigning a robotic puppet drummer I have been working on. The project is using lightshowpi to control a 5v sainsmart relay which in turn is controlling 12v linear solenoids to move the drummer's arms.

If you are unfamiliar with lightshowpi (http://lightshowpi.org/), it takes the frequency spectrum of a mp3 file (in my case a drum track) and splits it in to 8 discrete frequency bands. Each frequency band then turns a gpio pin on or off once a threshold is reached in the music track (it can also do PWM). It is normally used to make music synchronized Christmas light shows. I am using it to trigger a 8 channel 5v Sainsmart relay to control linear solenoids.

Here is the relay board i am using

http://www.sainsmart.com/8-channel-dc-5 ... logic.html

Here is the solenoid I am using.

http://www.amazon.com/Force-Stroke-Fram ... EYX01V0MG0

I have the GPIO pins directly wired in to the input pins on the relay like in this video. https://www.youtube.com/watch?v=oaf_zQcrg7g with the exception that I am using a external 5v power brick to power the relay board.

Here is a video of my initial testing.

https://youtu.be/plamFxNUQA8

One relay is set to trigger around 50Hz to move to the kick drum beat. The other around 2000Hz to his the snare. The plan it to have one arm move to the beat of the snare and the other to the beat of the kick drum. I was really excited at this point thinking this simple setup was going to work so I started building the limbs.

https://youtu.be/WYtXE9av5Kg

Now enters my problem. The LEDs on the relay board flash on and off as expected but I am receiving random results from the relays. Only 4 out of the 8 relays turn on/off when the LEDs flash. 2 of the working relays switched very accurately but 2 would be hit or miss. Now after a few hours of testing it seems that all of the relays are hit or miss or stop working for extended periods of time. It seems the LEDs are receiving enough signal to flash, but not enough to trigger the relays. I put a multi-meter on the relay output and confirmed they are the culprit. Over time, they have stopped tripping as expected or fail all together.

Can someone help me troubleshoot or provide a better solution to my current design? I am no pro when it comes to the hardware side of things so I am just guessing here. I can provide a diagram on how I have everything wired later today.

Thank you.

Image

Image

Image

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 5:17 pm

Neat project!

You are trying to use a mechanical relay that has a maximum ~100Hz operating rate at a higher speed than it can toggle.

Switch to solid state relays (or use MOSFET's) and make sure that whatever you use is rated to operate at your maximum switching speed.
TwoGuys wrote:Hello,

I need some assistance in troubleshooting or redesigning a robotic puppet drummer I have been working on. The project is using lightshowpi to control a 5v sainsmart relay which in turn is controlling 12v linear solenoids to move the drummer's arms.

If you are unfamiliar with lightshowpi (http://lightshowpi.org/), it takes the frequency spectrum of a mp3 file (in my case a drum track) and splits it in to 8 discrete frequency bands. Each frequency band then turns a gpio pin on or off once a threshold is reached in the music track (it can also do PWM). It is normally used to make music synchronized Christmas light shows. I am using it to trigger a 8 channel 5v Sainsmart relay to control linear solenoids.

Here is the relay board i am using

http://www.sainsmart.com/8-channel-dc-5 ... logic.html

Here is the solenoid I am using.

http://www.amazon.com/Force-Stroke-Fram ... EYX01V0MG0

I have the GPIO pins directly wired in to the input pins on the relay like in this video. https://www.youtube.com/watch?v=oaf_zQcrg7g with the exception that I am using a external 5v power brick to power the relay board.

Here is a video of my initial testing.

https://youtu.be/plamFxNUQA8

One relay is set to trigger around 50Hz to move to the kick drum beat. The other around 2000Hz to his the snare. The plan it to have one arm move to the beat of the snare and the other to the beat of the kick drum. I was really excited at this point thinking this simple setup was going to work so I started building the limbs.

https://youtu.be/WYtXE9av5Kg

Now enters my problem. The LEDs on the relay board flash on and off as expected but I am receiving random results from the relays. Only 4 out of the 8 relays turn on/off when the LEDs flash. 2 of the working relays switched very accurately but 2 would be hit or miss. Now after a few hours of testing it seems that all of the relays are hit or miss or stop working for extended periods of time. It seems the LEDs are receiving enough signal to flash, but not enough to trigger the relays. I put a multi-meter on the relay output and confirmed they are the culprit. Over time, they have stopped tripping as expected or fail all together.

Can someone help me troubleshoot or provide a better solution to my current design? I am no pro when it comes to the hardware side of things so I am just guessing here. I can provide a diagram on how I have everything wired later today.

Thank you.

Image

Image

Image
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 5:25 pm

Thank you mikronauts for the quick reply. I had a suspicion that was the case and I am very glad there are other options for the relay considering everything else has been simple and working flawlessly.

I may need some assistance in choosing an option to replace the relay. The solid state options I have seen look to be for AC power not DC.

P_Monty
Posts: 57
Joined: Sat Dec 27, 2014 2:45 pm
Location: Wiltshire, UK

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 7:11 pm

I've not checked all the links supplied, but I'm not convinced that the rate of the relays is the problem - when was the last time you saw a drummer hitting his drum more than 100 times a second...
Is it because the pi isn't supplying enough current to reliably trigger the relay?

TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 7:36 pm

P_Monty wrote:I've not checked all the links supplied, but I'm not convinced that the rate of the relays is the problem - when was the last time you saw a drummer hitting his drum more than 100 times a second...
Is it because the pi isn't supplying enough current to reliably trigger the relay?
I have been reading other people experiencing this issue as well. I am wondering even if this is the issue, will the mechanical relay be the right solution for this project? I will need the drummer to be able to run at the speeds shown in the video for over and hour and want it to be reliable.

Thank you again for the assitance on the hardware design side of things as I am inexperienced.

P_Monty
Posts: 57
Joined: Sat Dec 27, 2014 2:45 pm
Location: Wiltshire, UK

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 8:07 pm

I don't see a problem with using a mechanical relay and solenoid.

The relay board says it needs 15-20 mA to drive it - I think that's borderline for what a pi can supply...

Edit : a solid state relay as suggested above would probably not need as much drive current...

TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Fri Aug 28, 2015 9:27 pm

P_Monty wrote:I don't see a problem with using a mechanical relay and solenoid.

The relay board says it needs 15-20 mA to drive it - I think that's borderline for what a pi can supply...

Edit : a solid state relay as suggested above would probably not need as much drive current...
I am willing to try whatever works for the job. However, all the of solid state relay boards I have seen in my limited searching are for switching AC power, not 12v dc.

This guy looks to be doing something similar to what I need with a mosfet power control kit.

https://www.youtube.com/watch?v=hWrfdqmy83Y

Would a mosfet controller such as this be a good choice to control the solenoid I listed above?

https://www.sparkfun.com/products/12959

P_Monty
Posts: 57
Joined: Sat Dec 27, 2014 2:45 pm
Location: Wiltshire, UK

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Sat Aug 29, 2015 7:33 pm

I had a quick skim of the data sheet, and I think it should be ok.

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Sat Aug 29, 2015 11:44 pm

http://www.phidgets.com/docs/Solid_State_Relay_Primer
what is the max current you need to switch?

edit: looks like about 2.15A max

try L298n's or mofets
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Sun Aug 30, 2015 2:54 pm

Thank you, I will experiment with the Mosfet kit https://www.sparkfun.com/products/12959.

My only concern is will the circuit board safely handle it. I am powering the solenoid off a 12v 2.0A power brick at this time.

P_Monty
Posts: 57
Joined: Sat Dec 27, 2014 2:45 pm
Location: Wiltshire, UK

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Sun Aug 30, 2015 8:43 pm

The data sheet suggests the mosfet can handle 60V and 30A so no problem there. If the PCI tracks can't handle what you're doing you may need to bridge them with wire...

TwoGuys
Posts: 15
Joined: Tue Feb 24, 2015 3:06 am

Re: Assistance Needed Troubleshooting 12v Robotic Drummer

Mon Aug 31, 2015 12:47 pm

P_Monty wrote:The data sheet suggests the mosfet can handle 60V and 30A so no problem there. If the PCI tracks can't handle what you're doing you may need to bridge them with wire...
Fantastic idea. I will get everything ordered today and will report back with my progress. Thanks.

Return to “Automation, sensing and robotics”