Project feasability


Recommended Posts

Hi everyone!

 

I was looking around to find a solution for our system (see below). I learned from collaborators that they were using FPGAs to tackle similar processes. However they are using NI embedded system which are expensive, and everything is coded in Labview. By doing some research I stumbled onto the papilio, which looks like a great board.

 

Here are our needs:

 

We receive a square signal from a camera and depending on what the users set, as behavior (On=always on, Off=always off, Rising trigger=pulse at the rising edge of the camera signal, Falling trigger=same with falling, Camera=follow the camera trigger) and pulse length (only applicable for rising and falling trigger), a digital output is sent to a laser (also a square signal with the properties corresponding to the behavior and if necessary the pulse length). The pulse ranges from 1us to 100ms, the camera signal period is from 15ms to 100ms.

 

Now, an Arduino Due can do the job, although the microsecond regime requires a bit of optimization, but nothing fancy (like directly modifying pin registers). If we have several lasers, then an Arduino Due alone does not seem to be able to be fast enough to handle all the different pulses. For the moment we have four Arduinos on our set-up, that receive the same camera signal and independently handle their own laser.

 

We also would like to increase at some point the complexity by having alternating trigger for the lasers (e.g. one laser pulsing on frame i, the second one on frame i+1). This means that we need our Arduinos to be in sync.

 

Besides this, we also control several servos with another Arduino.

 

My questions are then the following:

 

- FPGAs low-level programming does not seem to be very easy to learn (understatement...) and would probably take me months of sweat. In the case of simple logic such as what we need, do you think this would be easily implemented using the graphical tools of the DesignLab? I am not an electrical engineer but I can surely find some people in the institute to help me with the logical design.

 

- Would it be possible to handle the servos and the change of behavior and pulse length (set by the user) by the soft processor and the camera signal by the FPGA? (I guess this is a dumb question since I guess they are made for this). 

 

Thanks for your time!

 

cheers

Link to comment
Share on other sites

This kind of stuff is exactly what an FPGA is good at and a micro-controller sucks at.  10 nS pulse resolution is easy to achieve with an FPGA while a micro-contoller struggles with 1 uS resolution.

 

The code for implementing the pulse generation is actually quite trivial, the hardest part is probably the laser control function - i.e. how to set the mode and pulse length etc. for multiple lasers.

Most likely, a system like this probably need a GUI interface on a PC to control the laser setup and the FPGA needs a way to communicate with the PC and set up the mode for each laser based on the inputs from the PC, and this will be the bulk of the code.  The code for the pulse generation is probably something like 10 - 15 lines.

 

Magnus

Link to comment
Share on other sites

This kind of stuff is exactly what an FPGA is good at and a micro-controller sucks at.  10 nS pulse resolution is easy to achieve with an FPGA while a micro-contoller struggles with 1 uS resolution.

 

The code for implementing the pulse generation is actually quite trivial, the hardest part is probably the laser control function - i.e. how to set the mode and pulse length etc. for multiple lasers.

Most likely, a system like this probably need a GUI interface on a PC to control the laser setup and the FPGA needs a way to communicate with the PC and set up the mode for each laser based on the inputs from the PC, and this will be the bulk of the code.  The code for the pulse generation is probably something like 10 - 15 lines.

 

Magnus

 

Actually, down to almost 1ns with our Spartan6 devices (that's the speed limit for serdes). But will be hard to propagate an almost-1GHz signal without a differential output and proper routing and layout.

 

1uS is just piece of cake. :)

 

Anyway, rojhann, can you give us some pointers on how this output needs to be generated ?

 

Link to comment
Share on other sites

This kind of stuff is exactly what an FPGA is good at and a micro-controller sucks at.  10 nS pulse resolution is easy to achieve with an FPGA while a micro-contoller struggles with 1 uS resolution.

 

The code for implementing the pulse generation is actually quite trivial, the hardest part is probably the laser control function - i.e. how to set the mode and pulse length etc. for multiple lasers.

Most likely, a system like this probably need a GUI interface on a PC to control the laser setup and the FPGA needs a way to communicate with the PC and set up the mode for each laser based on the inputs from the PC, and this will be the bulk of the code.  The code for the pulse generation is probably something like 10 - 15 lines.

 

The way it is now, we have a GUI that talks to the Arduinos through USB cable (serial commands). We send the behaviour value (0,1,2,3 or 4) and the pulse value (16bits) when they change.

 

For the papilio, I was more thinking of running the same Arduino code on the soft processor. The values would get to the FPGA through a shared memory or GPIO, but I might have misunderstood the way the whole board works. What do you think?

 

Can one communicate with the soft processor through the USB?

 

On the FPGA it would just be at every rising/falling trigger checking what is the behaviour value and doing on/off on a digital output (well, times four), and where the on time would last either until further notice, the next rising trigger or the pulse length. 

 

 

Anyway, rojhann, can you give us some pointers on how this output needs to be generated ?

 

 

I am not sure what you mean by "how". :s

 

 

 

How the output signal looks like? Or the process by which the type of signal is chosen for each laser? (I am not so familiar with the electronics culture so I might not get simple points :/). I made a quick image as an example of one laser following the camera trigger and one being pulsed on rising edge: 

 

2EdzyqK4.png 

(http://pasteboard.co/2EdzyqK4.png)

 

If you mean in terms of logic, then I have to work on it ^^

 

For me, it all comes down to this two additional questions that overlap with the previous ones:

 

- if the system we want to build is clear enough in terms of logic, do you think the graphic tool in the IDE would be sufficient to create and upload the circuit map or should I actually write Verilog lines? 

 

- can the soft processor do tasks like moving a servo and transmit few variables to the FPGA, while the FPGA carries out the triggering? (last part is for sure, I am still not totally aware of the soft core use and capabilities)

 

thanks!

 

j

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.