CNC Machine -- Valkyrie-Clone CNC

son of a…

Just when things are getting good…

The swf file, cleaninstall, stops after you download the rxtx-bin file, "jesus this is more complicated than the version I downloaded"

It’s a problem with the file, and not from my end. I ran it on different computers and even downloaded the file off the embed and ran in it Adobe cs4. It’s a runtime error.

Sorry, but is there any chance you can re-upload it somewhere else?

Try running the .swf yourself.

well, at least the software was free

Dang. When the software broke the file into chunks it must have lost a piece. The missing step is to go to the page you linked to on the RepRap site, and download the RXTX Bin file (which has the windows binaries). It should have a nice big folder for Windows. Copy the RXTX Windows binaries to the “bin” folder of each place you have JDK and JRE. Then go up two levels and copy the RXTX jar file to each lib/ext directory. Basically this is following the instructions that are given on the site you linked me to initially on the RepRap site. After installing these files, and the GCODE for Reprap program, the GCODE for Reprap bat file should work.

Here’s the link you gave me: http://reprap.org/bin/view/Main/RepRapMicrosoftSoftware#RXTX_Serial_Library_serial_port

Use the binaries zip file instead of the one you used. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip

Connect Arduino to Stepper Driver?

Hello,

1. Do we need to set address for every stepper driver? How?

2. Can we use 1 compiled firmware for all 4 stepper driver?

3. How to connect Arduino to those 4 stepper controller? Please let me know the pin assigment.

 

Many thanks.

Setting address

The Arduino connects through the I2C pins Analog4 (DATA) and Analog5 (CLK). The steppers and Arduino must share a common ground level. The way I connected the I2C to the 4 stepper drivers was to connect the two wires to a telephone-style terminal jack that connects the 1 pair of I2C wires into 4 pairs. This is the same type of thing I did for the power wires but I was a little more cautious about those – I wrapped up the connection in tape and heat shrink so I wouldn’t accidentally touch it. You can see the splitter on the side of the X stage – it’s the thing with all the wires attached.

https://www.robotshop.com/letsmakerobots/files/clone_cnc_terminal_board_lg.JPG

clone_cnc_terminal_board_sm.JPG


https://www.robotshop.com/letsmakerobots/files/clone_cnc_terminal_board_lg.JPG

You cannot use a single compiled firmware for each driver. You’ll need to change the source code for each of the 3 driver types (X,Y,Z) and recompile.

