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.

Ben Harel's Content

There have been 31 items by Ben Harel (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#53004 Commercial use of Netduino

Posted by Ben Harel on 30 September 2013 - 12:54 PM in General Discussion

Hi!

I have a theoretical question. Is it legal for me to buy, let's say 100 Netduinos, use them all to build the same project and sell it in stores?

Again, very theoretical question :)

Thank you!




#49812 Motors not working properly - urgent

Posted by Ben Harel on 23 May 2013 - 07:19 AM in Visual Studio

Sounds like the motor circuit is OK, but there is something wrong with the GPIOs. Possibly D4 is damaged. Try again with a different GPIO instead of D4. Then see if you can yet both motors running. I don't have access to my code right now to check the pwm frequency.

 

 

 

 

 

I tried D2, still nothing.




#49802 Motors not working properly - urgent

Posted by Ben Harel on 22 May 2013 - 10:31 PM in Visual Studio

Hi Ben,

 

Looking at the hardware:

There is no power supply shown in the diagram you linked to.

 

Do you have a Vin supply going to the barrel connector of the netduino (or directly onto the bread board)?

or are you powering the Netduino from 5V USB?

 

If you only have a 5V input to the Netduino, then I am guessing your motors don't have any power.

 

The motor driver needs a hefty power supply - I have found its a bad idea to draw power for motors through the Netduino's PCB. I also found it was a bad idea even to share a power supply (unexplained resets).

 

I now prefer to supply motors with a separate battery pack to the supply for the logic.

In my own buggy I use 6xAA for the motor driver to use, and a separate USB emergency phone charger battery to give 5V for the Netduino.

 

Looking at the software:

Try something really simple!

Forget PWM, just setup the GPIO as normal ON/OFF outputs and try turning the motors ON, then try reversing them.

This will prove the circuitry works.

Then try replacing the GPIO ON/OFF with PWM.

 

Hope this helps - Paul

 

Hi.

The left engine for some reason does not work, heres the code:

OutputPort left = new OutputPort(Pins.GPIO_PIN_D4, false);
OutputPort right = new OutputPort(Pins.GPIO_PIN_D10, false);
Thread.Sleep(5000);
right.Write(true);
left.Write(true);
Thread.Sleep(5000);
 
All of the cables are ok, and if I connect the replace cables between right engine and left engine the left works and the right one is not.



#49799 Motors not working properly - urgent

Posted by Ben Harel on 22 May 2013 - 08:16 PM in Visual Studio

And how do I reverse the motors? Reversing the cables?

 

oh I got it




#49798 Motors not working properly - urgent

Posted by Ben Harel on 22 May 2013 - 08:07 PM in Visual Studio

Yes, I connected a power supply to the Netduino.

About the software, I'll try that and report back. Thank you!

 

EDIT

Wait!

How do I set up the PWM? I gave it 1000 as frequency, is that good?




#49789 Motors not working properly - urgent

Posted by Ben Harel on 22 May 2013 - 06:36 PM in Visual Studio

Hi!

I have a platform(tracked) with two engines. I want to write a simple program that moves the car forward, backward and spin both directions. I used the following circuit, from the netmftoolbox documentation.

http://netmftoolbox....ailable classes

 

The code doesn't work for me for some reason, the engines do what ever they want.

I am trying to use a code I found on YouTube(modified for my use and the 4.2 version), here is the code:

 

