|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
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? Last edited by Horohoroboarder : 02-02-2007 at 15:54. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||||
|
|||||
|
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. |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
||||
|
||||
|
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 |
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
|||||
|
|||||
|
Re: Camera code completely turning off all PWM's
No, you're not. You're setting Digital I/O pin 17 to be an input. But let's ignore that for now, as it still has absolutely nothing to do with powering the camera.
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. Last edited by Alan Anderson : 02-02-2007 at 18:01. |
|
#10
|
|||
|
|||
|
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. Last edited by Horohoroboarder : 02-02-2007 at 18:15. |
|
#11
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Camera for turning | DustinB_3 | Programming | 18 | 17-02-2007 21:00 |
| Does the camera code suits to all versions of MPLAB and C18? | razer | Programming | 3 | 04-01-2007 14:50 |
| Turning motors on and off in the KitGearbox? | Andrew Blair | Kit & Additional Hardware | 4 | 31-12-2005 10:33 |
| Slowing down Camera drive turning | Zalumaskov | Programming | 1 | 27-02-2005 10:11 |
| Victor turning off | zeep25 | Electrical | 10 | 23-02-2004 18:35 |