Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Motor and camera pwms (http://www.chiefdelphi.com/forums/showthread.php?t=54545)

Tz0m 19-02-2007 13:05

Motor and camera pwms
 
Our motors are mapped to pwms 13, 14, 15, and 16. Our pan and tilt servos for the camera are mapped to pwms 1, and 2. For some reason, when we upload the camera code with Default_Routine();, appearing in user_routines.c, commented out, the camera works fine but we are not able to drive the robot and get no output from our joysticks. With Default_Routine(); uncommented, the camera does not work but we are able to drive the robot and get output from the joystick. A few times our joystick wound up controlling the camera's servos, but I don't remember how we had our code setup that time. Any help is greatly appreciated.

Alan Anderson 19-02-2007 13:32

Re: Motor and camera pwms
 
Read Default_Routine() and look at what it does. You'll have to modify it to avoid messing with the pwm outputs the camera tracking code is using. The easiest way to do that in your specific case is probably to comment out the two lines that set pwm01 and pwm02.

Tz0m 19-02-2007 16:51

Re: Motor and camera pwms
 
Thank you, this fixed our problem. However, we have the trigger on the joystick set to initiate autonomous mode, just for testing. When we press the trigger, though, the camera resets to the default position and then retracks the target.

Alan Anderson 19-02-2007 22:39

Re: Motor and camera pwms
 
Notice how User_Autonomous_Code() sets all the pwm outputs to 127 when it starts, including pwm01 and pwm02? You'll have to fix that if you want it not to interfere with the camera servos.

Tz0m 20-02-2007 12:48

Re: Motor and camera pwms
 
Thank you, this fixed our problem.


All times are GMT -5. The time now is 04:49.

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