Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Twitchy Motors (http://www.chiefdelphi.com/forums/showthread.php?t=143663)

jfox100 15-02-2016 15:01

Re: Twitchy Motors
 
Quote:

Originally Posted by hwu24110 (Post 1539803)


I swapped out the battery cables for shorter ones and switched out the battery. I still experience twitching.

You can sometimes get twitchy motors when you have a poor ground on a PWM cable. Try swapping out PWM cables. This would also explain some of the noise you show on the graph.

nighterfighter 15-02-2016 16:49

Re: Twitchy Motors
 
First, sorry for leaving the myRobot object in there. I wrote the code at midnight, in Notepad.

Second, glad to hear you solved the problem. Kinda surprised it took all of us that long to figure it out, something as silly as a timeout.

Although I'm not sure why the motor would twitch with values of 0, even if the timeout was tripping like that.

philso 15-02-2016 21:44

Re: Twitchy Motors
 
Quote:

Originally Posted by hwu24110 (Post 1540662)
We found the solution. It was because we were missing motor.setExpiration(0.1)

Code:

    public Robot() {
        stickL = new Joystick(0);
        stickR = new Joystick(1);
        controller = new Joystick(2);
        LF = new Talon(0);
        RF = new Talon(3);
        LR = new Talon(1);
        RR = new Talon(4);
        LF.setExpiration(0.1);
        RF.setExpiration(0.1);
        LR.setExpiration(0.1);
        RR.setExpiration(0.1);


Just curious, what does "setExpiration" do? I am the electrical/systems guy so I rarely get to see the code even though I help troubleshoot it at the system level.

Mark McLeod 15-02-2016 22:21

Re: Twitchy Motors
 
It's for the Safety and sets the maximum period or window within which a motor Set for that particular motor must be received to avoid automatic shutdown of the PWM output.

It's essentially to avoid a runaway robot if the code locks up, or gets blocked by a debugging session, after sending a full speed ahead command.

G_rupp 16-02-2016 14:27

Re: Twitchy Motors
 
Quote:

Originally Posted by hwu24110 (Post 1540140)
I do not have any dead band. Earlier I tested it by setting the values to 0 and it still twitched, so i don't think it's the controllers.



I unplugged the controller so it wouldn't receive any input.

To help troubleshoot, the Log File viewer has different indicators for Events. In the 2 images of the Log File Viewer, there are a lot of yellow events displayed at the top of the window. Each of these is for an Event that occurred. If you float your mouse over any of the dots, it will show the message in the lower left window. If you click on the Event List, it will display all of the events that occurred. There may have been an error stating that the motor was not being updated in time.


All times are GMT -5. The time now is 22:38.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi