Welcome! Log In Create A New Profile

Advanced

Engineering/Art Piece

Posted by ColinPoly 
Engineering/Art Piece
August 18, 2014 09:17AM
I need to code stepper motors to play out a sequence of acts consisting of varying combinations of CW and CCW rotations between 4 motors. The sequence, made up of these acts of short and varying rotations, needs to be long enough and/or random so that it wont be figured out by attendees at the gallery. Background below.

Working on a job for artist who wants to turn 4 concentric rings to rotate independently of one another. His art is the rings (Largest one is about 2.5feet across stepping down to about 11inches across), I have built the platform for the rings to rest on consisting of wood, lazy susans and timing belts. Each ring has its own microstepper driver and stepper motor to turn the timing belt, connected to arduino. His aim is to have his art appear to be operating in a simple machine sort of appearance.

Everything is either built or almost finished and the final step is to code the motors to play out these acts. An example of an act would go something like this. Timing is not the way I hope to do it necessarily, I am more trying to illustrate what the rings need to do, aka what the steppers need to do, over 1 of many 30 second intervals.

0-7seconds
Ring1 - move CW
Ring2 - wait
Ring3 - wait
Ring4 - wait
7-14seconds
Ring1 - move CW
Ring2 - move CCW
Ring3 - wait
Ring4 - wait
14-21seconds
Ring1 - move CW
Ring2 - move CCW
Ring3 - move CW
Ring4 - wait
21-28seconds
Ring1 - move CW
Ring2 - move CCW
Ring3 - move CW
Ring4 - move CCW

Does anyone have any ideas on what the best way to go about this would be? I am in the very early stages so do not really have any code I can share to get critiqued I am more just trying to find a reliable plan of attack. Is there a way to do this so that I can feel confident the artist can plug and play the piece and it will not get stuck due to a missed step or something else.
Re: Engineering/Art Piece
August 19, 2014 06:10AM
Sounds like you just have to send appropriate G-code. To get a 30 seconds movement, send G1 X300 F600. Or G1 X150 F300, if you want to move slower and half the distance. G1 X300 Y300 to move two rings.

These printer controllers don't care wether there are linear axes, they just send out stepper pulses, which turn the motors. One thing to adjust is step/mm, which I'd interpret as steps/degree, so an X360 would turn your first ring one full rotation.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Engineering/Art Piece
August 19, 2014 07:51PM
And here I have been trying to adapt the AccelStepper Library to do what I want and you come along and blow my mind. Thank you!
Re: Engineering/Art Piece
August 20, 2014 03:29AM
What type of gcode sender should I use? I have 4 motors so does that mean I need a 4-axis compatible one? Am I not making sense? Sorry I am completely new to gcode so any basic info you can share on how I can get to the point where I can control all 4 motors with Gcode, that would be appreciated very much. I have been dabbling around with senders, flashing my arduino, probably making a mess of things so any guidance would be perfect. Thanks again.
Re: Engineering/Art Piece
August 20, 2014 11:06AM
Quote
ColinPoly
What type of gcode sender should I use?

Most simple case? A serial terminal, like PuTTY, CoolTerm, GtkTerm. Connect, type commands, watch what happens. Pronterface should also work. Repetier Host might do things you don't want (it tries to "help" printers).

Quote
ColinPoly
I have 4 motors so does that mean I need a 4-axis compatible one?

About all RepRap firmwares and controllers _are_ 4 axes. 3 axes bot (X, Y, Z) and one extruder (E). An extruder ist just a stepper, too; heater & Co. are entirely independent.

Quote
ColinPoly
I have been dabbling around with senders, flashing my arduino, probably making a mess of things so any guidance would be perfect.

You can give Teacup firmware a try [reprap.org]

1. I love feedback from non-technical people.

2. It's small enough to fit on small Arduinos.

3. It sure doesn't mess around by assuming it drives a printer.

4. Default settings are very conservative, so it's unlikely you break something.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Engineering/Art Piece
August 20, 2014 07:02PM
Quote
Traumflug
Most simple case? A serial terminal, like PuTTY, CoolTerm, GtkTerm. Connect, type commands, watch what happens. Pronterface should also work. Repetier Host might do things you don't want (it tries to "help" printers).

Incredibly helpful! Thank you, thats exactly the direction I needed.

Quote
Traumflug
About all RepRap firmwares and controllers _are_ 4 axes. 3 axes bot (X, Y, Z) and one extruder (E). An extruder ist just a stepper, too; heater & Co. are entirely independent.

Learned that immediately after posting but thank you all the same.

Quote
Traumflug
1. I love feedback from non-technical people.

Ha that's embarassing, I am actually a mechanical engineer, but in terms of CNC yes I am very non-technical and this job schedule does not allow for time to try and sound more knowledgeable than I am. Which is why I really really appreciate all your help. My senior design project used steppers but it was completely different needs and was hoping to get steered in the easiest direction by someone helpful like yourself. Its probably chump change compared to building quality CNC machines but here it is.

[youtu.be]

Thanks again, I may be back smiling smiley
Re: Engineering/Art Piece
August 23, 2014 07:50PM
What are teacups default pin designations for Arduino Uno? When using Accelstepper I simply had to define a stepper(step size, step pin, dir pin), so for all 4 motors I would use pins (9,8),(7,6),(5,4),(3,2).

In the teacup firmware, I tried to edit the arduino.h file to match that pin setup, but uploading it failed. If not too much do you think you could tell me the matchups for the steps and directions pins for arduino or tell me how to edit to my liking? I have read your wiki section on pin designation but am having a hard time figuring out what is the correct way to setup my arduino and motors.
Re: Engineering/Art Piece
August 23, 2014 08:00PM
Sorry another question...Am I going to be able to set everything up so that it can run through the g-code steps I provide strictly through the arduino? I will be able to use my computer when designing the "performance" of motor steps, but in the end this is supposed to be a plug and play affair and be able to run entirely off of the arduino board (power for motors will of course be through psu plugged into the wall). Right now I have an UNO and from what I read and my needs being fairly limited, I think I have enough pins and memory but again im a stranger to all this.

Thank you in advance!

Colin
Re: Engineering/Art Piece
August 24, 2014 01:07PM
Okay I am back and have made a lot of progress and didnt want time taken for answering things have I managed to figure out already. So far I have figured out the pin designations for hot smiley2,5), Y(3,6), Z(4,7) motors but haven't hooked up extruder pins yet because I have not nailed down everything going on yet. I followed the teacup firmware instructions and got it to upload without any errors but from there I failed to properly figure out how to use Putty, CoolTerm, or Pronterface to work with it so I eventually went with g-code sender because it was easy to send commands and/or browse for text file of commands. Arduino app on windows was not running when I got this to work though so am I not using the teacup firmware? Or did I upload it and its using teacup without arduino ide on comp running?

Your posts have all been of great value to me, Traumflug, and I am now capable of doing exactly what I said I wanted initially, Thank you! Now that I can write a long script to follow the steps I need, all I need now is to figure out extruder pin assignments and how (if possible) I can get this thing to store and run this simple gcode file on the arduino itself so I can remove the need for a computer. Do you think that is possible? Also would like it to repeat the gcode once its finished running, so that it can cycle without being tended to. Any more advice you have to offer on these issues would be greatly appreciated. Thank you.

Colin
Sorry, only registered users may post in this forum.

Click here to login