Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Spiked's Content

There have been 129 items by Spiked (Search limited from 05-June 23)


By content type

See this member's


Sort by                Order  

#59584 Serial port issues

Posted by Spiked on 06 August 2014 - 05:34 PM in Netduino 2 (and Netduino 1)

And you need to use a separate serial usb cable/converter. Other than that, all the program does echo back any characters it receives.

 

There are a few spots in the code that bug me.  Why does he allocate a byte array of 1 byte?  just declare a byte, then use Serial readByte() and writeByte methods instead of read() and write().

 

I especially would not do a new byte every time I entered that delegate - very inefficient.




#59598 Slow I2C Sensor Reads, is this normal?

Posted by Spiked on 07 August 2014 - 07:12 PM in Netduino Plus 2 (and Netduino Plus 1)

.Net  is an interpreted Managed language.

 

As such there are a few things you should not do if you want efficient code.

 

Note that efficiency was not a goal of .Net, robustness was. That doesn't mean you can not be efficient, you just can not go throwing around features that were intended to protect you from yourself, and expect efficiency.

 

In your main loop, you re-allocate (using) a i2c device 3 times every loop. That has to be cleaned up by the garbage collector. Allocate it once outside the loop, then re-use it.

 

Same can be said for your transactions.  There is NO reason to re-create 9 (or worse as I looked more, you are doing bytes?) of them every single loop.  Creating new objects is not free, nor is disposing of them when no longer being used (every loop in this case).

 

I posted an article a while back when I first started playing with the Netduino, showing an efficient way to talk to an i2c IMU; http://www.spiked3.com/?p=421

 

The code in the next post show multiple devices, so look at it also; http://www.spiked3.com/?p=438

 

Bottom line;  Think every time you use 'new', and if it is appropriate. Do not just copy someone else's code without understanding it.




#59600 Slow I2C Sensor Reads, is this normal?

Posted by Spiked on 07 August 2014 - 09:04 PM in Netduino Plus 2 (and Netduino Plus 1)

mqtt is used separately for m2m.

 

The important thing to realize is you can allocate 1 i2c, then switch configs;

 

I2CDevice i2cBus = new I2CDevice(null);
 
I2CDevice.Configuration accellConfig = new I2CDevice.Configuration(0x53, 400),
               gyroConfig = new I2CDevice.Configuration(0x68, 400);
 
......
 
i2cBus.Config = gyroConfig;
i2cBus.Execute(new I2CDevice.I2CTransaction[] { I2CDevice.CreateWriteTransaction(GYRO_DLPF) }, 100);
System.Threading.Thread.Sleep(5);
 
I create all my recurring transactions once, then re-use them.
 
I2CDevice.I2CTransaction[] accelTrans = new I2CDevice.I2CTransaction[] {
                I2CDevice.CreateWriteTransaction(DATAX0),
                I2CDevice.CreateReadTransaction(readBuf) };
 
And read multiple bytes



#59603 Slow I2C Sensor Reads, is this normal?

Posted by Spiked on 07 August 2014 - 10:16 PM in Netduino Plus 2 (and Netduino Plus 1)

....a handfull of examples I came across which all appearantly did things the wrong way.....

 

Wait until you look into ultrasounds. I have yet to see a single example on the entire internet, arduino or anything else, done correctly :|




#59609 High Resolution Quad Encoder Problem

Posted by Spiked on 08 August 2014 - 06:19 PM in General Discussion

"Doing fast rates with something like a kalman filter can be very hard to implement in a micro-processor."

 

Which is why I am constantly amazed that over 8 years ago (July 2006) LEGO was able to build it into a kids toy, for $99, and nothing has been able to touch it yet that I have identified (as in available and working out of the box).  3 servo motors fully synced with PID control from encoders, while running an interpreted but multithreaded user programs, on an ancient ARM. Oh, and 4 sensors of about any connection type.  Sigh.

 

So I ordered a cyprus FPGA to explore this aspect of the hobby, not having any luck making the Netduino or an Arduino do what the 8 year old LEGO can do.  Any pointers to learning FPGAs?




#59612 High Resolution Quad Encoder Problem

Posted by Spiked on 08 August 2014 - 07:00 PM in General Discussion

Well that is certainly in the right direction, but a ways off from what I want to do fully.

 

So im guessing (sorry im a software guy) this is a chip I add externally? and it eliminates the need for tying up interrupt pins on the Xduino (x=ar or net)? which would be helpful since the Arduino only has 2 from what I've read, and the Netduinos cant really depend on accurate timing.

 

I still would like to add accurate hc-sr04 reading to the mix. Im guessing this does not do that?

 

BTW amazon and spark fun has never heard of a LSI7366.  But I see a data sheet on it (LS7366)

 

Then I need to figure out SPI ? And use a select for each encoder chip I assume?

 

