This video:
Chat:
Jeff: Ubuntu Mate 20.04 Raspberry Pi 3B
(This wasn’t obvious, so I’m not going to make any recommendations.)
Al: Prebuilt Raspberry Pi image notes.
Jeff: Ubiquity images :
LinoRobot code:
Presentation:
Al: sample udev rules
Jeff: Linux command to show secrets…
dmesg OR dmesg –follow OR dmesg -w
Jeff: The quadrature decode example for STM32.
Al: $65 Cortex M4
Al: Roger Clark site
Jeff: Other Roger Clark / STM32duino links:
#stm32cubeprogrammer
Index:
00:00 Terry: Battery mounting. Wiring – switches, power convertors, fuse block.
02:10 Terry: Loading ROS on Raspberry Pi. Desktop vs. server.
Ubiquity image?
Lino Robot image?
Discussion on installing different images.
09:45 Terry: Talks about his ROS to microcontroller communication method.
ROS Serial or hand built protocol.
UART Vs. USB.
15:40 Terry: Wants some way to identify which port is plugged in.
We discuss udev rules.
23:55 Jeff: Talks more about serial interfaces.
29:00 Terry: Asks how to power the boards.
33:45 Back to serial discussion.
36:30 Terry: Asks which diode to use.
38:10 Jeff: Mentions bootloaders. Then talks about a quadrature decode example.
Will not compile on Windows.
Loaded Arduino and a STM32 core on Linux. That compiles.
Long story of loading drivers to get the STM32 ST Link module to work.
42:00 Jeff: Goes back to Windows machine to fix it. Replacing the STM32 core fixed it.
But ST Link module no longer works.
43:05 Jeff: “Now I can compile and upload under Arduino on Linux.”
43:15 Jeff: Back to bootloaders.
46:00 Back to the quadrature story.
47:05 Back to bootloaders again.
50:50 The ultimate goal of total in-circuit programming.
51:25 Down the stm32duino rabbit hole.
56:20 Other than that, Jeff hasn’t been doing anything,
except thinking about wiring up a physical board.
Can be compiled and programmed with either Arduino IDE or ST Micro IDE.
59:15 Al: Asks for confirmation that this is all figured out.
1:05:00 Jeff: Talks about difference between ROS Serial and hand built protocol.
1:14:40 Al: Goes over changes he is making.
Messages, servo resolution, mode switch, test driving, PID settings.
Next steps.
1:17:15 Al: Shows his current board and goes through code changes.
Changing from ESP32servo.h to ledc.h to improve servo resolution.
Other changes and description.
===============
Lawn Tractor Automation YouTube page:
Index for Lawn Tractor Automation group:
http://sampson-jeff.com/RosAgriculture/LawnTractorMeetingNotes.txt
Index for the original ROS Agriculture group (~250 videos):
http://sampson-jeff.com/RosAgriculture/readme.txt
http://sampson-jeff.com/RosAgriculture/ros-agriculture-youtube20230104.txt (or newest file)
Okay since we're recording now I'll go Ahead and start Um after trying to drill one hole for 30 Minutes into that stainless steel and Not getting through I decided I don't Need to mount the um battery Connectors Where I was going to so Let's see I was going to mount them up Top here But I had to drill through this Stainless steel Instead I just decided to mount them On the side where I had aluminum Framework And that went much faster And so now I'm Wiring up the switches And the buses so that I can get my uh Three volt or my five volt power supply I've got this little uh where to go to This little uh Tobson 15 watt DC to DC converter Where you just put Um 12 or 24 volts in Or between up to 24 volts in And it gives you uh five volts out three Volts or three amps Filtered So that will be my three volt bus For driving the itsy bitsy and the Raspberry Pi
Um hopefully I'll get that wired up this Week going through my fuse block and so Forth Um any questions about that Not for me Terry okay Um I then was going to start loading uh Wanting to load Ross onto my Raspberry Pi Well I discovered you can't use the Ubuntu 2204 you have to use the 2004 And The Desktop version isn't available Anymore or I couldn't find it I'll put It that way So I'm having to load the server version And do everything without the GUI So I can then load the Load Ross Which probably isn't a bad thing but it Just makes it harder for me since I'm Not a real Unix guy Um Al do you remember if that the Ubiquity does that have a desktop or is That just a server version Um I don't remember Jeff I I loaded ubiquity on a Raspberry Pi Multiple times and I think they're Still have an image out there but I Don't know if it was the desktop or you Know something
Trimmed down just for their distro But I mean I can look it up I don't know Terry who are you Were you done Jeffrey did you want to Get into that anymore well the next Question is do you do you use the Lino Robot they have they have a pre-built Image too don't they Do you recall on that if that's got a Desktop built into it Again can you remember that that's fine We could look it up but Yeah I don't remember specifically when You say desktop or are you saying did They have like Libra office loaded on it Or something or no I mean um does it Bring up a desktop so you can actually Run a GUI yeah They both definitely they both had guise Uh I mean you you could remote into the Raspberry Pi I pretty much After you got it configured I didn't use The GUI but Um they're there If you if you know how to get to them So the point is uh both Lino robots and Um ubiquity robotics have pre-built Images you just download the download Their package put it on an SD flash card And plug it in and Away you go and both Of those were designed for Ross so I Know the ubiquity one at least comes With Um your full Ubuntu to make it work and
Then it's got whatever version of uh Ross that they're doing is built into it Already so you just download that stuff And put it on there and it should power Up and you're ready to go It's always confusing because because Once you do that it you don't see any Raw stuff and that's because Ross is uh Just hidden out under operas uh the Install version whatever so that's That confused Bob when he was trying to Do that Okay so what are those two places or can You put the links in uh uh [Music] I'll track those down because what I'll Do I'll go back to our index where we Talked about this stuff and I can come Up with uh links to this stuff and I'll Put it in the chat okay And I may not get it done during the Meeting because it'll distract me a lot But no no worries by the time we're done I can put it in the uh the description Of this meeting so you have those and They're basically other things available You can do that with you just download And put on the card and you're it comes Up running And that way you know start start with a Fresh card so you're not what what You've already got loaded on something Else you don't have to destroy that you Can just take you know put it on a new
Card when you plug that card in then You're you got a whole new it's like Putting a whole new hard drive in your Your laptop so right I I have no problems uh I mean I've just uh Got done Downloading the image and was just Booting it for the first time so I have no problem Reformatting the the disk the SD card And if you decide you you really want to Install from scratch and you want the Desktop version I I have made that works Like I can I can track that down if if You decide you want to go that way If it's got the GUI then Then that'll be fine And it's it's one of those things it's Not that hard to do you know you just You point to things they download the Binary and then there's somebody will Give you some instructions how you put That on the card so it's you know make One card for for say ubiquity and make One for liner robots or and make make a Separate card for you know if you're Gonna do it you know from scratch or Whatever and that way you just plug in Whichever card you want and go from There I see AL posted something here right Yeah I I mean these are getting a little Bit long in the tooth but uh
These are instructions that I wrote for Myself so bear you know there's a health Warning with them that um they may not Work exactly like They're stated but that's those are the Instructions I wrote down on how to Install the ubiquity image Okay loaded on them I will read through Those I've opened the link so I've got It so And if you go go to ubiquityrobotics.com They've got I think they go to write up On what they're doing and uh they're not Real clear on some of these they build These images but uh there was a point Where it wouldn't load on Raspberry Pi 4 And then just magically they come out With a new version but they didn't say Anything about it so you didn't know but You know this stuff will even run on a Raspberry Pi 4 if you happen to have one Of those Don't have any Force I've got three of The Three B's Yeah that brings up a really good point Because I don't remember what I was using when I You know put that image down on it But if you have trouble I mean semi is Like no I'll take a look at whatever You've got okay Just wanted to save you some steps there If you didn't want to uh to do the whole Thing and I know
Um also from lino robotics uh I think I Think they're the ones that have it's Called a rasmi script so Ross me as one Word and basically run that and it just Downloads Ross and puts it onto whatever Install you have and Matt was a big big Fan of that and I I usually instead of Loading everything from scratch every Time partly so I don't completely forget How to do it and then partly because When you get somebody else's image you Don't really know what's on it but you Know that's that's still a good way to Start is if you can get one that you Know because that the ubiquity Robotics Are part of Homebrew robotics out in California and they they all seem to Know what they're doing so it's in General you know that I trust their Stuff and it it most has most of the Stuff you're going to need it probably Even to get started you can have most of The stuff you need but you can still go Out you know at any point and say app Get this new package and install it on The fly so that though okay still works Out Appreciate it And so I anyway I hope to get that Installed And um Hopefully then start Testing the rs232 connection between The Raspberry Pi and my itsy bitsy
If you get any thought on how you're Going to get those to talk to each other Which in my whole rambling I'm going to Go over that and and say what I just Found so I'm just just curious if you've Decided what you're going to do there Um Not specifically I Because I'm rioting the uh the itsy Bitsy code I can format the message However the raw cereal needs to accept It If you're running raw cereal you don't Have to format anything you just load This giant package on On your your ross machine and then you Just install a library on your Arduino Stuff and it just all magically works And I I learned all this last night I Was digging through this because I I was Frustrated everything else so I went Down this path to figure it out and I Was able to load it and get their Examples to run so that's a I've avoided up to this point but if it Seems like it's an awful big it's it's a Lot bigger than I expected it to be and My stuff is is you know small I just say Do a print and then at the other end Retrieve it and do something with it and So it's it's much simpler and more to The point but then again I it could be That raw cereal is the way to go so I Don't I know Al runs that and Juan runs
That lots of people run that raw cereal So We could we could discuss that one of These days too Okay But no I I haven't uh I I just know that I'm gonna have rs232 connecting the two Boards Beyond that I haven't I figure I can format it however I need To So are you running rs232 you're running Asynchronous serial between the two Boards Rs250 refers to the the high voltage Drivers on oh okay no so no async so Basically you know you got the uart pins On both boards you can hook them Together and it has nothing to do with Rs232 at that point that's just Asynchronous cereal okay I stand Corrected just uh just a point there so People don't keep propagating this And I I know you you told us why you're Going to use that as opposed to going Over a USB but I will we'll worry about That later Um basically because I don't want that Long USB cord connecting the two I find if you look far enough you can Find short cables you have to go on like Amazon and say short USB cable and say Either mini or micro is that a micro Connector on that board or a type c
Connector on your board or it's a micro And I I know I bought a bunch one time There are the short ones for the mini But I don't remember if I went to Trouble tracking down the cables for the Micro or not but but you go out and Search and say either short cable or put In a six inch cable or something and It'll it'll bring up you put a six inch Cable and start showing you lots of Short ones so you can't actually just Buy a short cable What I've what I found was a lot of Times those are just Our cables they don't have the data line Uh well you know you gotta look real Hard when you buy them but right this One this this is one of those Okay this is one of the short cables Here so it goes from From this board Uh up to my Raspberry Pi and that's That's all longer it is but that's a Mini that's not a micro so okay uh one Of these days I have to track down the Ones for micro to make sure I have the Right ones but but yeah you can get Short cables and that's not not really An issue Now there there are reasons why you Might want to uh Uh go with asynchronous cereal as Opposed to uh As opposed to USB and I might talk about
That too I got stuff written on my list Here here let me let me specifically Point that out Well the one reason I was thinking of it Is that way I can connect up to the Um Arduino IDE And still have My serial to the Raspberry Pi Okay so it's got it has the USB Connector and it's got one or more extra Uarts Exposed on the pins Yes because the original some of the Original Arduino stuff it had a USB Connector on the board but then that Went through an ftdi chip and went to The only uart that was on the the Processor chip so you could you'd think You could use it for both but you can't So that a way to get around that you can Use again this thing I just held up the Guy put on a uh a Teensy 2.0 and it's Essentially like the Arduino chips but He used the it's like a 32 u4 or Something and it's got a a USB connector Directly into the chip and then it's Also got the extra uart on the chip so That was a way he got around the fact he Could talk USB at the same time he's Running a uart on the thing the itsy Bitsy has that also okay At least it says it does I haven't Verified it yet but Okay that's sorry for the moment that's
All I wanted to say about that right now I guess so Now what I'm hoping is that Whatever is on the Uh Raspberry Pi side Can Have a yes I'm here type message So that I can have the during startup Send out some message to the Raspberry Pi and it says yes I'm here So then I know that I can use serial one Rather than just serial zero What what's what's a Serial zero zero One Uh serial zero is the USB Cereal so that would go to the serial Monitor On the IDE Okay And serial one is what I would be Connecting to the Raspberry Pi So on on Linux that you typically when You connect something up it generates a Device driver so it's gonna it's gonna Name when you plug the say you plug a USB port in it's going to say oh I see a New USB and it's either going to call it A a TTY ACM zero or TTY USB 0 depending On the type of device probably your your Board is probably going to generate an Uh ACM zero type port and then what you Can do you can use udiv rules and say if You plugged it into this port or you can Go out read up the serial number of your
Device there's various ways to do it you Can say rename that to uh to Itsy debug Or something so then when you go to use It just every time you want to talk to It you just say like say in your serial Debug you'd say connect to the the Itsy Debug uh because that you just create The name of it and it you can set up These U Dev rules so smart enough that Whenever you plug it in it automatically Knows what that is Because otherwise you run into the Problem say you got a bunch of say Arduino Nanos you want to plug in each Time you plug one in it generates a USB 0 USB One USB two and you have no idea What the different boards are so that's Why you use the U Dev rules to try to Identify them and that way it it it Takes care of that kind of stuff If I'm using the a USB cable to connect The itsy bitsy to the Raspberry Pi but If I'm just using the transmit receive And ground So just in general Linux uses device Drivers for everything so when it sees a Device it creates these names for it so I think the the physical uart on that Board is going to be called uh TTY S I think it's it's probably going To be called ttys0 so it already in Order to use that Port it's already got A driver set up to run that so you just Have to even if I'm yes using one of the
The 40 pin Yeah you want to use you you want to use It you are no matter what and basically Anything on on Linux to to talk to Anything it generates one of these Device driver names for it so okay so it Should should already be there Uh as long as that Port is enabled and Again it goes back to the problem is That are those pins used for the Bluetooth if the Bluetooth is turned on Well I think Linux still has to know It I think you're going to turn your Bluetooth off in order to use those pins But I think either way Linux is already Assigned a device driver to to that uart That's out there so it already knows Where it is and what it's called It's just the type of device they give It different names and I was thinking The you know the the standard uarts are Called Ttys0 or ttys something else zero Depending on what kind it is so anyway That's that stuff should already already Be there okay I'm sure we will be talking again about This as I get further down this rabbit Hole and back to the U Dev rules you Really do need those because otherwise You know as you plug stuff in the names Keep changing and moving around so uh at Some point you have to figure all that Out so you can lock all that stuff down
So you know that every time you turn it On you know you're going to talk out the Physical uart to your other device and That's you know named so it knows how to Do that and then whatever your USB Coming from the devices you know there's A name for that so that you just Whenever you you run something like say You're going to run a program to talk to A uart then put in for the port name put In that slash Dev slash TTY s0 or Whatever whatever it ends up being Called Okay yeah so people do have the stuff Figured out it's just it's just more the Endless stuff that you have to learn in Linux to make all the stuff work Foreign I just want to have it done by next uh October You're not gonna have a dumb bite at Night when it snows actually it's Starting snowing already so No I won't yes I know it's snowing and No I won't have it done Oh yeah Area I put the udev rules that I'm Currently using Um in the chat just to see have an Example the The particular I know you're not going to be an expert On you need to have rules in one Conversation but
Um You'll see In that example a bunch of numbers 8-1.4 And Um Anyway that those are the unique Identifiers For a USB cable being plugged into a USB Port Um There's other ways to make things Unique but just so you have an example Okay It turns out this stuff is really Complicated so when you get ready to do It you know just just raise your hand And there's here's where's the little Button here Oh I don't see it so somewhere on here I You can raise your hand while just Running but anyway just raise your hand And say I want to do this now because There's various ways to do it you can Either go out let's say on the Raspberry Pi I find it easiest to just take the Physical port number see I've got on the Raspberry Pi it's got four USB ports on There so they're they're called Something like zero one two and three or Whatever they're called they actually Got some big long name for them but you Can say if any if anything is plugged Into that device then we're going to Call it whatever say call it IMU or call
It Etsy or whatever you want to what do You want to call it another way you can Actually go out to the the device you've Plugged in and it has things like serial Numbers and manufacturers and Uids and all kinds of stuff you can pull Up the problem is you when you're buying Um stuff from China like say the the Arduino Nanos from China they all have a Serial number zero or they're all one or Whatever so it turns out there's nothing About the board that is unique because You can write up these rules and say Okay go out and look at the board and Look at the the manufacturer ID and the Manufacturer's serial number and based On that you can make it work but I Finally just gave up and on the Raspberry Pi I just say if it's plugged Into the first USB port and there's Examples on how to do that say if it's Plugged in that Port I'm going to call It this and that you just have to make Sure you always plug the cables in the Same the same place every time Or you can actually get to the point Where you say it's going to be the first USB port but also make sure it says that It's an IMU or whatever you know by Looking up the ID stuff so the again It's a big journey and a lot of screwing Around but once you get it working it Seems to work fairly well Okay
At least I don't recall it all falling Apart I it it you know if you plug in a New device and it might screw something Out but yeah it's like everything else Like everything else in Linux Okay That was all I've got I was looking at my list Yeah so I was looking at my list here And uh since we're just talking about The serial stuff You're saying you could connect you know Wires directly from those two pins on The the Raspberry Pi the physical uart To the two pins on your your Uh little board and what I was thinking About doing is taking a USB cable from My Ross computer say in this case a Raspberry Pi take a USB cable and plug Into an ftdi adapter chip and then from There take those uart pins and connect My my development board and there's Several reasons for doing that now You're going to get the same Advantage If uh you're using a physical uart on The on the Raspberry Pi as long as Nothing weird happens there with it That'll work fine but the problem with Trying to just plug a USB cable directly From your Ross computer onto your Development board that every time you Unplug that cable that that interface Just disappears so like say you're Trying to program this stuff in Arduino
And you you write up you write up some Blink code or you write a code that's Going to put a hello world message out And if you if you unplug that cable the Port disappears so if you have you fire Up your your serial monitor that Connects to that port and it's showing The text messages coming out if you Unplug that while the interface just Disappears it goes away and that's real Annoying because then when you plug it Back in it takes up some finite amount Of time for it to come back up and if You put it out a message that says Program startup today's date is you know You're gonna you're gonna lose all the First messages because USB is is Screwing around trying to trying to get This stuff started up so so in my case If I have a USB cable to an ftdi adapter Then even if I turn my development board On and off or reset it or whatever the Interface stays there so that that keeps Working and you're going to get that Same Advantage by using the fit the Hardware physical keyword on the Raspberry Pi so Um Because because even if you turn your Eval board off that interface is still Going to remain there so that that's a Big advantage to be able to do that at Least when you're debugging because it's So annoying because otherwise if you've
Got the USB cable hooked up and you say Push the reset button on your your Processor well that the interface Disappears and takes you know half a Second or whatever to come back up so They just that's always been a pain so I decided my stuff I'll probably do you Know have a USB cable to ftdi adapter to My my eval board And the reason I was thinking about Using the uart is because I goes into Another one of my my complaints here I Was trying to figure out the uh the boot Loaders and you know I've been trying to Use this this little Um this little blue pill board here Here pardon me a moment I don't know why my camera screw up so Screwed up maybe I need more lights in Here anyway I got this board and I've Having a lot of problems trying to get The USB to work and I I think when I Want to start rambling here about boot Loaders and all this other stuff I've Been doing I think it's I think it's Fairly reliable now that that it uh is Going to work but uh I don't know if I should jump into Bootloaders next so anyway uh this this Board has like two or three extra uarts On it I think so I could use the uart Instead of using the USB and just avoid That completely And that would as I was saying then then
If I hit the reset on the board or I Download the board uh and and it goes For a reset I don't lose my interface so I if I if it's putting any messages out Over the USB I can I can still get those Which means if I wanted to I could see My option is either just plug in you Know plug in directly like this so I've Got the the USB cable plugged in I got the USB cable plugged in and then That just goes right to my Ross computer And in general in in normal life that Will keep everybody happy you know you Power everything up and it all the Interfaces select and I can I can say Run either my own messages or run Ross Serial across that and everybody should Be happy but if it turns out that that Interface is somewhat temperamental then I don't really want to uh To do it that way and in fact even on my Uh to go back and tell a story from my My Sammy 2 robot when I was playing with That I had that big evolve board I had This one on there and it's got Um wrong end of the board it's got the Debug this there's a debug chip on the Board here so it's got the debug Interface and it lets you if uh there Goes my thing again So it's got these blue wires uh So you can solder wires onto this chip And solder onto a uart that's out here And then it will actually take if you do
A print statement from this chip it goes Out the cable and goes out to whatever You're talking to so I that's why I was Talking to Ross originally And the uh let me turn my background off Is it's not going to play today Background are you powering that uh Little blue pill from the USB on the RS On the Ross Well that's another That's another good question and on my Hold on I'm gonna have to go turn some more Lights on if this isn't going to quit Quit screwing up on me here Um It it depends right now I'm just I've Just powering it with either uh you have To plug if you plug in the USB it Powers It and then if you it's also got this Debugger plugged in and if I plug that In that'll power it and Juan claimed That he if he does that if he plugs both Cables at the same time he says his Debugger gets really hot and later I Realized he might be plugging one into One computer or one into another Computer So that might be a problem and then on My uh on my Sammy 2 where I had this Board what I did was I I've got one of Those little uh Step down converter so I've got my Battery voltage coming in and it's a 12
Volt battery and this steps it down to Five volts And then it turns out that when that When they build these boards they'll Have a from From this USB connector or maybe even This USB connector the power coming in Goes through a diode and then drives all The five volts on the board and but they Don't put then somewhere there's a pin On either here or up here there's a pin That says V in but that VN does not have A diode on it so in order to order not Screw things up what I did was I put a Diode between my 5 volt converter and This board and then the USB has a diode Between those so whichever voltage is Higher is the voltage it's going to use And that way it doesn't it doesn't Overdrive anything and if I unplug one Or the other the board continues to run Does that diode uh drop the five volts Too much uh it it can drop it but if you Get the little converters that have They've got an adjustment pot on so what You do is you you plug that in you put a Volt meter over on the the board side And then you just adjust the voltage so Whatever diode drop you have okay you Just adjust that away Because the the converter that I've got Doesn't have any adjustment So Okay and the the main the main point is
There uh if you just put a diode in There Uh it it it's probably it's not going to Cure because Um On the board then it immediately takes The five volts come in and runs it Through a 3.3 volt regulator to run the Run everything on your board anyway so It it's probably not going to matter you Could probably put in anywhere between Uh 3.3 up to six volts or so into the Thing yeah don't don't take my word for That without looking it up go make sure You can do that before you before you Actually start putting voltages on but But I think in general yeah I I would Probably put a diode between that and You're on your board if you've got Something called VN or something like That look it up first to make sure what The voltage range is and that's what It's for but then yeah put a diode Between that and the external world if You're going to power it that way I see if you're if you're not going to Have the USB cable hooked up all the Time that yeah you do need to power it Some other way and that was my reasoning Too that I I wanted to build a power Directly as soon as I turn on the main Power switch on the robot I want the Robot itself to power my microcontroller Board as opposed to having to power it
Up through USB because mine will run Without the Ross computer on at all and If that's what was supplying the power Then that could be You know that could be an issue so so Yes that's okay that's the point on that I forgot what the original question was You said something about powering it for USB or something else well right I asked Whether you were powering it just by the USB to Ross Computer and what it sounds like is You're not Uh that's correct it could be powered Either way the way I've got mine set up And right now on on this one I'm just Starting to experiment with it's got Nothing it's just the board and if I Wanted to I could put well in this case This is this could be powered both ways Because it's got I can plug this one in And Powers it or I can plug the other End of the this Cable in and Powers it And then if I find somewhere on here There's a pin that says VN or something So you know I really should have that Hooked up to drive it that way too so Well that's still down the path so I Haven't figured it out yet This So I guess I'm just gonna be red today So anyway back to uh the serial stuff Yeah it's handy to have something that's Not
Not directly USB that it you keep losing Your interface anytime you do a reset or A download or anything else happens Um so that was that was that was some Something I thought about and on my my Sami 2 that's what I've done I I oh I Was going to tell the story of that so I I had that eval board hooked up and I Was going to the from the debugger USB Port it was going to a USB hub and then Hub is going to a Raspberry Pi And you know that that's just the way You hook stuff up and it should work but My my board kept resetting on my my eval Board kept resetting and I finally Tracked it down if you watch the D Message it says oh I just got a Timeout On this USB they called it USB something I can't remember did you USB serial or Something and it for some reason it was Just it was just cranky there's some Something between Linux and then Hub and Then debugger Port uh just randomly it Would time out or cause errors or Something and then my eval board would Reset on me and that I found that to be Very annoying But then I found out if I instead of Going through the Hub if I go directly From the the debug Port uh the USB cable From there and plug it directly into a Root port on the Raspberry Pi that had Stopped resetting I could still see Messages popping up under D message so
It's still it was still cranky still Didn't like that situation D message what's that uh that's a Linux Command you just type in D mesg and that Shows you a whole bunch of stuff going By And while we're at it here we uh Let's see how do we get chat to work Here So you can either do Just type that in Or you can say d e f as G Dash Dash Follow And that will What that does anytime you plug in a new Device or something changes you know it Shows you stuff because otherwise you Get like you type in D messages you get Like a thousand lines of stuff dumped on The screen and it won't change anymore After that so instead of typing D Message anytime you do anything just do The D message dash dash follow or you Can say I think I noticed d m e s g Dash W is the same as doing a dash dash Follow so you know the dash dash follows More more apparent to to a user because You know Uh app here that I ca I can't edit that Can I no I can delete it later I guess I Can say dash dash dash w So now before we before we move on I Just want to verify what diode you're
Using would uh one and four zero zero One Ah that should work that's a one amp Diode and you've got a small board mine I think I ended up putting a 3M diode on It because Because I just powered the board and the Board is power in my remote control Receiver and it's powering some other Stuff so I just put the larger I think It's a 5 amp module you know power Module on that I think I put a 3 amp Diode in between mine And I don't think that the type really Matters whether it's just a standard uh Like a power supply diode or you use a Shotkey diode so so the one in four Thousand one that's just a standard uh Power supply diode and it's going to Have you know like a 0.6 to 0.7 volt Drop And it's probably it's not a fast it's Not a fast diode but again you know it's It's DC so it doesn't doesn't really Matter too much so to answer your Question yeah that should work Okay what was the uh 3 amp version Uh I'm not familiar with it I I might Have used a shotkey diode it might have Been like a one in 5401 I think is the the numbers on those Or it you know there's about a million Diodes so that's you know what whatever I happen to have at the time is what I
Put on there Um So let's see if we if we beat that to Death uh yeah it it's a good point how Do you power these things and it's a Good point you know how do you connect Them together Um so I guess maybe we've maybe we've Covered all that So um let me back up and say so so I Think it was last week I was saying I Should take my my blue pills and see if I can figure out Um how to get those to work and if I can Make them work like an Arduino then I Could go go down that route so I pulled All my Boards out and it turns out that All three of them seem to act Differently all right I tried loading Boot loaders on them a couple years ago And it turns out one of the boards still Still apparently had a bootloader and if I'd run it under my Windows machine and I picked the right download option I was Able to actually load the blank program Downloaded the board make a change and That was working at the house that's Great and then later Um So so now we have to move on so anyway I Had that I had that working so I was Working like an Arduino I'd just say go To my blink program say upload it would Automatically stop the board reload the
Code and come back up running and Everybody seemed to be happy at that Point So then I moved on and I thought if I'm Going to use these blue pill boards and I want to use quadrature decode that's The whole reason to freeze the SD micro Stuff there's a guy on Homebrew robotics That has a GitHub where he wrote up code To do the quadrature decode on a blue Pill so that well I'll start there So I download his code it's just like an Arduino type sketch I loaded it in and Into my Windows machine and I said Compile and it popped up just you know Hundreds of Errors saying it can't find It can't find this Define in this header File it says the type defs are don't Match it said you're trying to convert Between integer types and I thought I I Don't so I looked at that for a couple Hours and finally decided I wasn't going To figure that out and I thought well I Should load this on a Linux machine Anyway And that would give me another give me a Fresh install and and whatever so I Pulled out my Linux machine and went Found the newest one dot X Arduino stuff Because when they go to 2.0 they change The user interface I didn't want to deal With that so I loaded loaded the newest Arduino stuff that I could And then I
Went through random Youtube videos that Says here's how you load the the stm32 Core so it understands this type of Chip And I I took somebody's video and I did I do One or two maybe I got it right the First time I picked one and loaded that In and then I said compile that code for The encoders and Bam it says oh Everybody's happy we're we're all ready To go so so I knew there's some Difference between those And then I thought okay now I got to do Is put that on the board to test it so I I went to it and I said upload with the St link uh interface which is that Little module that's on my board it says Up can't can't do it they've got a cord Dump or whatever they call it whatever The modern term for that is where it it Just blows up and it doesn't do anything So after much digging it turns out that You have to go out and load specifically Load the drivers for this St link module To work and I found one guy's uh Description I followed that and he Downloads a GitHub and compiles it and Did a lot of manual installs and copying And that one it looked like it was Trying to work but it obviously wasn't Going to work and then it was it was Time to go to bed so I got up the next Day and thought well maybe if I Uninstall that and look for a better
Version so I painstakingly uninstalled All that crap and found another YouTube Video and the guys to step me through it And I went and tried that and that did Work so I was able to get my St link Will now download from Arduino so I can Say you know load up a blink program say Select the St link programmer and say Upload and and it will So that was I was happier at that point So I went back to the Windows machine And thought why it's not why is that not Working and the the stm32 core that I Loaded was different between the uh the Linux stuff and my old stuff on the Windows So I thought well how do I fix that so I Was going to say how do I delete the Core that's there And I went out and looked at the board Manager and it said you know under this Description it says deprecated Deprecated deprecated I thought oh well That's why it doesn't work because it's Old and it's a piece of crap so I was Able to figure out how to uninstall that And then I installed the one that was on The Linux machine and then Windows Popped up says oh hey compiled every Everybody's ready to go so you're all Set so okay I'll upload that one so I Said plugged in the St link and said Upload it says oh no no I don't know St I don't know that that module anymore so
When I swapped out my 32 core it threw Away my drivers for my St link so I Think someone was saying now I have to Go out and install The st-link programmer package for Windows and that will fix that problem But I haven't got around to doing that Yet So I got to the point where now on Linux I can I can write code and it it seems To be modern enough code that's going to Work and I've got the one program or Function to work on that And uh So somewhere along the line I I think it Was When I switched over to the Linux Machine I thought okay let me try that That bootloader that's on the one board That the bootloader still works and I Selected whatever option they told me And I I did like a blank program it says Download and it comes up says it started Going through it says loading block Block block block that is in I think it Says download complete and then it Wouldn't talk to me after that so it so It did it did understand the bootloader And it downloaded code to the board but Now that that bootloader seems to be Gone so that's there's a problem with That And I I kept kept running into the Problem of the bootloader and I kept
Saying I should fix that and I did dig For hours and finally I'd keep giving up On it so last night before before I went To bed I found I may have found the Answer to that but let's let's let's go Back and move on with that so anyway I Can't do any of the the USB download Because I need to have a bootloader on This particular board to make that Happen but if I wanted to I can use the St-link programmer and I should be able To get that to work on your windows Again or it's got the serial download Option so you have to move it's on the Board it's got uh It's got these jumper blocks on the Board right here so you have to move one Of these jumper blocks push the reset Button and then put it back and that's Supposed to uh that puts it into a Serial download mode so there's two pins On the board and you can hook it up Either with an ftdi adapter or or like Terry's doing connect it directly to his Uh uart on his uh Ross computer So that that's another option you can do But then you have to go out you have to Monkey around with the jumpers to get That to work but I haven't given up on That completely as a a final final Solution because uh if it's connected to A uart anyway I can just use that you Are to talk out like like Terry wants to
Do and then whenever I want to reprogram It I could move the jumper and do it That way or I thought I could probably Get clever and have a little extra Microcontroller sitting there that knows I want to download and to wiggle those Pins for me to put it in download mode Or possibly in your code so you got code Running on the thing you send down a Special message saying saying boot or Serial boot or something and I think I Think internally it can just jump to the Bootloader and that will you know bypass Having to play around with all the Jumpers and everything and it that'll Work fine until it blows away your boot Loader and then you'll have to you know Do again do the Do the do the uh you know the jumpers The push button so you might have to do That to recover it but so there's lots Of different ways I went down that path On trying to figure all that stuff out You know what would be the way to do That So let's see uh well back to the fact That I was trying to get that quadrature Stuff to work And When I when I loaded the code it it was It initializes three channels and then It's supposed to uh read the read the Encoders and it just prints out a line Saying count in my case is account zero
Comma zero comma zero and since I've I Haven't got to the trouble hooking up an Encoder I assume that code's working and I assume if I hooked up an encoder that Would actually work So let's see my my thought so I've moved On with that I just know that it will Probably work if I uh if I If I hook up the encoders it's probably Working so that's something I need to Merge in later and let's see so I talked About the The Arduino on Windows the Arduino on Linux the St 32 core was a problem the St T link stuff so on either automatic Computers I have to load the St link Drivers separately and for some reason What I did it the first time it worked And now it doesn't on on windows so I Gotta track that down So then back to the boot loaders again So it turns out I found a YouTube video A couple years ago that said oh I told You six months ago how to load this Bootloader but now throw that throw all That out and load this new bootloader That's going to solve all your problems So that's why that's what was on the Board and I didn't understand any of This stuff but it turns out that was an HID bootloader and hid is some kind of a User I I can't even think what hid stands for But but anyway it's it's one of the
Various methods you can use so as a Bootloader written that can understand That and then you go to the Arduino when You say upload to one of the options is Hid 2.0 or 2.2 or something so Technically that should work now when I Try to do that on my Linux machine it Says oh uh the H you know it gives me a Line saying JavaScript blah blah blah it Says in this directory it says hid under Bar upload not found And but if I go look at the directory Where they told me to find it there's One called hid underbar flash so Probably that's just a naming convention That somebody screwed that up where it's Pointing to the wrong program to run That so so that wouldn't run Um Even though I think it early did it Earlier work Somehow I tried to do that and that's Why I blew the bootloader away on this Again so that was so that was that was a Concept there you could run the hid Bootloader and Everybody kept saying well the resistor On the board because here's the board With uh So so somewhere on the back here there's A resistor that they say it's a 10K but It needs to be 1.5 K and somebody says Well solder this resistor on here uh They'd say solder on a 1.8 K and that
Imperial is a 10K it's supposed to give You 1.5 K and they said that's going to Solve solve problems while that didn't Affect my stuff any and then I I was so It is digging through the boot loaders It's not obvious because people say Well It started with this one it went to this One and they're they're you know like 20 Or 30 of these things around and I can't Figure out what is what but I found one That's you know right on Linux now it Says I can use the St Stm32 duino bootloader so I was trying To search for that that took me to the Uh the Roger Clark from Melbourne Website which is also called he's he's Tied in with the stm32 duino Development group and I I kept seeing The stuff and I couldn't tell what modes This stuff would run in or what it's Supposed to be connected to and then Finally it's before I went to bed last Night I was on that GitHub and it kept Saying well look in the wiki and I Clicked on the wiki and it's it's inside The GitHub the little tab at the top That says Wiki and then I found a wealth Of knowledge there talking about uh Number one just the boot loaders in General and number two how this this Specific bootloader works so I think if I get Get his Version the st-32 duino bootloader if I
Put that on my board and then under Linux select that one that possibly that Will work and it may be smart enough That uh you know if your your code's Just running you say upload it'll stop The board put the new code in or reset The board and come back up running so I Don't have to squirrel with jumpers There's still a whole whole exploration There and the first thing of course is Um it's got to work it's it's you know Whether it's got jumpers or not it has To be something that works on that So that's that's kind of where I left That and I'll I'll go back to that here You know eventually on that so I I I'm still trying to think you know As we're talking about at the last Meeting if you can do all your your Programming in circuit without having to Tear it apart that'd be great if you can Do it without having to you know fiddle Around with jumpers and push buttons If You if you absolutely have to do that You can solder wires on and put push Buttons on the outside of your box so You know you just walk the box and say Hold down the boot zero button and then Reset it and then release the boot zero Button and that without having to tear It apart at least that will put you in a Mode where you can then go to your Bros Computer or your whatever your big Computer is and say reload that board
And then hopefully that would hopefully That would work So that's I still have to dig into that And uh As I say I I was the the other confusing Thing was I when I loaded the the Linux And I wanted the stm32 core to put on The board it says oh use this link and It's like https slash colon slash slash It says dan dot drone .org and then listed the whole thing out Of where you find this Json file but if You click on that and go to his go to go To there it just brings up a you know Instead of bringing up like a GitHub or Something else it just brings up a Single statement that lists out the the The website of the Stm32 duino website and that takes you Into the forum so it dumps you into this Forum but nobody there seems to know What this code is so I was digging Through this big long thread of several Hundred messages and finally they Decided that uh this this that Particular uh version of this Json file Was built by this guy named Dan drone And he just takes the stuff from the the Stm32 duino uh GitHub and he compiles it And stores it on his web page nobody Nobody says that but that's apparently What's happening here so if you want to Run this stuff you have to I guess you Can point to his stuff and load it or it
May be somebody else because somebody Says oh I think that's identical to to Roger's version and Rod it's this Roger I forgot what his name was Roger Clark From Melbourne so but they don't seem to Equate these together and nobody seems To know what's going on so I think after Reading all his message I finally Decided what I have is the latest Current stuff from there And then if I go to the bootloaders and And load that bootloader then Theoretically this stuff should all work Together so it's just a matter of going To track that down and see what happens They kept referring to the official oh Or you could use the official stm32 uh Core or you can use the stuff from the The duino site and I I still don't know If there's of the official version is Because they won't tell me that either So it's just all really confusing and if I just get to the point where it will Reliably work over that bootloader that I could decide if that's that's the way To go or do I want to use the serial Mode and do it that way which again Would give me the advantage it gets away From the the USB port coming and going As you do things so So I think uh the only other thing I was Going to point out is I've still got This this uh STM f
When it's F 407 board this is the one That Juan found and it's got the same Chip as you got on the the bigger eval Board here and so theoretically although It looks like the one chip is much Bigger maybe it's that's optical Illusion anyways so this is the same Chip on this one but it's it's got the Dual row headers so it'd just be more Soldering and playing around and Uh the advantage is it is a cortex M4 And I I kept saying for the last several Years that these f-103 boards I said Well it's the it's STM 32 F-103 I think is what the board the chip Is on the board so I assumed that f-103 Meant it was a cortex M1 because it said F1 well it turns out no it's a cortex M3 Even though it's called F1 so I you know It's f-103 but it's actually a cortex M3 So I've been telling people the wrong Thing all these years so this one's a Cortex M3 and then these these Boards of Cortex M4 And so they're newer and newer and Better and they've got floating Point Hardware floating Point whereas the the Cortex M3 does not And then the cortex M3 only has a Serial Bootloader but it is built in so you Can't blow it away you just move the Jumpers and Um it will load over serial then the
Cortex M4 apparently the jumpers you can Set it and you can run something called Dfu mode so again it's another built-in Boot loader it's on that board you can Either select the serial bootloader or This dfu mode and as long as you've got Something they'll talk to that then Theoretically you can program with those So just still more more things to go Down the path here and try to figure out What's going on And I haven't I haven't decided on the The the the F4 type boards which have The cortex M4 processor that's got the The built-in bootloader it's got this Built-in serial bootloader and built-in Dfu bootloader that you move jumpers Around to make it work I don't know once Once that's running you know can I get By without having to do the jumpers you Know having to fiddle around with that If I want to reprogram it or if it'll do It automatically so that that's that's Yet another thing to try to track down So other than that I guess I haven't Been doing anything other than it a lot Of this it was just to avoid having to Actually work on the thing so I but I Did find a piece of perfume board and Bolted down to the top of my robot and If I put on socket pins like you know Enough pins to plug this board into it And then have I need uh One connector for each quadrature any
One connector for the power driver board Any one connector for the RC Servo so I Just I can solder some some header pins On there and just wire on the back of The board hook those together and I Should be able to ready to actually try This stuff And once that Hardware is built it Doesn't really matter if I use uh If I use um I was distracted by Al's post there uh Well what was I saying I don't lost my Train of thought I forgot what I was talking about So anyway that's uh Oh oh the thing is once once I get this Uh Thing stuck on a perf board and wired up To my Hardware it really doesn't matter If I use the Arduino IDE to write the Code compile it and download it or I Switch back to the St micro Um IDE and use their libraries and their Methods I could I could program it Either way so it's not really it's it's Not a problem you know whichever way I Do it other than I see when they're They're doing the Arduino stuff they've Predefined which pins are going to be For the quadrature encoder and then it Turns out look by looking at it it seems Like whatever is Select for quadrature Encoder it's going to affect some of the
Extra uarts on the board they seem to Over the pins overlap now you these Things are very smart and you can go Into the uh if you're running the uh the St micro stuff I can say give me a Quadrature decoder give me another one Give me another one and it starts Assigning pins and if I decide well now But that conflicts with the uart that I Can I can say switch the pins on that to Something else and lock it down so it Quits quits trying to to bite me and Then I can and then say initialize the Uart so it allows you to Multiplex these Pins and decide what you actually want To run and if it conflicts with Something you might be able to switch Them to some other set of pins and make It work so that that's a big Advantage There and you can probably if you know What the commands are you could probably Do that in the Arduino code it's just Simply when you run your setup say uh You know do her A setup now let's see I I don't know how You do it but you got to go in you got To go in the code and say move these Pins around so they're where you want Them so I don't know if that's really The way to do this or not so it's just More more digging I guess So I think I'll stop babbling now So So to do a blue pill in an Arduino
Environment after all of your research Do you have to use Um do you have to solder on that Resistor and do you have to use The um Oh the the add-on Bootloader or can you do it through USB Well you you can't do it through USB Unless you have a bootloader I believe Now whether you have to solder the Resistor out or not that I I haven't Proven that people keep saying oh you Have to do that because the spec says it Should be this other value But you know I've I was using the USB on These without it being a problem Although I found somewhere as I dig it Through the source code it said Something about in order to get this Board to reset from the computer Somebody did this trick where you do Something you Re-initialize one of the I think the Data line From USB to just a gpio and it turns out They had to put a smaller resistor on to Make it that happen reliably so even Though everybody keeps saying the spec Says you has to have to have a 1.5 K Resistor instead of a 10K resistor I Don't think that's true I think it's Something some trick they did to make This bootloader work is why they have to Have that and everybody's propagating
The wrong information But uh so to answer your question I'm Not sure yet I have to you know see if I Can get a bootloader to work and then You can program it through the USB and Then find out what the caveats are to That if you have to you know if you have To do something like uh re manually Reset it or manually move jumper pins Around or whatever so I I don't know on That yet and the resistor again I'm not Sure if that's really needed or not So I I do know that one of my boards I Popped that 10K resistor off so it's got No resistor and it will not will not Recognize the USB so it has to have some Resistor on there but I'm not sure what The value needs to be on that So I'd say don't jump into this yet I Know you said you've got a whole pile of These laid around but you know We don't need other people going off on A wild goose chase until somebody Figures out you know how it actually Works so But in order to just yeah I was gonna say I went down the path Some time ago and it just became so Frustrating to get a bag to get them Programmed so Did you have the little uh module you Plug into it when one of these did did You have one of these were you trying Either the cereal or the USB to make
Yours work yes I think I had a couple of Them Well it turns out if if you're willing To use that module You can program it from an Arduino IDE As long as you set everything upright And if I would go back to the St micro Uh IDE and their libraries I could also Program it that way and I think the Board you know by default it's got that Serial serial boot loader built into it So if you wiggle the pins you can get That to fire up and I think either the Arduino or the SD micro stuff will Directly program that it just really Comes down to this bootloader trying to Get that figured out and number one find One that works find it works reliably And doesn't get overwritten you know Every every two or three times that you Program it I don't know how that's Happening or what's happening there so Imagination For me it was access to the board after You get it programmed I mean if you have To go back and reprogram it That's where I think Like abandoned using them because I Couldn't Having to use that module that you just Held up Is really impractical once you sort of Covered it up with a wheel encoder Well I also found out anyway but
I I seem to leave this plugged in all The time just like this and and if I Don't don't plug this into USB it Doesn't seem to screw anything up and And then if I want to talk to it over You I can power it over USB and Everybody's happy and or I can I found On my computer if I plug this this thing Into uh Plug this USB and this USB cable into The same computer I don't seem to have Electrical problems like one said he was Having so theoretically he could leave Both of these plugged in all the time And that way you just simply you know When you get ready to program you just Say program the thing and it goes out Through this through this debugger Module and programs it and once it comes Up then it'll start talking over the USB Cable so that again that's just more Stuff to You know to prove that it works and to Prove that works reliably and then and Then in a month you know say is it still Working or is it randomly causing Problems so that's just more Than as I say more more Journey there to Get that to work And in reality I kept thinking well Maybe the blue pill board's not very Good but it's just a chip solder on a Board you know there's no there's no Magic on the board and that's that
That's part of the problem because the This is uh extension of the maple leaf Board and the maple leaf board had the This processor on a board but to put Some extra parts on it to make the Downloading work better so theoretically You know if instead of buying this board You'd buy the maple leaf it's got more Um it's got more Hardware there to solve All this downloading problem but Somebody claims they've got this to work On this board without doing any Modifications other than maybe that Resistor so Again it's it's just going to have to be Tried and see what happens Foreign Oh and one other thing Um I I say I didn't write it on my list Here but they were talking about the Serial stuff and then Ross cereal came Up now when I would always do my stuff I Would just have a in order to con to Communicate between my microcontroller Board and my Ross computer I would just Simply have a print statement that would Say like say up on on Ross I had a node I think I'd probably call it my machine Interface node and it was probably Written in Python so I'd start that node Up it would subscribe to something like Say command velocity And then in in the in that program where You get a call back on command velocity
It says I just received this message I Would just strip off the forward Velocity and the the steering field I I'm going to call the steering field at This point without spending half an hour Explaining all that so I just strip off Those two values and then in the code it Would say uh print to this port so so I'd have so they would be connected by a USB port so I just do a print and I'd Create my own format so I'd say Something like uh e or I'd say c for Um command velocity comma the first Value comma the second value I just do a Print now we shove it down the thing and Then on my microcontroller it just says Oh I just received a line of stuff from The from Ross and it just says oh it Starts with a c that means it's for Command velocity it takes it parses Those two values and uses them so I just Use that concept you know going either Direction if I want to generate odometry Information on the microcontroller it Gender rates by five values I just uh So I do a print statement that says like Oh for odometry comma X comma y comma Theta comma uh velocity comma rotational Velocity and do a print and it sends it Up the Python program it says oh I just Received the line for the Microcontroller it strips off the values That then publishes that as an odometry Message and as an odometry transform so
That's the way I was originally doing That So then when I went and looked at the Raw cereal stuff uh it turns out you Look at the examples they're they're Very simple examples you just simply say Include ros.h in your your Arduino code And then under setup if you're gonna Let's see I think uh I don't remember if You have to set up the serial port or Not at that point I don't think you do I Think the the code automatically does That any in setup you say something like You know initialize the The raw cereal or whatever and then in Your your code it just simply says uh I Want to subscribe to and you you have a Mess it looks a lot like Ross code so You say I want to subscribe to this type Of message and that had me going because I after I got all this stuff loaded it It loaded up what looked like thousands Of messages but none of those had a Command velocity message in there so I Went out looked at Al's code and it Turns out you say I want to subscribe And you say it's a general messages Colon twist and that the twist is the Key right there that's a message type That is supported and then the next Field you say that it's going to be Called slash command velocity and the Next field is the Callback that when you Receive this message that's the the
Stuff in your Arduino to execute that And then the rest of it just it looks Like Ross code so in your callback it Says uh Ross callback uh comma message So that message now has a message is Received and then just like you do in Ross you'd say Okay a message dot Um velocity is going to be put into Velocity and message dot uh angular Velocity is going to go into uh steer And so it turns out that You know I kept avoiding so I thought oh It's going to be too complicated to Figure this out but it looks like yes From that standpoint it looks like it Will it will work if it's not taking up Too much room in my microcontroller in Order to do this stuff So the point was If you go through the examples and load Up the code you have to load the Libraries on Ross to do the I think it's Called the Ross serial dot python that's The program that's the node that runs at That end and then it loads another one Into Linux and then from there you Execute you do a Ross run something About load libraries And it's smart enough to take that stuff That you compiled and it and and somehow Wedge that into your Arduino Installation that's on your ross machine And then after you do that it just Apparently seems to work so I'll play
With that some more and see what see Where I go I started off they had a a Hello world program they just simply Initializes the thing creates a string Out that's going to publish a string Output called chatter so this is like The chatter example under the tutorials And then down in the code it says load The load the the string hello world into Whatever the message is and it says Publish that and it just magically Pushes it up and goes up to the python Node and it just magically publishes That as a chatter uh topic and that I Tried that and that did work and then I Went they had one called Odom and if you Look at that they've taken the the Odometry tutorial and stripped the code Out of that and stuck it into this Arduino program with the uh raw serial On top of it so you fire that up and it Generates a it publishes a transform Under Ross at like I know it's running Like 20 20 times a second or something You can see the values changing And that that odometry uh Odometry tutorial basically says here Let's just create a fake uh fake values Of driving around in a circle so it's Doing this uh shows it drive in a circle If you go watch it on the Transformers You can see it see the numbers changing So it does indeed that does indeed work So it's just gonna be a matter of
Figuring out you know how many how many Messages can you define because someone Said there's equates if you've got a Certain size processor you can do like Five you got a bigger processor you can Get like 25 and so it's just a matter of Figuring out you know Um You know just start off with the simple Stuff I think it's just going to work And then if if you have more than a Couple of messages you might have to Look at it and decide uh is it you might Have changed the equate to say do more Messages or something But you know there's actually before What I'm doing there's very few messages Being passed back and forth from Ross You have to send down the message it Says here's my forward velocity and my My steer value so that's one message and Once it gets down the microcontroller it Strips those apart and I can send the Velocity part of that to my Motors to Push it forward and take the steer part Of that instead of my RC server to make It steer and I was trying to think am I Doing anything else right now see I've Got will that work uh That I I mean I understand you're using The Ackerman for yours Would uh that's steer value Be um acceptable for the skid steer yes It all works out that's that's the thing
I didn't want to spend half an hour Going down the path that okay if you're Using temp planner or if you use the the Regular planners you get a normal Command velocity which is forward Velocity and rotational velocity but When you fire up the temp planer you can Set a flag saying convert that instead Of rotational velocity we want to Publish a steering angle and as they say Write the code says you shouldn't do This but we're going to put that right On top of that standardized message and Basically we're going to re Re um redefine that message and so so It's passing the same exact message down It's just how you interpret it at your End So the answer is yes yes that one okay And in fact in my case if I go to the Ackerman message then I you know it's Got It's got like six fields of stuff That it sends down instead of two Fields But but yes it should all it should all Work and in fact I noticed on the the Messages that are loaded it specifically Had one for Ackerman Ackerman command Message and but it did not have one for Command velocity so it's just just one Of those things it'd be more more Digging to figure out how to how to Merge this stuff together and make it Work Foreign
Owl runs Al runs this Ross Ross cereal And I went out and dug through his Examples and he's got he's got a Separate steering controller and a Separate transmission controller and Both of those subscribe to this command Velocity coming in and one of them picks Off the velocity to run the transmission Aaron picks off the steer to run the Steering stuff so that's something else You can do you got you got two separate Modules subscribing to the same message And that apparently apparently works I I Guess I don't see the reason why it Shouldn't work so Everybody's happy So just keep in mind you might want to Go with raw cereal or you might just Send your own values back and forth So it's just one of those things So I think I think I'm finally done with All my stuff that I was Looking into And back to your comment about how to Power the board yes I need to figure That out right now if I plug in either One of these things into a USB it Powers The board and just for debugging that's That's good enough right now and I I Don't have to get the bootloader running I can I can write code and get it to Program but I I'll probably go back to The bootloader next and see if I can get That now that I found actual
Documentation for it maybe I'll go back And try to get that get try to get that To work Okay So I'm I'm done I think Terry's done so Al did you have anything you want to say Now that I'm going to shut up Uh well I'm gonna be I'll try to be Brief let's see um I decided to use the word struggle Instead of fight but Um Relearning rust cereal Um Struggling with Ross info command to get Debug statements out because once you Subscribe to Ross serial you use I have Not found a way To get debug statements in a print Or Sprint F kind of way working so Anyway I have um cut command velocity Working in my main Uh Embedded code for the tractor controller I've implemented A mode switch I'll just Canter through The code a little bit Um I've changed from one esp32 Pwm generator called ESP Servo to Another tool and I'll explain or another Library to generate a pwm signal I'll Explain That I've driven the tractor out in the
Yard to figure out some Min and Max Control settings I've hard-coded my PID for steering Mostly Uh And the next thing I need to do is work On a PID controller for my speed and Implement a Deadman switch Um And I can explain a little bit about why And then Get to a command velocity Mission simple Command velocity mission Where I try to do anything more fancy But let me just show you the state of A couple of pieces of code oh and by the Way I was looking up I have the nanowet Every and I was just it appears that's a 20 megahertz clock speed and then I went Over to the blue pill And that the M3 is a 72 so yeah now I'm reminded why that Blue pill was Interesting Um Let's see as a reminder this is the Board that before we move on you were Saying you you couldn't get Ross info to Work are you just simply looking for a Way to see you'll get dump the stuff out And see it or did you really did you Want it to be logged in uh I assume that If you put it Ross info it'll probably Be logged as a Ross Bag
Or do you just want to see see the Messages It was mostly just to see it I mean I Found a workaround but I couldn't get The library There's two particular libraries and I Couldn't get them to work Um or couldn't find one actually I found Console.h But it required macros.h and I couldn't Find a Couldn't find it So you said you got you mentioned Chatter so you've got a chatter that Just sends messages back because you Could just just use the concept of Chatter which just takes a string and Pushes it up and just whatever message You got just just dump it into that Message and let it publish that which is Exactly what I ended up doing Um well there's There's two things going on there you Can Um I So this is the include statement that I Just I'm just going to canter through This top to bottom just to show you some Of the changes so This was the old pwm driver this is the New pwm driver it I guess it was written Originally for LEDs
Um The reason I did that is because it Gives me Higher resolution Well let me show you what uh I mean by That Sorry my laptop Um I Previously Had Um These two you can't really see them but Full reverse position and full forward Position was 58 and 98 that gave me a Total of 40 positions 26 of them to be Forward Um and there was some dead space in There so it didn't actually have 26 positions and I didn't know how to Change the resolution in that old Pwm Library so that's why I switched to The pwm library now I believe Instead of 40 positions I've got a total of 80. Five so I doubled my Effectively doubled it 59 forward and 26 in reverse Pardon the noise if you're hearing any Of my noise Um Let's see I did that by Changing the
Changing the library And that Library gave me access to Uh Let's see there it is gave me access to This I can set the resolution and that Let me change the pwm Max You know to 12 a 12-bit Number and although I don't have full Access to that because by I mean this is a picture of the servo That I've got I mean I'm literally There's a maybe a two inch metal Bar Connected to this and I think The distance traveled is two inches you Know and so it's like doesn't go very Far at all Um So that's the that's the driver for no Pun intended that's the reason why I um Changed drivers so that worked out So far it's worked out okay Um See what else have I changed in here Here's the chatter That I've put in here to get What is Chatter It's just the name that I gave this Function we could call it Terry's info function if we wanted to If you look at the Ross tutorials they Have they have a a tutorial called Chatter and it just simply sends Messages back and forth and they thought It was cute to call it that okay so he
Just he just copied that name And I just have two Two lines You know and I put a delay in there Um Don't know if it's required or not and It's just a way for me to get this Information Out while I'm doing debugs Command velocity looks pretty Simple here's a safety check that I put In to see if I've got A command velocity recently because if I Lose access to command velocity and if I'm in You know let's call it automatic mode I Want to stop Um So this is a safety flag thing that I Added Here's the Subscribe statement that Jeff Was talking about Um The transmission setup For the servo setup went from You know those five or six lines to These three lines to change from that Old library to the new library And again that's where the pwm Resolution is Coming in My main Loop hasn't changed Um Had to take out all these serial print
Statements And so I need to go back and put some Sort of better debug messages in there That I Have access to Um Let's see what else has changed that's One of the reasons why I was thinking of Using the difference between serial zero And serial one on my itsy bitsy so that I could have serial one being what talks To Ross But I could still have any debugs That I want on the USB if I'm connected Up I mean and there might be a more elegant Way to solve it than my You know info function called chatter But that's just what I've come up with So far So I've added a safety flag here to make Sure I've got A radio signal this is a basically the Command that when the radio signal comes In And then those are a whole bunch of Serial print statements I've Kicked out and then this is the um A couple of things are going on here It's the implementation of the mode Switch And it is adding You know Boolean logic to say it's the Mode switches that and the safety switch
Is okay then It's okay to Steer or throttle the thing otherwise This happens to be steering so it Points it straight Uh and this is the throttle function That's I'm working on this is work in Progress as we speak Um But there'd be two safety Flags is the Laura radio working and is the command Velocity Is the latency on that okay Um Here's where I need to add And check the safety Laura radio signal But I don't check the dead man switch so I need to add Some logic in there to check the dead Man switch And then um yeah I don't think anything Else is really Changed let's see back to my Uh men and Max control settings So You know I printed this off went out Into the yard drove the thing around And uh Measured a couple of things that were 35 Feet apart And counted the number of seconds it Took at different settings to get Between those and so These are the actual pwm
Settings that will drive the thing You know more or less Two meters a second or 0.6 meters a Second Now I have Wheel encoders And so the next step will be to go get Those working again and Um You know measure it based on the wheel Encoder data but this was just visual Controls because I wanted Before I went much further I wanted to Get some more reasonable Values for Full position and Reverse position so anyway that's the Journey that I've been on the last week Or so And then these are just the uh Commands that I was issuing to get get Things going I don't think Go ahead Jeff for your RC Servo where You're talking about resolution and Various things if you looked at servo.h Library Um not that I know of because I was I was going into Um You know what was available In platform IO for my esp32 And there's no guarantee that exists for Every processor but that that is
Something they wrote specifically to Talk to RC Servos and you can look to See what it uses for Resolutions and Ranges and whatever and number one you Know make sure it is going to work on Your your device before you go too far Of it Yeah it looks like it's available from This I've seen his name before Michael Um Margolis This is the one that I was using But yeah that does seem a bit to be Available Oh I see that Servo esp32 is probably Doing the same thing so you see where You did try that that Servo esp32 or Yeah that's what I had originally okay Um But then when I got down to it and I was Doing you know driving you know Physically in the yard Um My Min and Max positions It was only a 8-bit Resolution so I only had 255 if I had Access to all 180 degrees of the servo Because I'm only using I don't know 20 Degrees of the servo It gave me a very few number of Positions that And I was thinking As I get ready to try to get a pit Working for the throttle
It just didn't have very many options And Um I was thinking better resolution would Help me so that was my Tortured Logic for changing I I've done more rabbit holes Jeff that Are probably unneeded and this may be Another one but I've gone down it and I'm giving back Out so we'll we'll see uh In the long run sort of the effort Anyway I'm happy at the moment that I've Got you know a little bit more Resolution to deal with That's all I've got And if you get real desperate you can Pull out a drill and drill a new hole in That arm and move the connecting arm Down to give you they'll give you more Range too the server will have to move Further to to move that depending on What your you know how things fit Together right now If you have room to do that I should say You're exactly right and that Servo is mounted in such a painful spot That I really A part of the notion of trying to take That off but Um yeah I could do that Anyway That's what's going on with me Progress
In the yard driving that's always a good Thing And yes I bumped into a few things You are able to go out in your yard and Drive around My manual radio with manual radio Control I just wondering how many Obstacles you have because we still have Snow here we got After after our 12 inches of snow I Still got lots of snow pile in front Yard over the next two days it's Supposed to snow another eight to eight To ten inches so That I I'm not going to be driving in The yard anytime soon Unless I want to drive 27 degrees here In the morning so I don't know that We're out of the woods yet but at the Moment the the snow has gone It says it's 26 degrees here Well here it's warmed up to 44. so it's Uh We're enjoying a balmy 44. Okay is there any more robots for today Nope that's all I got I'm sure I could Ask you questions about pids but um I think I'm good for the moment Okay