Shop OBEX P1 Docs P2 Docs Learn Events
DHB-10 Overload & Propeller Activity Board FDSerial Buffer Overwrite — Parallax Forums

DHB-10 Overload & Propeller Activity Board FDSerial Buffer Overwrite

Hello,

I am currently using the Parallax Arlo Complete Robotic System with a Propeller Activity Board connected to the DHB-10 Motor Controller. The robotic platform is used for autonomous person following. There is a computer connected to a camera, which does the image processing and sends the data to the micro-controller (Propeller Activity Board) which implements a control loop and finally issues commands to the motor controller (DHB-10). I am using the fdserial library to do serial-over-USB communication.

The control loops looks something like this:
while(True) {
 data = receiveDataFromImageProcessor() # (blocking: waits until data is ready) uses the fdSerial library to receive data on the serial port
 processedData = processData() # implement the control loop, do some calculations
 issueCommandToMotorController(processedData) # send the command to the DHB-10 motor controller to move the robot
}

The issue I am running into is that the robot stops responding to commands after some amount of time. I believe it is because I am overloading too many commands on the DHB-10 motor controller which just stops responding after a while. The rate at which data is received (speed at which image processor sends data) is about 3-4 samples/second. Apart from using a
pause()
command in the loop (which causes other problems with sampling, calculations in the control), is there anything else I can try? The minimum value of
pause()
is 100 milliseconds which is a long time. This creates further problems because since the loop isn't consuming data from the fdSerial buffer fast enough, the data from the image processor starts overwriting the fdSerial buffer queue and ruins the data, which leads to parsing of garbage values. I'm trying to find the best tradeoff while keeping the highest sampling rate from the image processor. Any help would be appreciated. Thanks!

Comments

  • Hello Shamak!

    Welcome to the forums.

    About your question, if you didn't already find a solution you might try calling Parallax technical support. They have access to the engineer that worked on the DHB10 code. You'll find tech supports contact details at the main Parallax.com website.

    If you don't mind, please post back here your solution. Might be useful for other new users too! It's an interesting issue for sure.
  • Hi VonSzarvas,

    Thanks for your reply. Do you have any idea how to disable the internal PD loop within the DHB-10 motor controller? I want to use it as an open-loop motor controller. Is that possible?
  • shamak wrote: »
    Hi VonSzarvas,

    Thanks for your reply. Do you have any idea how to disable the internal PD loop within the DHB-10 motor controller? I want to use it as an open-loop motor controller. Is that possible?

    Good news! There definitely is a command in the DHB10 API that runs the motors open-loop. Long long time since I used it, but you should find that documented in one of the downloads at the DHB10 product page

    If not, tech support will definitely be able to help you with that question if no-one else here has experience with that.
  • update: A quick look seems to show that "GO" works open-loop, whereas "GOSPD" is closed.

    for example, "GO 10 0" will move the left wheel, and "GO 0 10" the right wheel. "GO 0 0" will stop both!

    There might be something else you need before that... maybe RST.
    Have a play with Arlo up on blocks :)

    ... you could also check the source-code,- as that might have some notes at the top of the file to explain commands.

  • I took a look at the source code for the firmware for the command GO.
    Pub Go(LeftPower, RightPower)
    
      CheckHWVer
      if PDRunning < 1                                  ' Requires use of the PD controller
        return @MotorError                                 ' Abort if it isn't running
      case LeftPower
        -127..127:
        other:
          return @InvalidParameter      
      case RightPower
        -127..127:
        other:
          return @InvalidParameter      
      Mode := POWER
      SetPower[LEFT] := LeftPower * Motors#MAX_ON_TIME / 127' Then set the motors' powers
      SetPower[RIGHT] := RightPower * Motors#MAX_ON_TIME / 127
    

    Looks like it requires the use of the PD Controller. I was hoping I could disable this control.
  • Hmm. There was a direct drive command somewhere.
  • @shamak

    Had a moment to check the code.

    My understanding is that the use of PDRunning is as a safety flag. If the motors have an error or timeout (for example), then the firmware will prevent you moving.

    But once past that safety check, the GO command directly drives the motor by assigning the turn speed (SetPower). ie. GO ignores PID.

    This is different to other commands, such as GOSPD or TURN, which rely on feedback from the encoders to execute movement. ie. they pay attention to PID.

    Maybe you could test this by unplugging the encoders? I haven't checked all the code to see if that would stop the firmware running, but if GO can operate in that state, then you'll know for sure! Either way, Parallax Tech could confirm for sure on Tuesday about how to drive the motors without PID.

    hope you get it all going as you'd like.

Sign In or Register to comment.