Welcome, Guest. Please Login.
Surveyor Corporation Surveyor SRV-1
Home Help Search Login

Surveyor Robotics Forum

Welcome to the user support forum for Surveyor SRV-1 robots, SRV-1 robot controllers and SVS stereo vision systems. To register for this forum, please send an email to support@surveyor.com which includes your desired forum user name, your registration email address, and a brief explanation of why you wish to join, and we will create a forum account for you.

Please note that there is a Search button in the forum toolbar for forum topics. Another effective search method for the entire surveyor.com site is to use Google, e.g. "xyz site://www.surveyor.com" where "xyz" is the search topic.



Pages: 1 2 3 
Send Topic Print
driving other motor controllers from the Blackfin (Read 34419 times)
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #15 - 01/31/08 at 9:10pm
 
Some details on how I have wired this up.
 
I took a standard servo wire, and removed the black wire from the plug side, and plugged the red/white into the pins 7-8 of the blackfin 32pin bus. Black pin went to pin2 GND. These were connected to drive S1 (white, pin7 of bf, left side motor), S2 (red, pin8, right side motor). Black wire went to GND of sabertooth.
 
Blackfin____________________Saber Tooth 2x10
Pin2   <--------Black-------------> GND
Pin7   <--------White-------------> S1
Pin8   <--------Red---------------> S2
 
 
I also confirmed that switch 4 of the Sabertooth needs to be in OFF position to support differential (non mixed drive). I configured a "elevon" mix on my RC radio side, and things are happy.
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #16 - 02/01/08 at 8:38am
 
Wiring looks fine.
 
I now have a version of firmware that drives 4 servos, and am thinking for control of adding two commands to the SRV_protocol similar in format to the 'M' command for PWM motors, but probably without the time-out parameter
 
'S' (0x53) would control servos 1+2
's' (0x73) would control servos 3+4
 
If we use a full 8-bit scale 0-255 (0x00 - 0xff), then 128 (0x80) is the midpoint, which should correspond to a 1.5ms servo pulse, with 0x00 corresponding to a 1.0ms pulse and 0x255 corresponding to a 2.0ms pulse.  So in hex, the command to set servos 1+2 to mid-range would be
 
0x53 0x80 0x80
 
The first appearance of 'M', 'S' or 's' commands would tell the firmware to initialize the timer channels for PWM or PPM.  We might later add a command for servo range scaling, in case the 1.0ms - 2.0ms range limits need to change.
 
Remaining question - what do we do with the numeric keypad commands ?  they're really useful for testing via a terminal, but also very specific to different robot setups.  I thought about making them configurable, but we would already have precise control with 'M', 'S' and 's'.  Maybe we just leave these available for developers who are modifying the source code for their own purposes.
 
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #17 - 02/01/08 at 11:20am
 
I would leave em as is.. I can modify the srv.config to use the new commands and that should be fine..
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #18 - 02/01/08 at 12:03pm
 
Okay - I'll leave the keypad commands, but disable them if the controller is in "servo mode".  If someone wants the modify the source to use them, it won't be difficult.
Back to top
 
 

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #19 - 02/01/08 at 3:39pm
 
Okay - I've posted a test version of code at  
 
    http://www.surveyor.com/blackfin/srv-blackfin-servo-020108.zip
 
I have added the 'S' and 's' commands to the protocol.  At the moment, the range of supported values is 0-100 (0x00 - 0x64) rather than 0-255, but we can change that later.  So in srv.config, the command
 
     533232
 
would be the equivalent of 'S' 50 50, which generates 1.5ms pulses at 50Hz on timer channels 2 & 3.  An 's' (0x73) command has an equivalent effect on channels 6 & 7.
 
The 'M' commands still work as well.  If the processor first sees an 'M' command, it will initialize the timer channels 2 & 3 in PWM mode for the robot H-bridge, and the keypad commands are activated in this mode after the first 'M' command is issued.  
 
If the processor first sees an 'S' command, it will initialize timer channels 2 & 3 in PPM (servo) mode, and when it first sees the 's' command, it will initialize timer channels 6 & 7 in PPM (servo) mode as well.
 
I tested the same code on an SRV-1 robot and on the coaxial rotor flyer using all 4 channels, and everything seems to be working, but please let me know how things go for you.
 
By the way, you can still drive this from a terminal - here's a link to an ASCII chart
    http://www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/images/ASCII1.GIF
 
so the sequence "S22" would be the same as 533232 or 'S' 50 50
 
Back to top
 
« Last Edit: 02/01/08 at 4:15pm by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #20 - 02/01/08 at 11:35pm
 
We have movement...  
 
Now I need to map out some controls for this..
 
 
 
Back to top
 
 
osmogr   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #21 - 02/02/08 at 12:42am
 
I was able to map out a few controls for srv1.config tonight
 
Stop point S22
 
Forward Medium S##
 
Reverse Medium SAA
 
Left Rotate SA#
 
Right Rotate S#A
 
I plan to make a new srv.config and post this tomorrow with the new controls..  
 
