Shop OBEX P1 Docs P2 Docs Learn Events
Cruise control via Stamp or another circuit. — Parallax Forums

Cruise control via Stamp or another circuit.

SteveWoodroughSteveWoodrough Posts: 190
edited 2009-01-13 04:11 in BASIC Stamp
I am attempting to make a simple speed control for an RC truck chassis robot.· I am bench testing some simple code that sends a Pulseout command to a RC motor controller and follows up with a Count command to a QTI sensor.· Below is a condensed version of the code:

DO
····GOSUB ApplyPulseSpecial
··· GOSUB MotorControl
LOOP
'
[noparse][[/noparse] Sub Routines ]
ApplyPulseSpecial:
······· PULSOUT Motor,MotorPulse ' Apply the pulse.
······· COUNT QTI,18,QTIPulse '14 good with debug is the high limit with debug
····························· '20 is good w/o debug output
······· 'DEBUG DEC QTIPulse,"+++",DEC MotorPulse, CR
······· RETURN
MotorControl:
····· IF QTIPulse < 4 THEN
········· MotorPulse = MotorPulse+1 MAX 950
······· ELSEIF QTIPulse >·8 THEN
······· MotorPulse = MotorPulse-1
····· ENDIF
······ RETURN

The Count duration (18 in this case) requires CONSTANT tweaking as the code expands.·· I understand the limits of the Stamp processor so my question is this:

·Is there a simple circuit I can build (or buy)·that will do the PID speed managment for me and not take up code and processor time?·

The circuit input from the·STAMP would be either HIGH for Go or LOW for Stop.· The circuit would then send·a pulse to the motor speed controller (1.5ms +/-).· The·circuit would also monitor the pulses from an·input like a QTI sensor to provide speed feedback.··The circuit would then adjust the motor controller·output pulses if the feedback pulse rate did not match some predetermined rate.·

Seems to me there is some digital comparitor that would do this much more effectively than using code.

·Thanks for your help.
Steve Woodrough


·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-01-12 03:27
    Here is a link about how to use the PID with a BS2. It does take up most of the capabilities of the BS2 though...
  • SteveWoodroughSteveWoodrough Posts: 190
    edited 2009-01-13 03:41
    Thanks for the reference material.

    I may have answered my own question. Can I "turn over" all active servo commands from the BS2 to a Parallax Servo Controller (USB)? I ***_u_me that I can monitor my speed and object sensing, etc. with the BS2 and send updated commands to the Servo Controller on an as needed basis. Is there a functional difference between the USB and Serial versions aside from the connections and support software?
    Thank You...Steve
  • SRLMSRLM Posts: 5,045
    edited 2009-01-13 04:11
    I'd go with the USB version. It has all the capabilities of the serial, and the added feature of USB control. Personally, I don't see why the regular version would be used, except possibly it's smaller footprint.
Sign In or Register to comment.