The address must be set in the source code for each driver board when you program the ATTINY2313 driver IC. In file “motor_driver.c”, in function “main()” (line 217 in the version at http://github.com/TinHead/Valkyrie-CNC-source-code/blob/master/), you change the line that says

usiTwiSlaveInit(2);
and you change it to 
usiTwiSlaveInit(3);
for Y-axis and
usiTwiSlaveInit(4);
for Z-axis. 

Thanks

Thanks for your complete explanation. Now I understand how the system works :slight_smile: Trying to build the circuit now and compile the firmware while waiting my friend build the machanic.

Btw, Do you know free software to convert CorelDraw (.CDR) or AutoCAD (.DXF) into G-Code?

Thanks.

Haven’t tried that yet

I haven’t tried that yet – and unless someone else on LMR or CNCZone forums knows how to do it, I’d suggest doing a really thorough Google search to dig up any plug-ins that may exist. If you convert to Inkscape, there is an Inkscape plugin that lets you convert vector objects into GCODE. (and if you are using a bitmap or something there is a way to “trace outline” in Inkscape that will create a vector object that you can then use the GCODE plugin on. You can find more about the “trace outline” function if you look up “Cricut”/“SCAL” instructions for doing this).

If you have no other way of doing it, I’d suggest finding the plugin that imports CDR and DXF files into Inkscape, where you can then use the free GCODE plugin for Inkscape to make a GCODE file. (EagleCAD also has a plugin called “pcb_gcode” that can make circuits, but then you’d have to use EagleCAD to design your board.)

<TinHead said>
There is the plugin:
http://bitbucket.org/jst/inkscape-gcode/src/tip/dist/
And there are some usage instructions a little outdated:
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?InkscapeHowto
btw: google: inskape gcode -> first hit
</TinHead>

Stepper wiring

I got eMinebea PM55L-48. 7.5o per step.

I found wiring description from this page
http://www.stepperboard.com/motor_wiring_examples.htm

But I dont know how to wire to the stepper driver.

1. Should I connect circuit ground to stepper common?
2. Should I connect both stepper commons?

If you have wiring diagram please share to me.

 

Many thanks for your helps.

Lots of diagrams

Okay there’s a lot of diagrams there. So your PM55 probably has a chunky block attached to it with all the wires coming out.

The wires toward the front of your motor are probably the A-coil (red and white above), and the wires toward the back of your motor are probably your B-coil (yellow and blue above). The motor is *face down* because it is my Z-axis.

The data sheet links I linked to earlier have this type of information on page 15 (last page). The colors are different but the order is the same. Since the motor is *face down* (the data sheet shows a face-up motor), the A1 and B1 wires are red and yellow. The A3 and B3 wires are white and blue. The other wires are not used for bipolar motors and are disconnected (not connected to either ground or 24V, they're just loose or you can clip them off).

http://www.eminebea.com/content/html/en/engineering/motors/pm_motor/selection_pm/pdf/pm_select.pdf

Your motor may vary, but the wire block in the picture is probably very similar to the PM55L.

In a previous message I noted that the pins labeled "A1,B1,A2,B2" did not correspond to the motor's labels. I first hooked A1 to A1, and A2 to A3 to test my driver. If I had read the data sheet I'd notice the sequence at the bottom of PAGE 13. In the driver code, A2 and B1 variable names are swapped compared to the PM sequence. So if you use the Valkyrie driver, you would hook up A1 to the A1 pin, A3 to the B1 pin, B1 to the A2 pin, and B3 to the B2 pin. Confusing? Follow the schematic to be sure -- note that "PD" and "PB" pins are associated with the different variables -- follow the wires and see where they lead on the L298N IC.

Hope this helps

Diagram

pm55.gif

I found that my stepper pin mapping is like in picture above.

I think coil B is YELLOW and ORANGE
and coil A is BLACK and BROWN.
(Because BLACK and BROWN is in top row)

 

I hooked RED and RED to ground.
(Should I hook these to the ground?)
Yellow to A1
Orange to B1
Black to A2
Browse to B2

Then I send G-Code.
Stepper seem to work properly.
Stepper spin if there is changes in the value of X Axis.
But I must test on the mechanical to make sure

the direction of rotation is correct.

Thanks for your detail explaination :)

 

 

If it spins, it works :slight_smile:
If it spins, it works :). Since the red wires are not used you can leave them loose – If you connect them to ground you are only using half the coil.

Transistor

Can we replace the L298 with transistors that have large current?

You shouldn’t need it for the PM55

Pino – You shouldn’t need more than the L298N for the PM55 motors. If you’re not sure, check the resistance across the coils. My PM42S motors have 80ohms across each coil, which limits the current very well. Your motors are similar, and according to the data sheet (page 4)
http://www.eminebea.com/content/html/en/engineering/motors/pm_motor/selection_pm/pdf/pm_select.pdf
the PM55L has 25% higher resistance than the PM42 motors (24/100 ~ 250milliamp/coil) which is fine. For my 1.4ohm/coil motors, it is a different story. Rather than replace L298N with transistors, I think it’s cheaper (at least for me) to redesign the circuit to use a L297/1 – I have to redesign the board anyway so I might as well figure out how to use the L297.

That’s just my opinion (I placed an order for the L297s already), so designing a transistor circuit could work. But my motors are bipolar not unipolar, so I definitely need an H-bridge instead of just transistors (an H-bridge can be made from transistors, but it takes more of them). If I had a unipolar motor, I might be able to get away with a 4-transistor circuit, since the center tap of each motor can be connected to ground. Since I have a bipolar motor, I need an 8-transistor circuit to allow the current to flow across the coils either forwards or backwards. If you decide to build a new driver with transistors, I’d like to see the build. I do have an H-bridge built out of NPN and PNP transistors, which I designed in EagleCAD – just for fun – and with a one-sided board there are a few jumper wires over the top. It seemed a bit complex compared to keeping it all on the L298 IC. I etched the H-bridge on some scrap board, but haven’t soldered or tested it yet. The design, at the tolerances of my machine, covers 50mmx125mm of board space for just two H-bridges, so I might end up with monster-sized board. But since I haven’t done the L297/L298 board yet, I don’t know for sure that L297/L298 will be any smaller (but it seems like it should be). Just rambling here…

-John