class Motor
    {
        private OutputPort directionPort;
        private PWM velocityPort;
        private uint velocity;
        private bool direction;
        public const bool Forward = true;
        public const bool Backward = false;
 
 
        public Motor(int PWMPortNum,Cpu.Pin pinForDirection)
        {
            //
            switch (PWMPortNum)
            {
                case 3: velocityPort = new PWM(PWMChannels.PWM_PIN_D3, 1000, 0.5, false); break;
                case 5: velocityPort = new PWM(PWMChannels.PWM_PIN_D5, 1000, 0.5, false); break;
                case 6: velocityPort = new PWM(PWMChannels.PWM_PIN_D6, 1000, 0.5, false); break;
                case 9: velocityPort = new PWM(PWMChannels.PWM_PIN_D9, 1000, 0.5, false); break;
                case 10: velocityPort = new PWM(PWMChannels.PWM_PIN_D10, 1000, 0.5, false); break;
                case 11: velocityPort = new PWM(PWMChannels.PWM_PIN_D11, 1000, 0.5, false); break;
                default: velocityPort = new PWM(PWMChannels.PWM_PIN_D5, 1000, 0.5, false); break;
            }
 
            directionPort = new OutputPort(pinForDirection, false);
            directionPort.DisableInterrupt();
        }
 
        public void Stop()
        {
            this.Velocity = 0;
            this.velocityPort.Stop();
        }
 
        public bool Direction
        {
            get { return this.direction; }
            set
            {
                this.direction = value;
                UpdateDirection();
            }
        }
 
        public uint Velocity
        {
            get { return this.velocity; }
            set
            {
                this.velocity = value;
                UpdateVelocity();
            }
        }
 
        private void UpdateVelocity()
        {
            velocityPort.DutyCycle = velocity;
            velocityPort.Start();
        }
 
        private void UpdateDirection()
        {
            directionPort.Write(Direction);
        }
    }

-------------------------------------------------------------------------

 class DriveSystem
    {
        private Motor leftMotor;
        private Motor rightMotor;
 
        public DriveSystem()
        {
            rightMotor = new Motor(5, Pins.GPIO_PIN_D4);
            leftMotor = new Motor(6, Pins.GPIO_PIN_D7);
        }
 
        public void Stop()
        {
            leftMotor.Stop();
            rightMotor.Stop();
        }
 
        public void SetLeftSpeed(uint speed)
        {
            leftMotor.Velocity = speed;
        }
 
        public void SetRightSpeed(uint speed)
        {
            rightMotor.Velocity = speed;
        }
    }

--------------------------------------------

 public class Program
    {
        public static void Main()
        {
            DriveSystem driveSystem = new DriveSystem();
            driveSystem.SetLeftSpeed(100);
            driveSystem.SetRightSpeed(1);
            Thread.Sleep(5000);
            driveSystem.Stop();
            driveSystem.SetLeftSpeed(1);
            driveSystem.SetRightSpeed(100);
            Thread.Sleep(5000);
            driveSystem.Stop();
            driveSystem.SetLeftSpeed(50);
            driveSystem.SetRightSpeed(50);
            Thread.Sleep(5000);
            driveSystem.Stop();
         
 
        }
 
    }

 

 

 

 

The robot is not moving if I give zero speed value to one of my motors. But the code above only moves one motor(the first) and at the second one - nothing. Only when it gets to the part when both of them should go it - it works.

 

 

I am in desperate need of help. I busted my head trying to get it working for the last month, and the project is due tomorrow.(My project is a robot controlled by motion captured from a camera, so I need the robot...)

Thank you

 




#48264 Can't ping(on a network) my netduino+

Posted by Ben Harel on 10 April 2013 - 08:51 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi.

I have a netduino+, and I configured it using MFDeploy using this settings:

(DHCP disabled)

Static IP address: 10.0.0.44

Subnet Mask: 255.255.255.0

