Tuesday, March 30, 2021

Interesting facts and ideas from a People for Education Report titled Technology in Schools.

This People for Education Report is an important read.

From the report:
"Up to now, future-ready skills and competencies have gone by a variety of labels including soft skills, 21st century skills, transferable skills, and global competencies (British Columbia Ministry of Education, 2017; OECD, 2018; RBC, 2018; Waddell et al., 2018). People for Education refers to them as The New Basics."

1. Thinking Creatively and critically
2. Developing a Sense of Self and Society
3. Communicating Effectively
4. Learning to learn
5. Collaborating

In Ontario "future ready" skills are referred to by the Ministry of Education as "transferable skills" including, 
1. critical thinking
2. social-emotional skills
3. adaptability
4. digital literacy
5. collaboration

While 1, 2 and 5 in both lists are a match, 3 & 4 are not. Adaptability & Digital Literacy are both open to interpretation more than the other 3 so it remains to be seen how these terms will be used in curriculum documents.

Thursday, April 9, 2020

Converting a 2418 Desktop CNC to Laser part 2

In part 1 I talked about the mechanical and wiring portions of the conversion. In part 2 I will discuss software settings and usage along with operation. Now that the laser is mounted and wired it's time to burn some wood!

The LaserGrbl software lets you change some of the Grbl firmware settings on the controller board. I left everything as is except $3 which I had to invert so that the X and Y movements on the mill matched the output from the software.

I started out powering the laser using an old 1 amp variable voltage power supply I built many years ago. I figured 12 volts, 5.5 W, that's less then 1/2 an amp right? Wrong. My initial try with the included griffin example file (look for the sample SVG - G Code folder) went well but after that the laser output started becoming erratic and would trail off after a few seconds. A quick test with a multimeter showed the power supply voltage was dropping to just 3 or 4 volts! 

A week or so later when I got a fixed 12V 5A power supply I was able to start experimenting again. LaserGRBL lets you make custom buttons. Right click and choose Add Custom Button in the button bar at the bottom. This one turns the laser on at low power (25/255).

I do not have limit switches so Grbl uses the XY position at power on as home. I make sure the laser is positioned on the lower left area of the workspace when I power up and then use this low power laser on/off button to give me a low power dot to position the work piece. Getting the laser focused was tough because even at the low power setting the wood begins to burn after a few seconds. Focusing took some patience as I had to keep moving a scrap piece while turning the focusing ring and looking for the smallest dot. It paid off because now it draws very sharp lines. I am using scrap pieces of 1/8" mahogany construction grade plywood.

After experimenting with laser power settings and feed speeds I came up with a combination that gave good clean lines and corners. I drew the iceboat outline by tracing a photo using Aspire and then exporting it in svg format. LaserGrbl generated the CNC code from the .svg file. On import the software asks for the feed speed and laser power settings. The code did not complete the lines in a logical order, often wasting time jogging back and forth. I still need to investigate why this is happening. 

Doing something with grey scale in it like a photo is the next challenge. Wood is either burned or not. LaserGrbl creates grey scale areas by using dots, the more space between the dots, the lighter the shade. The trick seems to be feeding LaserGrbl with a photo that is comprised of a narrow scale from light to medium grey.

I imported this grey scale file to try some test strips at different feeds and power settings.

Coming up I'll experiment with photos some more and then move on to cutting paper and wood.

Thursday, March 26, 2020

Converting a 2418 Desktop CNC to Laser part 1

I had been toying with the idea of swapping the spindle motor for a laser on my 2418 desktop CNC machine. The Woodpecker 2.6 controller has a laser output which is straight ON/OFF but I wanted to use a 5.5 W PWM controlled 450 nm blue laser so that I could adjust the laser power on the fly. The Laser I found on line is made by WonVon and comes with a controller with 12V and TTL (PWM) inputs. The software I found is similar to the GRBL software I used for CNC work and is called LaserGRBL v3.1.2.  I believe what I found out will work for any PWM controller laser running any CNC/Laser type software using the GRBL controller.

