Multichannel linear actuator control - no arduino experience

I’m a fairly capable DIYer but have no arduino experience. This was recommended by someone I had asked to help me do this with an analog board, so I need some help getting to just the simplest possible solution (including if the uno or something simpler will work)

I have an external on/off signal (it’s AC, but I can get 5V DC with an adapter) that can come on at any time and will last between 30 seconds and 60 seconds when on. I want to take this signal and generate two power drives at +24V and -24V. The idea is like a sample and hold circuit. When the signal goes high (from 0 to 5V), I want to generate a pulse that is +24V and 1A that lasts for a programmable time (say 15 sec or 10 sec). Then when the signal goes low (from 5V to 0V), I want to generate (on the same output), a -24V, 1A that lasts for another programmable duration.

I’m basically using an on/off to run a linear actuator to go forward for a fixed time when on, then backward for another fixed time when off.

I have 4 of these on/off signals and need to generate 4 drives at 24V.

I have a simple 4 channel relay box that will take a +5V signal and convert it to a 24V drive. It has 4 channels, and I’ve wired it with different polarities to a 24V supply. This gives me the ability to take 4 signals and generate 4 drives (A +24V, B -24V, C +24V, D -24V). This is wired to 2 of my actuators now. I can make another box if needed.

So the only part really missing is converting an on/off signal into 2 pulses that represent the turn on and turn off drives. And do that 4 times over.

I hope I explained this well enough. If not, I can draw it out? Please help.

I need everything from the purchase BOM to the simplest code to get it done.

Also, I can solder reasonably well and have a multimeter, etc…

I guess in the simplest view, I’d like to convert one long pulse into two short pulses going out over two channels. On the rising edge of the input pulse, I want the first channel to go high for a preset period, and on the falling edge of the input pulse, I want the second channel to go high for another preset period.

I’ll wire those two channels into my +24V and -24V relays.

I need everything from the purchase BOM to the simplest code to get it done.

First, this is never going to happen unless you’re willing to pay someone to do the work for you. We are willing to help in the case that you come to a point where you have an issue while building your own project.

Pretty much any Arduino model will do what you want. But, I can give you some advice about driving an actuator that has a regular DC motor; I am assuming you are trying to give it -24V just to reverse the motor. Look into a “H-Bridge.” It was designed just to drive motors and drive it forward and reverse without alot of components. An H-bridge can easily be driven with an Arduino without hassle and there are tons of tutorials and code examples…

Thanks. I’m willing to do the work but I’m not familiar with arduino.

I’m getting the uno. What code do I need to convert the input pulse into my rising and falling edge detection pulses?

No one has an edge detection program?

I just want to do one thing when a signal goes from low to high and a different thing when it goes from high to low.

Then you sit in one loop waiting for an edge to high.

When it goes high you go to another loop while you sit waiting for an edge to go low.

If you’ve never done ANYTHING with an Arduino or any other MCU for that matter, best you start off with a blinky LED and a pushbutton switch. You get those 2 down, you can do damn near anything.

Until then…think before you ask.

Thanks for the support for someone who needs help.

I’ve watched the videos and I’ll do the blinky led, but if it’s so easy - please post the two lines of code to get it done.

http://lmgtfy.com/?q=arduino+uno+blinky+led

Here’s a better idea…

You think of how it might be done.

Then you do it.

If it works for you, great. You’re done.

If it fails to work for you and you can’t figure it out after days and days of thinking about it, trying to fix it YOURSELF, post the question here (or anywhere), with all the relevant information (circuit diagram, code used, etc.), and I’m absolutely sure somebody will chime in and HELP you figure it out.

You really expect somebody to do your homework for you?

Are you one of these people?

http://www.informationweek.com/despite- … id/1063505?

On topics where I have expertise, I help without reserve. It doesn’t matter if someone hasn’t googled it or bashed their head against a problem or not.

I have a ton of responsibilities and arduino is supposed to make it easier, especially due to the open source and large design community. That was the hope, anyway.

I’m going to work through it. If I get no help, fine. I do expect the experts to help the new.

You’re not asking for help. Haven’t seen one sentence asking for help. All I’ve seen is “gimme”, “post this”, “post that”. Zero effort on your end so far.

What codlink and skimask are saying is that although you’ve described your problem pretty well, this forum works best when it’s interactive. We happily dispense free advice and help, but it’s usually to people who have already shown that they are trying to learn and are stuck on a particular point.

Sometimes the newer posters here come off as someone who just wants to sit back and have the answers provided. That’s fine, but they shouldn’t be surprised if people ask to be paid for that level of “help.” Other forums have “job boards” for paid assistance for just that reason.

And yes, even writing a few lines of code is real work if the person on the other end can’t debug it, because then you’ll be answering so many debugging questions, it may as well be engineered properly to work perfectly in the first place.

