Parallax Position controller and HB25
dracus
Posts: 9
I am trying to build a robot, and I am using Parallax Position Controller 27906 and HB25. I am using a dspic and I have followed your intructions on the signal protocols. I have been able to transmit data correctly from the dspic to the position controller (I have a motor atteched to it), and it wroks fine. But I have some trouble with the Check For Arrival, Querry Position and Querry Speed commands. I am not able to read the responses. I am not sure if, for instance, the Check for arrival commands need something like a second or two to return a value of "FF". I have tryed changhing the tolerance, but still, it take a couple of seconds to come up with the "arrived" signal.
I have attached a diode and a 10K resistor to pull up the signal. I have a nice scope so I am able to see the signals but I can not tell among so many signals what is the response.
On the other hand, this morning the system stop working and I know is the position controller or the
HB25 because I measure the data signal from the scope and is OK. Is there a way to test which one it is???? I know the HB25 is tricky because sometimes it seems to get "stucked".
Another consideration I have is "real time". How long will it take to transfer the signals from the position controller to the micro??? If the CHKFA takes so long, It would affect dramatically the kind of project I am doing....
I know there are too many questions, but please, Help me out....
Regards----
Victor
I have attached a diode and a 10K resistor to pull up the signal. I have a nice scope so I am able to see the signals but I can not tell among so many signals what is the response.
On the other hand, this morning the system stop working and I know is the position controller or the
HB25 because I measure the data signal from the scope and is OK. Is there a way to test which one it is???? I know the HB25 is tricky because sometimes it seems to get "stucked".
Another consideration I have is "real time". How long will it take to transfer the signals from the position controller to the micro??? If the CHKFA takes so long, It would affect dramatically the kind of project I am doing....
I know there are too many questions, but please, Help me out....
Regards----
Victor
Comments
Can you post your code that you have for the UART functions on you dspic? That may help us figure out where the problem is.
Paul
Well, I am far from my office, but I can show the the code later. I just got a display that shows exactly what is in the port of the computer. I can see better the problem I have, and it can be resumed like this:
I get to transmit correctly to the position controller. It executes correctly the configuration commans: Set Orientation as Reversed, TxDelay, Set Speed Maximum , Set Speed Ramp Rate. It also Performs the action commands Travel Number of Positions and Clear Position. I get a bruhsless gearhed dc motor traveling the steps I command. However, I do not get any response from the querry commands Query Position, Query Speed, and Check for Arrival.
Since I am using a dspic, I have the following configuration:
Position Controller Data
|
|
5V
/\/\/\
|
I>I
Tx DSpic
10k | Diode 1N4004
|
Rx DSpic
I am using this configuration since the DSpic UART has a Tx and a Rx and in the position controller there is just the data line.
As a Result, I can read now in the display what is in the UART Rx, which are the commands I am sending... 38 A0 48 00 20 40 FF 28 20 00 22
STXD SSRR SMAX CLRP TRVL
But when I Send the command CHFA
19 05
CHFA
I am supposed to get the response... 00 or FF
And when I send the command QPOS
09
I dont get back any response, even though the motor is moving, and all of the Action and configuration commands do what they are asked to do....
I am using 19 and 09 for CHFA and QPOS since I have both jumpers of the position controller on.
My only worry is that I am sending 5 V to the parallax position controller (which come from the micro board), but actually the micro is working at 3.3 V. I tried to use 3.3V for the position controller, but it did not work at all.
Do I have to wait for some time for the ATiny on the posoition controller to reply??? From the position controller instructions: "The main microcontroller communicates easily with up to four Position Controllers over a single-wire TTLlevel UART bus".
I am just testing one position controller, but I dont seem to be getting anywhere....
Thanks so much for your help...