I discovered that the Atmega 328 that is the brains on the Woodpecker is the same chip used on an Arduino. It had a boot loader called GRBL 0.9 but I needed to upgrade to 1.1 to be able to control a laser. There are a lot of instructions and discussions available showing how to do this on an Arduino but nothing clear for the Woodpecker. Fortunately, there is a utility built into LaserGRBL that flashes the 1.1 firmware (bootloader) with the push of a button. The USB interface to the Woodpecker uses a CH340 chip and LaserGRBL also has a utility to install the driver. Both utilities are in the menu bar under Tools.

I thought that the PWM pin that the S command (laser intensity) in G code was available on the 34 pin header. Sadly I was mistaken. The signal originates from the D11 pin on the Atmega 328. On the Woodpecker the 328 is too small to solder directly but D11 connects to the big power MOSFET that controls the spindle. You can see I soldered a short piece of blue solid 22 gauge wire directly to the MOSFET signal pin in the photo below. The brown ground wire is a female 0.1 jumper end. Both of these are spliced to the PWM input. White is PWM + and yellow is ground. The other connector in the photo with yellow and white wires connect to an external 12V DC power supply. On this connector yellow is + and white is ground.

I also thought it would be nice to easily switch between Laser and Spindle mode on the 2418. I hoped the spindle motor clamp was the right size to also hold the laser. Again, sadly I was mistaken. Fortunately I found that Brandon Piner had published some stl files on Hackaday that showed promise. His CNC Z Mount allows the easy exchange of tools. Brandon also put his files on Thingverse where a remix by wb-maker gave me a mount for my laser. Now all I needed was a mount for my spindle motor. I drew this out in Inventor and then got all three parts, the Z Mount, the laser mount and the spindle mount printed.

The next 3 photos show the Z Mount, the Z mount with the laser attached and the Z mount with the spindle mount attached.

In order to use the new Z mount I had to push the 4 bearings and lead screw adapter out of the original spindle mount and then push them back into the new Z mount. I was careful to use objects like bolts that were the same diameter as the bearing or adapter to gently tap them out/in. To push them out I supported the block on a solid surface with a hole large enough to receive the bearing or adapter. To push them in I made sure the parts had a thin coat of oil and were held square to the hole. No excessive force was needed.

In part 2 I will talk about getting the software set up and using LaserGRBL to do line art and grey scale bitmaps.

Thursday, July 5, 2018

Tiny Duino board on a desktop CNC

This photo shows 3 versions of the Tiny Duino board I first described in July 2014. The board on the right is laid out in Fritzing and etched using the toner transfer method to create a mask. The other 2 boards were laid out using Eagle and produced on my little desktop CNC machine seen in my October 2017 post. The default components in Eagle are good for commercial production but created pads and lines that were too fine for this method.

The first step was to learn a little about Eagle CAD. Eagle is free for hobbyists making small single sided or double sided circuit boards. You can edit components by opening the library containing the component and then double-clicking the package file for the component. I made the pads bigger and the drill holes smaller. Later when the CNC machine does the drilling the hole size is determined by the physical drill you place in the machine. I used save-as and put "my" in front of the library name to make it easier to find later. You will need to open your new libraries using the Library manager in order to be able to use them. You can find some tutorials online to learn more about this. In Eagle 8.6 the component libraries are in /cache/lbr. I put the libraries I edited into Github. Library files contain large collections of components. I only edited the components used on the TinyDuino.

Since I had already laid out the TinyDuino board for etching I found it quicker to place the components on a new board in Eagle and then create the traces. This takes 2 steps. Firstly use Signal to join the components and then Route to create the trace. You can move the traces around and create bends. I made the traces 20 to 30 wide. Ground traces that are wide then the rest make it easy to identify ground later on. Make sure they are all on the Bottom since you are making a single-sided board.

TinyDuino layout

