Wednesday, September 30, 2015

10. Well it's complicated... :-)

Well I feel more comfortable with software, a little less with electronics. I am not really into mechanics, so I need to learn everything from scratch.

How to properly cut to get everything squared and aligned. How to drill a hole that fits my design, with the right position, angle...

All sorts of little details that seem so obvious until you do it.

I bought quite a few tools for that, such as a vertical drilling machine, a tap and die set,... and parts.


I also purchased wheels and belt for the transmission and drilled a hole for its axis: this is exactly when I discovered that it was not that easy... :-)





Sunday, August 9, 2015

09. Designing the mechanics

Now stepping into mechanical design: after reviewing plenty videos and websites looking for the kind of cheap mechanical parts I can buy, I took my pencil, an eraser, my old wood board and found back some yellowish Canson paper I had bought last century.

Here is how my design look so far.

Front view

View from above

Two versions of a device to adjust belt tension



Sunday, July 19, 2015

08. Into mechanics

So the basics for the Arduino + CNC shield + G-code are under control to get the stepper motor moving. I now need some mechanical thing to move.

The following video is good source of inspiration:



Quite smart. Yet my constrains are different from a CNC: the axis should move faster and they don't need as much strength. Still the linear guidance could be the same...

After browsing the Internet for almost a whole week end, I end up with the following ideas:
  1. Linear guidance: 
    1. Use an aluminum T profil + 624vv bearing on one side
    2. Plain bearings as wheel on the other side
  2. Linear motion: use toothed belts by the meter + pulley + clamps
Suppliers found:
  • Bearings; on ebay for around 0.50 EUR per bearing
  • Toothed belt & co: http://www.tridistribution.fr/fr : it's way more expensive and I still need to get some details sorted out to choose the right features.

Sunday, July 5, 2015

07. Plug my stepper motor and test it

Now it's time to plug my stepper motor onthe CNC shield.

I read this tip: "Do NOT connect or disconnect a motor while the driver is energized. This will cause permanent damage."  -- Sparkfun

As per the specification of my 42BYGH47401A stepper motor, the wiring of the 4 leads are ordered as:
  • RED Phase: A
  • BLUE Phase: A Return
  • GREEN Phase: B
  • BLACK Phase: B Return
Not fully explicit to me as my CNC shield shows A1, A2, B1 and B2 for each


As per http://www.selene.co/Articles/WiringConfigurations.aspx, "Bipolar motors are the simplest of the configurations presented here. Bipolar motors have 4 leads and two windings. Only one configuration is possible with a bipolar motor, as shown to the right. What is important for a bipolar motor configuration is the polarity of each winding. The windings must be symmetric (A+ and B+ winding leads must be connected to the same end of the winding."

So I decided to wire it as
  • B2: black wire
  • B1: green wire
  • A1: red wire
  • A2: blue wire
This is how it looks:

So I am now ready for my first test:

  1. Switch on the main alim
  2. Plug in the USB cable into the Arduino
Here is my stepup:

In the Arduino IDE, I open a serial monitor (under Tools / Serial monitor):

  1. I type in $$ + send, to check that I am properly connected: I get my default parameter setup
  2. Now I can type in my first G-Code command:


It means "move x-axis by 4 mm at a feed rate of 25 mm per minute". And it works !!

Now the same in video: yeah !! :-)




As a recap, this video is also a pretty good introduction by John to getting started with Arduino CNC Shield.

Wednesday, May 13, 2015

06. Plugging Protoneer CNC shield and configuring DRV8825 driver

Now I need to step into the hardware side: connecting the driver with the CNC shield and the Arduino Uno:

1. Plug DRV8825 driver onto the Protoneer CNC shield:
Check the driver pins...


match the CNC shield pins:

So it looks like this:

2. Plug a power supply to the CNC shield
The one on the picture below is a 24 v x 6.5 A. It's more than needed for just a test but as I plan to have at least two stepper motors, it should be enough: http://www.gotronic.fr/art-alimentation-rs150-24-20113.htm#


3. Plug-in the Arduino to the USB port of the PC

4. Switch-on the CNC power supply

5. Configure the current limit of my driver
As very well explained on Pololu website, drivers need to be configured to make sure that the current they send does not exceed what the stepper motor can take. The following video explains it in more detail step by step:


In my case, my stepper motor 42BYGH47-401A shows the following specifications:

  • Phase: 2
  • Step Angle: 1.8°
  • Voltage: 24 V
  • Phase Current: 1.5A/Phase
  • Phase Resistance: 1.6ohm/Phase
  • Phase inductance: 2.8mH/Phase
  • Holding Torque: 5500g.cm
  • Lead Wire: 4
  • Insulation Class: B

Note 1: I was puzzled by the voltage spec as the same motor reference showed different voltage from one web site to another; in some cases down to 2.8 V. Eventually I came across the fact that rated voltage is not really relevant for stepper motors. On the contrary, the current limit is key to preserve the stepper motor. So I can power my stepper motor with my 24 V power supply.

As per the driver specification, if I want a max 1.5 A to be sent to my stepper motor, I need to set my DRV8825 Vref to 0.75 V ; so Vref x 2 = 1.5.

Note 2: the driver is set in "Full step", so no jumper have been placed on the CNC shield for that configuration.

With my multi-tester, I test the voltage between the screw of the potentiometer and the lower right pin (GND): I turn the potentiometer so the voltage shows 0.75 V.

Done !

6. Switch off the power supply and unplug the Arduino from the USB port of the PC

I am now ready to plug my stepper motor.

Tuesday, May 12, 2015

05. Compiling and sending GRBL on Arduino

Now that we are done with Arduino basic installation, I need to move into GRBL compilation and upload it into Arduino.