Default Gateway: 10.0.0.138(my router's IP address)

MAC Address: my n+ MAC address

DNS Primary Address: 8.8.8.8

DNS Secondary Address: 8.8.4.4

 

I used this wiki page http://wiki.netduino...duino-Plus.ashx

 

But when I ping through cmd: ping 10.0.0.44

I get Destination Host Unreachable error from my computer. What could be the problem? both of the DNS addresses I used, are from the settings in the wiki page, and I have no idea if i need to change them according to my network/service provider. Thank you!

 

 

***EDIT***

Now that I'm checking, if I ping the netduino+ on MFDeploy, it is always says TinyBooter, instead of TinyClr.Is that a problem?




#48217 USB Device Not Recognized

Posted by Ben Harel on 09 April 2013 - 03:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Well.. nothing. After I complete the flashing, I try to click on Device Capabilities, and I get an error:

 

<a target='_blank' title='ImageShack - Image And Video Hosting' href='http://imageshack.us...21/errorgy.png/'><img src='http://img21.imagesh...311/errorgy.png' border='0'/></a><br>Uploaded with <a target='_blank' href='http://imageshack.us'>ImageShack.us</a>

 

Plus, I noticed that at the very end of the flashing, in the step by step tutorial the textbox had:

chk signature

signature pass.

 

I had

chk sig

 

and thats it.




#48185 USB Device Not Recognized

Posted by Ben Harel on 08 April 2013 - 04:40 PM in Netduino Plus 2 (and Netduino Plus 1)

If bootloader mode works, try reflashing the firmware.

How do I do that?



#48013 USB Device Not Recognized

Posted by Ben Harel on 04 April 2013 - 11:16 AM in Netduino Plus 2 (and Netduino Plus 1)

Well, in one pc it does and in another one it does not. I deleted the drivers for both the regular connection and bootloader mode. In the pc which in I did not deleted the drivers, only the bootloader mode works.




#47988 USB Device Not Recognized

Posted by Ben Harel on 03 April 2013 - 06:37 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi. I have an N+ that worked and run a few simple projects before. After a couple of months lying in his box in a drawer, I plugged it to check its network settings to start a new project, but in MFDeploy, when I ping it it said TinyBooter or something like that, instead of TinyClr. I connected it to the pc without pressing the button. After I got tired of messing around with it, I decided to erase it, so I did, but still nothing. I decided to erase it completely and install the firmware all over again, and I deleted the drivers. Since then, when I plug the N+ to the computer(windows 7 32 bit) I get an error from device manager - USB Device Not Recognized. What can I do? I tried everything. This is very urgent, I have less than a month to complete a HUGE project by myself.




#46430 How do I connect Netduino+ to a pc wireless?

Posted by Ben Harel on 28 February 2013 - 09:09 PM in Netduino Plus 2 (and Netduino Plus 1)

You configure the adapter according to the pdf instructions. I use a fixed IP address for the adapter outside of the router DHCP address range and also give my Netduino a fixed IP address. For example,

 

Router LAN address: 192.168.0.1 Router DHCP range: 192.168.0.100-254 Ethernet adapter address: 192.168.0.3 <-- fixed IP address Netduino address: 192.168.0.50 <-- Fixed IP address

 

(1) Setup the adapter (IP address, SSID, Wpa key) (2) let the adapter connect to the network (check by pinging it) (3) Once the adapter has established itself on the LAN, plug in the Netduino to the adapter and wait a bit. (4) Ping the Netduino IP address and it should respond if all went well.

 

If steps 1-4 completed successfully, execute arp -a and in the arp table you should see the Netduino IP address and the adapter address, but the Netduino will now be associated with the adapter MAC address. You will need to take this into consideration if you are using if you are using the actual Netduino MAC for some reason, but otherwise it is the same as if you had just connected the Netduino to the router through an ethernet connection.

 

Thank you very much!

I ordered the router you suggested. You helped me a lot.




#46410 How do I connect Netduino+ to a pc wireless?

Posted by Ben Harel on 28 February 2013 - 03:43 PM in Netduino Plus 2 (and Netduino Plus 1)

There are adapters to bridge wired ethernet and Wifi. Found this article on the subject in general:

http://howto.cnet.co...r-home-network/

 

I've got some old D-Link product at home that does this for me. Such a link would be totally transparent to your Netduino. You could of course also get a Wifi-shield to do the job but then you probably can't take advantage of the built in networking capabilities of the N2+. Instead you would need a special driver.

 

If you don't need full TCP/IP, you can use Bluetooth or a pair of serial <-> 433Mhz (315Mhz) radio tranceivers. I think there are such devices that works transparently over a regular serial line. This would probably be the simplest solution.

 

For Bluetooth you need a combination of two things - the first is a tiny USB dongle that goes into your PC and the second is a Bluetooth module that you connect to the UART of your Netduino:

http://www.ebay.com/...=item51a5ccadd8

http://www.ebay.com/...=item4ac1878b21

 

As for the 433Mhz (315Mhz) radio option, you need something like a pair of these tranceivers:

http://www.ebay.com/...=item4ab41f2491

 

EDIT: Note that Bluetooth is short range (usually some 10 metres) while 433Mhz (315Mhz) radio can reach up to 100 metres. The frequency 433Mhz is used in Europe and 315Mhz is used in the US.

 

EDIT: The Bluetooth alternative would probably also let you control the Netduino from a SmartPhone which could be really cool.

 

 I thing I'll go with radio option, if the wifi wont work. Thank you!

 

 

I find that the Edimax BR-6258n NANO works quite well for this purpose,

 

http://www.amazon.co...sl_3j9dmxb197_b

 

Here is how to set it up,

 

http://www.edimax.us...rastructure.pdf

 

Thank you very much, how does it work?

I connect the netduino to it, and then what?




#46333 How do I connect Netduino+ to a pc wireless?

Posted by Ben Harel on 27 February 2013 - 01:13 PM in Netduino Plus 2 (and Netduino Plus 1)

How can I connect my Netduino+ to my computer wireless? Thank you!

(No cables between the robot and any router, unless the router is on the robot and not connecting to anything else)




#41748 Connect the N+ to pc through a router

Posted by Ben Harel on 18 December 2012 - 01:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi! I have a Linksys wrt54gl router. I am building a (tracked)robot. Is it possible to connect the N+ to it directly,and a laptop through wifi. Is it possible? I have a server program I wrote on the N+,and now it works only when I connect both devices to the router directly. When the user enters a url like this: "N+ op"/GO the motors starts. But when I try it from my laptop or my iPhone it does not work. How can I do it? Thank you!



#40152 Controlling a DC motor with external power source

Posted by Ben Harel on 25 November 2012 - 06:18 AM in General Discussion

Great!Thank you!



#40143 Controlling a DC motor with external power source

Posted by Ben Harel on 24 November 2012 - 11:06 PM in General Discussion

I connected the Vin on the Netduino as shown on the diagram. So the reason it doesn't work,is because I need a 7-12V power to the Netduino? It makes sense,because I tried to power it through a USB cable(only gives 5V). One more question - if I'll buy A 12V battery case,can I cut the cables of the wall adapter power supply with the proper jack and connect it to the battery case? Because I need the Netduino to be mobile. I'll post here after I'll get the wall wart and update you.I thank you very much for your help,your time and the effort you've put in to help me.



#39976 Controlling a DC motor with external power source

Posted by Ben Harel on 23 November 2012 - 06:16 AM in General Discussion

Thank you very much! I appreciate your help!



#39971 Controlling a DC motor with external power source

Posted by Ben Harel on 23 November 2012 - 12:44 AM in General Discussion

I'll try and setup the project later this evening and give you a hand with it. I saw that you were in chat earlier. Sorry I missed you.

Steve


Thank you for your help! :)



