Shop OBEX P1 Docs P2 Docs Learn Events
Stamp Keypad and Registers — Parallax Forums

Stamp Keypad and Registers

WhaleWhale Posts: 5
edited 2005-01-19 11:44 in BASIC Stamp
·I have an application where I want drive a stepper motor to advance a roller to move lengths of material. The distance is not fixed so needs to be programmable from a keypad. I want to use the steps of the stepper motor and the gearing to be able to move the material a predetermined distance.
······The lengths will be repeated so the values should be stored in a register so they can be recalled in the future if that length needs to used again.
······I would also like the steps that the stepper motor is taking to be visible on a readout.
The readout should display the present value being used as well as the register #. (ie - if we are using 20 programmable registers to store the values in, each register should be assigned a number so when these values are displayed that I can tell which register is in use. This number I would like to have displayed on a large 1" 2 digit 7 segment LED display)

Any help anyone can give me on this application would be most appreciated.

Comments

  • kelvin jameskelvin james Posts: 531
    edited 2005-01-07 18:56
    I have made a system that is close to what you describe. It is a stand-alone keypad input programmable motor controller with a lcd readout. I use a bs24p as the main controller for the components involved. Quite a bit of code required, but it is very doable. A motor controller/encoder and a keypad encoder are necessary to take some tasks away from the stamp. If you could provide some detail on the design as to what size, load and accuracy involved, i could give you a better idea on what you may or may not require. I don't have any background with led displays, but many people here do.

    kelvin
  • WhaleWhale Posts: 5
    edited 2005-01-10 05:42
    The stepper motor I have is 130 in/ oz and I have a stepper motor driver (Zhong Zhi Mechantronics Co Mod # BAL-35) so the only thing the stamp would have to provide is the direction ( +5 vdc) and step pulses.

    I am planning to use a 5:1 reduction belt drive to drive a 1.5" roller that is going to drive the·angle iron·I want to measure. I think that I should be able to attain about a .010" accuracy ( 1 step).

    Can the acceleration of the stepper be controlled so the roller doesn't slip on start up or shutdown?

    Should I use a separate encoder to monitor the material travel so I don't have to rely on the stepper for accuracy or is that over kill?

    I think for ease of use that there should be external control switches to initiate the stepper and also a jog feature to allow the iron to be moved manually up to the cutter.

    A future option that would be useful is to have a control relay that will initiate the cutter after a short delay ( also programmable) so this whole operation can be automated when all the bugs get worked out.

    Wade
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-10 16:06
    Whale said...
    A future option that would be useful is to have a control relay that will initiate the cutter after a short delay ( also programmable) so this whole operation can be automated when all the bugs get worked out.

    I don't know how big / strong the cutter is, but if you implement automatic cutting make sure you also implement good safety interlocks as well. I'm not experienced in industrial automation, but I'm sure others are and can offer suggestions. However, I'd see a requirement for either a complete hood with safety interlocks, or a two handed deadman switchs so that the cutter can not operate unless the operators hands are well away from it.

    Jim
  • WhaleWhale Posts: 5
    edited 2005-01-11 05:14
    The unit that I am using to cut the metal is called an Ironworker. It is basically a hydraulic shear and is very powerful ( 60 ton ram) and safety is of the main concern.
    I am an industrial maintence electrician so I have worked on and designed automated equipment but not using a stamp to control the operation.
    Good idea with the double pushbuttons to get the operators hands out of the way· before the cut is made.
    Thanks,
    Wade
  • kelvin jameskelvin james Posts: 531
    edited 2005-01-11 07:49
    Howdy Wade Sorry to rain on on your parade here, but i will be completely honest, your design will not work. It is impossible to achieve a .010 accuracy using a belt drive, driving a roller with an open loop system. Just the play in the belt alone could throw the positioning off by a half-inch, slippage of the roller against the metal maybe 1 inch, and if the motor stalls for a few steps by over-torque, well, you can see what i mean. All cnc machines have precise direct gearing moving a positioning table, which the part is clamped to to prevent any movement of the part during the machining process. Even play in standard gearing can cause a loss in accuracy, that's why most of them use a ball and screw to position the table. They also use a closed-loop position feedback by means of an encoder back to the controller. If you had the proper mechanical and electronic design, then yes, you could use a stamp to control it. You could also go with a PID based DC motor servo setup, that would eliminate the redundancy of using an encoder with a stepper motor, and would probably be less expensive overall. You may want to consider doing a search for a used cnc one axis feed table, or something along those lines, that you could implement into your project. I realize what you are trying to accomplish with what you have to work with, and i am just giving a heads up to what you are getting yourself into. Automating the positioning of a large and heavy piece of metal is not an easy thing to accomplish. kelvin
  • John BondJohn Bond Posts: 369
    edited 2005-01-11 09:13
    Hi Kelvin and Whale

    1. Timing belts can do 2mm (better than 1/10 Inch). There is a good but expensive US supplier called
    Special Drive Products http://www.sdp-si.com/ which I am sure many of your machine builders
    use. They also supply an amazing set of catalogues (a must-have for builders of small machines)
    2 I thought one chose stepper motors as follows - Calculate required torque, multiply this by a service
    factor, multiply this by a safety factor, choose the next size up of stepper motor. No chance
    of slip if your calculations are right (There are some big stepper motors available).

    Kelvin, I agree that a rethink on any project is usually time well spent and there are often many
    solutions to any engineering problem. I have found that the trick is choosing the one which best fits
    you, the developer.

    There is an old saying "Anything in life that is truly worth doing seems at first impossible".

    Good luck Whale.

    Kind Regards from Kwa Dukuza

    John Bond
  • kelvin jameskelvin james Posts: 531
    edited 2005-01-11 19:07
    For another possibility to use your existing idea, use could try using an encoder to track the position of the actual piece being cut, similar to the way a digital linear measuring gauge works. You would just attatch a wheel to encoder which is in contact with the steel being driven forward by your roller setup.That way, you would not have to rely on the motor and gearing for postioning.
    It would take some careful planning and trial/error to get it operating properly. Operation would be pretty simple, once you manually postion the piece at the exact measurement you want, you just store the encoder value to memory in the stamp, to be recalled for the next time it is required. After the first piece is cut, then the encoder would be reset to zero, ready for the next to be positioned. Also, you should look into a motor controller that has an encoder input built into it, easy to set up and interface with the stamp.They also have a ramping feature, which accelerates/deaccelerates the motor from the maximum speed, saving wear and reducing any frictional slippage. Solutions-cubed sells a couple of them and they are fairly inexpensive. I am pretty sure the motor driver you have there is the kind typically connected to a pc running nc control software. The stamp would then be only working as a controller to read your keypad input and to send out serial commands to the motor controller, as to move to a certain position. This would probably be the least expensive way to get it working.

    kelvin
  • WhaleWhale Posts: 5
    edited 2005-01-17 15:05
    I guess I missed the part about using a geared timing belt, a 5:1 reduction on a 1.5" roller. The roller will have a spring loaded pressure wheel to force the material travelling over the roller to have better traction. If slippage is a real problem, then maybe 2 drive rollers may be the answer. It is going to take a certain amount of trial and error to find what will work best.

    If you go through the math on this setup, the circumference of the 1.5" roller is 4.713" / 5(:1) = .942" per revolution of the stepper motor. 0.942 / 200 (steps) = .0047" per step. This what I figured my accuracy with. The cuts do not have to be exactly repeatable·so 1 to 2 mm accuracy is fine.

    I was also concerned with being able to control the acceleration/ deceleration rate of the stepper to prevent slipping of the roller ( also the reason for the spring loaded pressure wheel).

    To make this a more reliable·machine, a feedback encoder of some kind would be required.

    My biggest concern is if there is someone who could help me with designing the code for the stamp. I have really very little programming exerience in this kind of programming.

    Wade
  • Don BuczynskiDon Buczynski Posts: 31
    edited 2005-01-17 16:05
    Whale said...
    Can the acceleration of the stepper be controlled so the roller doesn't slip on start up or shutdown?
    Here is·a·technique for controlling the acceleration/deceleration of the stepper motor.


    '--------------------------------------------------------------------------
    ' BS2 pins connected to external stepper chip 
    StepPin         PIN     6               ' Stepper chip step input
    StepDir         PIN     7               ' Stepper chip step direction
     
    '--------------------------------------------------------------------------
    ' Program working variables 
    MoveSteps       VAR     WORD            ' Steps to move motor
    StepDelay       VAR     BYTE            ' Delay between steps
    StepRamp        VAR     BYTE            ' Ramp up/down point
    StepMin         CON     10              ' Minimum step delay
    StepMax         CON     40              ' Maximum step delay
    
    TestLoop:
      MoveSteps = 100                       ' Set 100 step move
      HIGH StepDir                          ' Set step direction CW
      GOSUB DoSteps                         ' Step the motor
      MoveSteps = 100                       ' Set 100 step move
      LOW StepDir                           ' Set step direction CCW
      GOSUB DoSteps                         ' Step the motor
      GOTO TestLoop
     
    '--------------------------------------------------------------------------
    ' The variable MoveSteps contains the step count. The variables StepDelay, 
    ' StepRamp, StepMin, and StepMax are used to effect the delay between each 
    ' step pulse (StepDelay). Stepping begins using StepMax (slowest motor 
    ' rotation) and gradually decrease to StepMin (fastest motor rotation). 
    ' StepRamp is used to know when to start slowing down. When the remaining
    ' steps to move is <= StepRamp, the delay period will begin increasing
    ' toward the StepMax value. 
    
     
    DoSteps:
      StepRamp = 0                          ' Initialize the speed ramp
      StepDelay = StepMax                   ' Set the slowest motor speed
      DO WHILE (MoveSteps > 0)
         HIGH StepPin                       ' Pulse the step pin
         LOW StepPin
         MoveSteps = MoveSteps - 1          ' Decrement MoveSteps value
         PAUSE StepDelay
         IF MoveSteps <= StepRamp THEN
            StepDelay = StepDelay + 1       ' Increase delay
         ELSEIF StepDelay > StepMin THEN
            StepDelay = StepDelay - 1       ' Decrease delay
            StepRamp = StepRamp + 1         ' Increment slowdown point
         ENDIF
      LOOP
      RETURN
     
    



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don Buczynski

    http://www.buczynski.com
  • WhaleWhale Posts: 5
    edited 2005-01-19 11:44
    Hi Don,
    Thank you very much for the acceleration code. It is most appreciated.

    Wade
Sign In or Register to comment.