Shop OBEX P1 Docs P2 Docs Learn Events
Quad dro — Parallax Forums

Quad dro

Richard S.Richard S. Posts: 70
edited 2012-10-10 07:53 in Propeller 1
I have been working on displaying quadrature encoders.· My interest is to readout Jenix glass scales for my mill and display to a CRT 640x480, using a standard keyboard for input.· Attached is the binary file of what I have so far.· A/B of·the X, Y, Z, and A encoders are hooked to P1/2, P3/4, P5/6, and P7/8· output pins respectively.· Although the program is meant for Jenix scales there are provisions to use it with rotary encoders but NOT Chinese scales.·I used the·ProtoBoard with simple wiring to supplement the needs of the encoder reader.· The extra EEPROM is used to store setups.·+5v·and ground for the encoders come from the servo pins.··Pix are attached.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Richard in Michigan
640 x 480 - 102K
640 x 480 - 120K

Comments

  • Richard S.Richard S. Posts: 70
    edited 2008-04-08 00:46
    I failed to mention that the +5v encoder inputs --> 1k ohm resister --> input pin of propeller.

    Also attached are a few screen shots.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
    640 x 480 - 64K
    640 x 480 - 51K
    640 x 480 - 51K
    640 x 480 - 49K
    640 x 480 - 57K
  • Richard S.Richard S. Posts: 70
    edited 2008-04-08 00:50
    Here are a few more pixs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
    640 x 480 - 66K
    640 x 480 - 65K
    640 x 480 - 64K
    640 x 480 - 65K
    640 x 480 - 62K
  • whickerwhicker Posts: 749
    edited 2008-04-08 01:01
    cool project.

    it's freaky to think how expensive this would have been without the Propeller chip.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-08 06:26
    Nice user interface. I assume that you are just using all the different characters in the rom for the lines?
  • Richard S.Richard S. Posts: 70
    edited 2008-04-08 11:01
    Stevenmess2004 ...

    Yes I used the ROM characters to generate the display screen.· A bit of code but it work nicely, I thought.·

    I will be releasing the program for hobbyist use soon.· I am running out of steam and have not completed 'bolt holes in line or arc/circle'.· About 1500 longs remain in RAM.· Three cogs are yet free.·

    A few more pix attached.· The binary will run on the demo board, but you will not be able to store or read setups.· Encoders do not need to be attached to tryout the different menu screens and set values.

    Whicker ...

    Yes it has been a fun project.· It is amazing how·a project·evolves and morphs over time.· Without the routines written by others, this project could never have been created by me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
    640 x 480 - 64K
    640 x 480 - 54K
    640 x 480 - 51K
    640 x 480 - 52K
    640 x 480 - 59K
  • LawsonLawson Posts: 870
    edited 2008-04-08 16:00
    very nice project! Can you preset an axis to some value? this is really nice for setting zeros when touching off with a tool. How about a "Goto" mode where a final position can be entered, and a set of readouts counts down the distance remaining till that position is reached? (a virtual set of dials would be cooler and allow faster reading at a glance) Can an axis be inverted in software? (i.e. if sliding the table right is reading negative inches can this be made to read positive inches?)

    I'm in the process of adding a recycled DRO to a general use lathe at work. (work at a university...) I was VERY tempted to make something similar. smilewinkgrin.gif

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • Richard S.Richard S. Posts: 70
    edited 2008-04-08 16:14
    Lawson...

    Yes, individual axis can be preset and set to zero.· The formula is as follows:

    readout =· (pos * scale * sign) + offset

    The encoder position is the same for all absolute and relative readouts.· Offsets may be set individually for all absolute and relative readouts.

    So if you want to count in relative X axis while Absolute X is counting up then set relative offset to negative number and readout will count up toward zero.

    Sign of each readout can be set also.

    Go to axis setup screen to change encoder and offset values, change sign, decimal places displayed, and type of units to readout.

    Regards

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • Richard S.Richard S. Posts: 70
    edited 2008-04-11 01:49
    My spin code for QDRO·is attached.· It consists of a zip archived file and a binary file.· The included OBJ files in the archive that have been modified for this project include VGA_TEXT and ROTARY_ENCODER.· Read the ROTARY_ENCODER· comments to see how I solved resetting the encoder values.· FLOAT_TO_FORMAT OBJ has been stripped out and imbedded into the QDRO code (at the end).· Still needs a little polishing.· When·running for the first time the file read/write/default screen might look strange until you load in some meaningful setup values.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • Richard S.Richard S. Posts: 70
    edited 2008-05-12 01:47
    Found an error. New archive available.

    I am looking for about 3 people with Jenix scales to test the program out.
    I would provide hardware/software in about 1 month if interested.

    Anyone try it out on rotary scales?

    Feedback would be appreciated.

    Thanx.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • jammajamma Posts: 33
    edited 2008-05-13 01:02
    Could it be used to work with rotary endocers like this:

    http://www.usdigital.com/products/e3/

    e.g. 2 channel quadrature TTL squarewave outputs. This is what I'm thinking of putting on my mill.
  • LawsonLawson Posts: 870
    edited 2008-05-13 14:57
    Lawson said...
    I'm in the process of adding a recycled DRO to a general use lathe at work. (work at a university...) I was VERY tempted to make something similar.

    Well I found out why the DRO I recycled was replaced. Seems that the counter box is flaky. (it counts and zeros, but nothing else is reliable) So, this Prop QDRO just got a LOT more interesting.

    Lathe is an WWII vintage Monarch with linear encoders on the bed and slide. I'm not the only recycler in the place so we've got old computer monitors and keyboards available. I'm most interested in adding proper axis pre-setting and any special Lathe functions to this machine.

    I've looked through the code on this and have a few comments on the UI layout. First I'd like to see some way to quickly zero and preset the axes on the main screen that shows the readouts. Second, since this machine is used by more than me, I'd like to see any and all setup menus moved into only one entry on the main menu with several "are you sure about this?" menu levels protecting them. Third, the Lathe/Mill special functions should probably be moved up to the main menu for easier access and so that people know they exist. Fourth, it'd be killer if this had an online help system. No need for the help files yet, just adding the help key and a placeholder screen would be enough for now. Also while it's nice that the UI only uses the number keys, a full PS2 keyboard is cheaper and easier to find so go ahead and use the extra keys if you need them.


    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?

    Post Edited (Lawson) : 5/13/2008 4:20:04 PM GMT
  • Richard S.Richard S. Posts: 70
    edited 2008-05-14 01:55
    Hello Jamma

    Yes QDRO works with rotary encoders such as those from US Digital.· I use a rotary encoder for testing purposes since it is compact compared to the linear glass scales from Jenix.· A picture of my test bed is attached.·

    To set up a given scale for any quadrature encoder do the following:

    1) Select 'main menu'· 2) select 'program options' 3) select 'calibrate xyza axis' 4) select 'x axis' (if this is the axis you need to calibarate for a given encoder) 5) in the x axis calibrate screen 'set units' ie inches, '# of inches to move' in the calibration process ie 2 inches, move the axis to the start position· and 'zero counter', then move the axis to the end position (in this case 2 inches) and 'set stop'....this will give you the 'counts/inch' for that particular encoder.·

    As an example...my rotary encoder requires·1000 steps or counts to equal 1 inch.· I save this result and go back to the previous menu to set additional (yza) calibrations.·

    I use all Jenis glass scales on my mill.· The counts/inch are·already known·and the same for each scale.· Since I know what it is ahead of time (info from the vendor)·all I need to do is go to 'edit counts/inch',·enter 5080 and save.· Once you have saved counts/inch, the program automatically calculates #counts/mm.·

    I hope this answers you question

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
    640 x 480 - 76K
  • Richard S.Richard S. Posts: 70
    edited 2008-05-14 02:22
    Hello Marty

    Thanx for your comments.

    Response:

    1) 'zero scales' can be added to the 'readout screen'.· Most likely it would be 'zero abs + rel' encoders.··'Preset encoder' function can be added, too.··You still have to drill down through several levels to decide if it will be absolute or relative axis and·the axis to change

    2) 'axis setup' is already on the 'main menu'.· Are you suggesting consolidating every setup parameter under a 'general setup' heading?·

    3) 'special functions' can be moved to 'main menu'.· I haven't expanded this yet.·

    4) I have considered a help selection for each screen but not implemented yet.·

    5) I started out with ps/2 keyboard and menu choices·based on·a letter highlighted in a given selection line to be the keypress to activate ie 'display Readouts', 'Zero encoders', read or Save settings',·and etc.· Then I decided to use numbers to make it more universal.· Either method is easy to implement.· Currently I am playing with a ps/2 keypad and you are correct they are not cheap at about $15-20 each.· Generic keyboards are $10.·Going with a keyboard will allow for alphanumeric entry of comments to saved setup parameters under 'read or save settings' on the·'main menu'.

    I would like to know if you have tested out the program with an encoder yet??

    Regards...



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • LawsonLawson Posts: 870
    edited 2008-05-14 16:03
    Richard S. said...
    1) 'zero scales' can be added to the 'readout screen'. Most likely it would be 'zero abs + rel' encoders. 'Preset encoder' function can be added, too. You still have to drill down through several levels to decide if it will be absolute or relative axis and the axis to change.

    Sounds good. These are the functions I use most often on a DRO so instant access is a real plus.

    Richard S. said...

    2) 'axis setup' is already on the 'main menu'. Are you suggesting consolidating every setup parameter under a 'general setup' heading?

    Yep, that's the start of what I'm suggesting. Step two is to protect those setup options with a screen that forces the user to read it. Primarily I want to avoid having a user change setup settings by accident because they're diving through the menus without looking at the screen and they make a typo.
    Richard S. said...

    3) 'special functions' can be moved to 'main menu'. I haven't expanded this yet.

    Again this is me looking at this from "the good machinist but didn't write the code" point of view. These functions will be used fairly often but ONLY if the operator knows they exist. So this leads to wanting them in someplace visible, but as they are 'extra' they don't need to be constantly accessible.
    Richard S. said...

    4) I have considered a help selection for each screen but not implemented yet.

    Good to hear!
    Richard S. said...

    5) I started out with ps/2 keyboard and menu choices based on a letter highlighted in a given selection line to be the keypress to activate ie 'display Readouts', 'Zero encoders', read or Save settings', and etc. Then I decided to use numbers to make it more universal. Either method is easy to implement. Currently I am playing with a ps/2 keypad and you are correct they are not cheap at about $15-20 each. Generic keyboards are $10. Going with a keyboard will allow for alphanumeric entry of comments to saved setup parameters under 'read or save settings' on the 'main menu'.

    I would like to know if you have tested out the program with an encoder yet??



    Regards...

    Huh, you found a LOT better price for PS/2 Keypads than I did. I only searched google for a few minutes though [noparse]:)[/noparse] $15-20 is an entirely reasonable price to pay for the space savings.

    Haven't tried it out with an encoder yet. I do plan to test it, but it may take a few weeks for it to get to the top of my list. (fixing/cleaning the work areas are a back burner project, and the flaky old box does count and zero so it provides ~80% of it's functionality still)

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • Richard S.Richard S. Posts: 70
    edited 2008-05-16 02:49
    Hello Marty...

    I liked your ideas about quick menu choices from the "display screen".· So, the quick menu choices are:· 0-menu,. 1-zero (all encoders), and 2-set xyza (change value of encoders).· Note when editing an·axis value,·ie x axis, when edit is complete choose #8 to return to display screen.

    "special functions" are now #7 on the "main menu" but have not been expanded.·

    I am dragging my feet on help files.· Seems other encoder boxes do not have this function ... you refer to a manual.·

    Updated qdro is attached.·

    I guess I should figure out how to update prior posting of program?

    Regards...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • LawsonLawson Posts: 870
    edited 2008-05-16 18:10
    To go back and edit a post just click on the Pencil icon in the top right corner of the post. Everything is editable, including attachments.

    hop.gif usability enhancements! hop.gif
    I usually only zero one axis at a time... I could just preset the axis I want to 0 and it'd do the same thing too.

    I know other DRO boxes normally lack online help. They also normally lack a screen capable of displaying anything helpful anyway. I have seen online help on higher end CNC controls, especially ones with interactive programming. It'd still be an awful useful feature. Looks like menu choice "8" is still open on most screens. "Num Lock" "/" or "*" might be a better option for a help key. Right now all that's likely needed is to reserve a specific key for online help. The rest users or other programmers can fill in.

    Just loaded it up on a spare protoboard. Compiles and loads like clockwork. (just looking at the UI, no encoders hooked up yet.) Fully functional [noparse]:)[/noparse] One minor bug, when set to lathe mode, the "axis setup" menu still displays "X Y Z A" and not "X Z1 Z2 A" like it should. How about instead of "Mill" and "Lathe" axis labels, each axis (1-4) is given a display symbol that can be set at compile time or preferably at run time? (this could make Mill/Lathe special functions harder to implement though)

    A few of the menu's could benefit from re-sorting based on how likely each function is to be used. Counting keystrokes for specific tasks would also benefit the UI. I'll probably just do this myself after I get my setup running.

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • Dennis240Dennis240 Posts: 5
    edited 2009-05-10 19:47
    Very nice project!
    What is a max reliable number of encoder counts a second can the propeller count?

    Post Edited (Dennis240) : 5/10/2009 7:55:27 PM GMT
  • Richard S.Richard S. Posts: 70
    edited 2009-05-11 03:42
    Thanx Dennis...

    I don't know off hand the max count rate. Info might be available from the author of the object (Quadrature Encoder) Jeff Martin of Parallax.
    There have been other threads discussing max count rate, but I don't have those available.

    I was thnking of eliminating the fourth axis and replacing it with a rpm display.

    I have also patched in using chinese (caliper) scales instead of quadrature encoders...but still needs some polishing up.

    Glad you enjoyed the project. I am indebted to all the contributors of the included objects!!
    I should submit QDRO to the object exchange, just have to figure out how!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard in Michigan
  • marknmarkn Posts: 7
    edited 2012-10-10 07:53
    Hi Richard
    What an amazing tool you have provided for us. Thanks. Could I get a schematic of the connections to the Propeller chip.
    Mark
Sign In or Register to comment.