Is this easier than using a FPGA?




#59615 Slow I2C Sensor Reads, is this normal?

Posted by Spiked on 08 August 2014 - 07:17 PM in Netduino Plus 2 (and Netduino Plus 1)

As far as I know .Net in general checks every array access to make sure your index is in bounds.

 

Making some of your data a plain byte, versus new byte[1]   may help quite a bit.




#59617 High Resolution Quad Encoder Problem

Posted by Spiked on 08 August 2014 - 07:24 PM in General Discussion

I know nothing about that. So, cant use or comment on something I do not know about. Apparently it is a secret?




#59623 High Resolution Quad Encoder Problem

Posted by Spiked on 08 August 2014 - 08:57 PM in General Discussion

That's great new.  Chris, when will support for this be added?




#59626 High Resolution Quad Encoder Problem

Posted by Spiked on 08 August 2014 - 10:16 PM in General Discussion

Someone I have respect for uses PSoC a lot, so I ordered their dev board - $25ish. 

http://www.cypress.com/?rID=77780

 

I'd figured it would be a starting point.  I downloaded that PDF and will check it out. Thanks.




#59630 Netduino 2 Plus, New Home

Posted by Spiked on 09 August 2014 - 08:24 AM in Project Showcase

Just an update; indeed the robot did acquire a LIDAR.  It is the Robo Peak LIDAR as was intended.

 

 

I think the device is good so far, although you can find hack'd neato version on eBay now for < $100. I'm not sure how good the drivers are for them.

 

The drivers that came with the RP weren't the highest quality either.  C++ only and everyone seems to just copy the original code because no one can understand it.  The data sent from the device doesn't match the documentation exactly, but it's close.

 

sidenote: the right hand sonar is not mounted because it is broken. This is what happens when you say 'go forth' and don't have working collision code :|  




#59638 Netduino 2 Plus, New Home

Posted by Spiked on 09 August 2014 - 06:43 PM in Project Showcase

Chris, embarrassingly, I started 6 years ago with the intent to learn SLAM.  I am very much not a person to copy/use other code without understanding it completely, so my hesitation to just plug in a ROS module and say I know it now. I had stroke, and that put everything on pause for 2 years or more.

 

I started with a LEGO, which I still hold high in robotics education regards, but never could get satisfactory LIDAR on it, although I did find one project where someone had achieved pretty decent results, I felt like I was always fighting 'not enough compute power' and to a career professional developer, the development environments were not friendly (looking back they are way better than some current ones).

 

My first home design/built robot, had several, first design/built mistakes. And when the top panel cracked, I decided it was time to start a new one.  That is this one, my second design/build,  and it still has some rough edges, but at least it looks cool :)

 

So as soon as I am confident it can roam around a room without running into things and breaking, I start digging deep into heavy math (SLAM).




#59658 New Robot Meetup Group, Seattle

Posted by Spiked on 11 August 2014 - 09:33 AM in General Discussion

Excellent!  The group is getting lots of members, but no one is signed up for the current meeting.

 

I am hoping that is just a matter of it being nice weather, and people have better things to do.

 

Hopefully attendance will pick up up as Seattle weather moves in.

 

So, what kind of learning event would interest you?  I would like it to be a step beyond,in a robotics direction, what you can get at the many existing Arduino(Netduino) / make groups.

 

BTW this month I am presenting my robot, as it is so far.  I had a small breakthrough tonight, so it might actually be moving on its own by the meeting.

 

Nice nickname by the way :)




#59660 Windows on Devices? When?

Posted by Spiked on 11 August 2014 - 09:36 AM in General Discussion

I want that Galileo board! Submitted my application by have not been selected. Oh well, I will keep playing with my Netduino / Arduino for now. 

 

Suggested course of action. Come up with a specific cool idea to use it for.  

 

Join the IRC channel and talk about it, You might get noticed <wink wink>




#59664 Slow I2C Sensor Reads, is this normal?

Posted by Spiked on 11 August 2014 - 06:03 PM in Netduino Plus 2 (and Netduino Plus 1)

What sensor(s) are you using? Curious if you could 'charge' all 3 at the same time to save some time.

 

There is no doubt and Arduino without any sort of firmware will be faster than a .Net managed device, but my experience is my Netduino can always be fast enough for me. 

 

I had pretty good luck with a 9 DoF IMU, which was 3 i2c devices with 6 bytes of data each - similar data size to your application. I ended up switching to an mpu6050 that does all the math on chip, and lowered the complexity immensely. In the end it took like 2 real lines of code to do 3D rendered AHRS.




#59676 New Robot Meetup Group, Seattle

Posted by Spiked on 12 August 2014 - 06:37 AM in General Discussion

Take a look at Seattle Robotics, aka SRS; http://www.seattlerobotics.org/

 

