FPGARelated.com
Forums

Is this possible with an FPGA?

Started by Joe3502 4 years ago8 replieslatest reply 10 months ago216 views

Hi All, 

I am starting to learn Verilog in order to program FPGAs. I have a project where I need to take three digital signals coming from three hall sensors on a linear motor (These hall sensors are placed on the motor such that each hall sensor puts out a wave 60 degrees out of phase from one another) and convert them into a signal that mimics an incremental encoder (A, B, and Z signals). My goal is to feed said A, B, and Z signal into a variable frequency drive for high-precision positioning.

Do you think that this is possible? If so, how would you go about it? I am still learning how to code with Verilog. This seems like a fairly complicated task for a beginner, so if anyone is willing to help that would be greatly appreciated!


Best Regards, 

Joe M 

[ - ]
Reply by rajkeerthy18February 16, 2023

Joe,

Hall sensors have various applications. Seems you are looking for an encoder type converter for discrete wave outputs. The following note could help. http://www.ti.com/lit/an/sboa200/sboa200.pdf

[ - ]
Reply by Joe3502February 16, 2023

Thank you for your reply. I am indeed looking for a converter to take three hall sensor inputs to a single encoder-type outputs. I will take a look at the note that you attached...

[ - ]
Reply by Joe3502February 16, 2023

Post deleted by author

[ - ]
Reply by Joe3502February 16, 2023
Here is the question that I have. The A and B signals are already covered in that file that you attached, but the Z signal (time signal) is not discussed. I am looking to use all three hall sensor values in order to get one output that mimics an encoder with that timing signal. Do you think you could assist me with this?
[ - ]
Reply by rajkeerthy18February 16, 2023

Joe,

You have to know the hall sensor characteristics. If the output is analogue which is most likely, you have to deal with a digital number along with phase relationship. The issue is  of verilog or FPGA. The variables, their behavior and what is desired to be done with it - the physical problem and your solution is the focus. Verilog and FPGA is my 10% of the whole effort. Could you share the hall sensor details? I can take a quick look.

[ - ]
Reply by cbradleyFebruary 16, 2023

Hi Joe,


I'm not an expert with verilog either, but as a first step I would try to implement it traditional logic gates and registers first, and then turn that

design into verilog code. There are (expensive) simulation tools out there to

help with this. Hopefully there will be more knowledgeable followups!


Chris

[ - ]
Reply by martinthompsonFebruary 16, 2023

Everything is possible :)

First figure out how it's going to work in maths, equations or just write a high-level description.  Think about how you can go from your very low resolution angle input and create a high resolution angle output.  You have to make some compromises - maybe assume the motor is going to rotate at an approximately constant angular rate.  Once you have seen the first 2 hall effect edges, you know how fast it is going, and you can interpolate the angle until you get to the next hall edge. Tracking changes in speed could be done instantly, or you could filter or track it.  If you want to extend to an accelerating or bidirectional motor, you may have to accept you'll be badly wrong until a new hall transition happens.

Once you have an understanding of whhat your limits are, then write a model for that description in a high-level language.  Persuade yourself it's going to work with a variety of motor situtations: slow, fast, stopped, maybe jittering around one of the hall transition points...

Once this works you have a good set of input and output data you can work with and build something in gates to match.

Fun project!



[ - ]
Reply by martinthompsonFebruary 16, 2023

Oops, I just noticed you said linear motor... but talk about degrees out of phase.  Not sure how those two things interact, but the general gist of what I wrote still applies... First understand, then model, finally implement.

[ - ]
Reply by engineer68February 16, 2023

Although most has been alread said to that, one add of mine:
Hall Sensors and others require noise processing and leveling in order to be easily processed with a digital interpretation like here the A,B - Encoding. This can be done the analog way in order to process it with a controller.

To do this the digital way requires some signal processing math which has to be adapted to the particular problem. Then there is also the chance to overcome the analog approach.

Regarding your problem, some calibration will have to be applied to adjust the variable sensor positions in production (BTDT) and also suppression of EMI on the cables must be performed too to obtain good signals to be fed into the module which will drive the motor. Here again some positioning feedback and calibration will be done too. (BTDT too).

Not sure if an FPGA is really required for that. 
In case an FPGA is choosen - not sure if that is an appropriate project to learn to deal with them.