SX48 Proto Board for Robotics
Brian Riley
Posts: 626
xxx
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhiull center, vermont
Post Edited (Brian Riley) : 8/31/2005 1:59:43 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhiull center, vermont
Post Edited (Brian Riley) : 8/31/2005 1:59:43 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Thanks, Jon, I will give it whirl when I get bac in later today.
Once again Parallax support shows its colors ...
cheers ... brian riley, n1bq, underhill center, vermont
I just spent some time looking the code over. I have a couple of questions;
1 - you set this up for the SX28; for the SX48 Proto Board I just change the directive to SX48 and drop the OPTIONX, STACKX stuff and recompile ???
2 - I don't have anything that will clock at 8 MHz (why that value???) If I use a 4 MHz resonator and change "RETURNINT 104" to "RETURNINT 52" that should fly???
3 - Similarly, if I use the 50 MHz resonator (I have plenty of them) I would set a pre-scale value and set "RETURNINT" to the appropriate value
4 - It took me a while to get the sense of the code, but I did, EXCEPT, I don't see the IR sensor function. In the beginning of the ISR you do
ISR_Start:
IR1 = ~IR1 ' toggle IR bits
IR2 = ~IR2
and that's the last we see of the IR sensor code ... did I miss something?
cheers ... brian riley, n1bq, underhill center, vermont
1 - Yes
2 - If you use "RETURNINT 52" that will drastically reduce the number of cycles the main code gets. If you leave the SX-Key connected you can use whatever freq you want.
3 - Yeah, that would be a better idea.
4 - The ISR code just modulates the IR LEDS. The main code has to check if it "sees" anything, and act accordingly.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
If your application desires reduced battery consumption you might want to consider not using the 50 MHz resonator and prescale approach, but a slower clock.
Guenther summed it up well and I will paraphrase. If you are running the SX a lot faster than you need to, it is like driving a car at 30 mph in 1st gear and the engine is at red-line...Compared to·a slower clock speed its·would be like driving·the same 30 mph in 4th gear and the engine rpm will be much lower.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ken
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
Product web site: www.sxvm.com
"One experiment is worth a thousand theories"
·
OK I set down to play wit this code finally, been kind of busy here the last 5 days or so. It suddenly occurred to me that the toggling of the IR LEDS every 13 uses works out to 38.4 KHz ... design or coincidence?????
I guess I know the answer ... FWIW, that is brilliant!!!! It sure simplifes all kinds of things. The two most time/resource hogging aspects of the robot servo stuff is the FREQOUT for the IRs and PULSEOUT to the servos. They don't leave a lot of time to do anything very smart in the normal single threaded mode of the Stamp. Now instead of having to push through 5-10 20ms PAUSES to do a few PULSOUTs then take a quick peek at some sensor only to rush back to keep the wheels moving I feel I have the room to try all kinds of things. I can pause to let the main routine to 'think' on more sophisticated navigation/activity/sensor matters only 'having' to go back when I determine the need to change direction and/or speed.
Once again ... BRAVO, both to you and to Gunter!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhiull center, vermont
Here's what I have on the SX48 Protoboard
(1) a single row of 16 female headers soldered into RC/RB along the bottom edge of the board
(2) a single row of 18 female headers soldered RD/RE/RTCC/MCLR
(3) a single row of 8 female headers soldered into RA
(4) a single row of 7 male headers soldered to the 4 Vss pins of the Servo connector and the 3 pin Vin/Vdd select for the servo power
(5) a double row of four male headers for the Power and signal lines of the servo
(6) a single row of 4 female headers for the servo data access
(7) a double row of 5 female headers for Vdd and Vss
(8) a small Parallax breadboard we are used to seeing on most of the demo boards, BUT, I had to take a chop saw and remove two rows of holes (the servo connections intrude into where it would otherwise fit unmodified, even if I moved the female headers out one more row I would still lose at least one row of the breadboard) Rotating it the way it would fit unmodified presents pins in a way awkward to wire up for sensors.
I have uploaded two photos, DSCN7599.jpg shows the board mounted on a robot chassis and you can see the whole setup. DSCN7600.jpg is a closuep of the area described in (4) through (7) above.
I also cranked up Jon's program SXBOT.SXB and got it running, I have no IR stuff running yet, thats my next project. But I did get his code running as is, then proceeded to create some subroutines for motion, GoForwardFast, AboutTurn, LeftTurn, etc. The routines make fixed behaviour a snap, its more like script writing than programming. I have uploaded that code, as BBRSXBot.SXB,
Jon, and Gunter, great work ... everyone else, enjoy. I will post my results when I get the IR avoidance and some line following stuff going.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
Post Edited (Brian Riley) : 8/31/2005 2:11:45 AM GMT
·· Nice job!· Let us know when you've got her fully functional!·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I am trying to convert my Toddler to an SX-52 with an SX-28.
Regarding power consumption.
The specifications for the SX-28 indicated the 50mhz pulls somewhere around 75 millamps; while the 4 mhz pull around 7 millamps.
Also, from what I have read, it seems that square waves are full of nasty harmonics [noparse][[/noparse]far more than in sine waves] and going above 50mhz may begin to get you into EMI problems and possibly RFI generation. [noparse][[/noparse]Am I correct on this?] If you have to go there, you can build shields and filters and such, but if you don't need it = why bother? Additionally, the SX=52 gets darned hot.
Regarding the generation of IR, it seems that you really could do that with a 555, an oscillator or something similar and free up a lot of computational power. You may run it in burst and trigger the bursts from software.
Since PWM takes so much, I have piggybacked a SX-28 on my SX-52 board. I guess I can run both at 8mhz. I am a bit worried about using two oscillators on the same board [noparse][[/noparse]I have put in a socket for the second one] and I am beginning to think I should either have the SX-52 drive both directly, or use the SX-52 to somehow indirectly drive the SX-28.
I seem to get so caught up in hardware that I never get down to code. Any suggestions? Initially, I will just try two 8mhz osc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
G. Herzog in Taiwan
Kind of like you get caught up in the hardware and put two SXs on one board, I do the same designing two-servo walking robots. I've built so many Toddler style robots that I'm starting to wonder if I'll ever get to put the same effort into the code. When I finally get to writing some code I do just enough to prove that my mechanics could be better, then I'm back to the shop to refine the design and do it all over again. So, take advice from somebody with the same disorder, who knows the right direction but sometimes can't get there himself:
1. Build this Toddler SX28/52 with one processor at a time.
2. Program the SX28 to manage the walking routines. This is a challenge with the Toddler since it has 34 movements which must be linked together. Try to port some of the existing Toddler code to the SX, making adjustments for syntax and constants. Create a routine for forward, back, left and right, ending with both feet squarely on the ground (so linking movements isn't a problem at first).
3. When the SX is walking the Toddler, then try to incorporate a serial communication scheme to the structure using the ISR (you may want to manage the servos from an ISR - this is something others on the group should answer). The serial routine would have a fixed baud rate and simple command set (i.e., F, B, R, L). Then try to use a BASIC Stamp as a master. Once it's working switch it over to the SX48.
This could be a good approach if you break it into small, manageable pieces. Don't spend too much time worrying about what the ultimate hardware connections will look like at first.
Ken Gracey
Parallax, Inc.
For my samples, I used a 4MHz clock for the SX which results in a relatively low power consumption. On the other hand, this low clock frequency only allows for a resolution of 15 steps between 0 and 100% for the servos in either direction. Using a higher clock, say 8 MHz would double this resolution. IOW, the higher the clock frequency, the better the resolution will be with the sacrifice of more power consumption.
You might consider using 5 rechargeable batteries giving you 6 Volts when fully charged. I don't think, a regulator is required - the SX can stand the 6 Volts and will continue operation down to 2.7 Volts when not clocked above 32 MHz, or 3.0 Volts with 50 MHz. I don't know the operating range for the servos, so you should check if they can stand voltages above 5 Volts.
Note that power consumption as a function of the clock frequency is somehow exponential. Typical values are 7.5 mA @ 4 MHz, 17 mA @ 20 MHz, 77 mA @ 50 MHz, and 100 mA @ 75 MHz (with external clock).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
Günther
So do you use the SX for any ham applications? (I spotted your call in the post)
-Dan
N8XJK
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I am working right now, among other things on an SX28 with a DS1302 and a temp sensor (undecided on Ds1620, DS1721 or what), keying a 28 Mhz fireball clock oscillator for telemetry on a high altitude balloon project. Telemetry in CW. I am just in early breadboard stage.
I am also doing some mental gymnastics for coding up an SX28 as a VP to talk/parse to a GPS and/or the back side of a KPC3+ (N1BQ-3 APRS Digi) TNC to feed StampSX for an APRS application, but that's all in 'fantasy land' for now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I keep thinking It would be nice to build the TNC and 2M RF Xmitter onto one board with a SX chip and some RS232 comm. I'd bet a relativley small unit could be built, using some of the really small DDS chips and PLL's out there. (Like you say, mental gymnastics...
My last major ham project turned into a long winded thing.·I'm still a little burned out from that one. It was printed in QST, and I've been answering email ever since.·Although, I'm starting to think·about taking on a 2+ KW swithing supply to power a full legal limit amp from 12 volts...··· ...I guess I'm just a sucker for punishment.
73,
Dan
DK4TT, how long have you had your ticket?
Licensed as Novice, WN2YKL in 1961, tech, WA2YKL in 1962, lapsed, then KA2BQE Tech+ in 1978, slow-code Extra at the restructuring in 2000, became N1BQ in June 2000 (funny thing, then, when it didn't matter, I got interested in CW and could now pass the 20 wpm fair and square!)
APRS is what got me really active in ham radio again in the 90's and my biggest problem is I see so many neat projects that are begging for a Stamp app, that I sometimes don't know which one to do first! Now my interest lays even more strongly with the SX. I see so much promise. The SX chips are the ideal 'Swiss Army Knife' you can make a VP to do just about anything, gimme a tube of SX28s and/or a stack of the new 48 proto boards and I can make it do just about anything ... and with 75 MIPs possible I can do it at the speed of light for the price of a PB&J sandwich!
Look at Jon's column in N&V this month, I dare any of you to tell me that didn't suggest a dozen different possibilities at first read!
Jon's gonna get a fat head if I keep this up, but between Jon's adaptation of Gunter's robot code and his recent N&V columns on the SX, Gunter's book, and Bean's PWM code, I am a lot more comfortable waltzing around inside most of the SX ... thanks all!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont
for more than 30 years now. Started with the German "C" license (no CW, max. 10W > 144 MHz only), followed by the "A" license (CW, max. 50W, all bands). After one year of "good behavior" it was automatically updated to "B".
vy 73
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I received N8XJK as a Tech Plus ~1992.·My XYL wanted
to study for·a tech ticket, so I helped her and
studied for the General at the same time. In July 2004
she passed her Tech test, and I passed my general
and Extra....·· ...and this hobby has been getting more
and more expensive ever since!
I really don't get into operating too much. I spend some
time on·40m in the morning on the·way to work. I end
up using it more when I'm on business trips to pass the
time.·On those days, My·father and I usually end up with
hourly schedules (for those 8·hour driving days).
APRS looks like fun. But·there are a few more projects
that I have in mind. Like you say, 75 mips is a lot of power!
And you can afford·afford to throw them at just about anything.
I'd be willing to bet, the SX could supervise a DDS and
still have power to spare...· ...2M FM isn't all that hard to make!
-Dan
·
The NJQRP DDS Daughter card had a demo program for a BS2 that barely touched the resources of the BS2. The SX series could do some serious manipulations of a DDS based rig without breaking a sweat even at 20 or even down at 8 MHz clock speed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cheers ... brian riley, n1bq, underhill center, vermont