seeking guidance - on simple random linear actuator project - open to pay

hello everybody!!

as new as it gets here, so please go easy on me!!

ive got a pretty small project that im starting out with, it involves moving a small, lightweight wheeled stage, with a linear actuator, an arduino and a motor controller.

i really hope i can get this done on my own with some love in the right direction, but if i cant, if anyone would like a bit of pay for code, i can arrange that if im over my head.

id like to have a breadboard button to stop, and another button to start it

in one version id like it to just slowly go back and forth.

in my 2nd version id like the code to have a random effect ……. that continually gives a random direction, speed and distance for the linear actuator.

so here’s what I’ve got (it’s all in the photos by the way)

-linear actuator with 8’’ stroke and built in 5 wire type potentiometer

-arduino - navy blue with “digital PWM” written on it. maybe a knock off.
-arduino uno r3 - official - coming in a few days
-Pololu high power simple motor controller G2 18v25
-breadboard, wires, buttons etc

Id like to keep this linear actuator in constant motion, but it’s only got a 25% duty cycle. when i called up servocity they told me id get away with it if i run a fan blowing on it, and also at least run a 75% duty cycle - in other words, it’ll be paused 25% of the time.

So ive dug into this a little bit so far, and i think ill probably have to run the randomSeed(millis() command, and i’m looking out for potential issues around commands arriving before others go out, so I’m thinking that as far as the random speed/direction/distance goes, maybe i would be better off calling a minimum distance travelled for each random change, thus giving time for output of the next line of code.

i think that’s it!!!! thank you community!

-SparkleUnicorn :wink: :wink: :wink: :wink: :wink: :wink: :wink: :wink: :wink: :wink:

A good approach to projects like this is to make some little projects that establish your ability to use your components individually. Once you have the ability to control the linear actuator you can think about the end game of making your two programs that make it dance.

In this case, it looks like step one is communicating with the Pololu device. Once you can command it, you can hook up the linear actuator and experiment further.

What are you using for power?

Looks like you will need a 12V 160W power supply and an H-Bridge motor driver capable of 160W.

You will connect the Yellow and White wires to +5v and Ground. Then connect the Blue wire to one of your analog inputs (A0 through A5). That will allow you to get a position from 0 to 1023 with just an analogRead().

Don't use a breadboard for motor connections.

The tracks will burn and the motor driver will probably be destroyed. Either use secure screw connectors or (better) solder all high current connections.

Appreciate all of you ...

John,I was under the impression that the Pololu high power simple motor controller G2 18v25 pictured above would be enough to relay commands from the arduino to the actuator ... I definitely need an additional H-Bridge?

Much appreciate the power supply advice. I am assuming too that the best course is to run three power supplies separately here, the 12V160W for the actuator, and then two others indivdually for the arduino and the controller ... perhaps I will need a fourth for the H-Bridge?

Bill, I do believe youre right that I should start with a smaller project. Tonight I'm setting up some led/push button situations, and also seeing if I can control the actuator manually and get acquainted.
You mentioned "two programs" , which I didnt understand - which 2 programs exactly?

JRemmington, thanks for the heads up. Something like this for example, isnt a good idea? :

Im hoping to run this for long periods, so I def dont want to take any chances.

Would anyone happen to have any advice on approaches to the code?... using random generator commands in conjuction with an on/off switch. I'm thinking that as far as the random speed/direction/distance goes, maybe i would be better off calling a minimum distance travelled for each random change, thus giving time for output of the next line of code. does this sound right?

should i use a randomSeed(millis() command?

You mentioned having two versions of your program in your first post. Perhaps you just intend to have the first evolve into the 2nd as the final version rather than keeping both.

That's exactly right WildBill... well, thank you all for your input, everything said has been very valuable to me, and your time is very very appreciated.

Im learning quickly, but I think Im going to hire a coder on this one.

If you want someone to write the code for you, I think you will still have to do a little coding yourself, simply to verify your power and wiring. Unless of course you're going to give the hardware to whoever is going to build this for you.

What you need isn't very difficult and could be written without access to the hardware as long as you can test it of course, but it will be slower than someone having all the parts in hand.

sparklingrobotunicorn:
Im learning quickly, but I think Im going to hire a coder on this one.

There is a forum section called "Gigs and Collaboration" where you can seek someone to do programming.

WildBill and John... very helpful, thanks so much for your time

Hi John, are saying I should use something like a large computer power supply?

12v160W… so Im doing the math for amps, are you thinking really high amperage, like 14?

Thank you so much!

sparklingrobotunicorn:
Hi John, are saying I should use something like a large computer power supply?
12v160W... so Im doing the math for amps, are you thinking really high amperage, like 14?

Yes. 160W / 12V = 13.33A. You can use a computer power supply as long as you can get at least 160W/13.33A from the 12V supply.
Another option is a simple 12V supply module and a 5V buck converter running off that to power the 5V stuff.