controlling ampflow motor controller with basic stamp?????
thefitz85
Posts: 16
i am currently working on my senior project (autonomous beverage delivery fridge). we seem to be having some issues programming the basic stamp to control the motor controller. power mosfets in motor controller are operated at 16khz pwm. the motor controller receives data in hex form (0 to 127 decimal). we have established communication between pc and motor controller amp, however we cannot seem to manipulate motor movement using commands from the basic stamp. any help would be greatly appreciated. thanks matthew fitzgerald Eastern Maine Community College
Comments
Description:
Send a speed of position value from 0 to 127 in the forward or reverse direction for a given
channel. In mixed mode, channel 1 value sets the common forward and reverse value for
both motors, while channel 2 sets the difference between motor 1 and motor 2 as required
for steering. In all other modes, channel 1 commands motor 1 and channel 2 commands
motor 2.
Syntax: !Mnn
Where M=
A: channel 1, forward direction
a: channel 1, reverse direction
B: channel 2, forward direction
b: channel 2, reverse direction
Where nn= Speed or position value in 2 Hexadecimal digits from 00 to 7F
Examples:
!B7F channel 2, 100% forward
!a3F channel 1, 50% reverse
we can get the motors turning using the windows hyper terminal. . . .but in order to send these values from the basic stamp do we use serin and serout, and if so can we just assign those to a pin address.
we also think that we may have an issue with communication between the motor controller and the basic stamp (motor controller config as follows: 9600 bits/s, 7-bit data, 1 Start bit, 1 Stop bit, Even Parity) we must match those values with the basic stamp correct?
again thanks for your help. we have had this project basically dropped in our laps with only a few weeks left in our program, but of course it is a prerequisite for graduation. any help is good help as we are really struggling through the baby steps. matthew fitzgerald
As Mike mentioned, we'll be able to help much more with a schematic and the program you're actually running.
For any serial communication to work, the parameters must be the same on both ends. The Stamps have varying capability at high comm speeds, depending on your program and the model of Stamp. For what its worth, I typically use 2400, 8, N, 1 and 4800, 8, N, 1 on the BS2 and up to 9600, 8,N,1 on the BS2sx and BS2px.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
matthew fitzgerald
From page 419 in the Stamp Basic Manual: 9600 Baud, 7-bit even parity, true logic should be 8276 and inverted logic should be 24660. Try that.