![]() |
Camera code completely turning off all PWM's
So, I went and downloaded Kevin Watson's "bells and whistles" version of the camera code. I made sure I got the most updated version.
I have not changed anything within the code besides changing the pwm's for the drive motors to 08 and 09 (because the camera utilizes 01 and 02 I believe). However, once uploading the code, absolutely none of our PWM's are receiving any output or input. The PWM lights are not showing on the operator controller and the terminal window says "searching...", but the pan/tilt servo motors will not move. I tried making revisions by adding pwm.h, but I realized that library should only affect PWM's 13-16. Any ideas? |
Re: Camera code completely turning off all PWM's
Make sure that you are actually getting to your default routine. In at least one version of Kevin's code it was commented out.
|
Re: Camera code completely turning off all PWM's
I've scanned through the code, it's the most recent on Kevin's website, and I haven't found any large sections of code commented out. Is anyone else experiencing this? I'm pretty sure that I haven't augmented anything that would completely disable the PWM outputs.
**Edit** Also, I did add in one line of code to power the camera. I'm pretty sure that this should be no problem. It's in the User_Initialization() under User_Routines.c, right after all of the pwm's and digital i/o's are set: digital_io_17 = 1; The camera is getting the green light and receiving data, but the servo's are not. Is it ok to set this variable to power the camera? |
Re: Camera code completely turning off all PWM's
Ok, my apologies for the series of stupid questions, but I think I'm making progress.
After tracking down a commented out Default_Routines(); and uncommenting it, I made a step forward. Now, when running, the Operator Interface LED's will light up when I move the joysticks accordingly. However, the camera servo motors (in addition to the drive motors) are still not responding at all. |
Re: Camera code completely turning off all PWM's
Quote:
If your servos and motor speed controllers are not responding, that sounds like the pwm outputs are disabled. What are the lights on the Victors doing? A steady yellow means the code is setting the outputs to neutral. A blinking yellow means the robot has been disabled and there is no pwm signal at all. |
Re: Camera code completely turning off all PWM's
I am changing the value of digital i/o pin 17, which is the only one designated as an output. I wasn't getting any power at all when I plugged the camera power into a PWM slot.
Also, when I move the joystick, the victors are still blinking and not receiving any setting at all. I'm trying to scan for anywhere where the PWM's might be disabled, but so far I haven't had any luck. |
Re: Camera code completely turning off all PWM's
Ryan,
Back up a bit. It sounds like you do not have a backup battery installed. Let's set the camera aside for a bit. Disconnect the camera and download and run the IFI default code. Do you have PWMs? Mike |
Re: Camera code completely turning off all PWM's
Yes, we initially took the default IRC code and uploaded it to the robot with no problem at all. The PWM's worked perfectly, but after uploading Kevin Watson's code we ran into a problem.
|
Re: Camera code completely turning off all PWM's
Quote:
Quote:
Quote:
And you didn't respond to Mike's important comment about having a backup battery connected. That's what supplies the 7.2 volt output which powers the servos. |
Re: Camera code completely turning off all PWM's
Ok, well as funny as it is, we found the problem.
Our PWM cords were totally fried >.< I replaced them and commented the Default_Routine() back in and it works like a charm. With that out of the way, hopefully 1820 will be a serious competitor during autonomous :) Oh, and I looked into the digital_io_17 declaration, and you were completely right. My apologies. We fixed our back-up battery connection and now the camera is powered from a PWM slot as expected. |
Re: Camera code completely turning off all PWM's
Hey Guys,
Thanks for the post, We are a rookie team from the UK and the "c" code has been driving me and my students mad. If we got the motors running on the default code then when we loaded the camera code with the same mods, it was dead. Then your post made me look at the default routine being remarked out. Ok so that got the pwm back on line, but now the camera was dead, remarked out the two lines calling pwm1 and pwm2 and hey presto the whole thing works. It seems so simple now but having spent all my life programming Basic - including my robonova1, "c" still kills my confidence. But less and less each day. This is the only site that has had any help whatsoever including first themselves. Keep up the good work guys. ForbinOne |
| All times are GMT -5. The time now is 21:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi