Project of the Month built by SilverSanJuan
Home Model Engine Machinist > CNC and 3-D Printers > Software and Programming > Electronic Dividing Head using the Arduino

Reply
 
Thread Tools
Old 07-18-2017, 05:32 PM   #241
markba633csi
 
Join Date: Jul 2017
Location: Mountain View, Ca
Posts: 3
Likes Given: 1

Default A note concerning LCD shields

Chuck Fellows for president! Great work Chuck, I'm sure you have inspired hundreds of code newbies, me included.
I purchased a SainSmart clone on Aliexpress, I found it was giving pushbutton errors quite often and I checked the voltage divider resistor values and 3 of them were wrong. The biggest error was that the top-most resistor was 3k instead of 2k. Big improvement in stability now. I'm thinking there might should be some decoupling caps on the shield Vcc? The stock board apparently has none.
Mark S.


markba633csi is offline  
 
Reply With Quote
Old 07-18-2017, 06:10 PM   #242
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,088
Liked 64 Times on 60 Posts
Likes Given: 2

Default

Chuck posted into this thread a steppermath.xls that shows the error rate for a 127 tooth gear cut. Easy enough to alter the values to check ones own mileage . . .

For myself am adding a 10th degree option somewhere in the script - i.e. for 7.2 degree, - [stepsBy10thDegree = (Degrees * multiplier) / 10;]
At 400 steps & 36:1, can get away with a reasonable error rate . .


__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----
Foozer is offline  
 
Reply With Quote
Old 07-19-2017, 09:20 AM   #243
rodw
 
Join Date: Dec 2012
Posts: 1,009
Liked 300 Times on 235 Posts
Likes Given: 155

Default

I don't think there is any need to use hardware to debounce buttons when you've got the power of a microprocessor to do it in software. There are plenty of methods but here is one. https://www.arduino.cc/en/Tutorial/Debounce

Foozer, Chucks spreadsheet on page 19 of this thread is specific to his algorithm so it can't be universally applied. Having said that, Chuck's algorithm accumulates steps, my (revised) algorithm accumulates errors. The end result is identical. The missed steps from rounding are spread around the full 360 degree circle.
__________________
RodW
Brisbane, Australia
vehiclemods.net.au
rodw is offline  
 
Reply With Quote
Old 07-19-2017, 04:02 PM   #244
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,088
Liked 64 Times on 60 Posts
Likes Given: 2

Default

Quote:
Originally Posted by rodw View Post
The missed steps from rounding are spread around the full 360 degree circle.
Both do it well. Chucks was easier for me to adapt a NES controller as input device, yours being a bit more sophisticated left me at the time, like a deer in the headlights trying to adapt same controller . .
__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----
Foozer is offline  
rodw Likes This 
Reply With Quote
Old 07-22-2017, 02:46 AM   #245
markba633csi
 
Join Date: Jul 2017
Location: Mountain View, Ca
Posts: 3
Likes Given: 1

Default

My replica of Chuck's original design still glitches now and then, I thought it might be switch bounce but now I'm not so sure. I set up a 555 timer pulsing a transistor to simulate the "right" button closure and I still get occasional opposite rotations and sometimes the number of divisions will suddenly increment up or down by one count. It could be emi noise from my 8825 driver getting into the arduino a/d or possibly a hiccup in the code itself- I need to get out the scope and do some more checking. I can't trust it yet for actual gear cutting till I get more consistent results. Also I need to understand the code in more depth, especially the "move the stepper" section.
Mark S.
Mt. View, Ca
markba633csi is offline  
 
Reply With Quote
Old 07-22-2017, 02:17 PM   #246
cfellows
Project of the Month Winner!!!
 
cfellows's Avatar
 
Join Date: Aug 2007
Posts: 3,874
Liked 755 Times on 484 Posts
Likes Given: 3

Default

Thanks for all the comments, folks. Very rewarding to see people are able to use the results of some of my work. It would be interesting to know just how many people have built a dividing head based on my software.

For me, it was all in fun in developing a real world application for the Arduino. Love that little computer! My career started with programming in the Air Force back in 1962. Of course, that was a long before the advent of the C language, but the Arduino took me back to some of those earlier year experiences when computers didn't have much, if any, of an operating system.

The most important test for me was to be sure that all my program values reset to their starting points after a full revolution in either direction. If one could accomplish that with a wide variety of different circle division numbers, then the algorithm was most likely working properly.

Chuck
cfellows is offline  
 
Reply With Quote
Old 07-22-2017, 03:41 PM   #247
markba633csi
 
Join Date: Jul 2017
Location: Mountain View, Ca
Posts: 3
Likes Given: 1

Default Debounce tutorial

I found a good tutorial on both hardware and software debouncing if anyone is interested:
Attached Files
File Type: pdf debouncing.pdf (333.3 KB, 17 views)
markba633csi is offline  
 
Reply With Quote
Old 07-22-2017, 04:32 PM   #248
Foozer
HMEM_LIFETIMESUPPORTER.png
 
Join Date: Nov 2008
Location: Camano Island, WA
Posts: 1,088
Liked 64 Times on 60 Posts
Likes Given: 2

Default

I Made One . . .
Little 3" rotary table with stepper mount similar to BMac's design.
Trimming some trees, had a hunk of wood - First attempt at actually using it.
One hole, wrong spot . . .
Attached Thumbnails
fly1.jpg  
__________________
"Nothing is more irritating than that which exposes the pedigree of ideas"----Lord Acton----
Foozer is offline  
 
Reply With Quote
Old 07-22-2017, 05:34 PM   #249
almarghi
 
Join Date: Aug 2011
Posts: 3
Liked 1 Times on 1 Posts
Likes Given: 9

Default

I have build two of them, using arduino nano with some small changes (regarding the outputs) and I didn't have any problems with the algorithm, but with the key voltage levels on the analog input. Both worked perfectly from the first time, without any issues.
Since I don't trust any contraption without feedback, I oversized all power components - motors and power supplies - and it worked. For supplying the arduino board, I have build a swithing 9V dc-dc converter and I have used its onboard 5V linear supply.
in the attached picture you can see a bearing cage with 64 holes. No position error detected.
Please excuse my bad english,
Alex


Attached Thumbnails
P0002_072416.jpg   IMG_20170617_113513.jpg  
almarghi is offline  
markba633csi Likes This 
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Electronic Dividing Head cfellows Tools 23 08-10-2013 02:29 AM
Rotary Head/Dividing Head Question chucketn General Engine Discussion 6 02-13-2012 03:18 PM
Dividing head m_kilde Tools 25 04-11-2011 09:17 AM
Dividing head Richard1 General Engine Discussion 9 09-15-2009 07:47 AM
Look Ma, no dividing head. John S Photos and Videos 7 07-15-2008 05:08 PM



Newest Threads






- Top - Member List