Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Servo control with a CNC shield v3 and UNO
westech
Newbie
Posts: 10
Permalink
Post Servo control with a CNC shield v3 and UNO
on: September 30, 2017, 00:52
Quote

Hello!

First I just want to say hello! My name is Max and I'm 15. I've just been researching Polargraphs these last couple days and am very excited. I pretty much have all the parts at home.

I have Ramps 1.4 but I want to try doing this with an UNO and a CNC Shield v3. Its a GRBL board. I understand the Stepper control pins, but how can I wire the servo? I'm not sure the Shield supports a 3 wire servo. I guess I can just run the wires straight from the UNO.

I understand I will be running the Polargraph firmware not the GRBL CNC firmware. (and yes, I have 2 a4988 drivers).

Just wanted to say Hi, and maybe get some thoughts.

Thanks

Max

Image

pauantich
Newbie
Posts: 4
Permalink
pauantich
Post Re: Servo control with a CNC shield v3 and UNO
on: October 8, 2017, 12:32
Quote

https://www.thingiverse.com/thing:1926074

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Servo control with a CNC shield v3 and UNO
on: October 8, 2017, 18:27
Quote

Polargraph firmware expects to control the servo with pin 9, so you need to access that somehow. Alternatively you can change the servo pin to an unused one by modifying: https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L135

The motor driver pins are specified in https://github.com/euphy/polargraph_server_a1/blob/master/configuration.ino#L53-L63 so you can map them to the GRBL shield pinouts, avoiding pin 9 perhaps!

Good luck,

sn

westech
Newbie
Posts: 10
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: October 10, 2017, 01:37
Quote

Thanks! I got the servo running fine on pin 9!

Still working on the motors!

kio
Newbie
Posts: 3
Permalink
kio
Post Re: Servo control with a CNC shield v3 and UNO
on: October 26, 2017, 10:54
Quote

Quote from westech on October 10, 2017, 01:37
Thanks! I got the servo running fine on pin 9!

Still working on the motors!

Hello everyone, I'm from St. Petersburg, Russia.
Not strong in English ...
Also trying to collect Polargraph on CNC shield v3 and UNO
Maybe you can share the connection scheme, for me, so far this is space ...)))

westech
Newbie
Posts: 10
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: October 30, 2017, 18:21
Quote

Here is what I did.

Still not sure,

1) How to set Steps per mm? (I'm using a 1.8 degree stepper with 20 tooth GT2 pulley, a4899 with 1/16 stepping) So, 20 x 2mm pitch = 40mm per revolution. 200 steps per revolution x 16 = 3200 micro steps per revolution. 3200/40mm = 80 micro steps per mm??

<blockquote class="imgur-embed-pub" lang="en" data-id="a/2eIQN"><a href="//imgur.com/2eIQN"></a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>

My Diagram and Instruction:

https://imgur.com/a/2eIQN

Image

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Servo control with a CNC shield v3 and UNO
on: October 31, 2017, 00:00
Quote

@westech - Check the following link. Change the values in the default.txt to match your set up, and mind that the microstepping value is entered separately (as machine.step.multiplier) -- don't forget to upload the changes to your machine.
https://github.com/euphy/polargraph/wiki/Building-a-Polargraph-from-a-vitamin-kit#software

westech
Newbie
Posts: 10
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: October 31, 2017, 06:18
Quote

Thanks Kong,

By the way, your photos of your work inspired me to build my own:-)

Max

kio
Newbie
Posts: 3
Permalink
kio
Post Re: Servo control with a CNC shield v3 and UNO
on: November 28, 2017, 17:14
Quote

Quote from westech on October 30, 2017, 18:21

My Diagram and Instruction:

https://imgur.com/a/2eIQN

Image

Many thanks! I was able to run a polargraph and draw a portrait of my mother! )))
Image

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Servo control with a CNC shield v3 and UNO
on: November 28, 2017, 20:47
Quote

Beautiful work, and well done!

NealXu
Newbie
Posts: 1
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: November 29, 2017, 15:52
Quote

Hi...i am a new user here. I will say you can use the DRV8825 boards by themselves but having the CNC shield makes everything much simpler, and given that those shields are pretty cheap I can't see why you'd want to put yourself through the work of creating your own carrier board.

alexdmejia-
s
Newbie
Posts: 6
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: March 26, 2018, 04:48
Quote

Hey guys,

I'm having trouble getting any movement from the steppers. I have the A4988 drivers and I have followed the instructions from the diagram above. I'm building both the hardware and the software from the source, both of which build perfectly fine. I have modified the pins as described in the diagram and I made sure that the servo works by lifting the pen.

To make sure that the servo connections are working I uploaded the grbl firmware to the Arduino and successfully tested the servos. As another sanity check I tried using the `move pen to point` button but still nothing.

Anything else I can test?

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: Servo control with a CNC shield v3 and UNO
on: March 26, 2018, 10:18
Quote

Hi Alex --
1. You made your changes to the firmware and uploaded it?
2. You edited the default.properties.txt in the contoller folder, changing the parameters to match the characteristics of your machine?
3. You launched the controller, got a connection, and un-paused the command queue?
4. You uploaded your machine specs to the arduino from the SETUP tab?
5. You hit the "Home" button? (not critical at this point, but preferably with you gondola at the home position).

After doing ALL these steps, a "Move Pen..." command didn't work?

If so, hit cntrl-c which will open a console which might show an error when you give the command.

alexdmejia-
s
Newbie
Posts: 6
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: March 26, 2018, 15:41
Quote

