Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - How can you make this program teacheable?

(you are viewing a thread; or go back to list of threads)

How can you make this program teacheable? (by Samukelo Shezi)
Hi Ldmicro community, and special greetings to Jonathan!

Can anyone please tell me how would you put a few extras on this simple program to get the motor "teacheable". When I say teacheable, I mean in terms of the postion and direction. Let's create a scenario: Let's say I want to teach the motor to travel to position 1000 (Lets just keep it at the normal 0 to 1023 for simplicity sake) and then immediately change direction to postion 500, then to 700, and then back to 0. Remember, I should be able to change this without modifying the program. The program must just have a teach mode. Please, try to add on to what I have attached. Unless you feel its crap! Lol! I just need this for my own education, hope you guys don't mind and will enjoy the chalenge. Thanks, God bless this community!
Sat May 22 2010, 11:39:03, download attachment TEACH_EXAMPLE.ld
(no subject) (by Samukelo Shezi)
Hi Jonathan

I hope you don't mind if I refer this one above to you. I should also have considered the issue of time intervals between direction change. I did not bother with the motor motor start stop logic. I just need advice as to how can I make my little program "teacheable". If you have a few minutes to spare, please!

Thank you in-advance

Regards
Samukelo
Thu May 27 2010, 22:36:09
(no subject) (by Jonathan Westhues)
Usually, "teach mode" means that the operator moves the machine through a set of positions by hand. Then afterward, the machine will run through that same set of positions automatically, under power.

The first question is how to sense the position of the shaft, to determine what position the user is teaching. A simple way to do that might be a quadrature rotary encoder; for reference, I've attached a program (that I believe that I've posted before) that converts those quadrature signals to a signed count.

You could then record the position of the shaft using one or more variables, and write code to move the stepper to that position. This would all be relatively standard stuff; though awkward if you want many "taught" positions, since LDmicro does not support arrays.
Thu May 27 2010, 22:52:08, download attachment stepper-encoder.ld
(no subject) (by Samukelo Shezi)
Ok, thanks Jonathan!
Fri May 28 2010, 12:15:00
Would like to get started (by CharlesTorach)
Dear members am so much delighted with this sharing of the plc technology.Am an electrician who would like to get started.
To be sincere my knowledge stops in connecting contactors switches and relays. How would a person like me get started if he is to learn this modern technology?Please members HELP.
Mon Jun 14 2010, 06:50:01
(no subject) (by Samukelo Shezi)
Hi Charles

Ldmicro has a wonderful tutorial, but it's specifically for the compiler and assumes the user has the basic knowledge of ladder logic. Jonathan, the author, recommends www.plcs.net as a good site for a beginner. Hope you get helped. Good luck.
Mon Jun 14 2010, 08:21:10
(no subject) (by charles Torach)
Thanks alot for the quick response.I hope to get back to you guys later.However I have a friend who has designed an automatic standby generator system whereby when there is no nomal supplies it will be the duty of the chip to start the generator, to me it is quite interesting and encouraging if properly known.It really gave me some interest of learning.I will get to you guys later for more reharsals.But first let me check this web site.Good day.
Tue Jun 15 2010, 06:09:55
(no subject) (by Bozidar)
Hello!
I played little with PIC16F877 and encoder (2000 pulses per revolution) (LCD readout) (Cycle time 200nS).
Problem is that if You are using encoder with higher resolution it will not read properly it will not change the direction of counting up/down instead it will continue counting in the same direction and positioning will not work. I didn't try with different encoder.(with 100 pulses per revolution will probably work but You lose precision)
Best way is to make it programmable similar to counter than You can change reversing position.
Put LCD to read position and settings.
Wed Jun 16 2010, 07:44:04
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):