View Full Version : Discussion 12F675 DIGITAL SERVO [sortof]
xtal
Feb 06, 2006, 08:16 PM
Has anybody built a digital servo using a 12f675 for the controller
to drive an hbridge and measuring the feedback pot with adc ...
I would like to build a large servo to steer a lawnmower...
I have an analog circuit using a 2611 driving the hbridge...but preferr
to use a pic driving opto-isolators...and use adc for feedback....I don't want to reinvent the wheel if this has already been done....
xtal
Feb 08, 2006, 08:02 AM
found some interesting links...............
http://www.openservo.com/
http://www.colinmackenzie.net/servo-docs.zip
http://www.openservo.com/viewcvs/viewcvs.cgi/superservo/
weazuul
Feb 08, 2006, 05:38 PM
Really nice that OpenServo site. Ty
xtal
Feb 11, 2006, 08:22 AM
Tried to make these eaiser to work with....for those interested
xtal
Feb 15, 2006, 07:47 AM
Found AN531 app note @ microchip.com [based on 16c56] which might be convertable to 12f675 or 12f683.................
xtal
Feb 22, 2006, 07:40 PM
I have started converting an531 to work on 12f675...but have encountered
problem using pin change interrupt...I want to use GP3 for servo input
I can't get the int to work.......
has anybody used pin-change int on the 12f675....I'd appreciate a code snippit if available....
JimDrew
Feb 23, 2006, 10:09 AM
Did you turn off the MCLR function in the CONFIG BITS? If not, the port will not generate the interrupt.
Bob Blackburn
Feb 23, 2006, 01:06 PM
I use int on change on gpio3 on a 12f675 to decode ppm
org 0004h
; Save the state (see page 64 of PIC12F675 data)
movwf w_save ; Save W register
swapf STATUS,W ; Save status (don't touch flags)
bcf STATUS,RP0 ; Back to bank 0
movwf status_save
; Interupt routine
; Find out why we are here
banksel GPIO
btfsc INTCON,GPIF ;is it a change of gpio?
call input_changed ;yes
btfsc INTCON,T0IF ;was it tmr0
call end_of_frame
; All done, restore status
swapf status_save,w
movwf STATUS
swapf w_save,f
swapf w_save,w
retfie
Don't forget to clear the INTCON,GPIF flag before leaving int routine or the int will be called again immediately!
The relevant int on change flag must be set to allow gpio3 to cause an int.
xtal
Feb 23, 2006, 05:36 PM
Thx for the replies....
I got the PIN change interrupt working ...I must of had a short between the
keyboard and floor....... :eek:
I got the rough copy of code working with the simulator ,,but have no idea how it will act..connected to h-bridge and feed back pot......
Has any body used stimulus data for the analog stuff .. I haven't a clue
how to set it up....
weazuul
Feb 26, 2006, 11:01 AM
have you done your code in asm or c? i work on something similar(bec) but insted of current measurement there could be a pot placed on that pin.
now the second thing is that interrupt on change on pic 12F6xx doesnt work that well (there is a section in the datasheet about interrupt occurance when a pin is being written in the read-modify-write cycle will not trigger the interrupt) and you might need either do a workarround this with a little code like use a bit variable were you can store the last direction of the monitored pin and if it does coincide with the pins direction now(when you are in the interrupt routine) the you missed an interrupt somewhere inbetween, or do the whole routine in software with polling and dont use the interrupts.
hope this helps a bit
xtal
Mar 01, 2006, 07:16 PM
HERE ARE 2 NON WORKING ATTEMPTS OF PORTING AN531
16CSERVO40 USING POLL DRIVEN ADC [ I DON'T BELIEVE ADC IS WORKING PROPERLY]
16CSERVO45 USING INT DRIVEN ADC [ I DON'T BELIEVE ADC IS WORKING PROPERLY]
BOTH ACT THE SAME... I APPEAR TO BE DECODING ONLY 1 DIRECTION
(IN REAL TESTING )
WHEN ADJUSTING THE BREADBOARD POT THE CCP PIN5 APPEARS TO BREAK INTO
OSCILLATION...[I'M USING 12F675 UNTIL MY 12F683 ARRIVE]
BOTTOM LINE I'M NOT USING PIN 5 ....
USING GP0=PIN7=AN0=POT
GP1=PIN6=AN1= NOT USE NOW
GP2=PIN5=CCP WHEN 12F683 NOW=OUTPUT 12F675
GP3=PIN4=SIGNAL IN POSITIVE PULSE 1.0-2.0 MS
GP4=PIN3 = PWMCW?
GP5=PIN2 = PWMCCW?
INTERNAL 8MHZ OSC
STUMPED FOR NOW,,,,,,,,,,,,,,,,,,,, :confused:
xtal
Mar 03, 2006, 07:43 PM
Heres a glitchy working copy .... assembled for the 12f675
It can be changed to 12f683 by changing the 1st define to PIC12f683...
I've only tried this on a very BIG servo.....It does work but will require
fine tuning....ie it's far from critically damped..
I'm still trying to get the 12f683 version to work....I believe its
still something flaky with the adc?????
xtal
Mar 12, 2006, 02:45 PM
I finally got the 12f683 working quite good on my BIG servo motor.....
[a STK tape loader motor from a 9980 xport] ......I'm happy with the
servo's motion.... :)
File servo683_ff has a pwm period of FF and the _3F has a pwm period of 3F....the FF ver is tuned a little better..... :rolleyes:
12f683 pin 7 is pot in pin 6 [future current in] pin 5 ccp output
pin 4 servo in pin 3 ccwdrive pin 2 cwdrive
This is a combination of AN531 and mostly openservo.com[colin MacKenzie]
The code is still sloppy and can be improved...... :(
xtal
Mar 13, 2006, 12:36 PM
I have just discovered that I did not use the 12f683-CCP output on my driver board....
I am achieving quite statisfactory results using only cw and ccw drive signals...
on thre BIG servo...
xtal
Mar 14, 2006, 05:17 PM
I have been trying to adapt the 8mhz 12f683 code to the 4mhz 12f675 .....
The servo does function but I have been unable to get the same smoothness
that I am getting with the 12F683.....
I don't really understand just how this code is working as good as it is...since I was
intending on using TMR2/PWM/CCP
Basically I am using TMR0 + prescale to generate intrupts at 512us, then I start
the ADC...when I get the ADC complete, I do the Pid_calculate, using the
current servo pulse length, and POT position... then set/clr cw/ccw outputs
dependant on direction, I alter the Kp,Ki,Kd,Kpid values and reassemble until I get
satisfactory results....the 12F683 with the BIG servo @12V is really good.....
xtal
Mar 15, 2006, 03:27 PM
I am currently using a simple bridge on my 12f servo RX2063.gif
I am planning to build RX2064.gif to use......
Does anyone see any problems with this circuit.......
xtal
Mar 16, 2006, 08:19 PM
I believe I see a problem with the op-amp fed h-bridge......
The CCP signal will need to swing from about +1 to +5....I think this can be easily
achived. ccp ----resister--------diode cathode-----to opamps
diode anode to +0.5 derived from another
diode in series with top led ref supply.....
any body have any comments? ......I feel like I'm all alone.................
Zlatko
Mar 19, 2006, 08:24 PM
xtal,
I have been keeping an eye on your project. I am interested in it for really small servos running of 1 cell LiPo. There are a few comercial products but it would be nice to have a play with it myself.
You are not alone ;)
Depending on what voltage/curent you want to feed the servo motor, I like the first H-bridge idea. I guess even for bigger motors you can find the right P/N FET to drive from 5V for a full turn on.
The first diagram will give a very light set up.
Cheers
JimDrew
Mar 22, 2006, 02:18 AM
Has anyone noticed that all of the new standard (non-digital) servos from Hitech now come with a H-bridge configuration using a PIC chip with current detection?
xtal
Mar 26, 2006, 08:53 AM
Heres an experimental servo code that is working ok on my big servo...
More work needs to be done for better stopping resolution,,,,
note that this code presently uses no mul / div ...
The servo algorithim I have denoted as BFD [ Brute Force Drive ]
The current program is Servo683_BFD1-GOOD1
xtal
Mar 26, 2006, 09:48 AM
Some pictures of my makshift big servo.....
xtal
Mar 26, 2006, 05:02 PM
Zlatko
It looks like there may be easy solution ......
1 - 12F683
1 - TC4423/25/25 Fet Driver [ 3 amp peak ] enough to drive small servo
1 - large electrolytic
2 - motor noise suppress caps
4 - diodes [ not sure if needed or not ]
probably would not have to surface mount.....
I posted this on openservo.com [hardware fourm]
Looks like you might be able to use 1 chip TC4423/24/25
3A max current dual driver...@ 0.91 cents . see link
http://telcom-semi.com/ParamChartSearch/chart.aspx?mid=11&lang=en&branchID=9010
which translates to microchip
xtal
Mar 26, 2006, 09:01 PM
Looks like the output resistance might be to high to drive motor directly.....
http://www.robotroom.com/HBridge.html
xtal
Mar 30, 2006, 12:45 PM
Hows my thinking??
Timer0 [1us] interrupts every 512us using 1:2 prescale...
At each Timer0 int I start an ADC conversion which takes about 26us.....
When the conversion is complete [conversion interrupt] I save the 10 bit value
of the feedback pot...,, and allow a pid loop to run.....which will set/clear
the cw/ccw and load ccpr1l[pwm] counter.....This looks like it shoule be ok....
But thinking about this!!!
I have 1/512us = 2khz UPDATE loop running,,,so any changes I make
to cw or ccw will act like 2khz pwm with the length of cw/ccw being the duty
cycle as well as direction control.
Therefore making changes to the dutycycle of the hardware CCP is probably
only affecting drive current...and I really have a pwm of some period ruuning
within a 2khz pwm loop....
Can sombody tell me what this is telling me ???????
orraman
Apr 03, 2006, 12:42 PM
Xtal,
I have long wanted to send my disablity buggy to the far end of a very rough field carrying a winch for a 2m glider.
Assuming mechanical ability and suitable hardware, could your servo driver manage this?
Thank you.
JTN
xtal
Apr 03, 2006, 04:04 PM
my newest servo driver [the drive part] still uses the same FET's [p-channel irf9540 n-channel surplus counter part] which will handle ..up to 20 AMPs with adequate heatsinking.....I am presently using tc4469 [which easily interfaces to
a 12f6xx pic] as a predriver which can probably drive additional fets for more drive,,but haven't tested this....
As long as you stay within voltage/current limits and have good heat sinking..
I don't see why not......
the original simple circuit might have switching problems under large loads
due to poor turn off due to gate cap.....
xtal
Apr 03, 2006, 04:06 PM
Note though......... there is currently no FAILSAFES.......
xtal
Apr 04, 2006, 08:30 AM
Here is the newest simple H-Bridge I am playing with........
xtal
Apr 04, 2006, 08:42 AM
early version pc layout
orraman
Apr 04, 2006, 06:48 PM
xtal
Thank you for the information, I am considering a threaded rod actuator with shock absorbing springs either side of the attachment point on the end of the tiller bar. 12v motor say 4Amp radiator fan motor would be ample. Intend using www.picaxe.co.uk as they are simple, cheap and download with a 3.5mm sterio plug.
JTN
xtal
Apr 12, 2006, 02:21 PM
I'm still working on this.....,,but have shifted to trying mikrobasic .......
demo version will compile up to 2k program words ....which in mpasm is a lot of code...
it took me abut 3 hr to get all but pwm portion to compile ok....learning curve not too
bad......
http://www.mikroelektronika.co.yu/english/product/compilers/mikrobasic/
MAVA
Apr 12, 2006, 02:41 PM
Guys,
Here is a DIY on a Brushless(sensored) Servo Design.
http://www.rcgroups.com/forums/showpost.php?p=4907733&postcount=1245
The full thread is on BLDC controller thread and it is Post 1245, dated Jan18,2006
http://www.rcgroups.com/forums/showthread.php?t=200567
Enjoy
Martin
xtal
Apr 25, 2006, 03:34 PM
mkbasic program based on cservo.txt c-program......
I need to change the pid run time to see how things act.....
This is the 1st successful working pgm in basic.... the servo does require tuning.....but I havn't figured just what I need to change yet...
the cservo.txt is very well documented, but I just know enough c to be dangerous.... the mkbasic is short on coments......
xtal
Apr 28, 2006, 05:08 AM
I am getting a lot of jitter with the mikro-basic,,,,I'm not sure that it all comes from
the PID values,,,I beginning to suspect some may be due to the extra overhead
of the higher level language causing jitter on the calculated length of the servo pulse ...........it wouldn't dare to be a problem with the program...........................
xtal
May 03, 2006, 08:03 PM
Finally.... got a good working version using mkbasic
zip contains complete project,,,, source is pidTMPv01.pbas
Pgarrett
Jun 14, 2006, 06:42 PM
Does anyone have access to a simple HEX-File program that can compile from an Assembly program?
I have had no luck in my search so far....
Pgarrett
Zlatko
Jun 14, 2006, 10:03 PM
Hi,
MPLAB from Microchip, FOC.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002
If that link doesn't work, go to www.microchip.com , and click on MPLAB-IDE under the Design category.
Cheers
Malc C
Jun 15, 2006, 04:28 AM
Must admit I've never had much luck with Mikrobasic when it comes to compiling. Even the "lets flash a LED" code never worked properly. As most of their development boards have their own USB programmer built in, I suspect (and it's just an opinion) that there is some companionship between the software and hardware.
Acetronics
Jun 15, 2006, 05:19 AM
Finally.... got a good working version using mkbasic
zip contains complete project,,,, source is pidTMPv01.pbas
Hi, XTAL
Working code ....??? you tell it rather quickly ;) ...
just entering your project into mk give a nice error window, at the bootom of the screen ... :eek:
I use to work with PbP ... so, may be I missed sth. :confused:
Alain
PS: some lines to comment, and it compiles, ....now ...
module P12F683Def
include "P12F683"
include "Math"
include "Math2" '"System"
'include "Delays"
'include "ADC_lib" "EEPROMlib_E_A" "Flash_F_E"
'include "Trigon" "Sound"
'include "SoftSPI" "SoftI2C" "owlib" "manchester" "Lcd" "Lcd8bit" "Conv"
'include "stringsLib" "button" "Soft_uart"
implements
end.
xtal
Jun 15, 2006, 04:17 PM
yep ..... the def file 12f683def needs to be cleaned up...
I believe you can rename/use 12675 file.......very little difference..
I now have about 20 variations of pid stuff ,,, but still,, I am not
satisfied....tuning is difficult on some and easier on others....
xtal
Jun 15, 2006, 04:42 PM
Zlatko.....
small servo components....
12f683 ssop TC4469 ssop and
a single chip H-Bridge .... = 1 servo control
ZXMHC3A01T8 and ZXMHC6A07T8
http://www.zetex.com
view datasheet @
http://webpages.charter.net/msw101144/TX-RX/
probably could do without TC4469 and add some resistors
Zlatko
Jun 15, 2006, 06:49 PM
Zlatko.....
small servo components....
12f683 ssop TC4469 ssop and
a single chip H-Bridge .... = 1 servo control
ZXMHC3A01T8 and ZXMHC6A07T8
http://www.zetex.com
view datasheet @
http://webpages.charter.net/msw101144/TX-RX/
probably could do without TC4469 and add some resistors
Thank you xtal !!!
TC4469 looks interesting, I have been looking for a while to update my electric forklift ESC ;) ( at 48V ) .
Cheers
Acetronics
Jun 16, 2006, 04:37 AM
I now have about 20 variations of pid stuff ,,, but still,, I am not
satisfied....tuning is difficult on some and easier on others....
Hi, XTAL
Yessss :D ... that's THE ever existing Problem with PID !!! One System ( servo + links + attached moving parts + air effect ) = 1 PID set of constants.
That's why Fuzzy logic is a better answer ... :p
But Fuzzy logic tools are really too expensive ( say 2000+ $ !!! :eek: )
Alain
xorcise
Jun 29, 2006, 10:17 AM
Must admit I've never had much luck with Mikrobasic when it comes to compiling. Even the "lets flash a LED" code never worked properly. As most of their development boards have their own USB programmer built in, I suspect (and it's just an opinion) that there is some companionship between the software and hardware.That shouldn't be. The compiled code is plain PIC Hex code....nothing more or less....and it can be loaded with any programmer. Typically, a blinking LED problem probably has more to do with turning off other PIC features that are multiplexed on the same pins.
I write and use mikroBASIC extensively....it's a great program....and free for up to 2000 words of hex code. I have written 8-channel and 16-channel servo drivers in mBASIC that compile from 150 to 350 words only. That means you can easily use the free version to drive some very complex action.
8-Channel PIC Servo Driver w/mBASIC (http://www.circuit-ed.com/forums/viewtopic.php?t=47)
16-Channel PIC Servo Driver w/mBASIC (http://www.circuit-ed.com/forums/viewtopic.php?t=48)
xtal
Jun 30, 2006, 09:09 PM
another Pid servo controller for my larger servo.....This probably has the
smoothest motion..... pid tuning is a little tricky...I probably need to add
some limiting....somewhere...? This only uses 37% of rom...I am planning
to incorporate this code with ESC code and then use ADC=0 to select
ESC output.......That is if I can get it all figured out..... :eek:
This is sort of patterned from Colin Mackinzie's servo [pid8.asm]
xtal
Jun 30, 2006, 09:49 PM
short servo movie
http://webpages.charter.net/msw101144/Movie_0001.avi
Nobert
Jul 10, 2006, 02:42 PM
Xtal
Do you have a working servo controller that will power up a standard RC servo?
Thanks,
Neal
xtal
Jul 10, 2006, 06:19 PM
post 28/29 can be miniatureized using surface mount components.....
and replace the big fets with half h-bridges or even a full h-bridge
probably can do away with tc4469...[I like the crisp switching the tc4469 supplies]
These are pid based so should work ...but would need tuning......
I have not tried on a small servo yet........try http:\\openservo.com for additional info
xtal
Jul 10, 2006, 06:31 PM
NOTE: the Pid8_V3_I2.zip is touchy to tune because the direction control
is completly controlled by the signed arithmatic.......in attempt to decrease code size...With all the pgm's I've done I am still unable to keep the servo arm from moving
when I shut the Transmitter off.....
I'm going to try to get an ESC working using the same circuit then merge the two
codes together for a multipurpose simple board.....I think most of the servo twitch
is caused by the transmitter,,because with the Tx off the pwm is rock solid.....
xtal
Jul 10, 2006, 07:38 PM
I just connected a vintage 1960 heathkit servo [with 1.5k feedback pot]
to the pid8 controller and also the pidpercent controller [attached] and have good motion and see no twitching [however I can see pwm jitter on oscope].
I was surprised no tuning was needed.......and I think I may be happy with
the smaller servo movement,,,,now If I had surface mount parts????
I could burn something up................
Ivan2280
Aug 06, 2007, 01:50 PM
hello,i have build a new board wih pic and max 4020 for my hitech hs-55 and work great.I have ordered some small pot of 0.3g and i am ready for work on a servo of only 1 g.This is a video of my modified hs-55 servo.
http://www.youtube.com/watch?v=OYWlNCcKwQg
Nobert
Aug 06, 2007, 02:47 PM
Ivan
Can you post the latest schmatic?
Thanks,
Neal
Ivan2280
Aug 06, 2007, 03:13 PM
I haven't a schematic on a paper,but i can prepare it for you.I have to do some mod and it is ready.After i prepare a pcb with smd part and max4016 or with 2 mosfet n&p channel for full h-bridge. :)
lazy-b
Aug 06, 2007, 11:49 PM
Xtal: Your Short Servo Movie, did not work, I am not sure if its due to my internet connection or there is a problem with your server.
Guys, Has anyone tried Modified a Regular Servo by adding an High Current H-Bridge Driver, can add an Opto-Coupler Between Servo amplifier and H-Bridge Driver.
I am looking for something very Reliable Huge Servo, where I can installed it in my Real UltraLIght Helicopter.
Xtal: keep us posted on your Project.....I might use it on my Real Helicopter.....I am just worried using a Microcontroller Base, What if the Microcontroller Hang-up? Hope there is a sort of Dual Redundancy.
Assuming that Microcontroller never hang-up, we could install Dual Potentiometer Feed-Back....a very common problem with servo motor is its FeedBack Potentiometer Wiper loose contact with its Carbon surface.
Ellion
xtal
Aug 07, 2007, 06:54 AM
try the movie link now ....
I need to compress the AVI file [8+meg] takes too much of my free webspace...
I leave the movie there until I need the space
Ivan which file did you use to test with ?
Ivan2280
Aug 07, 2007, 07:04 AM
Hello xtal,i have used file servo683-ff.hex
Have you a better one?This file work well on my hitech hs-55.
lazy-b
Aug 07, 2007, 08:16 AM
Xtal, Now able to Download your Movie, but can not play it on my computer need to download MP4 decoder.....I use my other Laptop computer with a new Vista O.S. still can not play it.....its the same problem I encounter a few year back.
This is the Reason, I switch all my Video to YouTube......No Limit on Uploading Video.....No need to Download special Decoding.......can upload 100MB or 10 Minutes video......If you have time, you can upload it to www.youtube.com and its Free.
I will try to Upload the File to YouTube, so that I can view it.......Just Let me know if you want me to delete it......have indicated in Description that the video own by XTAL(www.rcgroups.com)
Here is Xtal Video in YouTube Version:
http://www.youtube.com/watch?v=cXqIp7B8OkY
there a lots of Githering, hope you can also show the Transmitter Joystick, so that we could see how Good the Servo arms is following the Joystick.
Keep us Posted on your Project.
Just Look at the Related Video on YouTube, you would Amaze how other people done some works on Servo.
Ellion
AndyKunz
Aug 07, 2007, 09:50 AM
I am looking for something very Reliable Huge Servo, where I can installed it in my Real UltraLIght Helicopter.
Ellion,
Considering the huge potential for damage, I would recommend using a man-rated actuator not RC gear.
Actually, I would really recommend you getting a professional test pilot to fly it for you. He will know exactly how to test it prior to flight, and will be able to provide you with extremely valuable information regarding handling that could save your life. He will also know what to look for as he reads the pilot manuals from the designer.
Andy
lazy-b
Aug 08, 2007, 12:26 AM
Ellion,
Considering the huge potential for damage, I would recommend using a man-rated actuator not RC gear.
Actually, I would really recommend you getting a professional test pilot to fly it for you. He will know exactly how to test it prior to flight, and will be able to provide you with extremely valuable information regarding handling that could save your life. He will also know what to look for as he reads the pilot manuals from the designer.
Andy
Regarding Servo, I have an Industrial Grade Servo Motor with Built-in Gear Reduction, The Motor diameter is as Large as regular DVD disk but its thin (about 1/2 inch Thick), it has a large no. of pole (I guess 20 Pole) its Design for 24 Volts, The Gear Box is very similar posted by XTAL, instead of using a long arm, Plan to use a Toothed Belt or Chain Drive, this will give a very linear respond. and very strong Torque.....for a more precise, I could use a 10 Turn Potentiometer as feedback resistor.
Yes, Thats our intention, will hired a Real Helicopter Test Pilot to Test the Helicopter characteristic.
This is a Single Seater Helicopter, I plan to convert it to 2 Seater, One Seat on the Helicopter and the other Seat is on the Ground......I guess its posible.....Its just need two Transmitter.....The Transmitter from the Helicopter will Send the Stick Position to the Ground Receiver, The Ground Receiver has a Joystick, on Top of the Joystick there could be a Switch or a Pressure Sensor or another smaller Joystick , The Gound Pilot cound move the Switch or a Pressure Sensor and Transmit the signal to Helicopter Servo Motor turn , The Servo Motor must have some sort of Magnetic Cluths to control the Helicopter control stick, The Magnetic Cluth will only active when Ground Pilot take control.......This is some kind of a Real Feed Back Joystick.
The Above Control system is a Very Old Control System use by ANTENNA ROTATOR Mechanism.
I will creat another thread to discuss this matter.
Here is the Ultralight Mini 500 Helicopter:
http://www.youtube.com/watch?v=pJb7hQveh1Q
a full video of how we Test,Dismantle,Crate and Load it into Container and ship it to Philippines can be seen here:
http://www1.rcphilippines.com/forum/index.php?PHPSESSID=6457f5cec947fedcd0c81eb236e691 38&topic=293.135
Ellion
AndyKunz
Aug 08, 2007, 08:15 AM
I would prefer using a variable capacitor for feedback, as was once done for RC servos. The slide on a pot may bounce due to vibration, but a cap has no direct contact.
Andy
lazy-b
Aug 09, 2007, 12:44 AM
Andy,
Thats a Great idea......I've never seen a feedback circuit using a Variable capacitor......I wonder if it can give a linear respond......might use a Cheap AM Radio Tuning Capacitor, then using a 555 timer configure as oscillator with Variable tuning capacitor....then using pic controller to count the frequency.....I guess, its doable.
Here is better way and a safer way to learned hovering:
http://www.heli-chair.com/
I can modify my existing Transmitter, remove all those Potentiometer and put in inside the Mini 500 Joystick, Pedal and collective stick........or can just use a simpler Mechanical Linkages, by using a CABLE PushROD (Same as Bicycle Brake Cabling) to connect the Helicopter Joystick to Transmitter Joystick.
The most difficult for me is controlling the Rudder using my Foot Pedals.
Here is my First Helicopter Flight:
http://www.youtube.com/watch?v=Z6q8vIQpniE
Ellion
xtal
Aug 09, 2007, 05:34 AM
Ivan
try the percentpid.zip ,,,it showed good promise and should be easy to change
programming [mikrobasic]
AndyKunz
Aug 09, 2007, 09:54 AM
Heathkit (and other) servos used to be capacitor based. YOu can probably google for schematics. Next time I get up to my Dad's house I'll take a look and see if I can find his old ones.
Andy
Ivan2280
Sep 18, 2007, 11:31 AM
XTAL can you help me to adapt percentpic for pic 12f683 or 12f675 so i can test it?Thanks
This is my new servo:
http://www.rcgroups.com/forums/showthread.php?t=744497
xtal
Sep 18, 2007, 07:11 PM
Download percentPid.zip [post#50]
It is written in mikrobasic ....
see post 28,29,40
It should already be for 12f683....
the hex is included
to make changes get a copy of mikrobasic demo version
then make any changes and recompile...
gpio.0 adc in
gpio.1 nu
gpio.2 pwm out
gpio.3 = pulse in
gpio.4 gpio.5
H L - cw
L H - ccw
interrupt -- tmr0 issued adc
-- tmr1 length of servo pulse
tmr2
pidget compute err, calc prop,diff,integral gains
accumulate and compute pwm
this is all based on 100%
main: section - pic set up
main1: wait for 1st pid run ~~~~ set by adc interrupt
save CMDP=Rc=RC1=adc value=NP
set pwm off
do loop
wait for pid run ~~~~adc sample taken
if servo pulse has been captured compute time / clr capture
compute err and sign
compute pwmcount [pidget]
set direction & pwm count
loop
Been awhile since I played with this.....
All programs in this thread worked with my big servo
of course some better than others
smarbaga
Oct 11, 2007, 09:04 AM
if you require feedback
your best bet is a quadrature optical encoder.
this would take more microchip pic lines.
some new pics have quadrature encder ccts built in.
here is a picture of the uhu servo controllers i build.
up to max 200 motor volts at 10 amps.
you can see the nice square wave holding the motor
at its desired position.
this controller takes a step and direction signal for movement.
the shaft encoder is 1000 lines per rev. max 400 rpms with this
resolution.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.