There is a large maker / IoT community there, also at JigSaw Renaissance, Metrix, and other places around here.

 

http://www.jigsawrenaissance.org/

http://www.metrixcreatespace.com/

http://www.makerhaus.com/

 

Not that I'm steering you away, I just think they will have more resources at the moment than I do in those areas.




#59677 High Resolution Quad Encoder Problem

Posted by Spiked on 12 August 2014 - 09:33 AM in General Discussion

I don't know if I will do any thing with PSoC, but the break-away USB-Serial Controllers will prove useful.

 

lol. yeah for $4 what the heck.

 

I made some progress on my project. I was able to get 'good enough' stuff from the Netduino, which is great as it is the environment I am more comfortable with.

 

So I'm closing in on a LEGO NXT like Netduino component for my robot.  Dual encoded / regulated motor control, with ultrasonic sensors tightly coupled. The component will be implemented as a Pilot (move/steer), similar to those found in LeJOS and other Robot software.

 

I will still look at the FPGA eventually, as I always wanted to explore them.




#59696 Windows on Devices? When?

Posted by Spiked on 13 August 2014 - 03:13 AM in General Discussion

https://webchat.free...indowsondevices




#59773 Netduino Plus 1 and Pins class

Posted by Spiked on 18 August 2014 - 08:38 PM in Netduino Plus 2 (and Netduino Plus 1)

You have to watch how names of pins get passed around.

 

I define a variable like such

 

RegulatedMotor M0 = new RegulatedMotor( PWMChannels.PWM_PIN_D5, Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D10 );

 

but the function is defined

 

public RegulatedMotor(Cpu.PWMChannel pwmPin, Cpu.Pin encA, Cpu.Pin encB) { ... }




#59803 Multiple reboots

Posted by Spiked on 20 August 2014 - 07:26 PM in Netduino Plus 2 (and Netduino Plus 1)

Is there anything that can be done to reduce the multiple reboots that occur when debugging?

 

My netduino sometimes reboots 12-15 times before the debugger load symbol tables and begins debugging.

 

Then there are those rare occasions (1 in 50?) that it works with just one reboot.

 

I generally have control and can force some sort of orderly shutdown if that helps start the next session, I just have no idea what it would be to do that.




#59821 Windows on Devices? When?

Posted by Spiked on 21 August 2014 - 05:05 AM in General Discussion

The amazon one is supposedly gen 1. I read somewhere that WIndows required gen 2 BUT I was told that was not the case, and that is confirmed here; 

 

http://ms-iot.github...ghtAGalileo.htm

 

So that Amazon buy should be good.




#59841 Windows on Devices? When?

Posted by Spiked on 21 August 2014 - 08:04 PM in General Discussion

So that would be a problem for Windows and Linux then? As in a hardware limitation?

 

I'm really starting to get the impression none of these devices are going to satisfy the needs from a hardware standpoint. If you want to play in the IoT space you better have a SMC soldering pencil ready (metaphorically).

 

After a week of trying to make it work, I'm going to the FPGA board now.




#59901 Building Netduino Firmware

Posted by Spiked on 26 August 2014 - 02:52 AM in Netduino 2 (and Netduino 1)

I'm thinking I'm going to need to add stuff to the firmware myself, although it is way out of my comfort zone I don't know what else to try.

Is there any updated info I missed about a current procedure to do this?

 

I see the notes on doing it for 4.2.X in the wiki, step one is obtain some compiler that has been retired, so obviously that is out of date.




#59942 Blinky won't blink

Posted by Spiked on 30 August 2014 - 02:09 AM in Netduino Plus 2 (and Netduino Plus 1)

When you say "I can deploy the Blinky program, but  ..."

 

How do you mean deploy?  If you deploy by right clicking on the project and selecting deploy this does not start the program. It simply downloads it to the device. Press the onboard reset button and it should run.

 

On the other hand, you can deploy AND start the program by pressing F5 (as long as the project is selected as the startup project).

 

Otherwise your code looks fine and should work.




#59955 Blinky won't blink

Posted by Spiked on 30 August 2014 - 07:15 PM in Netduino Plus 2 (and Netduino Plus 1)

You had my curiosity peaked so I tried your program (on 4.3.1).

 

It ran as expected .... but

 

I will say it acted weird(er) than other programs. I don't know if you triggered some bug with a variable name or what, but there is a big delay when it starts (4-5 seconds).

 

I have 2 N2+ now, and they work differently as far as debugging, how many times they reboot when starting. The newest one consistently usb disconnects 3 times, then starts loading symbol tables. The previous one was a random number how many disconnects/reconnects it goes through.  The moral is I doubt if there is consistency among units at the moment.

 

I'll contrast this with the Galileo which feels rock solid as far as debugging (which also uses the ethernet connection not USB). 





home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.