Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Motors and the High Port Numbers (http://www.chiefdelphi.com/forums/showthread.php?t=43321)

Rick TYler 04-02-2006 18:34

Motors and the High Port Numbers
 
Has anyone ever had joy using PWM13-PWM16 for motor controllers?

Gdeaver 04-02-2006 18:39

Re: Motors and the High Port Numbers
 
I believe these are slow refreshed PWM outputs. Also they can glitch if there are conflicts with the interrupts.

lemoneasy 04-02-2006 18:42

Re: Motors and the High Port Numbers
 
We are currently using them as our motor controls, we are having a problem right now if we start the bot with camera off it turns in circles :(. While it tracks it kind of twitches, is that what you mean by the glitch if it conflicts with the interrupts Gdeaver? If so, you just made my day, couldn't find the twitch anywhere in the camera or tracking code.

Eldarion 04-02-2006 18:45

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by Gdeaver
I believe these are slow refreshed PWM outputs. Also they can glitch if there are conflicts with the interrupts.

Actually, they are the fast (7ms update possible, vs. 26.6ms update) PWM outputs, but they require a call to
Generate_PWMs(pwm13, pwm14, pwm15, pwm16); every time you want them updated.

They can glitch with interrupts, but I have never seen this happen personally. :)

lemoneasy 04-02-2006 18:50

Re: Motors and the High Port Numbers
 
I will try commenting out sections of the interupt code on monday, to see if I can locate the glitch, I'm also wondering if theres any chance of a conflict between cmuCam2's TTL input interfering with high port numbers for motors? We are generating the pwms each run through the code as you have written above, and it seems are problem with a slight twich is associated with the camera tracking or initializing, but I have yet to pinpoint what in it, and it seems no one else has had this problem yet...

JBotAlan 04-02-2006 18:52

Re: Motors and the High Port Numbers
 
I have seen a similar issue with the servos on the camera. I had them connected to PWM 1 and 2, and when I accidentally discharged static to the chassis of the robot, or connected the serial cable to the program port, the servos would twitch, big time. This doesn't prove to be an issue with the tracking code, though. I have never connected anything to 13-16, though. I use 16 to power the camera. That's probably all it's good for... :)

I remember reading somewhere that the new master code cures a twitch, but I don't know if it's the 13-16 issue, and I haven't upgraded, so I don't know.

Good luck,
JBotAlan

Rick TYler 04-02-2006 18:53

Re: Motors and the High Port Numbers
 
Our lead programmer wrote his own PID code. In testing, nothing worked right using the high PWM ports. He used Generate_Pwms, too. When we moved the control to PWM 3 & 4, it started working. No worries, it only cost us a day...

Gdeaver 04-02-2006 19:20

Re: Motors and the High Port Numbers
 
Check me but the lower PWM ports are controlled by the master proc. the high ones are software generated by the user proc. Interrupts are almost guaranteed to affect the upper PWM ports.

Jared Russell 04-02-2006 19:38

Re: Motors and the High Port Numbers
 
We've had some wacky stuff happen on ports 13-16. I would recommend forgoing them altogether.

Rick TYler 04-02-2006 19:41

Re: Motors and the High Port Numbers
 
So, if we are using encoders, which use interrupts, to control speed on the four high PWM ports, which are interrupt-sensitive, we aren't just shooting ourselves in the foot, but actually firing an M16 on full auto directly into our arch, right?

Kevin Watson 04-02-2006 19:59

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by lemoneasy
I will try commenting out sections of the interupt code on monday, to see if I can locate the glitch, I'm also wondering if theres any chance of a conflict between cmuCam2's TTL input interfering with high port numbers for motors? We are generating the pwms each run through the code as you have written above, and it seems are problem with a slight twich is associated with the camera tracking or initializing, but I have yet to pinpoint what in it, and it seems no one else has had this problem yet...

This is documented in the CMUcam2 FAQ: http://kevin.org/frc/camera.

-Kevin

Mark McLeod 04-02-2006 21:22

Re: Motors and the High Port Numbers
 
Just say no to PWMS 13-16.
Never used them, never will.
They seemed like a good idea at the time...
:rolleyes:

Alan Anderson 04-02-2006 21:38

Re: Motors and the High Port Numbers
 
We've been using pwm16...

...for camera power. :p

Mark McLeod 04-02-2006 21:39

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by Alan Anderson
We've been using pwm16...

...for camera power. :p

Guilty:o

Rick TYler 04-02-2006 21:43

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by Alan Anderson
We've been using pwm16...

...for camera power. :p

I've been reading that the camera is intended to run off the backup battery. Do the PWM ports provide the right voltage for the, you know, camera?


All times are GMT -5. The time now is 02:13.

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