The Make Your Own PCBs on an Inexpensive Desktop CNC machine Instructable article by davr.org helped me figure out how to use EagleCAD to generate the G code for my own desktop cnc mill. The pcb-gcode-EagleCAD plugin file contains a good manual in the docs folder to help you figure out the next steps. The plugin uses Processing and also generates a graphic so that you can double check your G Code. I used the single pass isolation mode and a 0.5mm end mill. Keep the spindle speed high, the feed rate low and run the code with the bit cutting air first to make sure the code works.

G code visualizer from the Eagle plugin.

Everything about this project required learning, trial and error and time. I was very pleased to see the final TinyDuino boards being cut. There were several trials until I got everything right. I think it really helped to do this with a circuit board that I am already very familiar with. I feel more confident that I can use this method to make a prototype circuit board in the future.

Friday, October 27, 2017

Comparing Single Board Microcontrollers

Happy Friday . . if you happen to be reading this on a Friday! So I am officially retired from teaching. I sleep in, read books, do errands and wonder where the day went! I still mentor for FRC team 4992 so I'm back in to the school two afternoons a week. I will do some supply work but otherwise my schedule is pretty clear. I planned to spend some more time on this blog and perhaps widen the scope a little but here it is already the end of October and I am finally sitting down to get at it. The first order at hand was to be a comprehensive list of Microntrollers but thanks to ZeusGuy, Graeme Bartlett et al there is now a nice long list on Wikipedia. Good job people.

The teachers in my department all pitched in and got me this neat little desktop CNC machine for my retirement gift. In the next couple of blog posts I'll talk about using Eagle CAD to generate G code files to make small circuit boards on this machine.

Saturday, August 19, 2017

A First Look at the mBot

Recently our school board received some mBots from Makeblock to try out in the classroom. The mBot is a small autonomous Arduino Uno based rover educational platform that can be programmed in Arduino C or a Scratch derivative called mBlock (mBlockly on an iPad).

The kit comes with the following:
mCore main board, DC motors, wheels, chassis, battery holder, hardware
INPUTs: Light Sensor, Button and IR Receiver on board and an Ultrasonic Sensor module and a Line Follower Sensor Module. The modules plug in via RJ25.
OUTPUTS: 2 RGB LEDs, Buzzer, IR Transmitter, 2 motor ports on board.
Each kit comes with either a WiFi or Bluetooth module that sits on mainboard headers.
POWER: Standard female DC power jack or standard Lithium 2.0 connector.

The sensors plug in to RJ25 jacks and the motors have 2 pin JST connections. There are 4 available RJ25 jacks. 1 and 2 contain Arduino I/O pins 9 through 12. 3 and 4 contain Arduino A0 through A3 pins. There is an ICSP header. There are no other I/O ports supplied. There are solder points for two 0.1" x 6 headers. On the left is A0, A1, A2, A3, SDA, SCL and on the right is GND, 5V, 9, 10, 11, 12.

The kit also comes with an IR remote (requires a CR2025 cell), a USB cable and a hex driver for assembly. Putting it together takes no time. The main board needs to be removed to change batteries if you are using AA cells. The main board supports charging Lithium batteries which are not included but might make a wise investment considering the way DC motors use up battery power.

Straight out of the box I had the mBot running in no time. The default program lets you control the mBot via Bluetooth (or WiFi), or via IR or it can be set to autonomous run around and avoid obstacles mode or line-following mode. I like the mBlock IDE because you can quickly program the mBot using Scratch-like blocks and see the Arduino C code result in the right hand window. This makes for an easy transition for grade 9 or 10 students who have used Scratch and want to start coding in C.

I think the mBot is a good platform for teaching robotics, interfacing or Arduino to grade 9 and 10 students. The price is very good. We purchased a similar all-in-one platform a few years ago that needs to stay tethered via a USB cable to work. The old platform engages students but can be frustrating because the tether cable limits motion. The mBot should be operated on the floor but drops and kicks will be inevitable. The mBot is very robust. The metal chassis can handle some pain. Parts like wheels and DC motors are easy to replace. The kit comes in a handy reusable box that can hold the mBot after assembly and stack in a cupboard.