#39966 Controlling a DC motor with external power source

Posted by Ben Harel on 22 November 2012 - 09:28 PM in General Discussion

Absolutely!

There are a few possible solutions that I would suggest that you look into. First off, you should never power a DC motor directly from the Netduino's pin. DC motors are incredilbly hungry for amps (current). Additionally, if powered by same source as your Netduino, the motors can produce a lot of electrical noise causing havoc to any sort of readings on the Netduino. To overcome this, you generally see a motor using it's own power source, such as your battery, that is separate from the Netduino's power source.

Here are a couple common examples written by community members ItsDan and Stefan on how to wire and use your DC motors.

  • This first example, by ItsDan, uses a transistor type system. - Transistor Example
  • The second example by Stefan uses a low cost chip called an H-Bridge to control a motor. - H-Bridge Example
  • The third, and my preferred method of controlling a motor, is using a pre-built motor controller, which generally incorporate H-Bridges Here are two common motor controllers that are known to work with the Netduino. - Adafruit Motor Shield and DFRobot Motor Shield

Hopefully this can get you started. And if you have any question please feel free to ask them here.

Cheers,
Steve





Thank you for your reply.I tried the second option you suggested,but it didn't work,and I thought your could give me a hand:
https://netmftoolbox...pported devices

I connected everything exactly as the picture shows,but when the program run,it does not work.I've added a while loop in order to make it go forever,and used the onboard led to tell me when it's off(with a delay of 2 seconds),but nothing works.Both of the engines are off.
What can be the problem? Are they common mistakes out there that maybe I made?

