Grasshopper

algorithmic modeling for Rhino

How to transfer Grasshopper definition into Arduino utilising firefly?

Hi everybody,

My project is creating Dual Axis Solar Tracker, and I have to do it via utilising Grasshopper, Firefly and Arduino.. well, I'm good at Grasshopper but just downloaded Firefly, thus I definitely need your help..

-What would be a first step? Should I have a Grasshopper definition for the entire project? 

- How to use Firefly to transfer data into Arduino? Particularly, which component is needed?

- Finally, If I create a physical Model for the project how does it work? in other words, how it could be responsive to the Sun by real data testing?

Cheers

Views: 2039

Replies to This Discussion

Hi,

Welcome to the group!  If you're just getting started with Firefly, my suggestion would be to look through some of the Grasshopper examples that are included with the Firefly download.  There are several different examples (working step by step) which have exhaustive notes to help explain things.  Basically, once you've uploaded the Firefly Firmata onto your board, the Arduino will send sensor data to Grasshopper and vice versa.  It does this in real-time (or generally around 30fps depending on your scene complexity and computer settings).  There is an example included in the download which discusses how to use the Firefly Code Generator.  Basically, you would just create your Grasshopper definition as you normally would, using the Uno or Mega Write components to send some signal out to the board (in this case it would probably be the values you want to use to control the servos on your dual axis solar tracker).  Then, the code generator will convert your Grasshopper definition to Arduino compatible code, on the fly... There really isn't anything you have to do special for this to work, it should search recursively upstream in your definition and write the code for you based on your setup.  Have a look at some of the example files, and the Firefly Primer and let us know if you need any more help.  Good lucks.

-Andy

Andy, thanks very much mate for your warm welcome and replying.. This is great basic info..... I'll do my the best and definitely need your help again.. However, can I just ask for the Grasshopper definition should I create whole stuff such as I have to create for the Physical Model of Dual Axis Solar Tracker? Cheers

No, you wont necessarily need to 'model' everything.  An Arduino doesn't really know what a line is, or a brep, etc.  The Code Generator has a library of functions it will implement if it detects a component in your definition... but if the Code Generator detects an unknown component (say for a line), then it will give you a warning and tell you which functions weren't found.  But, you can easily read in a sensor value (say from a light sensor) and then use that value to move a servo into a specific position (the basic definition for your light tracker).  You don't necessarily need to 'model' the geometry, but you would need to know the specific servo positions in order to control the light tracker (even if that is based off of the sensor information). The Code Generator should be able to generate all the necessary code for this project, as it shouldn't really contain any components that it doesn't already have in its library. BTW, I should note that you could still run the entire light tracking definition directly through Grasshopper (without the need for the Code Generator).  One of the main reasons to use the Code Generator is if you want it to run autonomously (off an external power supply, and not through your USB cable).  But, if you're just planning on having your Arduino board stay connected to your computer, then you could just use the standard Grasshopper/Firefly interface to control your light tracker.  Just a thought.

Best,

Andy

Sounds interesting, basically I don't need to use Code generator as its OK if I use my Arduino board that is connected to the Computer during its working. I might have other questions during this implementation so just wanna say excuse me if I'd take your time..Cheers mate

Hi, just wonder if I want to have ruffly this dual axis solar tracker like the above image, can I model the same for the GH definition? and should I implement all the angle rotations for servos in the definition the transfer everything via firefly to the board? Thanks very much

Any ideas please?

And which kind of servos is resistible for that exactly?

Hi Northern Rock,

Sorry for not responding sooner... For some reason I don't get notifications when people post to discussions on this forum.  I do get them for the Firefly Experiments forums (http://www.fireflyexperiments.com/discussions/) so you may have better success posting questions there.

To answer your question.. Yes, basically the same rotation values you would use to move your grasshopper model would be the same angle position to move your servos.  Actually, they sell robotic setups for this exact application (http://www.trossenrobotics.com/store/p/3139-Pan-and-Tilt-Kit-with-S...)  Mostly, these are used to mount small cameras to them and then you can control the pan and tilt of the camera... but you could certainly adapt it to hold some sort of panel... Or you could make your own too.  Basically, you just need to mount one servo on top of the other.  The bottom servo would control the panning, while the other the tilt.  Most standard servos will be able to move up to 180 degrees, so you'll have that amount of rotation for each motor.  You should probably limit your model to reflect this too.  The Firmata is setup so it wont really break if you send it a larger number... but it would be good if the GH model and your physical model were in synch.  Does this help?

Cheers,

Andy

Ha.  I just saw you posted your question over on the other forum too.  I'll post a link back here.

Hi Andy, many thanks mate.. yea it makes a sense...
Basically I've got this working for two servos, however as you state I need to have 4 light sensors around the PV panel to control the positions of servos as I have to prepare a dual axis solar tracker for my assignment, I should create it by myself by the way and now I've finished the Grasshopper definition and Firefly servo definition as well and if possible could you please take a look at attachments.. Now my question is how can I connect this GH Model to the Firefly and how Can I control the position of servos by 4 light sensors? Basically I need to collect the real time data as it obvious... and I don't need to disconnect my Arduino with the computer... So could you please help me to have this kind of controlling panning and tilt servos by 4 light sensors? I'd be very grateful

Cheers

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service