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.
Photo

Convert PIC code to run on Netduino

pic

  • Please log in to reply
5 replies to this topic

#1 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 06 August 2014 - 07:05 PM

Is it possible to convert PIC code (for a PIC12C509) to a Netduino application?  I am guessing it is not as simple as copy and paste.

I can supply the PIC code if that would help.

 

The end game is to build the attached circuit (an electronic forward/revers speed controller to connect to an RC controller).  In the end I will need (3) speed controllers so I am wanting to compress as much code into only 1 Netduino to control all the external).

 

bridge_circuit.gif

 

Also, I am not married to this idea.  I am very open to suggestions.



#2 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 06 August 2014 - 07:43 PM

I forgot to mention, I will need some pretty high current.  I am looking at about 20VDC at the motor and about 10 amps.  This is going to be the speed controller for a robot's drive train.



#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 06 August 2014 - 08:14 PM

Why not use the PIC?

 

There are some issues with the current .NET Micro Framework implementation that limit its usage in such scenarios. I don't know exactly how the PIC drives the H-Bridge, but I can think of

 

1) Bit-banging - it depends on the frequency. Netduino's managed code is interpreted, i.e. slow. IIRC it can produce signal at 10 kHz range - I am not sure how fast you need to drive those power MOSFETs. Also, the code can be disturbed at any time, for example by garbage collector or interrupt handler, so the motor control will be stuck for relatively long time in certain state, which is not something you'd want. There are some techniques to minimize such events, but no guarantees.

 

2) Timers or PWM - there is missing the key feature: synchronized channels. The signals for left and right part of the H-Bridge must have precise relationship, they cannot overlap at certain moments etc. - usually, you configure two channels with opposite polarity, dead time and then start them at the same time. This would require firmware modification (the microcontroler has these features, but they are not accessible from managed code).

 

Personally, I would go with the PIC(s) - you've already got proven working (?) design, it is much better for real-time control, and also significantly cheaper. You can use Netduino to control them, if you must... ;)



#4 beastyboy

beastyboy

    Advanced Member

  • Members
  • PipPipPip
  • 194 posts
  • LocationNetherlands

Posted 06 August 2014 - 08:33 PM

Why not use one of these? 

 

You probably need 2 or 3 depending on how many motors you need to get turning.

 

 

http://www.ebay.co.u...V-/300921027008


Van SchOten Ict Diensten en Services
http://www.voids.nl


#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 06 August 2014 - 08:37 PM

This is going to be the speed controller for a robot's drive train.

 

If the main project objective is NOT building a motor controller, I would consider one of the many motor controller modules or specialized driver ICs... just for inspiration Pololu controllers...



#6 beastyboy

beastyboy

    Advanced Member

  • Members
  • PipPipPip
  • 194 posts
  • LocationNetherlands

Posted 06 August 2014 - 08:48 PM

Yes as CW mentions the pololu are great choices, from reading through various robot articles the RoboClaw are more reliable then the controllers based on the infineon parts.


Van SchOten Ict Diensten en Services
http://www.voids.nl





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.