Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic Based Servo Controller and Free Control Software!

Status
Not open for further replies.
Thanks thats the way I had it initially. It's still not working. Is there anyway I can test to see what's going on?

I have a logic pulser - Are there any inputs on the PIC that I can pulse to get an output?
 
Last edited:
I have some pic code that will move a servo if you want to test that part. That at least will help you determine if the PIC is programming correctly, and the servos are getting power. Are you able to take the pic out to reprogram it? Also, make sure your power supply is at least 2 amps and about 9 volts or more.

Was the circuit working on the breadboard?
 
Hi and thank you. The code would be very useful. Its a 16f628A. I can sort out the necessary includes etc if you have written it for anyting else. I never built the SCC on bread board I went straigh to PCB. I used the LM1084 version of the board. I also put header pins in place of the D-Type. I drill everything through veroboard to ensure correct pin alignment but of course you cant do a d-type like that. That's why i was convinced it was something to do with the RS232 comms. Anyway the pic code would be a start to fault finding. Removing the PIC is no problem and I use the velleman programmer.

Many thanks.

Paul.
 
Last edited:
This is a link to code from another project I did recently with the 16f628a. This runs a single servo off of pin 10, which will be servo 5 position on Olly's board.

It is meant to decode an RC signal and move the servo accordingly. Without an RC signal, it will do nothing more than center the servo when powered up, but at least you will know that the power and servo control are working.

DIY project: Navlights Landing Gear 1.0-- Landing/Navigation Lights & servo retracts - RC Groups
 
Last edited:
Thanks. That seemed to work ok. - I just don't know what the problem is. Im sure it must be something to do with comms. Im going to check the PCB today and make sure everything is ok.

Thanks for your help so far.
 
Well I can find nothing wrong at all. I have no idea what's causing this. Would anyone like to take a look at the board if I mailed it to them?
 
post it here and I will try to help. It is hard to troubleshoot a board over the net. If the power to the servos and pic is working, and you have tested all of your leads with a multi-meter, and are sure that the max232 is connected correctly to the PIC, then my guess is you need to look at your connector to the computer. Make sure you are reading the pins correctly, and haven't reversed it. Do you have any other serial devices that you can try on that port?
 
Hi. The pic doesn't show it very well but thats just two rows of pcb headers on the board. I didn't have a pcb mount connector so I just used header pins. The pins are traced and just wired to the correct pins on the max232 (I Think).
 
Hi. The pic doesn't show it very well but thats just two rows of pcb headers on the board. I didn't have a pcb mount connector so I just used header pins. The pins are traced and just wired to the correct pins on the max232 (I Think).

I just don't see how you could salvage that one. You don't even have traces drawn to some of the required elements, but I guess you worked around it somehow.

If I were you, I would re-etch the board with the version that I posted. I have made 4 off of it, and I know it works. It also isolates the power to the Pic from the Servos, which is ideal to prevent brownouts.

https://www.electro-tech-online.com/attachments/sscboard600dpiupdated-jpg.37487/
 
Yes I think i'll make another attempt at it this week with your updated pcb layout. Out of interest what tracks are missing?
 
Two of them don't have any copper around them at all. Did you end up soldering a wire directly to the chip?

Can you post a pic of your completed board, top and bottom?

Also, I would buy a few PCB mount D-sub 9 pin connector. Digikey has them cheap.
 
Ssc

Help!
I had run the SSC several times but it show few problems:
-The servo only move within number 0 - 128 (in ssc)(more than 128 will be appear error: the servo twitch and move violently to one side)
-the servo only move 1 side (in my case left, how to get it to right? it should be 90 degree to left and 90 to right?)
(Is that SSC only support up to 90 travel degree?)

Any idea why this happen?
 
I finally got my SCC up and running with help from Olly. I too noticed that the SCC didn't allow full travel of the servo but as this was an exercise in servo control for me I decided to build my own board with just a pic and a few servo contectors on it. I use the board I built as a servo controller for my robot project. Olly's board acted as a great training aid for me in understanding pulses to the servo which is exactly what I needed it for. Sorry I can't help further with your problem but you can try emailing olly direct at HVLABS.
 
I think the standard servo range is 90 degrees, that's 45 to the left and 45 to the right of center, most servos will actually give a larger range than this but it's it's highly dependent on the exact servo. I don't know how your software works but it looks like you have your offset set up incorrectly. The value 0 should correspond to a pulse width output of 1ms and 255 should correspond to 2ms pulse width output. It sounds like yours is setup at 1.5 at 0 (which makes it not able to move in the one direction) and once the pulse gets too much past 2ms in width the servo starts glitching, so basically you're sending it an out of bounds pulse width. 127 should be center
 
Last edited:
Serial Servo Controller

Sceadwian, i think what u said maybe closest to my problem so i will try to change the offset value but i donno how....

Below is the ASM files i'm using and refered to, can you check the content and suggest me how to solve the error? i'm confused with the pwm signal calculation and the offset value setting. (anyone who know ASM please help...!)

P.S.
Right now my servo turn 45 degree to left(not center) at sync byte decimal 128, and turn to complete left at sync byte decimal 0. My servo will not move to center or right even at sync byte higher than 128(my servo can travel at 180 degree, 90 to left and 90 to right).

So i have some possible solution in mind :
1. Change the rotation resolution of my servo, maybe 180degree/128steps (since now i can only use sync byte between 0-128, not sure what happen to 128 above)
2. Change the offset value so i can put my center point at 64 sync byte, thus 0-64=left, 64-128=right, but i have to set 64 sync byte at my center...

anyone know how to check PWM signal using multimeter? i'm not sure if my pic generate correct PWM signal...
 

Attachments

  • SERVO8.ASM
    40.8 KB · Views: 449
Nope, I'm afraid I can't check your code, I don't program PICs.
Based on my experience programming AVR's though there's no reason you should settle for 128 steps, you should be able to get a minimum of 256 for the full servo range if not more easily. Instead of posting the ASM as a link try including it in code tags so that other users can view the code without having to download the file.
To use code tags you type the word code inside square brackets, past your text and then type the word /code inside square brackets, it's kind of like HTML markup. You have to use the code tags when posting something like that as the regular forum text doesn't preserve white spaces (tabs) and won't process any other possible markup references.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top