woah thanks for the quick reply @kongorilla.

1- yup
2- I'm not sure what changes need to happen in default.properties.txt, my understanding was that changes made in the Processing app were uploaded to that file. Where exactly does this file live so I can take a look at it?
3- yup. I did notice that some commands were failed to be parsed. I'll get some answers later tonight.
4- yup
5- I'm pretty sure I did, I'll try again later

Shorn
Beginner
Posts: 33
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: March 26, 2018, 21:20
Quote

I am using an Arduino Nano with the a1 code and a modified GRBL CNC shield with DRV8825 step drives, so I think your setup should work.

When you start the Polargraph Controller does it say it is connected at the top of the screen?

Also it has a soft interlock - you have to 'unpause' the system by clicking on the line near the top right- CommandQueue: QUEUE PAUSED - click to start

Sometimes overlooked is that you have to enable the drives by clicking the top line of the command queue

Hardware:
*Running an Arduino Nano reflashed with an Uno bootloader
*Modified knockoff GRBL CNC shield with knockoff DRV8825 step drivers
*400mA -200 step motors set to 16x microstepping
*2mm belt with 36 tooth drive gears
*Machine set to 1500 Max speed and 5000 motor acceleration

Software:
*Stock Polargraph Controller to make command queues
*D2S version 2
*Send.py on remote Raspberry Pi

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Servo control with a CNC shield v3 and UNO
on: March 26, 2018, 22:54
Quote

Just double-checking:

https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L71 is uncommented

#define SERIAL_STEPPER_DRIVERS

and lines https://github.com/euphy/polargraph_server_a1/.blob/master/polargraph_server_a1.ino#L58-L59 are commented like so

//#define ADAFRUIT_MOTORSHIELD_V1
//#include <AFMotor.h>

And in configuration.ino, this https://github.com/euphy/polargraph_server_a1/blob/master/configuration.ino#L53-L60 looks like

#define MOTOR_A_ENABLE_PIN 8
#define MOTOR_A_STEP_PIN 2
#define MOTOR_A_DIR_PIN 5
  
#define MOTOR_B_ENABLE_PIN 8
#define MOTOR_B_STEP_PIN 3
#define MOTOR_B_DIR_PIN 6

The notes on that diagram do indicated that the lines should start with #DEFINE rather than #define, but if it's compiling, I'll assume you spotted that!

If all that's in order, and the firmware is uploaded. Then Kongorilla's path should work.

Pop open the console (Ctrl+C, or you can just look at the black-and-white bottom half of the IDE if you are running the controller from source code.

On the SETUP tab, click "upload machine spec" and watch what happens. You may see some obvious errors. (There might be one about PG--somethingXX, you can ignore it.)

Second thing: When the machine starts up, it prints out a summary of it's own settings from EEPROM. Have the console up, and reset it, and show us a screen grab of what comes up.

One last thing - you say servo and stepper and I'm not sure quite which is not working. Does anything move?

sn

alexdmejia-
s
Newbie
Posts: 6
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: March 27, 2018, 04:02
Quote

Thank you all for the replies.

hmm not sure what changed but I tried again and now it works. I didn't change any code or any wires so I'm not sure what happened. Printing the brackets for the motors now, I'll report back when it is all setup :fingers_crossed: Thanks!

alexdmejia-
s
Newbie
Posts: 6
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: April 6, 2018, 23:01
Quote

so I'm almost done getting the whole setup to work, I just have a few more questions and hiccups.

1- The Y-axis motor seems to be reversed, when it need to go down, it goes up. It is wired the exact same way as the X-axis which is working correctly.

2 - I think that I misconfigure my motors because there is barely any movement. My machine is 2ft x 3ft and the gondola moves around 1cm from edge to edge. The motors that I have are these https://smile.amazon.com/gp/product/B06XSYP24P and I'm using them with https://smile.amazon.com/gp/product/B0714R39BC. So in the Java app I have them as 32mm per rev with 400 steps per rev. This is what the serial monitor says

Loaded width:103
Loaded height:154
Loaded mmPerRev:32.00
Loaded steps per rev:400
Loaded step multiplier:1
Loaded down pos:187
Loaded up pos:70
Recalc mmPerStep (0.08), stepsPerMM (12.50)
Recalc pageWidth in steps (1287)
Recalc pageHeight in steps (1925)

Any help is greatly appreciated

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Servo control with a CNC shield v3 and UNO
on: April 6, 2018, 23:27
Quote

1 - Polargraphs don't have X or Y axis motors, each movement is made of a combination of the two motors, A or B (left or right). https://github.com/euphy/polargraph/wiki/It's-going-the-wrong-way! might shed some light on it 🙂

2 - Width and height aren't right for a 2x3ft machine (too small).

Have a look at https://github.com/euphy/polargraph/wiki/Building-a-Polargraph-from-a-vitamin-kit#software for some details of how to set up a machine with serial stepper drivers. You should set stepsPerRev to be the motors true value (200 in your case) and stepMultiplier should be set to whatever you have as your microstepping setting for your stepper drivers. For instance on the Polarshield, I have it wired up to use 8x microstepping, so I set stepMultiplier to 8.

You can directly edit the default.properties.txt file to change these values. Remember to "upload machine spec" when you're done.

sn

alexdmejia-
s
Newbie
Posts: 6
Permalink
Post Re: Servo control with a CNC shield v3 and UNO
on: April 7, 2018, 04:28
Quote

woooo it works!! Thanks to everyone that helped me. The only issue that I have to solve is why the drawings are a little stretched

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.108 seconds.