Servo Tester - Read Receiver Pulses with Arduino

Projects that are not for RC, but are cool and worthy of development.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by rperkins » Sun Mar 03, 2013 10:39 pm

well I wasnt sure what you wanted to edit in the eeprom. It took me awhile to find a intel hex editor. One that automatically figures out the checksum and such. Never found a linux one, found a windows one. the trial version is limited to 20 lines of text. What do ya know, that's all we need :) If anyone out there knows of a open source Intel hex editor that automatically figures out the checksums, I'd love to hear about it.

anyway
the windows based intel hex editor http://www.smarttechnosoft.com/ihex/index.html
You'll need an ascii table to convert the hex to ascii, although the Intelhex software has you insert it as decimal. http://www.asciitable.com/


Made a small change. Now when the program first boots up it will display ~~jhsa~~~ instead of ejberg.dk. but you get the idea
intel_hex_editor.jpg

Here is the edited eeprom file to flash. Had to zip it up to get the forum to swallow it
servotst_edit.zip
(305 Bytes) Downloaded 161 times
The tricky part is locating which digit of hex you need to edit. then look up on the ascii table for the character you want to replace. then you right click on the hex, and insert the decimal number of the ascii you want to generate.

The easier way of course it to compile the source. Maybe you have enough there to do it. IDK


User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Sun Mar 03, 2013 10:44 pm

Thanks.. will have a look at it.. so many things to learn.. The best would be to learn to program my own project.. but that is still miles away..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

ReSt
Posts: 1540
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by ReSt » Sun Mar 03, 2013 11:22 pm

The code is not compiled but assembled.

Load it into AVR Studio
Start a new project. Select ATMEL AVR Assembler under project type and servotst2.asm as initial file.
Next screen select AVR Simulator as Debug platform and ATmega328 as device.
Finish
AVR Studio starts up and shows you among others, a window with the asm code.
From the menu run "Build" and that creates the hex file that you can upload to the 328

But be aware, that there are only 10 bytes left in the flash ram

(This is how far I got. Don't know how to run the program in AVR and single step it.)

Reinhard

User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Sun Mar 03, 2013 11:41 pm

Here are some pics and a video.. :)

[BBvideo 425,350]http://www.youtube.com/watch?v=cKBtik5H ... e=youtu.be[/BBvideo]

João
Attachments
030320132286.jpg
030320132287.jpg
030320132289.jpg
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by rperkins » Mon Mar 04, 2013 12:13 am

looks good. Glad it all came together. The case finishes it out nicely.

Looks like Rest got it to assemble. Sorry for the wrong terminology . a hex file is what we were after. I'll have to check out the AVR Studio. thanks


User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Mon Mar 04, 2013 12:18 am

I'm not finished with this yet ;)
I have the parts for version 2, except the encoder.. found one quite cheap but the postage is twice it's price :(

I connected a receiver and was very happy to find out that my 9x's sticks centering quite well ;) :)
João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Ozzy
Posts: 91
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by Ozzy » Mon Dec 17, 2018 11:11 pm

Here is a CPPM decoder using KK2 FC hardware.
KK2.1 CPPM Analyzer v1.2
This firmware can be flashed onto your KK2.1.x controller to test the output from your CPPM receiver. It will provide information like channel count, frame length and remaining frame space as well as live channel data.
It even has a "Test" mode where it will log the lowest and highest value for all input channels. If you let the logger run for a few minutes it can help you detect receiver problems (e.g. instability). This mode can also be used to check channel endpoints.

From here:
https://www.rcgroups.com/forums/showthr ... e-by-RC911
Attachments
KK21_CppmAnalyzer_v1_2.zip
(8.85 KiB) Downloaded 69 times

User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Tue Dec 18, 2018 11:44 am

Cool, what microcontroller is the KK board based on? perhaps it is possible to replicate it using an arduino and connect an LCD.. Is the KK schematics available somewhere?

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Ozzy
Posts: 91
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by Ozzy » Tue Dec 18, 2018 11:30 pm

The beauty of the KK2 flight controller was the LCD and button interface. Setting up and dialing in the PIDs was easy at the field. Schematic attached.
Attachments
KK2.1 Sch.pdf
(165.25 KiB) Downloaded 76 times

User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Wed Dec 19, 2018 12:39 am

Thanks.. Is the hardware of the KK2 the same as the KK1? Because your post above states that you can flash the KK2.1 with the sketch.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
jhsa
Posts: 19295
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by jhsa » Wed Dec 19, 2018 12:42 am

Also, i think there is no arduino with the Atmega644, so that's the end of my idea I guess :(

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Ozzy
Posts: 91
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by Ozzy » Wed Dec 19, 2018 2:57 am

OPPS! This was meant for this thread: https://openrcforums.com/forum/viewtopi ... 49#p141449
I reposted over there.


I am not a coder but a hardware guy. I have tried cheap rotary encoders with arduino, and they skip and multi pulse a lot more than I care for. I think better encoders (not the cheap $1 encoders I tried) will work fine, especially with correct hardware filtering (decent strong pull ups with RC filter before GPIO input pin).

Rotary encoders that are simple mechanical contacts have some issues compared to optical/hall/capacitive encoders that output sharp, clean and bounce free switching, making it a lot easier for the mpu.

Generally:
Best Performance: Both signals connect to interrupt pins.
Good Performance: First signal connects to an interrupt pin, second to a non-interrupt pin.
Low Performance: Both signals connect to non-interrupt pins,
Found here.
https://www.pjrc.com/teensy/td_libs_Encoder.html
Last edited by Ozzy on Wed Dec 19, 2018 3:26 pm, edited 1 time in total.

User avatar
Ozzy
Posts: 91
Joined: Sun Jul 08, 2012 7:57 am
Country: -

Re: Servo Tester - Read Receiver Pulses with Arduino

Post by Ozzy » Wed Dec 19, 2018 6:32 am

I know its not in the spirit of this thread (stand alone PWM checker), but here is another way to monitor Rx signals.

With the gyro you can use tethered data (usb connected) recording/display, or with the F4, it has dataflash to recorddata, including all the Rx signals, gyro, accelerometer, etc. Blackbox Explorer is pretty awesome in itself (picture attached).

This setup will let you check just about any type of Rx output, all down to a microsecond and upto 16 channels at once:
PPM (CPPM)
PWM
MSP
SPI
SPEK1024,
SPEK2048,
SBUS,
SUMD,
SUMH,
XB-B,
XB-B-RJ01,
IBUS,
JETIEXBUS,
CRSF,
SRXL,
CUSTOM,
FPORT

A flight controller is semi low cost (F1 ~$10, F4 ~$14 or less) and using betaflight gui
F4
https://www.ebay.com/itm/SP-Racing-F4-F ... 0&LH_BIN=1
F1
https://www.ebay.com/itm/NAZE32-REV6-Ac ... 0&LH_BIN=1

The betaflight gui can run on a pc/mac/linux, but also there is several android apps, I like speedybee, this way you dont need to lug a notebook to the field. You do need a $2 OTG cable and micro usb cable.

I am not on this forum a lot, you can PM me over on rcg here: https://www.rcgroups.com/forums/member.php?u=91160
And for the hell of it, my latest quad video :o https://www.youtube.com/watch?v=uHoFfpLSb2g
Attachments
Good and Bad corner spins.jpg
Betaflight Rx Tab.jpg


Post Reply

Return to “Other Electronic Projects”