As per https://github.com/grbl/grbl/wiki/Compiling-Grbl, I take the following steps:

1. Download the Grbl source code (v0.9i)
  • On GRBL Git page: https://github.com/grbl/grbl
  • Click the "Download ZIP" button on the lower right side of the home page.
  • Once downloaded, unzip it and you'll have a folder called GRBL-Master or something similar.
2. Load Grbl into the Arduino IDE as a Library.
  • Launch the Arduino IDE on the PC.
  • On Arduino IDE menu, click "Sketch", then "Include Library", then "Add .ZIP Library..." (note that this still works with a folder / prior to IDE version 1.6.2 this will be Import Library..., and click Add Library...).
  • Select the Grbl folder inside the grbl-master folder when asked to select a library folder you'd like to add. The correct folder only contains the source files and an example directory.
  • It may take a few seconds for the Arduino IDE to import it.
3. Open the GrblUpload Arduino example.
  • Click the File down-down menu, navigate to Examples->Grbl, and select GrblUpload.
4. Compile and upload Grbl to your Arduino.
  • Connect your Arduino Uno to your computer.
  • Make sure your board is set to the Arduino Uno in the Tool->Board menu and the serial port is selected correctly in Tool->Serial Port.
  • Click the Upload, and Grbl should compile and flash to your Arduino! (Flashing with a programmer also works by using the Upload Using Programmer menu command.)
5. To check that these steps are performed correctly, I can start using GBRL on my Arduino from my Arduino IDE on my PC, as explained here: https://github.com/grbl/grbl/wiki/Using-Grbl

So I take the following steps:
  • In Arduino IDE, under Tools, I select "Serial monitor": a window pops up
  • I change baud rate to 115200: I get GBRL following message "gbrl 0.9i ['$' for help]"


Good ! It working fine so far.
  • I also change the "No line ending" drop-down menu to "Carriage return".
  • I enter "$" and then click "send": I get few lines of help description:
Great !!

Monday, May 11, 2015

04. Getting my PC connected to Arduino

First, I need to get started with Arduino. I had purchased a starter kit some months ago, to help me get back into electronics and the details of naming conventions, bread boards, components... 15 projects to get started. Great help and good fun !

I just needed to update my PC to the latest version of Arduino IDE, which required me to also reinstall some drivers...
  1. Download latest version from http://www.arduino.cc/en/Main/Software (v 1.6.4 in my case)
  2. Get Arduino installed and started on my PC: http://www.arduino.cc/en/Guide/Windows
To make sure it's working ok, I tested my Arduino with the Blink app (see in Basics). I changed the delays between blinks, compiled, sent the code to Arduino and validated that it was working fine.


Sunday, May 10, 2015

03. Overall path to get my stepper motor under control

To get started, I purchased
A stepper motor is a brushless DC electric motor that divides a full rotation into a number of equal steps. http://en.wikipedia.org/wiki/Stepper_motor

To control my stepper motor from my Arduino card, I purchased
Grbl is a free, open source, high performance software for controlling the motion of machines that move, that make things, or that make things move, and will run on a straight Arduino. More here on GRBL: https://github.com/grbl/grbl/wiki

GRBL implements a so called G-Code: it's a language that allows to give orders to a CNC machine. Machine tools are usually monitored with 3 or 4 axes. In the case of my 2D plotter, the idea is to use the CNC shield for just 2 axes; optionally a third axis to move up and down the pen.

I had a Windows PC on which to install Arduino IDE: the latest version can be downloaded from http://www.arduino.cc/en/Main/Software (v 1.6.4 in my case)

Hence the following path:
  1. Getting my PC connected to Arduino
  2. Compiling and sending GRBL on Arduino
  3. Plugging Protoneer CNC shield and configuring DRV8825 driver
  4. Plugging my stepper motor and testing it
Steps 1 thru 4 are covered in the next posts.

This video also gives a good idea of where we are heading to:

Tuesday, May 5, 2015

02. Some directions: Arduino + precision mechanical parts

There are many solutions for small size electronics and prototyping:
I had gotten started with Arduino as it is more of a micro-controller than a little computer (as Rasberry Pi) and I believe it is appropriate for real-time processing. Last summer, I got started with a starter kit which is a good solution to get introduction to basic projects, components, coding and learning, even for parents and kids: http://www.gotronic.fr/art-starter-kit-arduino-k000007-18743.htm

As far as the mechanics is concerned, I need some precision, specifically for linear guiding and I came across these websites from which I expect to get my most precise parts:
A friend of mine reviewed my initial cinematic and also gave me the following advice:

"Precision is a matter of budget.

Now, a pair of copper plumbing tubes (which are, by construction, precise diameter and straight, when not welded), a plastic block in which you drill the diameter of your pipes and voila at lower cost (but you'll have to be lucky for forest of diameter to make it a tad more in diameter than the tube, but not too much, and accuracy will be won on the length of the plastic block).

There is a problem on your installation: it lacks a tension wire kit at the pulleys and you better make several turns over the "motor" pulleys. Balancing the strand lengths of 2 sides of the machine will be a crucial operation for its proper functioning => the connecting tube between the stepper motor and the bottom pulley (in the diagram) will be very steep for not having torsion."

Thursday, March 19, 2015

01. Objective: build a 2D plotter

In the good old times of mechanics or architecture, designers would draw their blue prints with a pencil and Rotring isograph. Then came the 2D plotters. Then came the laser and jetink printers.

A Rotring isograph is different from laser or jetink printing: it draws a darker line of China ink.

I want to build the intermediate version: a 2D plotter that would still use a Rotring isograph and could be piloted from a PC so I can drw from my PC on large scale papers; say 1.50m x 2.00m.

From a cinematic point of view, it could look like this:



This blog goes step by step through my investigations to build this 2D plotter.