I did have an issue with my wifi antenna, I think it was related to the pin, it appears the new pin material has pushed the metal sleeve inside the plug in too far, and doesnt make a good connection now, for now I have butchered an old wireless router that had the same connectors and I am using its antenna and it seems to be better now..  
 
Now I need to map the s channel and make some servo movements for the camera p/t..
Back to top
 
« Last Edit: 02/02/08 at 1:53am by osmogr »  
osmogr   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #22 - 02/02/08 at 2:08am
 
Here are the settings I used.  
 
Stop Point 533232
 
Slow Forward 532323
Medium Forward 531414
Full Forward 530000
 
Slow reverse 5334141
Medium Reverse 535050
Full Reverse 536464
 
Slow Right Turn 532341
Slow Left Turn 534123
Medium Right Turn 531450
Medium Left Turn 535014
Full Right Turn 530064
Full Left Turn 536400
 
 
I will be making some pretty icons and slapping up a new srv.config tomorrow.. and a VIDEO.. Smiley
 
New wifi is working good..  
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #23 - 02/02/08 at 8:06am
 
Thanks for the update - I'm very glad to hear that the new commands are working for you and look forward to the video, which we'll post in a link from the Surveyor Robotics Journal. Also, thanks for noting the antenna issue - I hadn't heard of problems with the replacement pin before.  
 
My goal today is to get the coaxial flyer airborne with the new firmware.  I will have to modify the keypad controls to produce a useful command set, since I need to be able to continuously adjust throttle and yaw trim as well as the pitch/roll servo settings.  However, since there's now logic to branch depending on whether we're in PWM or PPM mode, I can add this code without breaking anything.  
 
My thought is to use the keypad hits to incrementally adjust the last values sent by the 'S' or 's' functions.  For my application, the '+' and '-' keys would be used to incrementally adjust throttle.  '0' and '.' would be used for yaw trim.  The remaining numbers would be used to incrementally adjust pitch/roll settings.  
Back to top
 
« Last Edit: 02/02/08 at 8:06am by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #24 - 02/02/08 at 2:07pm
 
So I took all the values from the previous post, and put them into srv.config.  
 
And I have to say it works pretty well.. I took a video and as soon as I can upload it, a link will be posted.. The first part of the video is great reason why you should have someone running the camera, and someone else running the bot.. Wink  
 
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #25 - 02/03/08 at 3:32pm
 
I have the 4-channel servo interface working as well.  
 

 
You can find a description and a couple of video clips here -  
 
    http://diydrones.com/profiles/blog/show?id=705844%3ABlogPost%3A23537
 
There's still work to be done on the flight controls, but the Blackfin interface is solid.
 
Here's the updated code -  
 
    http://www.surveyor.com/blackfin/srv-blackfin-coax-020308.zip
 
In the PPM (servo) mode, the '+' and '-' keys are intended as throttle controls, increasing or decreasing both speed control channels.  The '<' and '>' keys are used to trim the two channels for yaw or steering control.
Back to top
 
« Last Edit: 02/03/08 at 4:06pm by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #26 - 02/04/08 at 3:05pm
 
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #27 - 02/04/08 at 4:25pm
 
Very nice !
 
I just posted a brief description of your project here -  
    http://www.surveyor.com/cgi-bin/robot_journal2.cgi/2008/02/04#141
 
We will release the code changes supporting servos with the mainstream SVN code base after a bit more testing, as the same firmware works with the existing SRV-1 base, your Lynxmotion base, and the coaxial rotor flyer described above.
Back to top
 
« Last Edit: 02/04/08 at 4:29pm by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
osmogr
Junior Member
**




Posts: 67
Re: driving other motor controllers from the Black
Reply #28 - 02/05/08 at 5:32pm
 
Using the + / - / < > commands I modified my srv.config to include these. They work great for speed controls and such..  
 
Maybe this is something already answered but is it possible to setup like an "autorun on switch setting"? So I can autorun code when a switch is set to ON and skip code if switch is off?
Back to top
 
 
osmogr   IP Logged
admin
YaBB Administrator
*****




Posts: 3606
Re: driving other motor controllers from the Black
Reply #29 - 02/05/08 at 6:09pm
 
Quote from osmogr on 02/05/08 at 5:32pm:
Using the + / - / < > commands I modified my srv.config to include these. They work great for speed controls and such..

Maybe this is something already answered but is it possible to setup like an "autorun on switch setting"? So I can autorun code when a switch is set to ON and skip code if switch is off?

 
At some point, I need to document the S, s, +, -, <, >.  I think once more of the sensor code is integrated, we'll freeze code, update the SRV_protocol document, and update the SVN archive.
 
There were requests in the past to enable the processor to jump into the C interpreter with a switch or jumper.  Again, this is something we might want to assign to a GPIO line, though we'd need to add a pullup resistor and jumper to the sensed line.  Maybe that's something to add to the next expansion board revision.
Back to top
 
« Last Edit: 02/05/08 at 6:14pm by admin »  

SRV-1 Development Team
Surveyor Corporation
Email WWW   IP Logged
Pages: 1 2 3 
Send Topic Print