Flywheel and valves programming

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
PicoPuls
Posts: 111
Joined: Wed Mar 02, 2016 11:26 am
Has thanked: 43 times
Been thanked: 22 times
Contact:

Flywheel and valves programming

Post by PicoPuls »

My question is how to approach this task in Flowcode6 and with a suitable PIC processor.
( I would prefer the ecio40p or eico40p16 )

A flywheel gives one reset-pulse at each revolution and 1024 clock pulses within one revolution.
Most PIC have a timer that could be used to follow one revolution of the flywheel, but I can't find a reset to syncronize the timer with the flywheel.

The goal is to have 6 outputs, in principle controlling valves, injection etc... where each ON and OFF of the output can be
adjusted within the range 0 .... 1023 pulses - and the last ranges stored for the next startup

It would be of great help to have some ideas about how to approach this:

Use an external CMOS 4040 counter ???
How to reset the PIC counter
Create a software counter in the PIC ??

Thanks and best regards

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flywheel and valves programming

Post by LeighM »

What is the rotational speed of the flywheel and is it relatively constant, or what is its range?

PicoPuls
Posts: 111
Joined: Wed Mar 02, 2016 11:26 am
Has thanked: 43 times
Been thanked: 22 times
Contact:

Re: Flywheel and valves programming

Post by PicoPuls »

It is very slow, up to 5 revolutions per second.
But it would be nice with an approach that allows for more speed sometime in the future

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flywheel and valves programming

Post by LeighM »

So you would be getting pulses at about 5KHz.
At that rate you could poll both the pulse and reset input signals in software, certainly with the eico40p16,
Use the pulse transitions to increment a counter, which you then compare with the various trigger points for your outputs,
clear the counter if you get a reset input transition.
You could enhance that by using an interrupt input for the pulse signal

PicoPuls
Posts: 111
Joined: Wed Mar 02, 2016 11:26 am
Has thanked: 43 times
Been thanked: 22 times
Contact:

Re: Flywheel and valves programming

Post by PicoPuls »

Hi
Now when setting up ECIO40P16 I have 3 questions

The processor on ECIO40P16 requires 3.3 V Is it a potential conflict to use EB061 Application Board and different other 5V Eblock modules ?

"ECIO can easily be integrated with LabView and Visual Basic." ( I cant find the necessary download of DLLs and suite of sample programs )

"If bootloader is overwritten it has to be sent to Matrix for restore" ( in mLOADER.zip it seems to be Bootloader.bin - can you explain )

Thanks and Best regards

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Flywheel and valves programming

Post by LeighM »

ECIO40P16 can be used with EB061, but you just need to be careful what you attach to it.
The 3v3 dsPIC33EP256MU806 device on ECIO40P16 has a few 5 volt tolerant pins, mainly on Port D.
We have a number of products that have (different) internal bootloader firmware, for ECIO40P16 it has to be sent to Matrix for restore in the unlikely event of it getting corrupted.
I think the references to LabView and Visual Basic are related to the fact that the device can be used as the basis of a USB peripheral.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flywheel and valves programming

Post by Benj »

Hello,

This link has some Labview and VB examples used with the Flowcode USB Slave component.

http://www.matrixtsl.com/resources/getr ... php?id=915

Post Reply