BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Sun Nov 19, 2017 11:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Roboclaw enters runaway state after ~5 minutes of operation
PostPosted: Sat Apr 19, 2014 4:17 pm 
Offline
New User

Joined: Sat Apr 19, 2014 3:57 pm
Posts: 2
I am using a Roboclaw v3 firmware version v3.0.3 - It is either 15A or 30A.

I am controlling using Advanced Serial Packet mode using an Arduino Mega.

I am building an animatronic for a theme park - shipping is very soon however and the animatronic keeps entering a run away state. It runs as expected for a few minutes then suddenly the motor speed runs up to full and we have to yank the plug.

I have reduced it to a basic routine that switches back and forth every couple of seconds as follows - this too fails after five or so minutes...

We have tested the encoder and it appears ok on the oscilloscope - is there any other possibilities?

Code:

// Pins for Roboclaw
#define ROBOCLAW_A_PIN 52
#define ROBOCLAW_B_PIN 46

//Roboclaw Address
#define ROBOCLAW_ADDRESS 0x80
// Roboclaw timeout for comms in microseconds
#define ROBOCLAW_TIMEOUT_MICROSECONDS 10000
//Velocity PID coefficients - Do not change!
#define ROBOCLAW_P 1.0
#define ROBOCLAW_I 0.5
#define ROBOCLAW_D 0.25
#define ROBOCLAW_QPPS 44000


boolean dirn = false;

boolean atTarget() {
    uint8_t depth1, depth2;
    roboclaw.ReadBuffers(ROBOCLAW_ADDRESS, depth1, depth2);
    return depth2 == 128;
}

setSpeedDistance(float spd, float dist) {
    roboclaw.SpeedDistanceM2(ROBOCLAW_ADDRESS, spd * M5_STEPS_PER_REV, dist * M5_STEPS_PER_REV, 1);
}


void setup() {
  roboclaw.begin(38400);
  //Set PID Coefficients
  roboclaw.SetM1VelocityPID(ROBOCLAW_ADDRESS, ROBOCLAW_D, ROBOCLAW_P, ROBOCLAW_I, ROBOCLAW_QPPS);
  roboclaw.SetM2VelocityPID(ROBOCLAW_ADDRESS, ROBOCLAW_D, ROBOCLAW_P, ROBOCLAW_I, ROBOCLAW_QPPS);

}


void loop() {

 if (atTarget(motor)) {
    delay(1000);
    dirn = !dirn;
    if (dirn) {
      setSpeedDistance(motor, 1.0, 1.0);
    } else {
      setSpeedDistance(motor, -1.0, 1.0);
    }
  }

}




Top
 Profile  
 
 Post subject: Re: Roboclaw enters runaway state after ~5 minutes of operat
PostPosted: Sat Apr 19, 2014 6:22 pm 
Offline
New User

Joined: Sat Apr 19, 2014 3:57 pm
Posts: 2
I have also noticed that it tends to trigger when switching on nearby equipment or opening the Serial diagnostics terminal which makes me think it is a noise thing.

I have put 10k pullup resistors on the Rx and Tx lines but no change.

I have also tried running powered from the Arduino board rather from the B.E.C but that didn't work either.

The cables betwen the Arduino and the Roboclaw are not shielded or twisted pairs but they are only ~10cm long ...


Top
 Profile  
 
 Post subject: Re: Roboclaw enters runaway state after ~5 minutes of operat
PostPosted: Thu Apr 24, 2014 5:11 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
I would recommend sending it in to be updated to 4+ firmware. That may fix whatever is happening but it would also add firmware update support to the board so we could try different things if the problem still happens after the update.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO