Shop OBEX P1 Docs P2 Docs Learn Events
Managing TTL signals with BS2P — Parallax Forums

Managing TTL signals with BS2P

JaviJavi Posts: 8
edited 2004-12-09 07:22 in BASIC Stamp
Hello I´m working in a Project with DC motors and I need accurate control two DC motors. Looking in the Parallax DC motor control web i found Solutions cubed, Now I´m runing MMC from solutions cubed buyed at parallax, it´s working fine, but i need to make a closed loop to accurate control the speed of the dc motors and the position, to make a PID.


My question is : it´s possible to conect a Solutions Cubed quadrature encoder, supply a TTL square wave, it generate 200 pulses per motor revolution do you thinks the BS2p is capable and enough faster to read two encoders ???? Considering dc motor speed about 4000 to 6000Rpm thats generate 80.000 to 120.000 Pulses minute aprox 1300 Pulses second. And get time to do another calculation?

Any ideas or comments will be apreciated

thanks in advance

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-30 16:20
    The BS2 is a single-tasking processor. This means it can't read every pulse from the encoder, or it will be doing nothing but reading pulses.

    What it can do is read a 'sample' pulse from the encoder using PULSIN. From the sample, it can decide (using a PID algorithm) to send a command to the MMC to speed up or slow down the motor.

    A quadrature encoder sounds like overkill in this instance (you'll get more pulses than you need) -- but looking at the Solutions-cubed website, it is what they use on their PID controller. Of course, they probably use PIC assembly for their control, not PBasic.
  • JaviJavi Posts: 8
    edited 2004-11-30 19:40
    Yes in Fact BS it´s not a multitasking processor i keep i mind, I only thinking on the possibility read pulses from encoder and then do another, for example run motor N turns counting Pulses or Make a Pid Filter to get both motors at same speed. Solutions cubed manages de Micro PID with BS2 look at the App notes.
  • JaviJavi Posts: 8
    edited 2004-12-08 10:23
    Please can anyone help me how to connect the encoder to a Bs2P here is the datasheet

    http://www.solutions-cubed.com/solutions cubed/Products Page/Downloads/ENC1_DS_1.pdf


    It´s possible to polll the input line, or another idea is the useo of the PWMPAL did they owrk???


    Please make your suggestiosn any hel will be appreciated

    thanks.
  • kelvin jameskelvin james Posts: 531
    edited 2004-12-09 07:22
    I think what you are trying to accomplish with the stamp and mmc is probably not attainable.
    One, the stamp being single tasked and two, the pulses counted will be too large for the limitations of the stamp. I personally have gone to motor controllers that do all the speed and position calculations by themselves, and get the stamp to read that data for program input. That way the stamp is free to run the motor controller through serial commands of what you want it to do, rather than being tied up trying to figure out what the motor/encoder is doing. Possibly the UPID that solutions cubed sells would be a better go, it does all the speed, ramping and positional stuff by itself ( has a positional counter that goes to the billions ) and the encoder feeds it. And they have user software that you can make your own custom adjusments for pwm, etc., that makes it easier for program code. And if you want to control 2 motors, then you will have to double that, as i think that board will only handle one motor.
    I am by no means an expert on basic component building for motor controllers, so maybe someone else here could shed some light on that, as far as making your own, if it is possible.
    Just my opinion here, think it will save you a lot of grief and wasted time. Possibly someone else has an easier solution.

    kelvin
Sign In or Register to comment.