That said, I’m going to plug my own blog since it may help you. I have a couple posts on making a [cycle timer that will show you how to do timed functions with the Arduino and controlling a hydraulic shock absorber from a [pushbutton that illustrates how to read an input switch and cycle through various states. That should get you started.](http://www.cedarlakeinstruments.com/blog/archives/221)](http://www.cedarlakeinstruments.com/blog/archives/283)

Thanks.

I get it. I help others without issue, and expect the same. I’ll check out your blog.

I solve big real life problems for a living, so so get the desire to get paid for expertise. But this is a free forum and I think I’m looking for a couple of lines of code and to know if this is feasible with the hardware I’m getting.

As far as what I’ve already done: I use another programmable controller to do this now and it is working, but I’ve run out of channels. Based on an external set of analog sensors and an internal timing program, I generate two pulses. I take these two 5V signals that represents the forward and reverse drives to an H bridge relay that generates the +24V and -24V to the linear actuator.

The controller has a very rudimentary programmability so the amount of code needed to do this was very long. Their expert forums looked at it and said it’s the simplest it can be.

It took me a few weeks to figure out but the lack of a real programming language was a pain. I programmed in C++ and Fortran in the past.

The get more channels, I decided to investigate arduino. I’ll figure it out. Based on my reading so far, it should be a basic time loop waiting for a signal to go high to enable a pulse. I haven’t found the couple of lines of code yet, but I will.

skimask:
Are you one of these people?

http://www.informationweek.com/despite- … id/1063505?

This link is soo true… Kids now a days think that every thing should be handed to them… And since it pretty much has, they think that Google’s first few links should contain the answer they’re looking for. When it doesn’t, then it doesn’t exist so they come here demanding the answer. When all it takes is changing a few words or phrases when searching Google.

I couldn’t begin to imagine how many hours I have spent using Google and how many times I had to change my search phrases to find what I’m looking for. But that’s the difference between the older internet users and the kids that were born with it. We have the patience and the knowledge to understand how Google works. The kids today want everything right now. That’s how they were raised.

It also seems like the younger generation is seeing Google like having to go to the library, look through the thousands of books just to get a one sentence answer that they’re looking for. They have no idea of how the older generation had to get their parents to drive them to a library and spend days looking for that one book. Now they sit at home press a few keys to find what their looking for, and when it doesn’t work, well, they get mad… Kids these days have it so bad. [/sarcasm]

Thanks.

I get it. I help others without issue, and expect the same. I’ll check out your blog.

I solve big real life problems for a living, so so get the desire to get paid for expertise. But this is a free forum and I think I’m looking for a couple of lines of code and to know if this is feasible with the hardware I’m getting.

As far as what I’ve already done: I use another programmable controller to do this now and it is working, but I’ve run out of channels. Based on an external set of analog sensors and an internal timing program, I generate two pulses. I take these two 5V signals that represents the forward and reverse drives to an H bridge relay that generates the +24V and -24V to the linear actuator.

The controller has a very rudimentary programmability so the amount of code needed to do this was very long. Their expert forums looked at it and said it’s the simplest it can be.

It took me a few weeks to figure out but the lack of a real programming language was a pain. I programmed in C++ and Fortran in the past.

The get more channels, I decided to investigate arduino. I’ll figure it out. Based on my reading so far, it should be a basic time loop waiting for a signal to go high to enable a pulse. I haven’t found the couple of lines of code yet, but I will.

So how come you can’t figure out a solution to this simple issue, “it’s just 2 lines of code…”

And what if we gave you the 2 lines of code? What would you learn? How to get exactly what you asked for? Seems you need to learn more than just asking for code.

Thanks for the link, Lyndon.

So the push button code is interesting, but it looks like you need to wait for the input to be completely realized before taking action. You evaluate if it’s a click or a press and then change states.

In my case, the input pulse is 4-5x the length of the desired output pulses. So while the input pulse is still going, I need to be generating a short pulse whose duration is very short. For example, the input is 45sec and the output for the “on” is 10sec.

Not to diminish the condescending tone but I’m not a kid. I’m in my 40s and work a 60hr week with little time.

I can figure it out, but I ask for help to accelerate my execution. I would do the same for others.

Like I said, I don’t “speak arduino” and that’s taking time and it’s why I’m asking for help. It’s like going to Germany and not speaking German. It doesn’t make me lazy or stupid to ask the community to help while I slowly read my “speak German” manual.

So you can’t figure out out to type in “Arduino detecting rising edge”?

I know you were not a kid just by reading your posts. Kids don’t have the respect to even type in complete words or sentences.

I apologize of my attitude toward you. It’s not personal. You have to understand that we get this everyday here. There are few volunteers that try to help those members that actually help themselves. When people make an account here just to demand an answer, it really pisses us off.

Not to jump in here, but really, in less than 24 hours you went from posting your issue to complaining that no one had responded by giving you edge detection code.

There are currently only 6 registered users on this forum and I would guess it is only those people who are going to help.

I would have posted some code but I don’t have what you’re asking for. I would have to Google it myself.

Often times, we see someone posting their issue and short time later they are posting the solution that they found themselves. Sometimes we just wait them out or we would be busy catering to the needs of the newbies.

Lyndon, your site is awesome!

I’m not offended. Just frustrated. I did try to google it for a couple of days without result before posting.

When I do figure it out, I’ll post it here so others who need something like it will get moving faster and they can contribute to the community faster.

You seem to need a one-shot from the input (that way you can ignore how long it stays on), latch your output, then start your timer to turn the output off.

Check this link for some example code for one-shot:

http://playground.arduino.cc/Code/Buttons