I usually shy away from endorsing products but this unit deserves mention for its competitive price and ease of use. I would recommend these to anyone starting out high school Computer Tech or Robotics classes. A class set might be impossible to budget in one year but as I always recommend - have a plan. Buy 2 or 3 a year. These units will do a great job at covering many of the learning outcomes in TEJ courses.

Sunday, June 5, 2016

The Internet of Things part 1, the Yun

In the Internet of Things series I will explore the use of WiFi enabled microprocessors like the Arduino Yun and Digispark Oak as tools that students can use to learn how to connect devices to the Internet. The connection of devices and machines to the Internet to allow man-machine and machine-machine interaction is now embodied in the phrase "the Internet of Things". There has been an explosion of interest in industry and commercial markets as the price of WiFi technology comes down. A corresponding surge in the hobby, DIY field can be seen with an ever growing number of products and online tutorials and projects. The Yun was first released in 2013 with the same form factor and IDE as the original Arduino. Recently we saw the release of the Raspberry Pi 3 which has 802.11n and Bluetooth built in. The Digispark Oak, the Omega Onion and a host of other products aimed at the hobbiest, DIY and developer fields are becoming available.

In this post I will write about my first few experiments with the Yun. In the next few posts I will describe early experiments with the Oak and other WiFi enabled microcontroller solutions. I hope to be able to conclude with a wish list for enabling students to learn about this technology in a clean and consistent manner. My early experience with the Yun and Oak indicate that the technology is not straight forward nor for the faint of heart. I hope to finally compare and contrast all the solutions that I tried out.

The first step as it is with any of these things is to follow the Getting Started tutorial that comes with the device. I found that I could connect the Yun easily to my home network (Linksys) or my experiment router (Belkin with no Internet). At school I should be able to connect to our public network since the Yun does not require any special settings at the router. Some familiarity with ip addressing and the Linux OS helps but is not necessary.

"The Arduino Yún is a microcontroller board based on the ATmega32u4 and the Atheros AR9331. The Atheros processor supports a Linux distribution based on OpenWrt named Linino OS. The board has built-in Ethernet and WiFi support, a USB-A port, micro-SD card slot, 20 digital input/output pins (7 of them can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator, a micro USB connection, an ICSP header, and 3 reset buttons." - from the Arduino.org website.

The Atheros processor communicates with the ATmega microcontroller using a technology called Ciao Core.  This technology is incorporated into the Bridge library which must be included in your sketches.

Step 2 involved using the Yun just like any other Arduino to verify the correct operation of the following devices:
1. Photoresistor in series with a fixed resistor to measure analog light levels.
    Photoresistor wiring from Arduino Tutorial.
2. DHT22 to measure temperature and humidity. DHT22 wiring from Make Nation.

The sketch worked perfectly using the open source DHT22 Arduino library.

Step 3 used the Weather Station tutorial in Marco Schwartz's book the Internet of Things with the Arduino Yun. The tutorial uses a website/software stack called Temboo as a go-between a Yun and cloud apps like Google docs. You will need to have a Temboo account and a Google account.

Marco's book is 2 years old and Google has changed the way docs are accessed. Instead of good old username and password Google now uses the oAuth protocol. The Temboo website uses apps they call choreos that enable the flow of data from the Yun to be entered onto a spreadsheet. In order to set up a connection you must now run an initialization oAuth choreo and a Finalize oAuth choreo. As you go through the process you collect a client id, app id and other tokens that have to be copied into your code. You can follow the Temboo tutorial which gives you some Arduino Yun code that works. You can find my code, which integrates the original code from the book and the Temboo tutorial on Github. https://github.com/mdruiven/Yun-Weather-Station. All the account information and tokens are in a separate file called TembooAccount.h. Make sure to change them to your own codes and information.

I found that I had to use my coding skills to solve a couple of issues. I think the level of complexity was medium to hard and beyond the average high school level. That said, I believe that senior high school students could tackle problems very similar to this one by following these directions and using my code. By similar I mean write some data to a spreadsheet collected from various sensors connected to a Yun. I think this has a very high cool factor and will encourage students, and others, to continue to learn and experiment with this technology.