Thank you very much!



#39963 V4.2 PWM class

Posted by Ben Harel on 22 November 2012 - 08:04 PM in Visual Studio

Thank you. I am using the Netduino Plus,firmware 4.2 and coding in C#. I'd love an explanation for each variable on the constructor,let's say for a led/DC motor.(Whats the dutyCycle?frequency? I'll try to contact Gutworks,thanks for the tips.



#39961 V4.2 PWM class

Posted by Ben Harel on 22 November 2012 - 07:30 PM in Visual Studio

Hi! How do I use the PWM class on version 4.2?Every example I find is for the previouse versions(new PWM(Pins.GPIO_PIN_D6)),but now it requires four variables.I want to write the following code(netmftoolbox - HBridge),but I cant,beause the class wont match. (sorry for my english). HBridge MotorDriver = new HBridge(new Netduino.PWM(Pins.GPIO_PIN_D6), Pins.GPIO_PIN_D7, new Netduino.PWM(Pins.GPIO_PIN_D5), Pins.GPIO_PIN_D4); // Motor 1 half speed backward MotorDriver.SetState(HBridge.Motors.Motor1, -50); // Motor 2 half speed forward MotorDriver.SetState(HBridge.Motors.Motor2, 50); // Lets run for 5 seconds Thread.Sleep(5000); // Motor 1 full speed backward MotorDriver.SetState(HBridge.Motors.Motor1, -100); // Motor 2 full speed forward MotorDriver.SetState(HBridge.Motors.Motor2, 100); // Lets run for 5 seconds Thread.Sleep(5000); // Stops both motors MotorDriver.SetState(HBridge.Motors.Motor1, 0); MotorDriver.SetState(HBridge.Motors.Motor2, 0); } } } Thank you very much for your help! EDIT: All I needed to change is from new Netduino.PWM to: PWMChannels. BUT I still need help in order to connect other stuff like leds.



#39736 Controlling a DC motor with external power source

Posted by Ben Harel on 20 November 2012 - 03:24 PM in General Discussion

Is it possible for a Netduino Plus to control two DC motors that are powered by batteries?



#39734 Connecting a motor to the netduino

Posted by Ben Harel on 20 November 2012 - 02:37 PM in General Discussion

Ok, I'll try.Thank you!In order to connect only one motor,I do not need to change anything in the connections right?Also, when I create a new PWM(v4.2),what are the dutycycle and frequency?



#39733 PC can't install Netduino Plus drivers

Posted by Ben Harel on 20 November 2012 - 02:35 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi! I've solved it,thank you. If anyone runs into this problem: Windows failed to install automatically the Netduino drivers. I've updated windows(EVERYTHING it suggests) including downloading service pack 1,and windows was able to install the drivers.(Dont forget to remove the drivers first,then connect the netduino to the updated windows pc).




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.